htt.h 779 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  216. */
  217. #define HTT_CURRENT_VERSION_MAJOR 3
  218. #define HTT_CURRENT_VERSION_MINOR 97
  219. #define HTT_NUM_TX_FRAG_DESC 1024
  220. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  221. #define HTT_CHECK_SET_VAL(field, val) \
  222. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  223. /* macros to assist in sign-extending fields from HTT messages */
  224. #define HTT_SIGN_BIT_MASK(field) \
  225. ((field ## _M + (1 << field ## _S)) >> 1)
  226. #define HTT_SIGN_BIT(_val, field) \
  227. (_val & HTT_SIGN_BIT_MASK(field))
  228. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  229. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  230. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  231. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  232. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  233. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  234. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  235. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  236. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  237. /*
  238. * TEMPORARY:
  239. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  240. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  241. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  242. * updated.
  243. */
  244. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  245. /*
  246. * TEMPORARY:
  247. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  248. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  249. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  250. * updated.
  251. */
  252. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  253. /*
  254. * htt_dbg_stats_type -
  255. * bit positions for each stats type within a stats type bitmask
  256. * The bitmask contains 24 bits.
  257. */
  258. enum htt_dbg_stats_type {
  259. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  260. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  261. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  262. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  263. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  264. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  265. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  266. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  267. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  268. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  269. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  270. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  271. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  272. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  273. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  274. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  275. /* bits 16-23 currently reserved */
  276. /* keep this last */
  277. HTT_DBG_NUM_STATS
  278. };
  279. /*=== HTT option selection TLVs ===
  280. * Certain HTT messages have alternatives or options.
  281. * For such cases, the host and target need to agree on which option to use.
  282. * Option specification TLVs can be appended to the VERSION_REQ and
  283. * VERSION_CONF messages to select options other than the default.
  284. * These TLVs are entirely optional - if they are not provided, there is a
  285. * well-defined default for each option. If they are provided, they can be
  286. * provided in any order. Each TLV can be present or absent independent of
  287. * the presence / absence of other TLVs.
  288. *
  289. * The HTT option selection TLVs use the following format:
  290. * |31 16|15 8|7 0|
  291. * |---------------------------------+----------------+----------------|
  292. * | value (payload) | length | tag |
  293. * |-------------------------------------------------------------------|
  294. * The value portion need not be only 2 bytes; it can be extended by any
  295. * integer number of 4-byte units. The total length of the TLV, including
  296. * the tag and length fields, must be a multiple of 4 bytes. The length
  297. * field specifies the total TLV size in 4-byte units. Thus, the typical
  298. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  299. * field, would store 0x1 in its length field, to show that the TLV occupies
  300. * a single 4-byte unit.
  301. */
  302. /*--- TLV header format - applies to all HTT option TLVs ---*/
  303. enum HTT_OPTION_TLV_TAGS {
  304. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  305. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  306. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  307. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  308. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  309. };
  310. PREPACK struct htt_option_tlv_header_t {
  311. A_UINT8 tag;
  312. A_UINT8 length;
  313. } POSTPACK;
  314. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  315. #define HTT_OPTION_TLV_TAG_S 0
  316. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  317. #define HTT_OPTION_TLV_LENGTH_S 8
  318. /*
  319. * value0 - 16 bit value field stored in word0
  320. * The TLV's value field may be longer than 2 bytes, in which case
  321. * the remainder of the value is stored in word1, word2, etc.
  322. */
  323. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  324. #define HTT_OPTION_TLV_VALUE0_S 16
  325. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  326. do { \
  327. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  328. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  329. } while (0)
  330. #define HTT_OPTION_TLV_TAG_GET(word) \
  331. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  332. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  333. do { \
  334. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  335. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  336. } while (0)
  337. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  338. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  339. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  340. do { \
  341. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  342. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  343. } while (0)
  344. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  345. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  346. /*--- format of specific HTT option TLVs ---*/
  347. /*
  348. * HTT option TLV for specifying LL bus address size
  349. * Some chips require bus addresses used by the target to access buffers
  350. * within the host's memory to be 32 bits; others require bus addresses
  351. * used by the target to access buffers within the host's memory to be
  352. * 64 bits.
  353. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  354. * a suffix to the VERSION_CONF message to specify which bus address format
  355. * the target requires.
  356. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  357. * default to providing bus addresses to the target in 32-bit format.
  358. */
  359. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  360. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  361. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  362. };
  363. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  364. struct htt_option_tlv_header_t hdr;
  365. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  366. } POSTPACK;
  367. /*
  368. * HTT option TLV for specifying whether HL systems should indicate
  369. * over-the-air tx completion for individual frames, or should instead
  370. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  371. * requests an OTA tx completion for a particular tx frame.
  372. * This option does not apply to LL systems, where the TX_COMPL_IND
  373. * is mandatory.
  374. * This option is primarily intended for HL systems in which the tx frame
  375. * downloads over the host --> target bus are as slow as or slower than
  376. * the transmissions over the WLAN PHY. For cases where the bus is faster
  377. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  378. * and consquently will send one TX_COMPL_IND message that covers several
  379. * tx frames. For cases where the WLAN PHY is faster than the bus,
  380. * the target will end up transmitting very short A-MPDUs, and consequently
  381. * sending many TX_COMPL_IND messages, which each cover a very small number
  382. * of tx frames.
  383. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  384. * a suffix to the VERSION_REQ message to request whether the host desires to
  385. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  386. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  387. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  388. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  389. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  390. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  391. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  392. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  393. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  394. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  395. * TLV.
  396. */
  397. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  398. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  399. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  400. };
  401. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  402. struct htt_option_tlv_header_t hdr;
  403. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  404. } POSTPACK;
  405. /*
  406. * HTT option TLV for specifying how many tx queue groups the target
  407. * may establish.
  408. * This TLV specifies the maximum value the target may send in the
  409. * txq_group_id field of any TXQ_GROUP information elements sent by
  410. * the target to the host. This allows the host to pre-allocate an
  411. * appropriate number of tx queue group structs.
  412. *
  413. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  414. * a suffix to the VERSION_REQ message to specify whether the host supports
  415. * tx queue groups at all, and if so if there is any limit on the number of
  416. * tx queue groups that the host supports.
  417. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  418. * a suffix to the VERSION_CONF message. If the host has specified in the
  419. * VER_REQ message a limit on the number of tx queue groups the host can
  420. * supprt, the target shall limit its specification of the maximum tx groups
  421. * to be no larger than this host-specified limit.
  422. *
  423. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  424. * shall preallocate 4 tx queue group structs, and the target shall not
  425. * specify a txq_group_id larger than 3.
  426. */
  427. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  428. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  429. /*
  430. * values 1 through N specify the max number of tx queue groups
  431. * the sender supports
  432. */
  433. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  434. };
  435. /* TEMPORARY backwards-compatibility alias for a typo fix -
  436. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  437. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  438. * to support the old name (with the typo) until all references to the
  439. * old name are replaced with the new name.
  440. */
  441. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  442. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  443. struct htt_option_tlv_header_t hdr;
  444. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  445. } POSTPACK;
  446. /*
  447. * HTT option TLV for specifying whether the target supports an extended
  448. * version of the HTT tx descriptor. If the target provides this TLV
  449. * and specifies in the TLV that the target supports an extended version
  450. * of the HTT tx descriptor, the target must check the "extension" bit in
  451. * the HTT tx descriptor, and if the extension bit is set, to expect a
  452. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  453. * descriptor. Furthermore, the target must provide room for the HTT
  454. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  455. * This option is intended for systems where the host needs to explicitly
  456. * control the transmission parameters such as tx power for individual
  457. * tx frames.
  458. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  459. * as a suffix to the VERSION_CONF message to explicitly specify whether
  460. * the target supports the HTT tx MSDU extension descriptor.
  461. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  462. * by the host as lack of target support for the HTT tx MSDU extension
  463. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  464. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  465. * the HTT tx MSDU extension descriptor.
  466. * The host is not required to provide the HTT tx MSDU extension descriptor
  467. * just because the target supports it; the target must check the
  468. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  469. * extension descriptor is present.
  470. */
  471. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  472. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  473. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  474. };
  475. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  476. struct htt_option_tlv_header_t hdr;
  477. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  478. } POSTPACK;
  479. typedef struct {
  480. union {
  481. /* BIT [11 : 0] :- tag
  482. * BIT [23 : 12] :- length
  483. * BIT [31 : 24] :- reserved
  484. */
  485. A_UINT32 tag__length;
  486. /*
  487. * The following struct is not endian-portable.
  488. * It is suitable for use within the target, which is known to be
  489. * little-endian.
  490. * The host should use the above endian-portable macros to access
  491. * the tag and length bitfields in an endian-neutral manner.
  492. */
  493. struct {
  494. A_UINT32 tag : 12, /* BIT [11 : 0] */
  495. length : 12, /* BIT [23 : 12] */
  496. reserved : 8; /* BIT [31 : 24] */
  497. };
  498. };
  499. } htt_tlv_hdr_t;
  500. typedef enum {
  501. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  502. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  503. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  504. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  505. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  506. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  507. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  508. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  510. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  511. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  512. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  513. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  514. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  515. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  516. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  517. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  518. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  520. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  521. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  522. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  523. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  524. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  525. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  526. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  527. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  528. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  529. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  530. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  531. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  532. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  533. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  534. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  535. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  536. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  537. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  538. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  539. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  540. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  541. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  542. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  543. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  544. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  545. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  546. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  547. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  550. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  551. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  553. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  554. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  555. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  556. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  557. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  558. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  559. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  560. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  561. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  562. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  563. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  564. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  565. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  566. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  567. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  568. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  569. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  570. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  571. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  572. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  573. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  574. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  575. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  576. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  577. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  578. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  579. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  580. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  581. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  582. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  583. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  584. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  585. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  586. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  587. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  588. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  589. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  590. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  591. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  592. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  593. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  594. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  595. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  597. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  598. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  599. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  600. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  602. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  603. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  604. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  605. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  607. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  608. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  609. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  610. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  611. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  612. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  613. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  616. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  617. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  618. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  619. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  620. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  621. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  622. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  623. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  624. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  625. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  626. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  627. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  628. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  629. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  630. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  631. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  632. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  633. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  634. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  635. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  636. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  637. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  638. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  639. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  640. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  641. HTT_STATS_MAX_TAG,
  642. } htt_tlv_tag_t;
  643. #define HTT_STATS_TLV_TAG_M 0x00000fff
  644. #define HTT_STATS_TLV_TAG_S 0
  645. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  646. #define HTT_STATS_TLV_LENGTH_S 12
  647. #define HTT_STATS_TLV_TAG_GET(_var) \
  648. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  649. HTT_STATS_TLV_TAG_S)
  650. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  651. do { \
  652. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  653. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  654. } while (0)
  655. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  656. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  657. HTT_STATS_TLV_LENGTH_S)
  658. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  659. do { \
  660. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  661. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  662. } while (0)
  663. /*=== host -> target messages ===============================================*/
  664. enum htt_h2t_msg_type {
  665. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  666. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  667. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  668. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  669. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  670. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  671. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  672. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  673. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  674. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  675. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  676. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  677. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  678. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  679. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  680. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  681. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  682. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  683. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  684. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  685. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  686. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  687. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  688. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  689. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  690. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  691. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  692. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  693. /* keep this last */
  694. HTT_H2T_NUM_MSGS
  695. };
  696. /*
  697. * HTT host to target message type -
  698. * stored in bits 7:0 of the first word of the message
  699. */
  700. #define HTT_H2T_MSG_TYPE_M 0xff
  701. #define HTT_H2T_MSG_TYPE_S 0
  702. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  703. do { \
  704. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  705. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  706. } while (0)
  707. #define HTT_H2T_MSG_TYPE_GET(word) \
  708. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  709. /**
  710. * @brief host -> target version number request message definition
  711. *
  712. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  713. *
  714. *
  715. * |31 24|23 16|15 8|7 0|
  716. * |----------------+----------------+----------------+----------------|
  717. * | reserved | msg type |
  718. * |-------------------------------------------------------------------|
  719. * : option request TLV (optional) |
  720. * :...................................................................:
  721. *
  722. * The VER_REQ message may consist of a single 4-byte word, or may be
  723. * extended with TLVs that specify which HTT options the host is requesting
  724. * from the target.
  725. * The following option TLVs may be appended to the VER_REQ message:
  726. * - HL_SUPPRESS_TX_COMPL_IND
  727. * - HL_MAX_TX_QUEUE_GROUPS
  728. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  729. * may be appended to the VER_REQ message (but only one TLV of each type).
  730. *
  731. * Header fields:
  732. * - MSG_TYPE
  733. * Bits 7:0
  734. * Purpose: identifies this as a version number request message
  735. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  736. */
  737. #define HTT_VER_REQ_BYTES 4
  738. /* TBDXXX: figure out a reasonable number */
  739. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  740. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  741. /**
  742. * @brief HTT tx MSDU descriptor
  743. *
  744. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  745. *
  746. * @details
  747. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  748. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  749. * the target firmware needs for the FW's tx processing, particularly
  750. * for creating the HW msdu descriptor.
  751. * The same HTT tx descriptor is used for HL and LL systems, though
  752. * a few fields within the tx descriptor are used only by LL or
  753. * only by HL.
  754. * The HTT tx descriptor is defined in two manners: by a struct with
  755. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  756. * definitions.
  757. * The target should use the struct def, for simplicitly and clarity,
  758. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  759. * neutral. Specifically, the host shall use the get/set macros built
  760. * around the mask + shift defs.
  761. */
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  765. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  766. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  767. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  768. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  769. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  770. #define HTT_TX_VDEV_ID_WORD 0
  771. #define HTT_TX_VDEV_ID_MASK 0x3f
  772. #define HTT_TX_VDEV_ID_SHIFT 16
  773. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  774. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  775. #define HTT_TX_MSDU_LEN_DWORD 1
  776. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  777. /*
  778. * HTT_VAR_PADDR macros
  779. * Allow physical / bus addresses to be either a single 32-bit value,
  780. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  781. */
  782. #define HTT_VAR_PADDR32(var_name) \
  783. A_UINT32 var_name
  784. #define HTT_VAR_PADDR64_LE(var_name) \
  785. struct { \
  786. /* little-endian: lo precedes hi */ \
  787. A_UINT32 lo; \
  788. A_UINT32 hi; \
  789. } var_name
  790. /*
  791. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  792. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  793. * addresses are stored in a XXX-bit field.
  794. * This macro is used to define both htt_tx_msdu_desc32_t and
  795. * htt_tx_msdu_desc64_t structs.
  796. */
  797. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  798. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  799. { \
  800. /* DWORD 0: flags and meta-data */ \
  801. A_UINT32 \
  802. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  803. \
  804. /* pkt_subtype - \
  805. * Detailed specification of the tx frame contents, extending the \
  806. * general specification provided by pkt_type. \
  807. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  808. * pkt_type | pkt_subtype \
  809. * ============================================================== \
  810. * 802.3 | bit 0:3 - Reserved \
  811. * | bit 4: 0x0 - Copy-Engine Classification Results \
  812. * | not appended to the HTT message \
  813. * | 0x1 - Copy-Engine Classification Results \
  814. * | appended to the HTT message in the \
  815. * | format: \
  816. * | [HTT tx desc, frame header, \
  817. * | CE classification results] \
  818. * | The CE classification results begin \
  819. * | at the next 4-byte boundary after \
  820. * | the frame header. \
  821. * ------------+------------------------------------------------- \
  822. * Eth2 | bit 0:3 - Reserved \
  823. * | bit 4: 0x0 - Copy-Engine Classification Results \
  824. * | not appended to the HTT message \
  825. * | 0x1 - Copy-Engine Classification Results \
  826. * | appended to the HTT message. \
  827. * | See the above specification of the \
  828. * | CE classification results location. \
  829. * ------------+------------------------------------------------- \
  830. * native WiFi | bit 0:3 - Reserved \
  831. * | bit 4: 0x0 - Copy-Engine Classification Results \
  832. * | not appended to the HTT message \
  833. * | 0x1 - Copy-Engine Classification Results \
  834. * | appended to the HTT message. \
  835. * | See the above specification of the \
  836. * | CE classification results location. \
  837. * ------------+------------------------------------------------- \
  838. * mgmt | 0x0 - 802.11 MAC header absent \
  839. * | 0x1 - 802.11 MAC header present \
  840. * ------------+------------------------------------------------- \
  841. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  842. * | 0x1 - 802.11 MAC header present \
  843. * | bit 1: 0x0 - allow aggregation \
  844. * | 0x1 - don't allow aggregation \
  845. * | bit 2: 0x0 - perform encryption \
  846. * | 0x1 - don't perform encryption \
  847. * | bit 3: 0x0 - perform tx classification / queuing \
  848. * | 0x1 - don't perform tx classification; \
  849. * | insert the frame into the "misc" \
  850. * | tx queue \
  851. * | bit 4: 0x0 - Copy-Engine Classification Results \
  852. * | not appended to the HTT message \
  853. * | 0x1 - Copy-Engine Classification Results \
  854. * | appended to the HTT message. \
  855. * | See the above specification of the \
  856. * | CE classification results location. \
  857. */ \
  858. pkt_subtype: 5, \
  859. \
  860. /* pkt_type - \
  861. * General specification of the tx frame contents. \
  862. * The htt_pkt_type enum should be used to specify and check the \
  863. * value of this field. \
  864. */ \
  865. pkt_type: 3, \
  866. \
  867. /* vdev_id - \
  868. * ID for the vdev that is sending this tx frame. \
  869. * For certain non-standard packet types, e.g. pkt_type == raw \
  870. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  871. * This field is used primarily for determining where to queue \
  872. * broadcast and multicast frames. \
  873. */ \
  874. vdev_id: 6, \
  875. /* ext_tid - \
  876. * The extended traffic ID. \
  877. * If the TID is unknown, the extended TID is set to \
  878. * HTT_TX_EXT_TID_INVALID. \
  879. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  880. * value of the QoS TID. \
  881. * If the tx frame is non-QoS data, then the extended TID is set to \
  882. * HTT_TX_EXT_TID_NON_QOS. \
  883. * If the tx frame is multicast or broadcast, then the extended TID \
  884. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  885. */ \
  886. ext_tid: 5, \
  887. \
  888. /* postponed - \
  889. * This flag indicates whether the tx frame has been downloaded to \
  890. * the target before but discarded by the target, and now is being \
  891. * downloaded again; or if this is a new frame that is being \
  892. * downloaded for the first time. \
  893. * This flag allows the target to determine the correct order for \
  894. * transmitting new vs. old frames. \
  895. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  896. * This flag only applies to HL systems, since in LL systems, \
  897. * the tx flow control is handled entirely within the target. \
  898. */ \
  899. postponed: 1, \
  900. \
  901. /* extension - \
  902. * This flag indicates whether a HTT tx MSDU extension descriptor \
  903. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  904. * \
  905. * 0x0 - no extension MSDU descriptor is present \
  906. * 0x1 - an extension MSDU descriptor immediately follows the \
  907. * regular MSDU descriptor \
  908. */ \
  909. extension: 1, \
  910. \
  911. /* cksum_offload - \
  912. * This flag indicates whether checksum offload is enabled or not \
  913. * for this frame. Target FW use this flag to turn on HW checksumming \
  914. * 0x0 - No checksum offload \
  915. * 0x1 - L3 header checksum only \
  916. * 0x2 - L4 checksum only \
  917. * 0x3 - L3 header checksum + L4 checksum \
  918. */ \
  919. cksum_offload: 2, \
  920. \
  921. /* tx_comp_req - \
  922. * This flag indicates whether Tx Completion \
  923. * from fw is required or not. \
  924. * This flag is only relevant if tx completion is not \
  925. * universally enabled. \
  926. * For all LL systems, tx completion is mandatory, \
  927. * so this flag will be irrelevant. \
  928. * For HL systems tx completion is optional, but HL systems in which \
  929. * the bus throughput exceeds the WLAN throughput will \
  930. * probably want to always use tx completion, and thus \
  931. * would not check this flag. \
  932. * This flag is required when tx completions are not used universally, \
  933. * but are still required for certain tx frames for which \
  934. * an OTA delivery acknowledgment is needed by the host. \
  935. * In practice, this would be for HL systems in which the \
  936. * bus throughput is less than the WLAN throughput. \
  937. * \
  938. * 0x0 - Tx Completion Indication from Fw not required \
  939. * 0x1 - Tx Completion Indication from Fw is required \
  940. */ \
  941. tx_compl_req: 1; \
  942. \
  943. \
  944. /* DWORD 1: MSDU length and ID */ \
  945. A_UINT32 \
  946. len: 16, /* MSDU length, in bytes */ \
  947. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  948. * and this id is used to calculate fragmentation \
  949. * descriptor pointer inside the target based on \
  950. * the base address, configured inside the target. \
  951. */ \
  952. \
  953. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  954. /* frags_desc_ptr - \
  955. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  956. * where the tx frame's fragments reside in memory. \
  957. * This field only applies to LL systems, since in HL systems the \
  958. * (degenerate single-fragment) fragmentation descriptor is created \
  959. * within the target. \
  960. */ \
  961. _paddr__frags_desc_ptr_; \
  962. \
  963. /* DWORD 3 (or 4): peerid, chanfreq */ \
  964. /* \
  965. * Peer ID : Target can use this value to know which peer-id packet \
  966. * destined to. \
  967. * It's intended to be specified by host in case of NAWDS. \
  968. */ \
  969. A_UINT16 peerid; \
  970. \
  971. /* \
  972. * Channel frequency: This identifies the desired channel \
  973. * frequency (in mhz) for tx frames. This is used by FW to help \
  974. * determine when it is safe to transmit or drop frames for \
  975. * off-channel operation. \
  976. * The default value of zero indicates to FW that the corresponding \
  977. * VDEV's home channel (if there is one) is the desired channel \
  978. * frequency. \
  979. */ \
  980. A_UINT16 chanfreq; \
  981. \
  982. /* Reason reserved is commented is increasing the htt structure size \
  983. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  984. * A_UINT32 reserved_dword3_bits0_31; \
  985. */ \
  986. } POSTPACK
  987. /* define a htt_tx_msdu_desc32_t type */
  988. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  989. /* define a htt_tx_msdu_desc64_t type */
  990. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  991. /*
  992. * Make htt_tx_msdu_desc_t be an alias for either
  993. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  994. */
  995. #if HTT_PADDR64
  996. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  997. #else
  998. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  999. #endif
  1000. /* decriptor information for Management frame*/
  1001. /*
  1002. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1003. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1004. */
  1005. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1006. extern A_UINT32 mgmt_hdr_len;
  1007. PREPACK struct htt_mgmt_tx_desc_t {
  1008. A_UINT32 msg_type;
  1009. #if HTT_PADDR64
  1010. A_UINT64 frag_paddr; /* DMAble address of the data */
  1011. #else
  1012. A_UINT32 frag_paddr; /* DMAble address of the data */
  1013. #endif
  1014. A_UINT32 desc_id; /* returned to host during completion
  1015. * to free the meory*/
  1016. A_UINT32 len; /* Fragment length */
  1017. A_UINT32 vdev_id; /* virtual device ID*/
  1018. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1019. } POSTPACK;
  1020. PREPACK struct htt_mgmt_tx_compl_ind {
  1021. A_UINT32 desc_id;
  1022. A_UINT32 status;
  1023. } POSTPACK;
  1024. /*
  1025. * This SDU header size comes from the summation of the following:
  1026. * 1. Max of:
  1027. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1028. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1029. * b. 802.11 header, for raw frames: 36 bytes
  1030. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1031. * QoS header, HT header)
  1032. * c. 802.3 header, for ethernet frames: 14 bytes
  1033. * (destination address, source address, ethertype / length)
  1034. * 2. Max of:
  1035. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1036. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1037. * 3. 802.1Q VLAN header: 4 bytes
  1038. * 4. LLC/SNAP header: 8 bytes
  1039. */
  1040. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1041. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1042. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1043. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1044. A_COMPILE_TIME_ASSERT(
  1045. htt_encap_hdr_size_max_check_nwifi,
  1046. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1047. A_COMPILE_TIME_ASSERT(
  1048. htt_encap_hdr_size_max_check_enet,
  1049. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1050. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1051. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1052. #define HTT_TX_HDR_SIZE_802_1Q 4
  1053. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1054. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1055. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1056. HTT_TX_HDR_SIZE_802_1Q + \
  1057. HTT_TX_HDR_SIZE_LLC_SNAP)
  1058. #define HTT_HL_TX_FRM_HDR_LEN \
  1059. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1060. #define HTT_LL_TX_FRM_HDR_LEN \
  1061. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1062. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1063. /* dword 0 */
  1064. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1065. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1066. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1067. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1068. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1069. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1070. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1071. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1072. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1073. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1074. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1075. #define HTT_TX_DESC_PKT_TYPE_S 13
  1076. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1077. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1078. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1079. #define HTT_TX_DESC_VDEV_ID_S 16
  1080. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1081. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1082. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1083. #define HTT_TX_DESC_EXT_TID_S 22
  1084. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1085. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1086. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1087. #define HTT_TX_DESC_POSTPONED_S 27
  1088. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1089. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1090. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1091. #define HTT_TX_DESC_EXTENSION_S 28
  1092. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1093. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1094. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1095. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1096. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1097. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1098. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1099. #define HTT_TX_DESC_TX_COMP_S 31
  1100. /* dword 1 */
  1101. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1102. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1103. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1104. #define HTT_TX_DESC_FRM_LEN_S 0
  1105. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1106. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1107. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1108. #define HTT_TX_DESC_FRM_ID_S 16
  1109. /* dword 2 */
  1110. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1111. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1112. /* for systems using 64-bit format for bus addresses */
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1115. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1116. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1117. /* for systems using 32-bit format for bus addresses */
  1118. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1119. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1120. /* dword 3 */
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1122. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1124. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1125. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1126. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1127. #if HTT_PADDR64
  1128. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1129. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1130. #else
  1131. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1132. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1133. #endif
  1134. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1135. #define HTT_TX_DESC_PEER_ID_S 0
  1136. /*
  1137. * TEMPORARY:
  1138. * The original definitions for the PEER_ID fields contained typos
  1139. * (with _DESC_PADDR appended to this PEER_ID field name).
  1140. * Retain deprecated original names for PEER_ID fields until all code that
  1141. * refers to them has been updated.
  1142. */
  1143. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1144. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1145. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1146. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1147. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1148. HTT_TX_DESC_PEER_ID_M
  1149. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1150. HTT_TX_DESC_PEER_ID_S
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1152. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1154. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1155. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1156. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1157. #if HTT_PADDR64
  1158. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1159. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1160. #else
  1161. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1162. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1163. #endif
  1164. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1165. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1166. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1167. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1168. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1169. do { \
  1170. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1171. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1172. } while (0)
  1173. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1174. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1175. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1176. do { \
  1177. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1178. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1179. } while (0)
  1180. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1181. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1182. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1183. do { \
  1184. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1185. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1186. } while (0)
  1187. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1188. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1189. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1190. do { \
  1191. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1192. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1193. } while (0)
  1194. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1195. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1196. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1197. do { \
  1198. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1199. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1200. } while (0)
  1201. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1202. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1203. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1204. do { \
  1205. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1206. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1207. } while (0)
  1208. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1209. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1210. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1211. do { \
  1212. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1213. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1214. } while (0)
  1215. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1216. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1217. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1218. do { \
  1219. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1220. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1221. } while (0)
  1222. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1223. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1224. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1225. do { \
  1226. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1227. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1228. } while (0)
  1229. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1230. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1231. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1232. do { \
  1233. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1234. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1235. } while (0)
  1236. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1237. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1238. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1239. do { \
  1240. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1241. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1242. } while (0)
  1243. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1244. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1245. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1246. do { \
  1247. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1248. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1249. } while (0)
  1250. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1251. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1252. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1253. do { \
  1254. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1255. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1256. } while (0)
  1257. /* enums used in the HTT tx MSDU extension descriptor */
  1258. enum {
  1259. htt_tx_guard_interval_regular = 0,
  1260. htt_tx_guard_interval_short = 1,
  1261. };
  1262. enum {
  1263. htt_tx_preamble_type_ofdm = 0,
  1264. htt_tx_preamble_type_cck = 1,
  1265. htt_tx_preamble_type_ht = 2,
  1266. htt_tx_preamble_type_vht = 3,
  1267. };
  1268. enum {
  1269. htt_tx_bandwidth_5MHz = 0,
  1270. htt_tx_bandwidth_10MHz = 1,
  1271. htt_tx_bandwidth_20MHz = 2,
  1272. htt_tx_bandwidth_40MHz = 3,
  1273. htt_tx_bandwidth_80MHz = 4,
  1274. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1275. };
  1276. /**
  1277. * @brief HTT tx MSDU extension descriptor
  1278. * @details
  1279. * If the target supports HTT tx MSDU extension descriptors, the host has
  1280. * the option of appending the following struct following the regular
  1281. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1282. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1283. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1284. * tx specs for each frame.
  1285. */
  1286. PREPACK struct htt_tx_msdu_desc_ext_t {
  1287. /* DWORD 0: flags */
  1288. A_UINT32
  1289. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1290. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1291. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1292. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1293. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1294. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1295. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1296. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1297. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1298. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1299. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1300. /* DWORD 1: tx power, tx rate, tx BW */
  1301. A_UINT32
  1302. /* pwr -
  1303. * Specify what power the tx frame needs to be transmitted at.
  1304. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1305. * The value needs to be appropriately sign-extended when extracting
  1306. * the value from the message and storing it in a variable that is
  1307. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1308. * automatically handles this sign-extension.)
  1309. * If the transmission uses multiple tx chains, this power spec is
  1310. * the total transmit power, assuming incoherent combination of
  1311. * per-chain power to produce the total power.
  1312. */
  1313. pwr: 8,
  1314. /* mcs_mask -
  1315. * Specify the allowable values for MCS index (modulation and coding)
  1316. * to use for transmitting the frame.
  1317. *
  1318. * For HT / VHT preamble types, this mask directly corresponds to
  1319. * the HT or VHT MCS indices that are allowed. For each bit N set
  1320. * within the mask, MCS index N is allowed for transmitting the frame.
  1321. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1322. * rates versus OFDM rates, so the host has the option of specifying
  1323. * that the target must transmit the frame with CCK or OFDM rates
  1324. * (not HT or VHT), but leaving the decision to the target whether
  1325. * to use CCK or OFDM.
  1326. *
  1327. * For CCK and OFDM, the bits within this mask are interpreted as
  1328. * follows:
  1329. * bit 0 -> CCK 1 Mbps rate is allowed
  1330. * bit 1 -> CCK 2 Mbps rate is allowed
  1331. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1332. * bit 3 -> CCK 11 Mbps rate is allowed
  1333. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1334. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1335. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1336. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1337. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1338. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1339. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1340. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1341. *
  1342. * The MCS index specification needs to be compatible with the
  1343. * bandwidth mask specification. For example, a MCS index == 9
  1344. * specification is inconsistent with a preamble type == VHT,
  1345. * Nss == 1, and channel bandwidth == 20 MHz.
  1346. *
  1347. * Furthermore, the host has only a limited ability to specify to
  1348. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1349. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1350. */
  1351. mcs_mask: 12,
  1352. /* nss_mask -
  1353. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1354. * Each bit in this mask corresponds to a Nss value:
  1355. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1356. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1357. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1358. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1359. * The values in the Nss mask must be suitable for the recipient, e.g.
  1360. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1361. * recipient which only supports 2x2 MIMO.
  1362. */
  1363. nss_mask: 4,
  1364. /* guard_interval -
  1365. * Specify a htt_tx_guard_interval enum value to indicate whether
  1366. * the transmission should use a regular guard interval or a
  1367. * short guard interval.
  1368. */
  1369. guard_interval: 1,
  1370. /* preamble_type_mask -
  1371. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1372. * may choose from for transmitting this frame.
  1373. * The bits in this mask correspond to the values in the
  1374. * htt_tx_preamble_type enum. For example, to allow the target
  1375. * to transmit the frame as either CCK or OFDM, this field would
  1376. * be set to
  1377. * (1 << htt_tx_preamble_type_ofdm) |
  1378. * (1 << htt_tx_preamble_type_cck)
  1379. */
  1380. preamble_type_mask: 4,
  1381. reserved1_31_29: 3; /* unused, set to 0x0 */
  1382. /* DWORD 2: tx chain mask, tx retries */
  1383. A_UINT32
  1384. /* chain_mask - specify which chains to transmit from */
  1385. chain_mask: 4,
  1386. /* retry_limit -
  1387. * Specify the maximum number of transmissions, including the
  1388. * initial transmission, to attempt before giving up if no ack
  1389. * is received.
  1390. * If the tx rate is specified, then all retries shall use the
  1391. * same rate as the initial transmission.
  1392. * If no tx rate is specified, the target can choose whether to
  1393. * retain the original rate during the retransmissions, or to
  1394. * fall back to a more robust rate.
  1395. */
  1396. retry_limit: 4,
  1397. /* bandwidth_mask -
  1398. * Specify what channel widths may be used for the transmission.
  1399. * A value of zero indicates "don't care" - the target may choose
  1400. * the transmission bandwidth.
  1401. * The bits within this mask correspond to the htt_tx_bandwidth
  1402. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1403. * The bandwidth_mask must be consistent with the preamble_type_mask
  1404. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1405. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1406. */
  1407. bandwidth_mask: 6,
  1408. reserved2_31_14: 18; /* unused, set to 0x0 */
  1409. /* DWORD 3: tx expiry time (TSF) LSBs */
  1410. A_UINT32 expire_tsf_lo;
  1411. /* DWORD 4: tx expiry time (TSF) MSBs */
  1412. A_UINT32 expire_tsf_hi;
  1413. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1414. } POSTPACK;
  1415. /* DWORD 0 */
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1431. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1432. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1433. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1434. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1435. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1436. /* DWORD 1 */
  1437. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1438. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1439. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1440. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1441. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1442. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1443. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1444. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1445. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1446. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1447. /* DWORD 2 */
  1448. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1449. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1450. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1451. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1452. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1453. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1454. /* DWORD 0 */
  1455. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1456. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1457. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1458. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1459. do { \
  1460. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1461. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1462. } while (0)
  1463. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1464. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1465. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1466. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1467. do { \
  1468. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1469. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1470. } while (0)
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1472. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1473. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1475. do { \
  1476. HTT_CHECK_SET_VAL( \
  1477. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1478. ((_var) |= ((_val) \
  1479. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1480. } while (0)
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1482. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1483. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1485. do { \
  1486. HTT_CHECK_SET_VAL( \
  1487. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1488. ((_var) |= ((_val) \
  1489. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1490. } while (0)
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1492. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1493. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1495. do { \
  1496. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1497. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1498. } while (0)
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1500. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1501. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1503. do { \
  1504. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1505. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1506. } while (0)
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1508. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1509. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1511. do { \
  1512. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1513. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1514. } while (0)
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1516. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1517. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1519. do { \
  1520. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1521. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1522. } while (0)
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1524. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1525. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1527. do { \
  1528. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1529. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1530. } while (0)
  1531. /* DWORD 1 */
  1532. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1533. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1534. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1535. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1536. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1537. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1538. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1539. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1540. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1541. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1542. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1543. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1544. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1545. do { \
  1546. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1547. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1548. } while (0)
  1549. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1550. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1551. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1552. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1553. do { \
  1554. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1555. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1556. } while (0)
  1557. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1558. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1559. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1560. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1561. do { \
  1562. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1563. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1564. } while (0)
  1565. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1566. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1567. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1568. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1569. do { \
  1570. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1571. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1572. } while (0)
  1573. /* DWORD 2 */
  1574. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1575. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1576. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1577. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1578. do { \
  1579. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1580. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1581. } while (0)
  1582. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1583. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1584. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1585. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1586. do { \
  1587. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1588. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1589. } while (0)
  1590. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1591. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1592. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1593. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1594. do { \
  1595. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1596. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1597. } while (0)
  1598. typedef enum {
  1599. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1600. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1601. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1602. } htt_11ax_ltf_subtype_t;
  1603. typedef enum {
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1605. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1606. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1607. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1608. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1609. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1610. } htt_tx_ext2_preamble_type_t;
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1618. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1619. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1620. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1621. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1622. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1623. /**
  1624. * @brief HTT tx MSDU extension descriptor v2
  1625. * @details
  1626. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1627. * is received as tcl_exit_base->host_meta_info in firmware.
  1628. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1629. * are already part of tcl_exit_base.
  1630. */
  1631. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1632. /* DWORD 0: flags */
  1633. A_UINT32
  1634. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1635. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1636. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1637. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1638. valid_retries : 1, /* if set, tx retries spec is valid */
  1639. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1640. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1641. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1642. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1643. valid_key_flags : 1, /* if set, key flags is valid */
  1644. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1645. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1646. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1647. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1648. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1649. 1 = ENCRYPT,
  1650. 2 ~ 3 - Reserved */
  1651. /* retry_limit -
  1652. * Specify the maximum number of transmissions, including the
  1653. * initial transmission, to attempt before giving up if no ack
  1654. * is received.
  1655. * If the tx rate is specified, then all retries shall use the
  1656. * same rate as the initial transmission.
  1657. * If no tx rate is specified, the target can choose whether to
  1658. * retain the original rate during the retransmissions, or to
  1659. * fall back to a more robust rate.
  1660. */
  1661. retry_limit : 4,
  1662. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1663. * Valid only for 11ax preamble types HE_SU
  1664. * and HE_EXT_SU
  1665. */
  1666. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1667. * Valid only for 11ax preamble types HE_SU
  1668. * and HE_EXT_SU
  1669. */
  1670. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1671. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1672. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1673. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1674. */
  1675. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1676. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1677. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1678. * Use cases:
  1679. * Any time firmware uses TQM-BYPASS for Data
  1680. * TID, firmware expect host to set this bit.
  1681. */
  1682. /* DWORD 1: tx power, tx rate */
  1683. A_UINT32
  1684. power : 8, /* unit of the power field is 0.5 dbm
  1685. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1686. * signed value ranging from -64dbm to 63.5 dbm
  1687. */
  1688. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1689. * Setting more than one MCS isn't currently
  1690. * supported by the target (but is supported
  1691. * in the interface in case in the future
  1692. * the target supports specifications of
  1693. * a limited set of MCS values.
  1694. */
  1695. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1696. * Setting more than one Nss isn't currently
  1697. * supported by the target (but is supported
  1698. * in the interface in case in the future
  1699. * the target supports specifications of
  1700. * a limited set of Nss values.
  1701. */
  1702. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1703. update_peer_cache : 1; /* When set these custom values will be
  1704. * used for all packets, until the next
  1705. * update via this ext header.
  1706. * This is to make sure not all packets
  1707. * need to include this header.
  1708. */
  1709. /* DWORD 2: tx chain mask, tx retries */
  1710. A_UINT32
  1711. /* chain_mask - specify which chains to transmit from */
  1712. chain_mask : 8,
  1713. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1714. * TODO: Update Enum values for key_flags
  1715. */
  1716. /*
  1717. * Channel frequency: This identifies the desired channel
  1718. * frequency (in MHz) for tx frames. This is used by FW to help
  1719. * determine when it is safe to transmit or drop frames for
  1720. * off-channel operation.
  1721. * The default value of zero indicates to FW that the corresponding
  1722. * VDEV's home channel (if there is one) is the desired channel
  1723. * frequency.
  1724. */
  1725. chanfreq : 16;
  1726. /* DWORD 3: tx expiry time (TSF) LSBs */
  1727. A_UINT32 expire_tsf_lo;
  1728. /* DWORD 4: tx expiry time (TSF) MSBs */
  1729. A_UINT32 expire_tsf_hi;
  1730. /* DWORD 5: flags to control routing / processing of the MSDU */
  1731. A_UINT32
  1732. /* learning_frame
  1733. * When this flag is set, this frame will be dropped by FW
  1734. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1735. */
  1736. learning_frame : 1,
  1737. /* send_as_standalone
  1738. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1739. * i.e. with no A-MSDU or A-MPDU aggregation.
  1740. * The scope is extended to other use-cases.
  1741. */
  1742. send_as_standalone : 1,
  1743. /* is_host_opaque_valid
  1744. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1745. * with valid information.
  1746. */
  1747. is_host_opaque_valid : 1,
  1748. rsvd0 : 29;
  1749. /* DWORD 6 : Host opaque cookie for special frames */
  1750. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1751. rsvd1 : 16;
  1752. /*
  1753. * This structure can be expanded further up to 40 bytes
  1754. * by adding further DWORDs as needed.
  1755. */
  1756. } POSTPACK;
  1757. /* DWORD 0 */
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1779. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1780. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1781. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1782. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1783. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1784. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1785. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1786. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1787. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1788. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1789. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1790. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1791. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1792. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1793. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1794. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1795. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1796. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1797. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1798. /* DWORD 1 */
  1799. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1800. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1801. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1802. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1803. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1804. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1805. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1806. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1807. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1808. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1809. /* DWORD 2 */
  1810. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1811. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1812. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1813. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1814. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1815. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1816. /* DWORD 5 */
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1823. /* DWORD 6 */
  1824. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1825. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1826. /* DWORD 0 */
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1834. } while (0)
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1836. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1837. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1841. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1842. } while (0)
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1844. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1845. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1849. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1850. } while (0)
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1852. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1853. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL( \
  1857. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1858. ((_var) |= ((_val) \
  1859. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1860. } while (0)
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1862. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1863. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1865. do { \
  1866. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1867. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1868. } while (0)
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1870. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1871. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1873. do { \
  1874. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1875. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1876. } while (0)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1878. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1879. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1881. do { \
  1882. HTT_CHECK_SET_VAL( \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1884. ((_var) |= ((_val) \
  1885. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1886. } while (0)
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1888. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1889. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1891. do { \
  1892. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1893. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1894. } while (0)
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1896. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1897. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1899. do { \
  1900. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1901. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1902. } while (0)
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1904. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1905. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1907. do { \
  1908. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1909. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1910. } while (0)
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1912. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1913. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1918. } while (0)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1920. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1921. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1926. } while (0)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1928. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1929. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1934. } while (0)
  1935. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1990. } while (0)
  1991. /* DWORD 1 */
  1992. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1996. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1997. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1998. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1999. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2000. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2001. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2002. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2003. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2004. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2008. } while (0)
  2009. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2010. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2011. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2012. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2016. } while (0)
  2017. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2018. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2019. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2020. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2024. } while (0)
  2025. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2026. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2027. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2028. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2032. } while (0)
  2033. /* DWORD 2 */
  2034. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2035. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2036. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2037. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2038. do { \
  2039. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2040. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2041. } while (0)
  2042. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2043. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2044. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2045. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2046. do { \
  2047. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2048. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2049. } while (0)
  2050. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2051. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2052. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2053. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2054. do { \
  2055. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2056. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2057. } while (0)
  2058. /* DWORD 5 */
  2059. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2066. } while (0)
  2067. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2074. } while (0)
  2075. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2076. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2077. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2078. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2082. } while (0)
  2083. /* DWORD 6 */
  2084. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2085. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2086. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2087. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2091. } while (0)
  2092. typedef enum {
  2093. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2094. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2095. } htt_tcl_metadata_type;
  2096. /**
  2097. * @brief HTT TCL command number format
  2098. * @details
  2099. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2100. * available to firmware as tcl_exit_base->tcl_status_number.
  2101. * For regular / multicast packets host will send vdev and mac id and for
  2102. * NAWDS packets, host will send peer id.
  2103. * A_UINT32 is used to avoid endianness conversion problems.
  2104. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2105. */
  2106. typedef struct {
  2107. A_UINT32
  2108. type: 1, /* vdev_id based or peer_id based */
  2109. rsvd: 31;
  2110. } htt_tx_tcl_vdev_or_peer_t;
  2111. typedef struct {
  2112. A_UINT32
  2113. type: 1, /* vdev_id based or peer_id based */
  2114. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2115. vdev_id: 8,
  2116. pdev_id: 2,
  2117. host_inspected:1,
  2118. rsvd: 19;
  2119. } htt_tx_tcl_vdev_metadata;
  2120. typedef struct {
  2121. A_UINT32
  2122. type: 1, /* vdev_id based or peer_id based */
  2123. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2124. peer_id: 14,
  2125. rsvd: 16;
  2126. } htt_tx_tcl_peer_metadata;
  2127. PREPACK struct htt_tx_tcl_metadata {
  2128. union {
  2129. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2130. htt_tx_tcl_vdev_metadata vdev_meta;
  2131. htt_tx_tcl_peer_metadata peer_meta;
  2132. };
  2133. } POSTPACK;
  2134. /* DWORD 0 */
  2135. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2136. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2137. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2138. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2139. /* VDEV metadata */
  2140. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2141. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2142. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2143. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2144. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2145. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2146. /* PEER metadata */
  2147. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2148. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2149. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2150. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2151. HTT_TX_TCL_METADATA_TYPE_S)
  2152. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2156. } while (0)
  2157. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2158. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2159. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2160. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2164. } while (0)
  2165. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2166. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2167. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2168. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2169. do { \
  2170. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2171. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2172. } while (0)
  2173. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2174. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2175. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2176. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2180. } while (0)
  2181. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2182. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2183. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2184. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2188. } while (0)
  2189. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2190. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2191. HTT_TX_TCL_METADATA_PEER_ID_S)
  2192. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2195. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2196. } while (0)
  2197. typedef enum {
  2198. HTT_TX_FW2WBM_TX_STATUS_OK,
  2199. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2200. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2201. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2202. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2203. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2204. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2205. HTT_TX_FW2WBM_TX_STATUS_MAX
  2206. } htt_tx_fw2wbm_tx_status_t;
  2207. typedef enum {
  2208. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2209. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2210. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2211. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2212. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2213. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2214. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2215. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2216. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2217. } htt_tx_fw2wbm_reinject_reason_t;
  2218. /**
  2219. * @brief HTT TX WBM Completion from firmware to host
  2220. * @details
  2221. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2222. * DWORD 3 and 4 for software based completions (Exception frames and
  2223. * TQM bypass frames)
  2224. * For software based completions, wbm_release_ring->release_source_module will
  2225. * be set to release_source_fw
  2226. */
  2227. PREPACK struct htt_tx_wbm_completion {
  2228. A_UINT32
  2229. sch_cmd_id: 24,
  2230. exception_frame: 1, /* If set, this packet was queued via exception path */
  2231. rsvd0_31_25: 7;
  2232. A_UINT32
  2233. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2234. * reception of an ACK or BA, this field indicates
  2235. * the RSSI of the received ACK or BA frame.
  2236. * When the frame is removed as result of a direct
  2237. * remove command from the SW, this field is set
  2238. * to 0x0 (which is never a valid value when real
  2239. * RSSI is available).
  2240. * Units: dB w.r.t noise floor
  2241. */
  2242. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2243. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2244. rsvd1_31_16: 16;
  2245. } POSTPACK;
  2246. /* DWORD 0 */
  2247. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2248. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2249. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2250. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2251. /* DWORD 1 */
  2252. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2253. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2254. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2255. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2256. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2257. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2258. /* DWORD 0 */
  2259. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2260. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2261. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2262. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2266. } while (0)
  2267. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2268. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2269. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2270. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2274. } while (0)
  2275. /* DWORD 1 */
  2276. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2278. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2279. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2283. } while (0)
  2284. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2285. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2286. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2287. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2291. } while (0)
  2292. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2293. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2294. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2295. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2296. do { \
  2297. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2298. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2299. } while (0)
  2300. /**
  2301. * @brief HTT TX WBM Completion from firmware to host
  2302. * @details
  2303. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2304. * (WBM) offload HW.
  2305. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2306. * For software based completions, release_source_module will
  2307. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2308. * struct wbm_release_ring and then switch to this after looking at
  2309. * release_source_module.
  2310. */
  2311. PREPACK struct htt_tx_wbm_completion_v2 {
  2312. A_UINT32
  2313. used_by_hw0; /* Refer to struct wbm_release_ring */
  2314. A_UINT32
  2315. used_by_hw1; /* Refer to struct wbm_release_ring */
  2316. A_UINT32
  2317. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2318. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2319. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2320. exception_frame: 1,
  2321. rsvd0: 12, /* For future use */
  2322. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2323. rsvd1: 1; /* For future use */
  2324. A_UINT32
  2325. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2326. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2327. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2328. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2329. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2330. */
  2331. A_UINT32
  2332. data1: 32;
  2333. A_UINT32
  2334. data2: 32;
  2335. A_UINT32
  2336. used_by_hw3; /* Refer to struct wbm_release_ring */
  2337. } POSTPACK;
  2338. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2339. /* DWORD 3 */
  2340. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2341. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2342. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2343. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2344. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2345. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2346. /* DWORD 3 */
  2347. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2348. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2349. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2350. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2354. } while (0)
  2355. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2356. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2357. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2358. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2359. do { \
  2360. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2361. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2362. } while (0)
  2363. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2364. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2365. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2366. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2367. do { \
  2368. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2369. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2370. } while (0)
  2371. typedef enum {
  2372. TX_FRAME_TYPE_UNDEFINED = 0,
  2373. TX_FRAME_TYPE_EAPOL = 1,
  2374. } htt_tx_wbm_status_frame_type;
  2375. /**
  2376. * @brief HTT TX WBM transmit status from firmware to host
  2377. * @details
  2378. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2379. * (WBM) offload HW.
  2380. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2381. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2382. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2383. */
  2384. PREPACK struct htt_tx_wbm_transmit_status {
  2385. A_UINT32
  2386. sch_cmd_id: 24,
  2387. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2388. * reception of an ACK or BA, this field indicates
  2389. * the RSSI of the received ACK or BA frame.
  2390. * When the frame is removed as result of a direct
  2391. * remove command from the SW, this field is set
  2392. * to 0x0 (which is never a valid value when real
  2393. * RSSI is available).
  2394. * Units: dB w.r.t noise floor
  2395. */
  2396. A_UINT32
  2397. sw_peer_id: 16,
  2398. tid_num: 5,
  2399. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2400. * and tid_num fields contain valid data.
  2401. * If this "valid" flag is not set, the
  2402. * sw_peer_id and tid_num fields must be ignored.
  2403. */
  2404. mcast: 1,
  2405. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2406. * contains valid data.
  2407. */
  2408. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2409. reserved: 4;
  2410. A_UINT32
  2411. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2412. * packets in the wbm completion path
  2413. */
  2414. } POSTPACK;
  2415. /* DWORD 4 */
  2416. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2417. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2418. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2419. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2420. /* DWORD 5 */
  2421. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2422. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2423. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2424. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2425. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2426. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2427. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2428. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2429. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2430. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2431. /* DWORD 4 */
  2432. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2433. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2434. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2435. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2439. } while (0)
  2440. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2441. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2442. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2443. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2447. } while (0)
  2448. /* DWORD 5 */
  2449. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2450. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2451. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2452. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2456. } while (0)
  2457. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2458. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2459. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2460. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2464. } while (0)
  2465. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2466. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2467. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2468. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2471. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2472. } while (0)
  2473. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2474. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2475. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2476. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2479. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2480. } while (0)
  2481. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2482. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2483. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2484. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2485. do { \
  2486. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2487. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2488. } while (0)
  2489. /**
  2490. * @brief HTT TX WBM reinject status from firmware to host
  2491. * @details
  2492. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2493. * (WBM) offload HW.
  2494. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2495. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2496. */
  2497. PREPACK struct htt_tx_wbm_reinject_status {
  2498. A_UINT32
  2499. reserved0: 32;
  2500. A_UINT32
  2501. reserved1: 32;
  2502. A_UINT32
  2503. reserved2: 32;
  2504. } POSTPACK;
  2505. /**
  2506. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2507. * @details
  2508. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2509. * (WBM) offload HW.
  2510. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2511. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2512. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2513. * STA side.
  2514. */
  2515. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2516. A_UINT32
  2517. mec_sa_addr_31_0;
  2518. A_UINT32
  2519. mec_sa_addr_47_32: 16,
  2520. sa_ast_index: 16;
  2521. A_UINT32
  2522. vdev_id: 8,
  2523. reserved0: 24;
  2524. } POSTPACK;
  2525. /* DWORD 4 - mec_sa_addr_31_0 */
  2526. /* DWORD 5 */
  2527. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2528. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2529. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2530. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2531. /* DWORD 6 */
  2532. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2533. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2534. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2535. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2536. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2537. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2540. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2541. } while (0)
  2542. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2543. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2544. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2545. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2548. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2549. } while (0)
  2550. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2551. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2552. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2553. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2556. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2557. } while (0)
  2558. typedef enum {
  2559. TX_FLOW_PRIORITY_BE,
  2560. TX_FLOW_PRIORITY_HIGH,
  2561. TX_FLOW_PRIORITY_LOW,
  2562. } htt_tx_flow_priority_t;
  2563. typedef enum {
  2564. TX_FLOW_LATENCY_SENSITIVE,
  2565. TX_FLOW_LATENCY_INSENSITIVE,
  2566. } htt_tx_flow_latency_t;
  2567. typedef enum {
  2568. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2569. TX_FLOW_INTERACTIVE_TRAFFIC,
  2570. TX_FLOW_PERIODIC_TRAFFIC,
  2571. TX_FLOW_BURSTY_TRAFFIC,
  2572. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2573. } htt_tx_flow_traffic_pattern_t;
  2574. /**
  2575. * @brief HTT TX Flow search metadata format
  2576. * @details
  2577. * Host will set this metadata in flow table's flow search entry along with
  2578. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2579. * firmware and TQM ring if the flow search entry wins.
  2580. * This metadata is available to firmware in that first MSDU's
  2581. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2582. * to one of the available flows for specific tid and returns the tqm flow
  2583. * pointer as part of htt_tx_map_flow_info message.
  2584. */
  2585. PREPACK struct htt_tx_flow_metadata {
  2586. A_UINT32
  2587. rsvd0_1_0: 2,
  2588. tid: 4,
  2589. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2590. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2591. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2592. * Else choose final tid based on latency, priority.
  2593. */
  2594. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2595. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2596. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2597. } POSTPACK;
  2598. /* DWORD 0 */
  2599. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2600. #define HTT_TX_FLOW_METADATA_TID_S 2
  2601. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2602. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2603. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2604. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2605. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2606. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2607. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2608. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2609. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2610. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2611. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2612. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2613. /* DWORD 0 */
  2614. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2615. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2616. HTT_TX_FLOW_METADATA_TID_S)
  2617. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2618. do { \
  2619. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2620. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2621. } while (0)
  2622. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2623. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2624. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2625. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2626. do { \
  2627. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2628. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2629. } while (0)
  2630. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2631. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2632. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2633. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2634. do { \
  2635. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2636. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2637. } while (0)
  2638. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2639. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2640. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2641. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2642. do { \
  2643. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2644. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2645. } while (0)
  2646. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2647. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2648. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2649. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2652. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2653. } while (0)
  2654. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2655. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2656. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2657. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2658. do { \
  2659. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2660. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2661. } while (0)
  2662. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2663. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2664. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2665. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2666. do { \
  2667. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2668. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2669. } while (0)
  2670. /**
  2671. * @brief host -> target ADD WDS Entry
  2672. *
  2673. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2674. *
  2675. * @brief host -> target DELETE WDS Entry
  2676. *
  2677. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2678. *
  2679. * @details
  2680. * HTT wds entry from source port learning
  2681. * Host will learn wds entries from rx and send this message to firmware
  2682. * to enable firmware to configure/delete AST entries for wds clients.
  2683. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2684. * and when SA's entry is deleted, firmware removes this AST entry
  2685. *
  2686. * The message would appear as follows:
  2687. *
  2688. * |31 30|29 |17 16|15 8|7 0|
  2689. * |----------------+----------------+----------------+----------------|
  2690. * | rsvd0 |PDVID| vdev_id | msg_type |
  2691. * |-------------------------------------------------------------------|
  2692. * | sa_addr_31_0 |
  2693. * |-------------------------------------------------------------------|
  2694. * | | ta_peer_id | sa_addr_47_32 |
  2695. * |-------------------------------------------------------------------|
  2696. * Where PDVID = pdev_id
  2697. *
  2698. * The message is interpreted as follows:
  2699. *
  2700. * dword0 - b'0:7 - msg_type: This will be set to
  2701. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2702. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2703. *
  2704. * dword0 - b'8:15 - vdev_id
  2705. *
  2706. * dword0 - b'16:17 - pdev_id
  2707. *
  2708. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2709. *
  2710. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2711. *
  2712. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2713. *
  2714. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2715. */
  2716. PREPACK struct htt_wds_entry {
  2717. A_UINT32
  2718. msg_type: 8,
  2719. vdev_id: 8,
  2720. pdev_id: 2,
  2721. rsvd0: 14;
  2722. A_UINT32 sa_addr_31_0;
  2723. A_UINT32
  2724. sa_addr_47_32: 16,
  2725. ta_peer_id: 14,
  2726. rsvd2: 2;
  2727. } POSTPACK;
  2728. /* DWORD 0 */
  2729. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2730. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2731. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2732. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2733. /* DWORD 2 */
  2734. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2735. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2736. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2737. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2738. /* DWORD 0 */
  2739. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2740. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2741. HTT_WDS_ENTRY_VDEV_ID_S)
  2742. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2745. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2746. } while (0)
  2747. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2748. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2749. HTT_WDS_ENTRY_PDEV_ID_S)
  2750. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2753. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2754. } while (0)
  2755. /* DWORD 2 */
  2756. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2757. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2758. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2759. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2762. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2763. } while (0)
  2764. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2765. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2766. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2767. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2770. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2771. } while (0)
  2772. /**
  2773. * @brief MAC DMA rx ring setup specification
  2774. *
  2775. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2776. *
  2777. * @details
  2778. * To allow for dynamic rx ring reconfiguration and to avoid race
  2779. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2780. * it uses. Instead, it sends this message to the target, indicating how
  2781. * the rx ring used by the host should be set up and maintained.
  2782. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2783. * specifications.
  2784. *
  2785. * |31 16|15 8|7 0|
  2786. * |---------------------------------------------------------------|
  2787. * header: | reserved | num rings | msg type |
  2788. * |---------------------------------------------------------------|
  2789. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2790. #if HTT_PADDR64
  2791. * | FW_IDX shadow register physical address (bits 63:32) |
  2792. #endif
  2793. * |---------------------------------------------------------------|
  2794. * | rx ring base physical address (bits 31:0) |
  2795. #if HTT_PADDR64
  2796. * | rx ring base physical address (bits 63:32) |
  2797. #endif
  2798. * |---------------------------------------------------------------|
  2799. * | rx ring buffer size | rx ring length |
  2800. * |---------------------------------------------------------------|
  2801. * | FW_IDX initial value | enabled flags |
  2802. * |---------------------------------------------------------------|
  2803. * | MSDU payload offset | 802.11 header offset |
  2804. * |---------------------------------------------------------------|
  2805. * | PPDU end offset | PPDU start offset |
  2806. * |---------------------------------------------------------------|
  2807. * | MPDU end offset | MPDU start offset |
  2808. * |---------------------------------------------------------------|
  2809. * | MSDU end offset | MSDU start offset |
  2810. * |---------------------------------------------------------------|
  2811. * | frag info offset | rx attention offset |
  2812. * |---------------------------------------------------------------|
  2813. * payload 2, if present, has the same format as payload 1
  2814. * Header fields:
  2815. * - MSG_TYPE
  2816. * Bits 7:0
  2817. * Purpose: identifies this as an rx ring configuration message
  2818. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2819. * - NUM_RINGS
  2820. * Bits 15:8
  2821. * Purpose: indicates whether the host is setting up one rx ring or two
  2822. * Value: 1 or 2
  2823. * Payload:
  2824. * for systems using 64-bit format for bus addresses:
  2825. * - IDX_SHADOW_REG_PADDR_LO
  2826. * Bits 31:0
  2827. * Value: lower 4 bytes of physical address of the host's
  2828. * FW_IDX shadow register
  2829. * - IDX_SHADOW_REG_PADDR_HI
  2830. * Bits 31:0
  2831. * Value: upper 4 bytes of physical address of the host's
  2832. * FW_IDX shadow register
  2833. * - RING_BASE_PADDR_LO
  2834. * Bits 31:0
  2835. * Value: lower 4 bytes of physical address of the host's rx ring
  2836. * - RING_BASE_PADDR_HI
  2837. * Bits 31:0
  2838. * Value: uppper 4 bytes of physical address of the host's rx ring
  2839. * for systems using 32-bit format for bus addresses:
  2840. * - IDX_SHADOW_REG_PADDR
  2841. * Bits 31:0
  2842. * Value: physical address of the host's FW_IDX shadow register
  2843. * - RING_BASE_PADDR
  2844. * Bits 31:0
  2845. * Value: physical address of the host's rx ring
  2846. * - RING_LEN
  2847. * Bits 15:0
  2848. * Value: number of elements in the rx ring
  2849. * - RING_BUF_SZ
  2850. * Bits 31:16
  2851. * Value: size of the buffers referenced by the rx ring, in byte units
  2852. * - ENABLED_FLAGS
  2853. * Bits 15:0
  2854. * Value: 1-bit flags to show whether different rx fields are enabled
  2855. * bit 0: 802.11 header enabled (1) or disabled (0)
  2856. * bit 1: MSDU payload enabled (1) or disabled (0)
  2857. * bit 2: PPDU start enabled (1) or disabled (0)
  2858. * bit 3: PPDU end enabled (1) or disabled (0)
  2859. * bit 4: MPDU start enabled (1) or disabled (0)
  2860. * bit 5: MPDU end enabled (1) or disabled (0)
  2861. * bit 6: MSDU start enabled (1) or disabled (0)
  2862. * bit 7: MSDU end enabled (1) or disabled (0)
  2863. * bit 8: rx attention enabled (1) or disabled (0)
  2864. * bit 9: frag info enabled (1) or disabled (0)
  2865. * bit 10: unicast rx enabled (1) or disabled (0)
  2866. * bit 11: multicast rx enabled (1) or disabled (0)
  2867. * bit 12: ctrl rx enabled (1) or disabled (0)
  2868. * bit 13: mgmt rx enabled (1) or disabled (0)
  2869. * bit 14: null rx enabled (1) or disabled (0)
  2870. * bit 15: phy data rx enabled (1) or disabled (0)
  2871. * - IDX_INIT_VAL
  2872. * Bits 31:16
  2873. * Purpose: Specify the initial value for the FW_IDX.
  2874. * Value: the number of buffers initially present in the host's rx ring
  2875. * - OFFSET_802_11_HDR
  2876. * Bits 15:0
  2877. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2878. * - OFFSET_MSDU_PAYLOAD
  2879. * Bits 31:16
  2880. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2881. * - OFFSET_PPDU_START
  2882. * Bits 15:0
  2883. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2884. * - OFFSET_PPDU_END
  2885. * Bits 31:16
  2886. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2887. * - OFFSET_MPDU_START
  2888. * Bits 15:0
  2889. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2890. * - OFFSET_MPDU_END
  2891. * Bits 31:16
  2892. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2893. * - OFFSET_MSDU_START
  2894. * Bits 15:0
  2895. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2896. * - OFFSET_MSDU_END
  2897. * Bits 31:16
  2898. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2899. * - OFFSET_RX_ATTN
  2900. * Bits 15:0
  2901. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2902. * - OFFSET_FRAG_INFO
  2903. * Bits 31:16
  2904. * Value: offset in QUAD-bytes of frag info table
  2905. */
  2906. /* header fields */
  2907. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2908. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2909. /* payload fields */
  2910. /* for systems using a 64-bit format for bus addresses */
  2911. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2912. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2913. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2914. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2915. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2916. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2917. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2918. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2919. /* for systems using a 32-bit format for bus addresses */
  2920. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2921. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2922. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2923. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2924. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2925. #define HTT_RX_RING_CFG_LEN_S 0
  2926. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2927. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2928. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2929. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2930. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2931. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2932. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2933. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2934. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2935. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2936. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2937. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2938. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2939. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2940. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2941. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2942. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2943. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2944. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2945. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2946. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2947. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2948. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2949. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2950. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2951. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2952. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2953. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2954. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2955. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2956. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2957. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2958. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2959. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2960. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2961. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2962. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2963. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2965. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2967. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2968. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2969. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2970. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2971. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2972. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2973. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2974. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2975. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2976. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2977. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2978. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2979. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2980. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2981. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2982. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2983. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2984. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2985. #if HTT_PADDR64
  2986. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2987. #else
  2988. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2989. #endif
  2990. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2991. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2992. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2993. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2994. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2995. do { \
  2996. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2997. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2998. } while (0)
  2999. /* degenerate case for 32-bit fields */
  3000. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3001. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3002. ((_var) = (_val))
  3003. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3004. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3005. ((_var) = (_val))
  3006. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3007. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3008. ((_var) = (_val))
  3009. /* degenerate case for 32-bit fields */
  3010. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3011. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3012. ((_var) = (_val))
  3013. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3014. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3015. ((_var) = (_val))
  3016. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3017. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3018. ((_var) = (_val))
  3019. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3021. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3024. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3025. } while (0)
  3026. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3027. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3028. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3029. do { \
  3030. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3031. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3032. } while (0)
  3033. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3034. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3035. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3036. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3037. do { \
  3038. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3039. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3040. } while (0)
  3041. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3042. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3043. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3044. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3047. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3048. } while (0)
  3049. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3050. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3051. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3052. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3053. do { \
  3054. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3055. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3056. } while (0)
  3057. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3058. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3059. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3060. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3063. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3064. } while (0)
  3065. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3066. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3067. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3068. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3069. do { \
  3070. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3071. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3072. } while (0)
  3073. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3074. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3075. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3076. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3077. do { \
  3078. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3079. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3080. } while (0)
  3081. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3082. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3083. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3084. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3085. do { \
  3086. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3087. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3088. } while (0)
  3089. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3090. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3091. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3092. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3093. do { \
  3094. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3095. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3096. } while (0)
  3097. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3098. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3099. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3100. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3103. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3104. } while (0)
  3105. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3106. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3107. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3108. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3111. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3112. } while (0)
  3113. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3114. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3115. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3116. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3119. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3120. } while (0)
  3121. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3122. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3123. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3124. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3127. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3128. } while (0)
  3129. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3130. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3131. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3132. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3133. do { \
  3134. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3135. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3136. } while (0)
  3137. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3138. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3139. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3140. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3141. do { \
  3142. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3143. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3144. } while (0)
  3145. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3146. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3147. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3148. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3149. do { \
  3150. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3151. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3152. } while (0)
  3153. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3154. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3155. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3156. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3157. do { \
  3158. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3159. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3160. } while (0)
  3161. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3162. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3163. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3164. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3165. do { \
  3166. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3167. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3168. } while (0)
  3169. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3170. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3171. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3172. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3173. do { \
  3174. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3175. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3176. } while (0)
  3177. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3178. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3179. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3180. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3181. do { \
  3182. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3183. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3184. } while (0)
  3185. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3186. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3187. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3188. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3189. do { \
  3190. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3191. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3192. } while (0)
  3193. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3194. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3195. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3196. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3199. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3200. } while (0)
  3201. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3202. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3203. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3204. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3205. do { \
  3206. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3207. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3208. } while (0)
  3209. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3210. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3211. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3212. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3213. do { \
  3214. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3215. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3216. } while (0)
  3217. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3218. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3219. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3220. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3221. do { \
  3222. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3223. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3224. } while (0)
  3225. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3226. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3227. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3228. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3229. do { \
  3230. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3231. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3232. } while (0)
  3233. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3234. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3235. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3236. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3237. do { \
  3238. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3239. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3240. } while (0)
  3241. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3242. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3243. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3244. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3245. do { \
  3246. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3247. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3248. } while (0)
  3249. /**
  3250. * @brief host -> target FW statistics retrieve
  3251. *
  3252. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3253. *
  3254. * @details
  3255. * The following field definitions describe the format of the HTT host
  3256. * to target FW stats retrieve message. The message specifies the type of
  3257. * stats host wants to retrieve.
  3258. *
  3259. * |31 24|23 16|15 8|7 0|
  3260. * |-----------------------------------------------------------|
  3261. * | stats types request bitmask | msg type |
  3262. * |-----------------------------------------------------------|
  3263. * | stats types reset bitmask | reserved |
  3264. * |-----------------------------------------------------------|
  3265. * | stats type | config value |
  3266. * |-----------------------------------------------------------|
  3267. * | cookie LSBs |
  3268. * |-----------------------------------------------------------|
  3269. * | cookie MSBs |
  3270. * |-----------------------------------------------------------|
  3271. * Header fields:
  3272. * - MSG_TYPE
  3273. * Bits 7:0
  3274. * Purpose: identifies this is a stats upload request message
  3275. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3276. * - UPLOAD_TYPES
  3277. * Bits 31:8
  3278. * Purpose: identifies which types of FW statistics to upload
  3279. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3280. * - RESET_TYPES
  3281. * Bits 31:8
  3282. * Purpose: identifies which types of FW statistics to reset
  3283. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3284. * - CFG_VAL
  3285. * Bits 23:0
  3286. * Purpose: give an opaque configuration value to the specified stats type
  3287. * Value: stats-type specific configuration value
  3288. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3289. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3290. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3291. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3292. * - CFG_STAT_TYPE
  3293. * Bits 31:24
  3294. * Purpose: specify which stats type (if any) the config value applies to
  3295. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3296. * a valid configuration specification
  3297. * - COOKIE_LSBS
  3298. * Bits 31:0
  3299. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3300. * message with its preceding host->target stats request message.
  3301. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3302. * - COOKIE_MSBS
  3303. * Bits 31:0
  3304. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3305. * message with its preceding host->target stats request message.
  3306. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3307. */
  3308. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3309. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3310. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3311. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3312. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3313. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3314. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3315. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3316. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3317. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3318. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3319. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3320. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3321. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3322. do { \
  3323. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3324. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3325. } while (0)
  3326. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3327. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3328. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3329. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3330. do { \
  3331. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3332. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3333. } while (0)
  3334. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3335. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3336. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3337. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3338. do { \
  3339. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3340. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3341. } while (0)
  3342. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3343. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3344. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3345. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3346. do { \
  3347. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3348. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3349. } while (0)
  3350. /**
  3351. * @brief host -> target HTT out-of-band sync request
  3352. *
  3353. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3354. *
  3355. * @details
  3356. * The HTT SYNC tells the target to suspend processing of subsequent
  3357. * HTT host-to-target messages until some other target agent locally
  3358. * informs the target HTT FW that the current sync counter is equal to
  3359. * or greater than (in a modulo sense) the sync counter specified in
  3360. * the SYNC message.
  3361. * This allows other host-target components to synchronize their operation
  3362. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3363. * security key has been downloaded to and activated by the target.
  3364. * In the absence of any explicit synchronization counter value
  3365. * specification, the target HTT FW will use zero as the default current
  3366. * sync value.
  3367. *
  3368. * |31 24|23 16|15 8|7 0|
  3369. * |-----------------------------------------------------------|
  3370. * | reserved | sync count | msg type |
  3371. * |-----------------------------------------------------------|
  3372. * Header fields:
  3373. * - MSG_TYPE
  3374. * Bits 7:0
  3375. * Purpose: identifies this as a sync message
  3376. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3377. * - SYNC_COUNT
  3378. * Bits 15:8
  3379. * Purpose: specifies what sync value the HTT FW will wait for from
  3380. * an out-of-band specification to resume its operation
  3381. * Value: in-band sync counter value to compare against the out-of-band
  3382. * counter spec.
  3383. * The HTT target FW will suspend its host->target message processing
  3384. * as long as
  3385. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3386. */
  3387. #define HTT_H2T_SYNC_MSG_SZ 4
  3388. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3389. #define HTT_H2T_SYNC_COUNT_S 8
  3390. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3391. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3392. HTT_H2T_SYNC_COUNT_S)
  3393. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3396. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3397. } while (0)
  3398. /**
  3399. * @brief host -> target HTT aggregation configuration
  3400. *
  3401. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3402. */
  3403. #define HTT_AGGR_CFG_MSG_SZ 4
  3404. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3405. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3406. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3407. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3408. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3409. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3410. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3411. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3412. do { \
  3413. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3414. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3415. } while (0)
  3416. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3417. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3418. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3419. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3420. do { \
  3421. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3422. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3423. } while (0)
  3424. /**
  3425. * @brief host -> target HTT configure max amsdu info per vdev
  3426. *
  3427. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3428. *
  3429. * @details
  3430. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3431. *
  3432. * |31 21|20 16|15 8|7 0|
  3433. * |-----------------------------------------------------------|
  3434. * | reserved | vdev id | max amsdu | msg type |
  3435. * |-----------------------------------------------------------|
  3436. * Header fields:
  3437. * - MSG_TYPE
  3438. * Bits 7:0
  3439. * Purpose: identifies this as a aggr cfg ex message
  3440. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3441. * - MAX_NUM_AMSDU_SUBFRM
  3442. * Bits 15:8
  3443. * Purpose: max MSDUs per A-MSDU
  3444. * - VDEV_ID
  3445. * Bits 20:16
  3446. * Purpose: ID of the vdev to which this limit is applied
  3447. */
  3448. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3449. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3450. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3451. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3452. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3453. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3454. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3455. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3456. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3459. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3460. } while (0)
  3461. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3462. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3463. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3464. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3467. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3468. } while (0)
  3469. /**
  3470. * @brief HTT WDI_IPA Config Message
  3471. *
  3472. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3473. *
  3474. * @details
  3475. * The HTT WDI_IPA config message is created/sent by host at driver
  3476. * init time. It contains information about data structures used on
  3477. * WDI_IPA TX and RX path.
  3478. * TX CE ring is used for pushing packet metadata from IPA uC
  3479. * to WLAN FW
  3480. * TX Completion ring is used for generating TX completions from
  3481. * WLAN FW to IPA uC
  3482. * RX Indication ring is used for indicating RX packets from FW
  3483. * to IPA uC
  3484. * RX Ring2 is used as either completion ring or as second
  3485. * indication ring. when Ring2 is used as completion ring, IPA uC
  3486. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3487. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3488. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3489. * indicated in RX Indication ring. Please see WDI_IPA specification
  3490. * for more details.
  3491. * |31 24|23 16|15 8|7 0|
  3492. * |----------------+----------------+----------------+----------------|
  3493. * | tx pkt pool size | Rsvd | msg_type |
  3494. * |-------------------------------------------------------------------|
  3495. * | tx comp ring base (bits 31:0) |
  3496. #if HTT_PADDR64
  3497. * | tx comp ring base (bits 63:32) |
  3498. #endif
  3499. * |-------------------------------------------------------------------|
  3500. * | tx comp ring size |
  3501. * |-------------------------------------------------------------------|
  3502. * | tx comp WR_IDX physical address (bits 31:0) |
  3503. #if HTT_PADDR64
  3504. * | tx comp WR_IDX physical address (bits 63:32) |
  3505. #endif
  3506. * |-------------------------------------------------------------------|
  3507. * | tx CE WR_IDX physical address (bits 31:0) |
  3508. #if HTT_PADDR64
  3509. * | tx CE WR_IDX physical address (bits 63:32) |
  3510. #endif
  3511. * |-------------------------------------------------------------------|
  3512. * | rx indication ring base (bits 31:0) |
  3513. #if HTT_PADDR64
  3514. * | rx indication ring base (bits 63:32) |
  3515. #endif
  3516. * |-------------------------------------------------------------------|
  3517. * | rx indication ring size |
  3518. * |-------------------------------------------------------------------|
  3519. * | rx ind RD_IDX physical address (bits 31:0) |
  3520. #if HTT_PADDR64
  3521. * | rx ind RD_IDX physical address (bits 63:32) |
  3522. #endif
  3523. * |-------------------------------------------------------------------|
  3524. * | rx ind WR_IDX physical address (bits 31:0) |
  3525. #if HTT_PADDR64
  3526. * | rx ind WR_IDX physical address (bits 63:32) |
  3527. #endif
  3528. * |-------------------------------------------------------------------|
  3529. * |-------------------------------------------------------------------|
  3530. * | rx ring2 base (bits 31:0) |
  3531. #if HTT_PADDR64
  3532. * | rx ring2 base (bits 63:32) |
  3533. #endif
  3534. * |-------------------------------------------------------------------|
  3535. * | rx ring2 size |
  3536. * |-------------------------------------------------------------------|
  3537. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3538. #if HTT_PADDR64
  3539. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3540. #endif
  3541. * |-------------------------------------------------------------------|
  3542. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3543. #if HTT_PADDR64
  3544. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3545. #endif
  3546. * |-------------------------------------------------------------------|
  3547. *
  3548. * Header fields:
  3549. * Header fields:
  3550. * - MSG_TYPE
  3551. * Bits 7:0
  3552. * Purpose: Identifies this as WDI_IPA config message
  3553. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3554. * - TX_PKT_POOL_SIZE
  3555. * Bits 15:0
  3556. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3557. * WDI_IPA TX path
  3558. * For systems using 32-bit format for bus addresses:
  3559. * - TX_COMP_RING_BASE_ADDR
  3560. * Bits 31:0
  3561. * Purpose: TX Completion Ring base address in DDR
  3562. * - TX_COMP_RING_SIZE
  3563. * Bits 31:0
  3564. * Purpose: TX Completion Ring size (must be power of 2)
  3565. * - TX_COMP_WR_IDX_ADDR
  3566. * Bits 31:0
  3567. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3568. * updates the Write Index for WDI_IPA TX completion ring
  3569. * - TX_CE_WR_IDX_ADDR
  3570. * Bits 31:0
  3571. * Purpose: DDR address where IPA uC
  3572. * updates the WR Index for TX CE ring
  3573. * (needed for fusion platforms)
  3574. * - RX_IND_RING_BASE_ADDR
  3575. * Bits 31:0
  3576. * Purpose: RX Indication Ring base address in DDR
  3577. * - RX_IND_RING_SIZE
  3578. * Bits 31:0
  3579. * Purpose: RX Indication Ring size
  3580. * - RX_IND_RD_IDX_ADDR
  3581. * Bits 31:0
  3582. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3583. * RX indication ring
  3584. * - RX_IND_WR_IDX_ADDR
  3585. * Bits 31:0
  3586. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3587. * updates the Write Index for WDI_IPA RX indication ring
  3588. * - RX_RING2_BASE_ADDR
  3589. * Bits 31:0
  3590. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3591. * - RX_RING2_SIZE
  3592. * Bits 31:0
  3593. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3594. * - RX_RING2_RD_IDX_ADDR
  3595. * Bits 31:0
  3596. * Purpose: If Second RX ring is Indication ring, DDR address where
  3597. * IPA uC updates the Read Index for Ring2.
  3598. * If Second RX ring is completion ring, this is NOT used
  3599. * - RX_RING2_WR_IDX_ADDR
  3600. * Bits 31:0
  3601. * Purpose: If Second RX ring is Indication ring, DDR address where
  3602. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3603. * If second RX ring is completion ring, DDR address where
  3604. * IPA uC updates the Write Index for Ring 2.
  3605. * For systems using 64-bit format for bus addresses:
  3606. * - TX_COMP_RING_BASE_ADDR_LO
  3607. * Bits 31:0
  3608. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3609. * - TX_COMP_RING_BASE_ADDR_HI
  3610. * Bits 31:0
  3611. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3612. * - TX_COMP_RING_SIZE
  3613. * Bits 31:0
  3614. * Purpose: TX Completion Ring size (must be power of 2)
  3615. * - TX_COMP_WR_IDX_ADDR_LO
  3616. * Bits 31:0
  3617. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3618. * Lower 4 bytes of DDR address where WIFI FW
  3619. * updates the Write Index for WDI_IPA TX completion ring
  3620. * - TX_COMP_WR_IDX_ADDR_HI
  3621. * Bits 31:0
  3622. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3623. * Higher 4 bytes of DDR address where WIFI FW
  3624. * updates the Write Index for WDI_IPA TX completion ring
  3625. * - TX_CE_WR_IDX_ADDR_LO
  3626. * Bits 31:0
  3627. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3628. * updates the WR Index for TX CE ring
  3629. * (needed for fusion platforms)
  3630. * - TX_CE_WR_IDX_ADDR_HI
  3631. * Bits 31:0
  3632. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3633. * updates the WR Index for TX CE ring
  3634. * (needed for fusion platforms)
  3635. * - RX_IND_RING_BASE_ADDR_LO
  3636. * Bits 31:0
  3637. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3638. * - RX_IND_RING_BASE_ADDR_HI
  3639. * Bits 31:0
  3640. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3641. * - RX_IND_RING_SIZE
  3642. * Bits 31:0
  3643. * Purpose: RX Indication Ring size
  3644. * - RX_IND_RD_IDX_ADDR_LO
  3645. * Bits 31:0
  3646. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3647. * for WDI_IPA RX indication ring
  3648. * - RX_IND_RD_IDX_ADDR_HI
  3649. * Bits 31:0
  3650. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3651. * for WDI_IPA RX indication ring
  3652. * - RX_IND_WR_IDX_ADDR_LO
  3653. * Bits 31:0
  3654. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3655. * Lower 4 bytes of DDR address where WIFI FW
  3656. * updates the Write Index for WDI_IPA RX indication ring
  3657. * - RX_IND_WR_IDX_ADDR_HI
  3658. * Bits 31:0
  3659. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3660. * Higher 4 bytes of DDR address where WIFI FW
  3661. * updates the Write Index for WDI_IPA RX indication ring
  3662. * - RX_RING2_BASE_ADDR_LO
  3663. * Bits 31:0
  3664. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3665. * - RX_RING2_BASE_ADDR_HI
  3666. * Bits 31:0
  3667. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3668. * - RX_RING2_SIZE
  3669. * Bits 31:0
  3670. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3671. * - RX_RING2_RD_IDX_ADDR_LO
  3672. * Bits 31:0
  3673. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3674. * DDR address where IPA uC updates the Read Index for Ring2.
  3675. * If Second RX ring is completion ring, this is NOT used
  3676. * - RX_RING2_RD_IDX_ADDR_HI
  3677. * Bits 31:0
  3678. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3679. * DDR address where IPA uC updates the Read Index for Ring2.
  3680. * If Second RX ring is completion ring, this is NOT used
  3681. * - RX_RING2_WR_IDX_ADDR_LO
  3682. * Bits 31:0
  3683. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3684. * DDR address where WIFI FW updates the Write Index
  3685. * for WDI_IPA RX ring2
  3686. * If second RX ring is completion ring, lower 4 bytes of
  3687. * DDR address where IPA uC updates the Write Index for Ring 2.
  3688. * - RX_RING2_WR_IDX_ADDR_HI
  3689. * Bits 31:0
  3690. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3691. * DDR address where WIFI FW updates the Write Index
  3692. * for WDI_IPA RX ring2
  3693. * If second RX ring is completion ring, higher 4 bytes of
  3694. * DDR address where IPA uC updates the Write Index for Ring 2.
  3695. */
  3696. #if HTT_PADDR64
  3697. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3698. #else
  3699. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3700. #endif
  3701. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3702. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3707. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3709. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3711. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3713. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3715. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3717. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3719. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3721. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3741. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3742. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3763. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3765. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3769. } while (0)
  3770. /* for systems using 32-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3773. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3777. } while (0)
  3778. /* for systems using 64-bit format for bus addr */
  3779. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3780. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3781. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3784. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3785. } while (0)
  3786. /* for systems using 64-bit format for bus addr */
  3787. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3788. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3789. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3792. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3793. } while (0)
  3794. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3795. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3796. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3797. do { \
  3798. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3799. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3800. } while (0)
  3801. /* for systems using 32-bit format for bus addr */
  3802. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3803. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3804. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3805. do { \
  3806. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3807. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3808. } while (0)
  3809. /* for systems using 64-bit format for bus addr */
  3810. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3811. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3812. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3813. do { \
  3814. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3815. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3816. } while (0)
  3817. /* for systems using 64-bit format for bus addr */
  3818. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3819. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3820. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3821. do { \
  3822. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3823. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3824. } while (0)
  3825. /* for systems using 32-bit format for bus addr */
  3826. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3827. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3828. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3829. do { \
  3830. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3831. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3832. } while (0)
  3833. /* for systems using 64-bit format for bus addr */
  3834. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3835. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3836. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3837. do { \
  3838. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3839. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3840. } while (0)
  3841. /* for systems using 64-bit format for bus addr */
  3842. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3843. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3844. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3845. do { \
  3846. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3847. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3848. } while (0)
  3849. /* for systems using 32-bit format for bus addr */
  3850. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3851. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3852. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3853. do { \
  3854. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3855. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3856. } while (0)
  3857. /* for systems using 64-bit format for bus addr */
  3858. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3859. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3860. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3861. do { \
  3862. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3863. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3864. } while (0)
  3865. /* for systems using 64-bit format for bus addr */
  3866. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3867. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3868. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3869. do { \
  3870. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3871. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3872. } while (0)
  3873. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3874. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3875. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3876. do { \
  3877. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3878. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3879. } while (0)
  3880. /* for systems using 32-bit format for bus addr */
  3881. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3882. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3883. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3884. do { \
  3885. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3886. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3887. } while (0)
  3888. /* for systems using 64-bit format for bus addr */
  3889. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3890. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3891. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3892. do { \
  3893. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3894. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3895. } while (0)
  3896. /* for systems using 64-bit format for bus addr */
  3897. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3898. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3899. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3900. do { \
  3901. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3902. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3903. } while (0)
  3904. /* for systems using 32-bit format for bus addr */
  3905. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3906. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3907. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3908. do { \
  3909. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3910. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3911. } while (0)
  3912. /* for systems using 64-bit format for bus addr */
  3913. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3914. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3915. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3916. do { \
  3917. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3918. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3919. } while (0)
  3920. /* for systems using 64-bit format for bus addr */
  3921. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3922. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3923. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3924. do { \
  3925. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3926. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3927. } while (0)
  3928. /* for systems using 32-bit format for bus addr */
  3929. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3930. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3931. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3932. do { \
  3933. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3934. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3935. } while (0)
  3936. /* for systems using 64-bit format for bus addr */
  3937. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3938. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3939. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3940. do { \
  3941. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3942. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3943. } while (0)
  3944. /* for systems using 64-bit format for bus addr */
  3945. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3946. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3947. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3948. do { \
  3949. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3950. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3951. } while (0)
  3952. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3953. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3954. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3955. do { \
  3956. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3957. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3958. } while (0)
  3959. /* for systems using 32-bit format for bus addr */
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3961. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3963. do { \
  3964. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3965. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3966. } while (0)
  3967. /* for systems using 64-bit format for bus addr */
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3969. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3970. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3971. do { \
  3972. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3973. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3974. } while (0)
  3975. /* for systems using 64-bit format for bus addr */
  3976. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3977. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3978. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3979. do { \
  3980. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3981. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3982. } while (0)
  3983. /* for systems using 32-bit format for bus addr */
  3984. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3985. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3986. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3987. do { \
  3988. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3989. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3990. } while (0)
  3991. /* for systems using 64-bit format for bus addr */
  3992. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3993. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3994. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3995. do { \
  3996. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3997. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3998. } while (0)
  3999. /* for systems using 64-bit format for bus addr */
  4000. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4001. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4002. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4003. do { \
  4004. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4005. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4006. } while (0)
  4007. /*
  4008. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4009. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4010. * addresses are stored in a XXX-bit field.
  4011. * This macro is used to define both htt_wdi_ipa_config32_t and
  4012. * htt_wdi_ipa_config64_t structs.
  4013. */
  4014. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4015. _paddr__tx_comp_ring_base_addr_, \
  4016. _paddr__tx_comp_wr_idx_addr_, \
  4017. _paddr__tx_ce_wr_idx_addr_, \
  4018. _paddr__rx_ind_ring_base_addr_, \
  4019. _paddr__rx_ind_rd_idx_addr_, \
  4020. _paddr__rx_ind_wr_idx_addr_, \
  4021. _paddr__rx_ring2_base_addr_,\
  4022. _paddr__rx_ring2_rd_idx_addr_,\
  4023. _paddr__rx_ring2_wr_idx_addr_) \
  4024. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4025. { \
  4026. /* DWORD 0: flags and meta-data */ \
  4027. A_UINT32 \
  4028. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4029. reserved: 8, \
  4030. tx_pkt_pool_size: 16;\
  4031. /* DWORD 1 */\
  4032. _paddr__tx_comp_ring_base_addr_;\
  4033. /* DWORD 2 (or 3)*/\
  4034. A_UINT32 tx_comp_ring_size;\
  4035. /* DWORD 3 (or 4)*/\
  4036. _paddr__tx_comp_wr_idx_addr_;\
  4037. /* DWORD 4 (or 6)*/\
  4038. _paddr__tx_ce_wr_idx_addr_;\
  4039. /* DWORD 5 (or 8)*/\
  4040. _paddr__rx_ind_ring_base_addr_;\
  4041. /* DWORD 6 (or 10)*/\
  4042. A_UINT32 rx_ind_ring_size;\
  4043. /* DWORD 7 (or 11)*/\
  4044. _paddr__rx_ind_rd_idx_addr_;\
  4045. /* DWORD 8 (or 13)*/\
  4046. _paddr__rx_ind_wr_idx_addr_;\
  4047. /* DWORD 9 (or 15)*/\
  4048. _paddr__rx_ring2_base_addr_;\
  4049. /* DWORD 10 (or 17) */\
  4050. A_UINT32 rx_ring2_size;\
  4051. /* DWORD 11 (or 18) */\
  4052. _paddr__rx_ring2_rd_idx_addr_;\
  4053. /* DWORD 12 (or 20) */\
  4054. _paddr__rx_ring2_wr_idx_addr_;\
  4055. } POSTPACK
  4056. /* define a htt_wdi_ipa_config32_t type */
  4057. 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));
  4058. /* define a htt_wdi_ipa_config64_t type */
  4059. 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));
  4060. #if HTT_PADDR64
  4061. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4062. #else
  4063. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4064. #endif
  4065. enum htt_wdi_ipa_op_code {
  4066. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4067. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4068. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4069. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4070. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4071. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4072. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4073. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4074. /* keep this last */
  4075. HTT_WDI_IPA_OPCODE_MAX
  4076. };
  4077. /**
  4078. * @brief HTT WDI_IPA Operation Request Message
  4079. *
  4080. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4081. *
  4082. * @details
  4083. * HTT WDI_IPA Operation Request message is sent by host
  4084. * to either suspend or resume WDI_IPA TX or RX path.
  4085. * |31 24|23 16|15 8|7 0|
  4086. * |----------------+----------------+----------------+----------------|
  4087. * | op_code | Rsvd | msg_type |
  4088. * |-------------------------------------------------------------------|
  4089. *
  4090. * Header fields:
  4091. * - MSG_TYPE
  4092. * Bits 7:0
  4093. * Purpose: Identifies this as WDI_IPA Operation Request message
  4094. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4095. * - OP_CODE
  4096. * Bits 31:16
  4097. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4098. * value: = enum htt_wdi_ipa_op_code
  4099. */
  4100. PREPACK struct htt_wdi_ipa_op_request_t
  4101. {
  4102. /* DWORD 0: flags and meta-data */
  4103. A_UINT32
  4104. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4105. reserved: 8,
  4106. op_code: 16;
  4107. } POSTPACK;
  4108. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4109. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4110. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4111. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4112. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4113. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4116. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4117. } while (0)
  4118. /*
  4119. * @brief host -> target HTT_SRING_SETUP message
  4120. *
  4121. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4122. *
  4123. * @details
  4124. * After target is booted up, Host can send SRING setup message for
  4125. * each host facing LMAC SRING. Target setups up HW registers based
  4126. * on setup message and confirms back to Host if response_required is set.
  4127. * Host should wait for confirmation message before sending new SRING
  4128. * setup message
  4129. *
  4130. * The message would appear as follows:
  4131. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4132. * |--------------- +-----------------+-----------------+-----------------|
  4133. * | ring_type | ring_id | pdev_id | msg_type |
  4134. * |----------------------------------------------------------------------|
  4135. * | ring_base_addr_lo |
  4136. * |----------------------------------------------------------------------|
  4137. * | ring_base_addr_hi |
  4138. * |----------------------------------------------------------------------|
  4139. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4140. * |----------------------------------------------------------------------|
  4141. * | ring_head_offset32_remote_addr_lo |
  4142. * |----------------------------------------------------------------------|
  4143. * | ring_head_offset32_remote_addr_hi |
  4144. * |----------------------------------------------------------------------|
  4145. * | ring_tail_offset32_remote_addr_lo |
  4146. * |----------------------------------------------------------------------|
  4147. * | ring_tail_offset32_remote_addr_hi |
  4148. * |----------------------------------------------------------------------|
  4149. * | ring_msi_addr_lo |
  4150. * |----------------------------------------------------------------------|
  4151. * | ring_msi_addr_hi |
  4152. * |----------------------------------------------------------------------|
  4153. * | ring_msi_data |
  4154. * |----------------------------------------------------------------------|
  4155. * | intr_timer_th |IM| intr_batch_counter_th |
  4156. * |----------------------------------------------------------------------|
  4157. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4158. * |----------------------------------------------------------------------|
  4159. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4160. * |----------------------------------------------------------------------|
  4161. * Where
  4162. * IM = sw_intr_mode
  4163. * RR = response_required
  4164. * PTCF = prefetch_timer_cfg
  4165. * IP = IPA drop flag
  4166. *
  4167. * The message is interpreted as follows:
  4168. * dword0 - b'0:7 - msg_type: This will be set to
  4169. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4170. * b'8:15 - pdev_id:
  4171. * 0 (for rings at SOC/UMAC level),
  4172. * 1/2/3 mac id (for rings at LMAC level)
  4173. * b'16:23 - ring_id: identify which ring is to setup,
  4174. * more details can be got from enum htt_srng_ring_id
  4175. * b'24:31 - ring_type: identify type of host rings,
  4176. * more details can be got from enum htt_srng_ring_type
  4177. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4178. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4179. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4180. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4181. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4182. * SW_TO_HW_RING.
  4183. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4184. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4185. * Lower 32 bits of memory address of the remote variable
  4186. * storing the 4-byte word offset that identifies the head
  4187. * element within the ring.
  4188. * (The head offset variable has type A_UINT32.)
  4189. * Valid for HW_TO_SW and SW_TO_SW rings.
  4190. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4191. * Upper 32 bits of memory address of the remote variable
  4192. * storing the 4-byte word offset that identifies the head
  4193. * element within the ring.
  4194. * (The head offset variable has type A_UINT32.)
  4195. * Valid for HW_TO_SW and SW_TO_SW rings.
  4196. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4197. * Lower 32 bits of memory address of the remote variable
  4198. * storing the 4-byte word offset that identifies the tail
  4199. * element within the ring.
  4200. * (The tail offset variable has type A_UINT32.)
  4201. * Valid for HW_TO_SW and SW_TO_SW rings.
  4202. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4203. * Upper 32 bits of memory address of the remote variable
  4204. * storing the 4-byte word offset that identifies the tail
  4205. * element within the ring.
  4206. * (The tail offset variable has type A_UINT32.)
  4207. * Valid for HW_TO_SW and SW_TO_SW rings.
  4208. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4209. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4210. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4211. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4212. * dword10 - b'0:31 - ring_msi_data: MSI data
  4213. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4214. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4215. * dword11 - b'0:14 - intr_batch_counter_th:
  4216. * batch counter threshold is in units of 4-byte words.
  4217. * HW internally maintains and increments batch count.
  4218. * (see SRING spec for detail description).
  4219. * When batch count reaches threshold value, an interrupt
  4220. * is generated by HW.
  4221. * b'15 - sw_intr_mode:
  4222. * This configuration shall be static.
  4223. * Only programmed at power up.
  4224. * 0: generate pulse style sw interrupts
  4225. * 1: generate level style sw interrupts
  4226. * b'16:31 - intr_timer_th:
  4227. * The timer init value when timer is idle or is
  4228. * initialized to start downcounting.
  4229. * In 8us units (to cover a range of 0 to 524 ms)
  4230. * dword12 - b'0:15 - intr_low_threshold:
  4231. * Used only by Consumer ring to generate ring_sw_int_p.
  4232. * Ring entries low threshold water mark, that is used
  4233. * in combination with the interrupt timer as well as
  4234. * the the clearing of the level interrupt.
  4235. * b'16:18 - prefetch_timer_cfg:
  4236. * Used only by Consumer ring to set timer mode to
  4237. * support Application prefetch handling.
  4238. * The external tail offset/pointer will be updated
  4239. * at following intervals:
  4240. * 3'b000: (Prefetch feature disabled; used only for debug)
  4241. * 3'b001: 1 usec
  4242. * 3'b010: 4 usec
  4243. * 3'b011: 8 usec (default)
  4244. * 3'b100: 16 usec
  4245. * Others: Reserverd
  4246. * b'19 - response_required:
  4247. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4248. * b'20 - ipa_drop_flag:
  4249. Indicates that host will config ipa drop threshold percentage
  4250. * b'21:31 - reserved: reserved for future use
  4251. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4252. * b'8:15 - ipa drop high threshold percentage:
  4253. * b'16:31 - Reserved
  4254. */
  4255. PREPACK struct htt_sring_setup_t {
  4256. A_UINT32 msg_type: 8,
  4257. pdev_id: 8,
  4258. ring_id: 8,
  4259. ring_type: 8;
  4260. A_UINT32 ring_base_addr_lo;
  4261. A_UINT32 ring_base_addr_hi;
  4262. A_UINT32 ring_size: 16,
  4263. ring_entry_size: 8,
  4264. ring_misc_cfg_flag: 8;
  4265. A_UINT32 ring_head_offset32_remote_addr_lo;
  4266. A_UINT32 ring_head_offset32_remote_addr_hi;
  4267. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4268. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4269. A_UINT32 ring_msi_addr_lo;
  4270. A_UINT32 ring_msi_addr_hi;
  4271. A_UINT32 ring_msi_data;
  4272. A_UINT32 intr_batch_counter_th: 15,
  4273. sw_intr_mode: 1,
  4274. intr_timer_th: 16;
  4275. A_UINT32 intr_low_threshold: 16,
  4276. prefetch_timer_cfg: 3,
  4277. response_required: 1,
  4278. ipa_drop_flag: 1,
  4279. reserved1: 11;
  4280. A_UINT32 ipa_drop_low_threshold: 8,
  4281. ipa_drop_high_threshold: 8,
  4282. reserved: 16;
  4283. } POSTPACK;
  4284. enum htt_srng_ring_type {
  4285. HTT_HW_TO_SW_RING = 0,
  4286. HTT_SW_TO_HW_RING,
  4287. HTT_SW_TO_SW_RING,
  4288. /* Insert new ring types above this line */
  4289. };
  4290. enum htt_srng_ring_id {
  4291. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4292. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4293. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4294. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4295. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4296. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4297. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4298. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4299. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4300. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4301. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4302. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4303. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4304. /* Add Other SRING which can't be directly configured by host software above this line */
  4305. };
  4306. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4307. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4308. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4309. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4310. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4311. HTT_SRING_SETUP_PDEV_ID_S)
  4312. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4315. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4316. } while (0)
  4317. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4318. #define HTT_SRING_SETUP_RING_ID_S 16
  4319. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4320. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4321. HTT_SRING_SETUP_RING_ID_S)
  4322. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4325. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4326. } while (0)
  4327. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4328. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4329. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4330. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4331. HTT_SRING_SETUP_RING_TYPE_S)
  4332. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4335. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4336. } while (0)
  4337. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4338. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4339. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4340. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4341. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4342. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4343. do { \
  4344. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4345. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4346. } while (0)
  4347. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4348. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4349. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4350. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4351. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4352. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4355. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4356. } while (0)
  4357. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4358. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4359. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4360. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4361. HTT_SRING_SETUP_RING_SIZE_S)
  4362. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4363. do { \
  4364. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4365. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4366. } while (0)
  4367. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4368. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4369. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4370. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4371. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4372. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4375. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4376. } while (0)
  4377. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4378. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4379. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4380. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4381. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4382. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4383. do { \
  4384. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4385. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4386. } while (0)
  4387. /* This control bit is applicable to only Producer, which updates Ring ID field
  4388. * of each descriptor before pushing into the ring.
  4389. * 0: updates ring_id(default)
  4390. * 1: ring_id updating disabled */
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4393. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4394. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4395. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4399. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4400. } while (0)
  4401. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4402. * of each descriptor before pushing into the ring.
  4403. * 0: updates Loopcnt(default)
  4404. * 1: Loopcnt updating disabled */
  4405. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4406. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4407. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4408. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4409. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4410. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4411. do { \
  4412. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4413. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4414. } while (0)
  4415. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4416. * into security_id port of GXI/AXI. */
  4417. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4418. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4419. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4420. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4421. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4422. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4423. do { \
  4424. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4425. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4426. } while (0)
  4427. /* During MSI write operation, SRNG drives value of this register bit into
  4428. * swap bit of GXI/AXI. */
  4429. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4430. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4431. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4432. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4433. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4434. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4435. do { \
  4436. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4437. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4438. } while (0)
  4439. /* During Pointer write operation, SRNG drives value of this register bit into
  4440. * swap bit of GXI/AXI. */
  4441. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4442. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4443. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4444. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4445. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4446. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4447. do { \
  4448. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4449. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4450. } while (0)
  4451. /* During any data or TLV write operation, SRNG drives value of this register
  4452. * bit into swap bit of GXI/AXI. */
  4453. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4454. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4455. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4456. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4457. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4458. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4459. do { \
  4460. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4461. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4462. } while (0)
  4463. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4464. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4465. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4466. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4467. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4468. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4469. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4470. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4471. do { \
  4472. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4473. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4474. } while (0)
  4475. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4476. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4477. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4478. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4479. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4480. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4481. do { \
  4482. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4483. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4484. } while (0)
  4485. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4486. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4487. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4488. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4489. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4490. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4491. do { \
  4492. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4493. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4494. } while (0)
  4495. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4496. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4497. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4498. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4499. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4500. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4501. do { \
  4502. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4503. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4504. } while (0)
  4505. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4506. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4507. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4508. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4509. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4510. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4511. do { \
  4512. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4513. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4514. } while (0)
  4515. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4516. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4517. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4518. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4519. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4520. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4521. do { \
  4522. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4523. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4524. } while (0)
  4525. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4526. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4527. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4528. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4529. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4530. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4531. do { \
  4532. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4533. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4534. } while (0)
  4535. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4536. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4537. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4538. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4539. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4540. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4541. do { \
  4542. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4543. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4544. } while (0)
  4545. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4546. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4547. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4548. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4549. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4550. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4551. do { \
  4552. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4553. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4554. } while (0)
  4555. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4556. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4557. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4558. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4559. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4560. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4561. do { \
  4562. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4563. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4564. } while (0)
  4565. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4566. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4567. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4568. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4569. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4570. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4571. do { \
  4572. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4573. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4574. } while (0)
  4575. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4576. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4577. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4578. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4579. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4580. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4581. do { \
  4582. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4583. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4584. } while (0)
  4585. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4586. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4587. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4588. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4589. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4590. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4591. do { \
  4592. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4593. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4594. } while (0)
  4595. /**
  4596. * @brief host -> target RX ring selection config message
  4597. *
  4598. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4599. *
  4600. * @details
  4601. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4602. * configure RXDMA rings.
  4603. * The configuration is per ring based and includes both packet subtypes
  4604. * and PPDU/MPDU TLVs.
  4605. *
  4606. * The message would appear as follows:
  4607. *
  4608. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4609. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4610. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4611. * |-------------------------------------------------------------------|
  4612. * | rsvd2 | ring_buffer_size |
  4613. * |-------------------------------------------------------------------|
  4614. * | packet_type_enable_flags_0 |
  4615. * |-------------------------------------------------------------------|
  4616. * | packet_type_enable_flags_1 |
  4617. * |-------------------------------------------------------------------|
  4618. * | packet_type_enable_flags_2 |
  4619. * |-------------------------------------------------------------------|
  4620. * | packet_type_enable_flags_3 |
  4621. * |-------------------------------------------------------------------|
  4622. * | tlv_filter_in_flags |
  4623. * |-------------------------------------------------------------------|
  4624. * | rx_header_offset | rx_packet_offset |
  4625. * |-------------------------------------------------------------------|
  4626. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4627. * |-------------------------------------------------------------------|
  4628. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4629. * |-------------------------------------------------------------------|
  4630. * | rsvd3 | rx_attention_offset |
  4631. * |-------------------------------------------------------------------|
  4632. * | rsvd4 | mo| fp| rx_drop_threshold |
  4633. * | |ndp|ndp| |
  4634. * |-------------------------------------------------------------------|
  4635. * Where:
  4636. * PS = pkt_swap
  4637. * SS = status_swap
  4638. * OV = rx_offsets_valid
  4639. * DT = drop_thresh_valid
  4640. * The message is interpreted as follows:
  4641. * dword0 - b'0:7 - msg_type: This will be set to
  4642. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4643. * b'8:15 - pdev_id:
  4644. * 0 (for rings at SOC/UMAC level),
  4645. * 1/2/3 mac id (for rings at LMAC level)
  4646. * b'16:23 - ring_id : Identify the ring to configure.
  4647. * More details can be got from enum htt_srng_ring_id
  4648. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4649. * BUF_RING_CFG_0 defs within HW .h files,
  4650. * e.g. wmac_top_reg_seq_hwioreg.h
  4651. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4652. * BUF_RING_CFG_0 defs within HW .h files,
  4653. * e.g. wmac_top_reg_seq_hwioreg.h
  4654. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4655. * configuration fields are valid
  4656. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4657. * rx_drop_threshold field is valid
  4658. * b'28:31 - rsvd1: reserved for future use
  4659. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4660. * in byte units.
  4661. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4662. * - b'16:31 - rsvd2: Reserved for future use
  4663. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4664. * Enable MGMT packet from 0b0000 to 0b1001
  4665. * bits from low to high: FP, MD, MO - 3 bits
  4666. * FP: Filter_Pass
  4667. * MD: Monitor_Direct
  4668. * MO: Monitor_Other
  4669. * 10 mgmt subtypes * 3 bits -> 30 bits
  4670. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4671. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4672. * Enable MGMT packet from 0b1010 to 0b1111
  4673. * bits from low to high: FP, MD, MO - 3 bits
  4674. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4675. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4676. * Enable CTRL packet from 0b0000 to 0b1001
  4677. * bits from low to high: FP, MD, MO - 3 bits
  4678. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4679. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4680. * Enable CTRL packet from 0b1010 to 0b1111,
  4681. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4682. * bits from low to high: FP, MD, MO - 3 bits
  4683. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4684. * dword6 - b'0:31 - tlv_filter_in_flags:
  4685. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4686. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4687. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4688. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4689. * A value of 0 will be considered as ignore this config.
  4690. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4691. * e.g. wmac_top_reg_seq_hwioreg.h
  4692. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4693. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4694. * A value of 0 will be considered as ignore this config.
  4695. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4696. * e.g. wmac_top_reg_seq_hwioreg.h
  4697. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4698. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4699. * A value of 0 will be considered as ignore this config.
  4700. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4701. * e.g. wmac_top_reg_seq_hwioreg.h
  4702. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4703. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4704. * A value of 0 will be considered as ignore this config.
  4705. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4706. * e.g. wmac_top_reg_seq_hwioreg.h
  4707. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4708. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4709. * A value of 0 will be considered as ignore this config.
  4710. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4711. * e.g. wmac_top_reg_seq_hwioreg.h
  4712. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4713. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4714. * A value of 0 will be considered as ignore this config.
  4715. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4716. * e.g. wmac_top_reg_seq_hwioreg.h
  4717. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4718. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4719. * A value of 0 will be considered as ignore this config.
  4720. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4721. * e.g. wmac_top_reg_seq_hwioreg.h
  4722. * - b'16:31 - rsvd3 for future use
  4723. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4724. * to source rings. Consumer drops packets if the available
  4725. * words in the ring falls below the configured threshold
  4726. * value.
  4727. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4728. * by host. 1 -> subscribed
  4729. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4730. * by host. 1 -> subscribed
  4731. */
  4732. PREPACK struct htt_rx_ring_selection_cfg_t {
  4733. A_UINT32 msg_type: 8,
  4734. pdev_id: 8,
  4735. ring_id: 8,
  4736. status_swap: 1,
  4737. pkt_swap: 1,
  4738. rx_offsets_valid: 1,
  4739. drop_thresh_valid: 1,
  4740. rsvd1: 4;
  4741. A_UINT32 ring_buffer_size: 16,
  4742. rsvd2: 16;
  4743. A_UINT32 packet_type_enable_flags_0;
  4744. A_UINT32 packet_type_enable_flags_1;
  4745. A_UINT32 packet_type_enable_flags_2;
  4746. A_UINT32 packet_type_enable_flags_3;
  4747. A_UINT32 tlv_filter_in_flags;
  4748. A_UINT32 rx_packet_offset: 16,
  4749. rx_header_offset: 16;
  4750. A_UINT32 rx_mpdu_end_offset: 16,
  4751. rx_mpdu_start_offset: 16;
  4752. A_UINT32 rx_msdu_end_offset: 16,
  4753. rx_msdu_start_offset: 16;
  4754. A_UINT32 rx_attn_offset: 16,
  4755. rsvd3: 16;
  4756. A_UINT32 rx_drop_threshold: 10,
  4757. fp_ndp: 1,
  4758. mo_ndp: 1,
  4759. rsvd4: 20;
  4760. } POSTPACK;
  4761. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4762. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4763. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4764. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4765. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4766. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4767. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4770. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4771. } while (0)
  4772. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4773. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4774. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4775. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4776. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4777. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4780. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4781. } while (0)
  4782. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4783. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4784. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4785. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4786. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4787. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4788. do { \
  4789. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4790. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4791. } while (0)
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4795. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4796. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4798. do { \
  4799. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4800. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4801. } while (0)
  4802. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4803. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4804. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4805. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4806. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4807. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4808. do { \
  4809. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4810. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4811. } while (0)
  4812. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4813. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4814. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4815. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4816. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4817. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4818. do { \
  4819. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4820. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4821. } while (0)
  4822. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4823. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4824. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4825. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4826. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4827. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4828. do { \
  4829. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4830. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4831. } while (0)
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4835. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4836. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4838. do { \
  4839. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4840. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4841. } while (0)
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4845. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4846. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4850. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4851. } while (0)
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4855. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4856. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4858. do { \
  4859. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4860. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4861. } while (0)
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4865. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4866. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4868. do { \
  4869. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4870. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4871. } while (0)
  4872. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4873. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4874. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4875. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4876. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4877. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4878. do { \
  4879. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4880. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4881. } while (0)
  4882. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4883. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4884. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4885. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4886. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4888. do { \
  4889. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4890. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4891. } while (0)
  4892. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4893. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4894. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4895. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4896. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4898. do { \
  4899. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4900. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4901. } while (0)
  4902. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4903. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4904. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4905. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4906. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4908. do { \
  4909. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4910. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4911. } while (0)
  4912. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4913. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4914. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4915. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4916. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4918. do { \
  4919. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4920. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4921. } while (0)
  4922. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4923. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4924. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4925. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4926. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4928. do { \
  4929. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4930. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4931. } while (0)
  4932. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4933. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4934. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4935. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4936. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4937. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4938. do { \
  4939. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4940. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4941. } while (0)
  4942. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4943. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4944. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4945. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4946. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4947. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4948. do { \
  4949. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4950. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4951. } while (0)
  4952. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4953. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4954. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4955. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4956. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4957. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4958. do { \
  4959. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4960. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4961. } while (0)
  4962. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4963. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4964. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4965. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4966. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4967. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4968. do { \
  4969. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4970. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4971. } while (0)
  4972. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4973. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4974. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4975. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4976. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4977. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4978. do { \
  4979. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4980. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4981. } while (0)
  4982. /*
  4983. * Subtype based MGMT frames enable bits.
  4984. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4985. */
  4986. /* association request */
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4993. /* association response */
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5000. /* Reassociation request */
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5007. /* Reassociation response */
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5014. /* Probe request */
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5021. /* Probe response */
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5028. /* Timing Advertisement */
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5035. /* Reserved */
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5042. /* Beacon */
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5049. /* ATIM */
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5056. /* Disassociation */
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5063. /* Authentication */
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5070. /* Deauthentication */
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5077. /* Action */
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5084. /* Action No Ack */
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5091. /* Reserved */
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5098. /*
  5099. * Subtype based CTRL frames enable bits.
  5100. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5101. */
  5102. /* Reserved */
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5109. /* Reserved */
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5116. /* Reserved */
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5123. /* Reserved */
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5130. /* Reserved */
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5137. /* Reserved */
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5144. /* Reserved */
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5151. /* Control Wrapper */
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5158. /* Block Ack Request */
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5165. /* Block Ack*/
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5172. /* PS-POLL */
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5179. /* RTS */
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5186. /* CTS */
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5193. /* ACK */
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5200. /* CF-END */
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5207. /* CF-END + CF-ACK */
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5214. /* Multicast data */
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5221. /* Unicast data */
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5228. /* NULL data */
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5233. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5236. do { \
  5237. HTT_CHECK_SET_VAL(httsym, value); \
  5238. (word) |= (value) << httsym##_S; \
  5239. } while (0)
  5240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5241. (((word) & httsym##_M) >> httsym##_S)
  5242. #define htt_rx_ring_pkt_enable_subtype_set( \
  5243. word, flag, mode, type, subtype, val) \
  5244. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5245. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5246. #define htt_rx_ring_pkt_enable_subtype_get( \
  5247. word, flag, mode, type, subtype) \
  5248. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5249. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5250. /* Definition to filter in TLVs */
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5267. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5268. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5269. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5270. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5271. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5272. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5273. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5274. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5275. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5276. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5277. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5278. do { \
  5279. HTT_CHECK_SET_VAL(httsym, enable); \
  5280. (word) |= (enable) << httsym##_S; \
  5281. } while (0)
  5282. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5283. (((word) & httsym##_M) >> httsym##_S)
  5284. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5285. HTT_RX_RING_TLV_ENABLE_SET( \
  5286. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5287. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5288. HTT_RX_RING_TLV_ENABLE_GET( \
  5289. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5290. /**
  5291. * @brief host -> target TX monitor config message
  5292. *
  5293. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5294. *
  5295. * @details
  5296. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5297. * configure RXDMA rings.
  5298. * The configuration is per ring based and includes both packet types
  5299. * and PPDU/MPDU TLVs.
  5300. *
  5301. * The message would appear as follows:
  5302. *
  5303. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  5304. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5305. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5306. * |-----------+--------+--------+-----+------------------------------------|
  5307. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5308. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5309. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5310. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5311. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5312. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5313. * |------------------------------------------------------------------------|
  5314. * | tlv_filter_mask_in0 |
  5315. * |------------------------------------------------------------------------|
  5316. * | tlv_filter_mask_in1 |
  5317. * |------------------------------------------------------------------------|
  5318. * | tlv_filter_mask_in2 |
  5319. * |------------------------------------------------------------------------|
  5320. * | tlv_filter_mask_in3 |
  5321. * |-----------------+-----------------+---------------------+--------------|
  5322. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5323. * |------------------------------------------------------------------------|
  5324. * | pcu_ppdu_setup_word_mask |
  5325. * |--------------------+--+--+--+-----+---------------------+--------------|
  5326. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5327. * |------------------------------------------------------------------------|
  5328. *
  5329. * Where:
  5330. * PS = pkt_swap
  5331. * SS = status_swap
  5332. * The message is interpreted as follows:
  5333. * dword0 - b'0:7 - msg_type: This will be set to
  5334. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5335. * b'8:15 - pdev_id:
  5336. * 0 (for rings at SOC level),
  5337. * 1/2/3 mac id (for rings at LMAC level)
  5338. * b'16:23 - ring_id : Identify the ring to configure.
  5339. * More details can be got from enum htt_srng_ring_id
  5340. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5341. * BUF_RING_CFG_0 defs within HW .h files,
  5342. * e.g. wmac_top_reg_seq_hwioreg.h
  5343. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5344. * BUF_RING_CFG_0 defs within HW .h files,
  5345. * e.g. wmac_top_reg_seq_hwioreg.h
  5346. * b'26:31 - rsvd1: reserved for future use
  5347. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5348. * in byte units.
  5349. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5350. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5351. * 64, 128, 256.
  5352. * If all 3 bits are set config length is > 256.
  5353. * if val is '0', then ignore this field.
  5354. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5355. * 64, 128, 256.
  5356. * If all 3 bits are set config length is > 256.
  5357. * if val is '0', then ignore this field.
  5358. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5359. * 64, 128, 256.
  5360. * If all 3 bits are set config length is > 256.
  5361. * If val is '0', then ignore this field.
  5362. * - b'25:31 - rsvd2: Reserved for future use
  5363. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5364. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5365. * If packet_type_enable_flags is '1' for MGMT type,
  5366. * monitor will ignore this bit and allow this TLV.
  5367. * If packet_type_enable_flags is '0' for MGMT type,
  5368. * monitor will use this bit to enable/disable logging
  5369. * of this TLV.
  5370. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5371. * If packet_type_enable_flags is '1' for CTRL type,
  5372. * monitor will ignore this bit and allow this TLV.
  5373. * If packet_type_enable_flags is '0' for CTRL type,
  5374. * monitor will use this bit to enable/disable logging
  5375. * of this TLV.
  5376. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5377. * If packet_type_enable_flags is '1' for DATA type,
  5378. * monitor will ignore this bit and allow this TLV.
  5379. * If packet_type_enable_flags is '0' for DATA type,
  5380. * monitor will use this bit to enable/disable logging
  5381. * of this TLV.
  5382. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5383. * If packet_type_enable_flags is '1' for MGMT type,
  5384. * monitor will ignore this bit and allow this TLV.
  5385. * If packet_type_enable_flags is '0' for MGMT type,
  5386. * monitor will use this bit to enable/disable logging
  5387. * of this TLV.
  5388. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5389. * If packet_type_enable_flags is '1' for CTRL type,
  5390. * monitor will ignore this bit and allow this TLV.
  5391. * If packet_type_enable_flags is '0' for CTRL type,
  5392. * monitor will use this bit to enable/disable logging
  5393. * of this TLV.
  5394. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5395. * If packet_type_enable_flags is '1' for DATA type,
  5396. * monitor will ignore this bit and allow this TLV.
  5397. * If packet_type_enable_flags is '0' for DATA type,
  5398. * monitor will use this bit to enable/disable logging
  5399. * of this TLV.
  5400. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5401. * If packet_type_enable_flags is '1' for MGMT type,
  5402. * monitor will ignore this bit and allow this TLV.
  5403. * If packet_type_enable_flags is '0' for MGMT type,
  5404. * monitor will use this bit to enable/disable logging
  5405. * of this TLV.
  5406. * If filter_in_TX_MPDU_START = 1 it is recommended
  5407. * to set this bit.
  5408. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5409. * If packet_type_enable_flags is '1' for CTRL type,
  5410. * monitor will ignore this bit and allow this TLV.
  5411. * If packet_type_enable_flags is '0' for CTRL type,
  5412. * monitor will use this bit to enable/disable logging
  5413. * of this TLV.
  5414. * If filter_in_TX_MPDU_START = 1 it is recommended
  5415. * to set this bit.
  5416. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5417. * If packet_type_enable_flags is '1' for DATA type,
  5418. * monitor will ignore this bit and allow this TLV.
  5419. * If packet_type_enable_flags is '0' for DATA type,
  5420. * monitor will use this bit to enable/disable logging
  5421. * of this TLV.
  5422. * If filter_in_TX_MPDU_START = 1 it is recommended
  5423. * to set this bit.
  5424. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5425. * If packet_type_enable_flags is '1' for MGMT type,
  5426. * monitor will ignore this bit and allow this TLV.
  5427. * If packet_type_enable_flags is '0' for MGMT type,
  5428. * monitor will use this bit to enable/disable logging
  5429. * of this TLV.
  5430. * If filter_in_TX_MSDU_START = 1 it is recommended
  5431. * to set this bit.
  5432. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5433. * If packet_type_enable_flags is '1' for CTRL type,
  5434. * monitor will ignore this bit and allow this TLV.
  5435. * If packet_type_enable_flags is '0' for CTRL type,
  5436. * monitor will use this bit to enable/disable logging
  5437. * of this TLV.
  5438. * If filter_in_TX_MSDU_START = 1 it is recommended
  5439. * to set this bit.
  5440. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5441. * If packet_type_enable_flags is '1' for DATA type,
  5442. * monitor will ignore this bit and allow this TLV.
  5443. * If packet_type_enable_flags is '0' for DATA type,
  5444. * monitor will use this bit to enable/disable logging
  5445. * of this TLV.
  5446. * If filter_in_TX_MSDU_START = 1 it is recommended
  5447. * to set this bit.
  5448. * b'15:31 - rsvd3: Reserved for future use
  5449. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5450. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5451. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5452. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5453. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5454. * - b'8:15 - tx_peer_entry_word_mask:
  5455. * - b'16:23 - tx_queue_ext_word_mask:
  5456. * - b'24:31 - tx_msdu_start_word_mask:
  5457. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5458. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5459. * - b'8:15 - rxpcu_user_setup_word_mask:
  5460. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5461. * MGMT, CTRL, DATA
  5462. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5463. * 0 -> MSDU level logging is enabled
  5464. * (valid only if bit is set in
  5465. * pkt_type_enable_msdu_or_mpdu_logging)
  5466. * 1 -> MPDU level logging is enabled
  5467. * (valid only if bit is set in
  5468. * pkt_type_enable_msdu_or_mpdu_logging)
  5469. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5470. * 0 -> MSDU level logging is enabled
  5471. * (valid only if bit is set in
  5472. * pkt_type_enable_msdu_or_mpdu_logging)
  5473. * 1 -> MPDU level logging is enabled
  5474. * (valid only if bit is set in
  5475. * pkt_type_enable_msdu_or_mpdu_logging)
  5476. * - b'21 - dma_mpdu_data(D) : For DATA
  5477. * 0 -> MSDU level logging is enabled
  5478. * (valid only if bit is set in
  5479. * pkt_type_enable_msdu_or_mpdu_logging)
  5480. * 1 -> MPDU level logging is enabled
  5481. * (valid only if bit is set in
  5482. * pkt_type_enable_msdu_or_mpdu_logging)
  5483. * - b'22:31 - rsvd4 for future use
  5484. */
  5485. PREPACK struct htt_tx_monitor_cfg_t {
  5486. A_UINT32 msg_type: 8,
  5487. pdev_id: 8,
  5488. ring_id: 8,
  5489. status_swap: 1,
  5490. pkt_swap: 1,
  5491. rsvd1: 6;
  5492. A_UINT32 ring_buffer_size: 16,
  5493. config_length_mgmt: 3,
  5494. config_length_ctrl: 3,
  5495. config_length_data: 3,
  5496. rsvd2: 7;
  5497. A_UINT32 pkt_type_enable_flags: 3,
  5498. filter_in_tx_mpdu_start_mgmt: 1,
  5499. filter_in_tx_mpdu_start_ctrl: 1,
  5500. filter_in_tx_mpdu_start_data: 1,
  5501. filter_in_tx_msdu_start_mgmt: 1,
  5502. filter_in_tx_msdu_start_ctrl: 1,
  5503. filter_in_tx_msdu_start_data: 1,
  5504. filter_in_tx_mpdu_end_mgmt: 1,
  5505. filter_in_tx_mpdu_end_ctrl: 1,
  5506. filter_in_tx_mpdu_end_data: 1,
  5507. filter_in_tx_msdu_end_mgmt: 1,
  5508. filter_in_tx_msdu_end_ctrl: 1,
  5509. filter_in_tx_msdu_end_data: 1,
  5510. rsvd3: 17;
  5511. A_UINT32 tlv_filter_mask_in0;
  5512. A_UINT32 tlv_filter_mask_in1;
  5513. A_UINT32 tlv_filter_mask_in2;
  5514. A_UINT32 tlv_filter_mask_in3;
  5515. A_UINT32 tx_fes_setup_word_mask: 8,
  5516. tx_peer_entry_word_mask: 8,
  5517. tx_queue_ext_word_mask: 8,
  5518. tx_msdu_start_word_mask: 8;
  5519. A_UINT32 pcu_ppdu_setup_word_mask;
  5520. A_UINT32 tx_mpdu_start_word_mask: 8,
  5521. rxpcu_user_setup_word_mask: 8,
  5522. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5523. dma_mpdu_mgmt: 1,
  5524. dma_mpdu_ctrl: 1,
  5525. dma_mpdu_data: 1,
  5526. rsvd4: 10;
  5527. } POSTPACK;
  5528. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5529. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5530. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5531. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5532. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5533. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5534. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5537. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5538. } while (0)
  5539. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5540. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5541. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5542. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5543. HTT_TX_MONITOR_CFG_RING_ID_S)
  5544. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5547. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5548. } while (0)
  5549. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5550. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5551. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5552. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5553. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5554. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5557. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5558. } while (0)
  5559. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5560. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5561. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5562. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5563. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5564. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5567. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5568. } while (0)
  5569. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5570. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5571. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5572. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5573. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5574. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5577. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5578. } while (0)
  5579. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5580. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5581. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5582. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5583. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5584. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5587. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5588. } while (0)
  5589. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5590. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5591. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5592. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5593. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5594. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5597. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5598. } while (0)
  5599. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5600. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5601. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5602. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5603. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5604. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5605. do { \
  5606. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5607. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5608. } while (0)
  5609. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5611. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5612. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5613. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5614. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5615. do { \
  5616. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5617. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5618. } while (0)
  5619. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  5620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  5621. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  5622. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  5623. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  5624. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  5627. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  5628. } while (0)
  5629. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  5630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  5631. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  5632. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  5633. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  5634. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  5637. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  5638. } while (0
  5639. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  5640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  5641. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  5642. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  5643. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  5644. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  5645. do { \
  5646. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  5647. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  5648. } while (0)
  5649. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  5650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  5651. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  5652. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  5653. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  5654. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  5655. do { \
  5656. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  5657. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  5658. } while (0)
  5659. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  5660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  5661. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  5662. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  5663. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  5664. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  5665. do { \
  5666. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  5667. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  5668. } while (0
  5669. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  5670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  5671. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  5672. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  5673. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  5674. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  5675. do { \
  5676. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  5677. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  5678. } while (0)
  5679. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  5680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  5681. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  5682. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  5683. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  5684. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  5687. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  5688. } while (0)
  5689. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  5690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  5691. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  5692. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  5693. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  5694. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  5695. do { \
  5696. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  5697. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  5698. } while (0
  5699. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  5700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  5701. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  5702. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  5703. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  5704. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  5707. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  5708. } while (0)
  5709. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  5710. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  5711. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  5712. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  5713. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  5714. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  5717. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  5718. } while (0)
  5719. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  5720. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  5721. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  5722. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  5723. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  5724. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  5725. do { \
  5726. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  5727. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  5728. } while (0
  5729. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  5730. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  5731. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  5732. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  5733. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  5734. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  5735. do { \
  5736. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  5737. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  5738. } while (0)
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5742. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5743. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5747. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5748. } while (0)
  5749. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  5750. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5751. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5752. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5753. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5754. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5755. do { \
  5756. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5757. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5758. } while (0)
  5759. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  5760. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  5761. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5762. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5763. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5764. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5765. do { \
  5766. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5767. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5768. } while (0)
  5769. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  5770. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  5771. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5772. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5773. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5774. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5775. do { \
  5776. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5777. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5778. } while (0)
  5779. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  5780. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  5781. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5782. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5783. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5784. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5785. do { \
  5786. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5787. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5788. } while (0)
  5789. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  5790. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  5791. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5792. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5793. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5794. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5797. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5798. } while (0)
  5799. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  5800. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5801. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5802. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5803. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5804. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5807. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5808. } while (0)
  5809. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  5810. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  5811. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5812. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5813. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5814. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5815. do { \
  5816. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5817. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5818. } while (0)
  5819. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5820. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5821. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5822. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5823. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5824. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5825. do { \
  5826. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5827. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5828. } while (0)
  5829. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  5830. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  5831. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  5832. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  5833. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  5834. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5835. do { \
  5836. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  5837. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  5838. } while (0)
  5839. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  5840. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  5841. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  5842. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  5843. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  5844. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5845. do { \
  5846. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  5847. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  5848. } while (0)
  5849. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  5850. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  5851. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  5852. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  5853. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  5854. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5855. do { \
  5856. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  5857. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  5858. } while (0)
  5859. /*
  5860. * pkt_type_enable_flags
  5861. */
  5862. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  5863. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  5864. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  5865. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  5866. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  5867. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  5868. /*
  5869. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  5870. */
  5871. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5872. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5873. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5874. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5875. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5876. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5877. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5878. do { \
  5879. HTT_CHECK_SET_VAL(httsym, value); \
  5880. (word) |= (value) << httsym##_S; \
  5881. } while (0)
  5882. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5883. (((word) & httsym##_M) >> httsym##_S)
  5884. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  5885. * type -> MGMT, CTRL, DATA*/
  5886. #define htt_tx_ring_pkt_type_set( \
  5887. word, mode, type, val) \
  5888. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5889. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5890. #define htt_tx_ring_pkt_type_get( \
  5891. word, mode, type) \
  5892. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5893. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5894. /* Definition to filter in TLVs */
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5959. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5960. do { \
  5961. HTT_CHECK_SET_VAL(httsym, enable); \
  5962. (word) |= (enable) << httsym##_S; \
  5963. } while (0)
  5964. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5965. (((word) & httsym##_M) >> httsym##_S)
  5966. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5967. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5968. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5969. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5970. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5971. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6036. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6037. do { \
  6038. HTT_CHECK_SET_VAL(httsym, enable); \
  6039. (word) |= (enable) << httsym##_S; \
  6040. } while (0)
  6041. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6042. (((word) & httsym##_M) >> httsym##_S)
  6043. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6044. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6045. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6046. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6047. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6048. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6113. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6114. do { \
  6115. HTT_CHECK_SET_VAL(httsym, enable); \
  6116. (word) |= (enable) << httsym##_S; \
  6117. } while (0)
  6118. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6119. (((word) & httsym##_M) >> httsym##_S)
  6120. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6121. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6122. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6123. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6124. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6125. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6170. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(httsym, enable); \
  6173. (word) |= (enable) << httsym##_S; \
  6174. } while (0)
  6175. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6176. (((word) & httsym##_M) >> httsym##_S)
  6177. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6178. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6179. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6180. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6181. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6182. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6183. /**
  6184. * @brief host --> target Receive Flow Steering configuration message definition
  6185. *
  6186. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6187. *
  6188. * host --> target Receive Flow Steering configuration message definition.
  6189. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6190. * The reason for this is we want RFS to be configured and ready before MAC
  6191. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6192. *
  6193. * |31 24|23 16|15 9|8|7 0|
  6194. * |----------------+----------------+----------------+----------------|
  6195. * | reserved |E| msg type |
  6196. * |-------------------------------------------------------------------|
  6197. * Where E = RFS enable flag
  6198. *
  6199. * The RFS_CONFIG message consists of a single 4-byte word.
  6200. *
  6201. * Header fields:
  6202. * - MSG_TYPE
  6203. * Bits 7:0
  6204. * Purpose: identifies this as a RFS config msg
  6205. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6206. * - RFS_CONFIG
  6207. * Bit 8
  6208. * Purpose: Tells target whether to enable (1) or disable (0)
  6209. * flow steering feature when sending rx indication messages to host
  6210. */
  6211. #define HTT_H2T_RFS_CONFIG_M 0x100
  6212. #define HTT_H2T_RFS_CONFIG_S 8
  6213. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6214. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6215. HTT_H2T_RFS_CONFIG_S)
  6216. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6217. do { \
  6218. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6219. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6220. } while (0)
  6221. #define HTT_RFS_CFG_REQ_BYTES 4
  6222. /**
  6223. * @brief host -> target FW extended statistics retrieve
  6224. *
  6225. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6226. *
  6227. * @details
  6228. * The following field definitions describe the format of the HTT host
  6229. * to target FW extended stats retrieve message.
  6230. * The message specifies the type of stats the host wants to retrieve.
  6231. *
  6232. * |31 24|23 16|15 8|7 0|
  6233. * |-----------------------------------------------------------|
  6234. * | reserved | stats type | pdev_mask | msg type |
  6235. * |-----------------------------------------------------------|
  6236. * | config param [0] |
  6237. * |-----------------------------------------------------------|
  6238. * | config param [1] |
  6239. * |-----------------------------------------------------------|
  6240. * | config param [2] |
  6241. * |-----------------------------------------------------------|
  6242. * | config param [3] |
  6243. * |-----------------------------------------------------------|
  6244. * | reserved |
  6245. * |-----------------------------------------------------------|
  6246. * | cookie LSBs |
  6247. * |-----------------------------------------------------------|
  6248. * | cookie MSBs |
  6249. * |-----------------------------------------------------------|
  6250. * Header fields:
  6251. * - MSG_TYPE
  6252. * Bits 7:0
  6253. * Purpose: identifies this is a extended stats upload request message
  6254. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6255. * - PDEV_MASK
  6256. * Bits 8:15
  6257. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6258. * Value: This is a overloaded field, refer to usage and interpretation of
  6259. * PDEV in interface document.
  6260. * Bit 8 : Reserved for SOC stats
  6261. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6262. * Indicates MACID_MASK in DBS
  6263. * - STATS_TYPE
  6264. * Bits 23:16
  6265. * Purpose: identifies which FW statistics to upload
  6266. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6267. * - Reserved
  6268. * Bits 31:24
  6269. * - CONFIG_PARAM [0]
  6270. * Bits 31:0
  6271. * Purpose: give an opaque configuration value to the specified stats type
  6272. * Value: stats-type specific configuration value
  6273. * Refer to htt_stats.h for interpretation for each stats sub_type
  6274. * - CONFIG_PARAM [1]
  6275. * Bits 31:0
  6276. * Purpose: give an opaque configuration value to the specified stats type
  6277. * Value: stats-type specific configuration value
  6278. * Refer to htt_stats.h for interpretation for each stats sub_type
  6279. * - CONFIG_PARAM [2]
  6280. * Bits 31:0
  6281. * Purpose: give an opaque configuration value to the specified stats type
  6282. * Value: stats-type specific configuration value
  6283. * Refer to htt_stats.h for interpretation for each stats sub_type
  6284. * - CONFIG_PARAM [3]
  6285. * Bits 31:0
  6286. * Purpose: give an opaque configuration value to the specified stats type
  6287. * Value: stats-type specific configuration value
  6288. * Refer to htt_stats.h for interpretation for each stats sub_type
  6289. * - Reserved [31:0] for future use.
  6290. * - COOKIE_LSBS
  6291. * Bits 31:0
  6292. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6293. * message with its preceding host->target stats request message.
  6294. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6295. * - COOKIE_MSBS
  6296. * Bits 31:0
  6297. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6298. * message with its preceding host->target stats request message.
  6299. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6300. */
  6301. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6302. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6303. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6304. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6305. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6306. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6307. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6308. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6309. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6310. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6311. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6314. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6315. } while (0)
  6316. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6317. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6318. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6319. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6320. do { \
  6321. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6322. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6323. } while (0)
  6324. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6325. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6326. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6327. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6328. do { \
  6329. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6330. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6331. } while (0)
  6332. /**
  6333. * @brief host -> target FW PPDU_STATS request message
  6334. *
  6335. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6336. *
  6337. * @details
  6338. * The following field definitions describe the format of the HTT host
  6339. * to target FW for PPDU_STATS_CFG msg.
  6340. * The message allows the host to configure the PPDU_STATS_IND messages
  6341. * produced by the target.
  6342. *
  6343. * |31 24|23 16|15 8|7 0|
  6344. * |-----------------------------------------------------------|
  6345. * | REQ bit mask | pdev_mask | msg type |
  6346. * |-----------------------------------------------------------|
  6347. * Header fields:
  6348. * - MSG_TYPE
  6349. * Bits 7:0
  6350. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6351. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6352. * - PDEV_MASK
  6353. * Bits 8:15
  6354. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6355. * Value: This is a overloaded field, refer to usage and interpretation of
  6356. * PDEV in interface document.
  6357. * Bit 8 : Reserved for SOC stats
  6358. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6359. * Indicates MACID_MASK in DBS
  6360. * - REQ_TLV_BIT_MASK
  6361. * Bits 16:31
  6362. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6363. * needs to be included in the target's PPDU_STATS_IND messages.
  6364. * Value: refer htt_ppdu_stats_tlv_tag_t
  6365. *
  6366. */
  6367. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6368. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6369. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6370. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6371. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6372. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6373. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6374. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6375. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6378. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6379. } while (0)
  6380. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6381. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6382. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6383. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6386. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6387. } while (0)
  6388. /**
  6389. * @brief Host-->target HTT RX FSE setup message
  6390. *
  6391. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6392. *
  6393. * @details
  6394. * Through this message, the host will provide details of the flow tables
  6395. * in host DDR along with hash keys.
  6396. * This message can be sent per SOC or per PDEV, which is differentiated
  6397. * by pdev id values.
  6398. * The host will allocate flow search table and sends table size,
  6399. * physical DMA address of flow table, and hash keys to firmware to
  6400. * program into the RXOLE FSE HW block.
  6401. *
  6402. * The following field definitions describe the format of the RX FSE setup
  6403. * message sent from the host to target
  6404. *
  6405. * Header fields:
  6406. * dword0 - b'7:0 - msg_type: This will be set to
  6407. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6408. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6409. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6410. * pdev's LMAC ring.
  6411. * b'31:16 - reserved : Reserved for future use
  6412. * dword1 - b'19:0 - number of records: This field indicates the number of
  6413. * entries in the flow table. For example: 8k number of
  6414. * records is equivalent to
  6415. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6416. * b'27:20 - max search: This field specifies the skid length to FSE
  6417. * parser HW module whenever match is not found at the
  6418. * exact index pointed by hash.
  6419. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6420. * Refer htt_ip_da_sa_prefix below for more details.
  6421. * b'31:30 - reserved: Reserved for future use
  6422. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6423. * table allocated by host in DDR
  6424. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6425. * table allocated by host in DDR
  6426. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6427. * entry hashing
  6428. *
  6429. *
  6430. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6431. * |---------------------------------------------------------------|
  6432. * | reserved | pdev_id | MSG_TYPE |
  6433. * |---------------------------------------------------------------|
  6434. * |resvd|IPDSA| max_search | Number of records |
  6435. * |---------------------------------------------------------------|
  6436. * | base address lo |
  6437. * |---------------------------------------------------------------|
  6438. * | base address high |
  6439. * |---------------------------------------------------------------|
  6440. * | toeplitz key 31_0 |
  6441. * |---------------------------------------------------------------|
  6442. * | toeplitz key 63_32 |
  6443. * |---------------------------------------------------------------|
  6444. * | toeplitz key 95_64 |
  6445. * |---------------------------------------------------------------|
  6446. * | toeplitz key 127_96 |
  6447. * |---------------------------------------------------------------|
  6448. * | toeplitz key 159_128 |
  6449. * |---------------------------------------------------------------|
  6450. * | toeplitz key 191_160 |
  6451. * |---------------------------------------------------------------|
  6452. * | toeplitz key 223_192 |
  6453. * |---------------------------------------------------------------|
  6454. * | toeplitz key 255_224 |
  6455. * |---------------------------------------------------------------|
  6456. * | toeplitz key 287_256 |
  6457. * |---------------------------------------------------------------|
  6458. * | reserved | toeplitz key 314_288(26:0 bits) |
  6459. * |---------------------------------------------------------------|
  6460. * where:
  6461. * IPDSA = ip_da_sa
  6462. */
  6463. /**
  6464. * @brief: htt_ip_da_sa_prefix
  6465. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6466. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6467. * documentation per RFC3849
  6468. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6469. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6470. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6471. */
  6472. enum htt_ip_da_sa_prefix {
  6473. HTT_RX_IPV6_20010db8,
  6474. HTT_RX_IPV4_MAPPED_IPV6,
  6475. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6476. HTT_RX_IPV6_64FF9B,
  6477. };
  6478. /**
  6479. * @brief Host-->target HTT RX FISA configure and enable
  6480. *
  6481. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6482. *
  6483. * @details
  6484. * The host will send this command down to configure and enable the FISA
  6485. * operational params.
  6486. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6487. * register.
  6488. * Should configure both the MACs.
  6489. *
  6490. * dword0 - b'7:0 - msg_type:
  6491. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6492. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6493. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6494. * pdev's LMAC ring.
  6495. * b'31:16 - reserved : Reserved for future use
  6496. *
  6497. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6498. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6499. * packets. 1 flow search will be skipped
  6500. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6501. * tcp,udp packets
  6502. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6503. * calculation
  6504. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6505. * calculation
  6506. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6507. * calculation
  6508. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6509. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6510. * length
  6511. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6512. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6513. * length
  6514. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6515. * num jump
  6516. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6517. * num jump
  6518. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6519. * data type switch has happend for MPDU Sequence num jump
  6520. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6521. * for MPDU Sequence num jump
  6522. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6523. * for decrypt errors
  6524. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6525. * while aggregating a msdu
  6526. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6527. * The aggregation is done until (number of MSDUs aggregated
  6528. * < LIMIT + 1)
  6529. * b'31:18 - Reserved
  6530. *
  6531. * fisa_control_value - 32bit value FW can write to register
  6532. *
  6533. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6534. * Threshold value for FISA timeout (units are microseconds).
  6535. * When the global timestamp exceeds this threshold, FISA
  6536. * aggregation will be restarted.
  6537. * A value of 0 means timeout is disabled.
  6538. * Compare the threshold register with timestamp field in
  6539. * flow entry to generate timeout for the flow.
  6540. *
  6541. * |31 18 |17 16|15 8|7 0|
  6542. * |-------------------------------------------------------------|
  6543. * | reserved | pdev_mask | msg type |
  6544. * |-------------------------------------------------------------|
  6545. * | reserved | FISA_CTRL |
  6546. * |-------------------------------------------------------------|
  6547. * | FISA_TIMEOUT_THRESH |
  6548. * |-------------------------------------------------------------|
  6549. */
  6550. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6551. A_UINT32 msg_type:8,
  6552. pdev_id:8,
  6553. reserved0:16;
  6554. /**
  6555. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6556. * [17:0]
  6557. */
  6558. union {
  6559. /*
  6560. * fisa_control_bits structure is deprecated.
  6561. * Please use fisa_control_bits_v2 going forward.
  6562. */
  6563. struct {
  6564. A_UINT32 fisa_enable: 1,
  6565. ipsec_skip_search: 1,
  6566. nontcp_skip_search: 1,
  6567. add_ipv4_fixed_hdr_len: 1,
  6568. add_ipv6_fixed_hdr_len: 1,
  6569. add_tcp_fixed_hdr_len: 1,
  6570. add_udp_hdr_len: 1,
  6571. chksum_cum_ip_len_en: 1,
  6572. disable_tid_check: 1,
  6573. disable_ta_check: 1,
  6574. disable_qos_check: 1,
  6575. disable_raw_check: 1,
  6576. disable_decrypt_err_check: 1,
  6577. disable_msdu_drop_check: 1,
  6578. fisa_aggr_limit: 4,
  6579. reserved: 14;
  6580. } fisa_control_bits;
  6581. struct {
  6582. A_UINT32 fisa_enable: 1,
  6583. fisa_aggr_limit: 4,
  6584. reserved: 27;
  6585. } fisa_control_bits_v2;
  6586. A_UINT32 fisa_control_value;
  6587. } u_fisa_control;
  6588. /**
  6589. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6590. * timeout threshold for aggregation. Unit in usec.
  6591. * [31:0]
  6592. */
  6593. A_UINT32 fisa_timeout_threshold;
  6594. } POSTPACK;
  6595. /* DWord 0: pdev-ID */
  6596. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6597. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6598. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6599. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6600. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6601. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6604. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6605. } while (0)
  6606. /* Dword 1: fisa_control_value fisa config */
  6607. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6608. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6609. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6610. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6611. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6612. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6615. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6616. } while (0)
  6617. /* Dword 1: fisa_control_value ipsec_skip_search */
  6618. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6619. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6620. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6621. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6622. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6623. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6624. do { \
  6625. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6626. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6627. } while (0)
  6628. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6629. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6630. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6631. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6632. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6633. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6634. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6635. do { \
  6636. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6637. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6638. } while (0)
  6639. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6640. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6641. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6642. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6643. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6644. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6645. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6648. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6649. } while (0)
  6650. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6651. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6652. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6653. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6654. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6655. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6656. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6657. do { \
  6658. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6659. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6660. } while (0)
  6661. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6662. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6663. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6664. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6665. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6666. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6667. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6668. do { \
  6669. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6670. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6671. } while (0)
  6672. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6673. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6674. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6675. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6676. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6677. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6678. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6679. do { \
  6680. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6681. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6682. } while (0)
  6683. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6684. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6685. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6686. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6687. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6688. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6689. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6690. do { \
  6691. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6692. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6693. } while (0)
  6694. /* Dword 1: fisa_control_value disable_tid_check */
  6695. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6696. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6697. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6698. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6699. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6700. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6703. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6704. } while (0)
  6705. /* Dword 1: fisa_control_value disable_ta_check */
  6706. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6707. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6708. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6709. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6710. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6711. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6712. do { \
  6713. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6714. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6715. } while (0)
  6716. /* Dword 1: fisa_control_value disable_qos_check */
  6717. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6718. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6719. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6720. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6721. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6722. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6723. do { \
  6724. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6725. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6726. } while (0)
  6727. /* Dword 1: fisa_control_value disable_raw_check */
  6728. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6729. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6730. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6731. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6732. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6733. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6736. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6737. } while (0)
  6738. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6739. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6740. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6741. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6742. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6743. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6744. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6745. do { \
  6746. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6747. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6748. } while (0)
  6749. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6750. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6751. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6752. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6753. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6754. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6755. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6756. do { \
  6757. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6758. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6759. } while (0)
  6760. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6761. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6762. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6763. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6764. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6765. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6766. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6769. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6770. } while (0)
  6771. /* Dword 1: fisa_control_value fisa config */
  6772. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6773. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6774. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6775. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6776. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6777. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6778. do { \
  6779. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6780. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6781. } while (0)
  6782. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6783. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6784. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6785. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6786. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6787. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6788. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6789. do { \
  6790. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6791. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6792. } while (0)
  6793. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6794. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6795. pdev_id:8,
  6796. reserved0:16;
  6797. A_UINT32 num_records:20,
  6798. max_search:8,
  6799. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6800. reserved1:2;
  6801. A_UINT32 base_addr_lo;
  6802. A_UINT32 base_addr_hi;
  6803. A_UINT32 toeplitz31_0;
  6804. A_UINT32 toeplitz63_32;
  6805. A_UINT32 toeplitz95_64;
  6806. A_UINT32 toeplitz127_96;
  6807. A_UINT32 toeplitz159_128;
  6808. A_UINT32 toeplitz191_160;
  6809. A_UINT32 toeplitz223_192;
  6810. A_UINT32 toeplitz255_224;
  6811. A_UINT32 toeplitz287_256;
  6812. A_UINT32 toeplitz314_288:27,
  6813. reserved2:5;
  6814. } POSTPACK;
  6815. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6816. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6817. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6818. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6819. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6820. /* DWORD 0: Pdev ID */
  6821. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6822. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6823. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6824. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6825. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6826. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6827. do { \
  6828. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6829. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6830. } while (0)
  6831. /* DWORD 1:num of records */
  6832. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6833. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6834. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6835. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6836. HTT_RX_FSE_SETUP_NUM_REC_S)
  6837. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6838. do { \
  6839. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6840. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6841. } while (0)
  6842. /* DWORD 1:max_search */
  6843. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6844. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6845. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6846. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6847. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6848. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6849. do { \
  6850. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6851. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6852. } while (0)
  6853. /* DWORD 1:ip_da_sa prefix */
  6854. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6855. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6856. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6857. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6858. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6859. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6860. do { \
  6861. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6862. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6863. } while (0)
  6864. /* DWORD 2: Base Address LO */
  6865. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6866. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6867. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6868. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6869. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6870. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6873. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6874. } while (0)
  6875. /* DWORD 3: Base Address High */
  6876. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6877. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6878. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6879. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6880. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6881. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6882. do { \
  6883. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6884. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6885. } while (0)
  6886. /* DWORD 4-12: Hash Value */
  6887. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6888. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6889. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6890. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6891. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6892. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6893. do { \
  6894. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6895. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6896. } while (0)
  6897. /* DWORD 13: Hash Value 314:288 bits */
  6898. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6899. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6900. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6901. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6902. do { \
  6903. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6904. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6905. } while (0)
  6906. /**
  6907. * @brief Host-->target HTT RX FSE operation message
  6908. *
  6909. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6910. *
  6911. * @details
  6912. * The host will send this Flow Search Engine (FSE) operation message for
  6913. * every flow add/delete operation.
  6914. * The FSE operation includes FSE full cache invalidation or individual entry
  6915. * invalidation.
  6916. * This message can be sent per SOC or per PDEV which is differentiated
  6917. * by pdev id values.
  6918. *
  6919. * |31 16|15 8|7 1|0|
  6920. * |-------------------------------------------------------------|
  6921. * | reserved | pdev_id | MSG_TYPE |
  6922. * |-------------------------------------------------------------|
  6923. * | reserved | operation |I|
  6924. * |-------------------------------------------------------------|
  6925. * | ip_src_addr_31_0 |
  6926. * |-------------------------------------------------------------|
  6927. * | ip_src_addr_63_32 |
  6928. * |-------------------------------------------------------------|
  6929. * | ip_src_addr_95_64 |
  6930. * |-------------------------------------------------------------|
  6931. * | ip_src_addr_127_96 |
  6932. * |-------------------------------------------------------------|
  6933. * | ip_dst_addr_31_0 |
  6934. * |-------------------------------------------------------------|
  6935. * | ip_dst_addr_63_32 |
  6936. * |-------------------------------------------------------------|
  6937. * | ip_dst_addr_95_64 |
  6938. * |-------------------------------------------------------------|
  6939. * | ip_dst_addr_127_96 |
  6940. * |-------------------------------------------------------------|
  6941. * | l4_dst_port | l4_src_port |
  6942. * | (32-bit SPI incase of IPsec) |
  6943. * |-------------------------------------------------------------|
  6944. * | reserved | l4_proto |
  6945. * |-------------------------------------------------------------|
  6946. *
  6947. * where I is 1-bit ipsec_valid.
  6948. *
  6949. * The following field definitions describe the format of the RX FSE operation
  6950. * message sent from the host to target for every add/delete flow entry to flow
  6951. * table.
  6952. *
  6953. * Header fields:
  6954. * dword0 - b'7:0 - msg_type: This will be set to
  6955. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6956. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6957. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6958. * specified pdev's LMAC ring.
  6959. * b'31:16 - reserved : Reserved for future use
  6960. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6961. * (Internet Protocol Security).
  6962. * IPsec describes the framework for providing security at
  6963. * IP layer. IPsec is defined for both versions of IP:
  6964. * IPV4 and IPV6.
  6965. * Please refer to htt_rx_flow_proto enumeration below for
  6966. * more info.
  6967. * ipsec_valid = 1 for IPSEC packets
  6968. * ipsec_valid = 0 for IP Packets
  6969. * b'7:1 - operation: This indicates types of FSE operation.
  6970. * Refer to htt_rx_fse_operation enumeration:
  6971. * 0 - No Cache Invalidation required
  6972. * 1 - Cache invalidate only one entry given by IP
  6973. * src/dest address at DWORD[2:9]
  6974. * 2 - Complete FSE Cache Invalidation
  6975. * 3 - FSE Disable
  6976. * 4 - FSE Enable
  6977. * b'31:8 - reserved: Reserved for future use
  6978. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6979. * for per flow addition/deletion
  6980. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6981. * and the subsequent 3 A_UINT32 will be padding bytes.
  6982. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6983. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6984. * from 0 to 65535 but only 0 to 1023 are designated as
  6985. * well-known ports. Refer to [RFC1700] for more details.
  6986. * This field is valid only if
  6987. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6988. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6989. * range from 0 to 65535 but only 0 to 1023 are designated
  6990. * as well-known ports. Refer to [RFC1700] for more details.
  6991. * This field is valid only if
  6992. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6993. * - SPI (31:0): Security Parameters Index is an
  6994. * identification tag added to the header while using IPsec
  6995. * for tunneling the IP traffici.
  6996. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6997. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6998. * Assigned Internet Protocol Numbers.
  6999. * l4_proto numbers for standard protocol like UDP/TCP
  7000. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7001. * l4_proto = 17 for UDP etc.
  7002. * b'31:8 - reserved: Reserved for future use.
  7003. *
  7004. */
  7005. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7006. A_UINT32 msg_type:8,
  7007. pdev_id:8,
  7008. reserved0:16;
  7009. A_UINT32 ipsec_valid:1,
  7010. operation:7,
  7011. reserved1:24;
  7012. A_UINT32 ip_src_addr_31_0;
  7013. A_UINT32 ip_src_addr_63_32;
  7014. A_UINT32 ip_src_addr_95_64;
  7015. A_UINT32 ip_src_addr_127_96;
  7016. A_UINT32 ip_dest_addr_31_0;
  7017. A_UINT32 ip_dest_addr_63_32;
  7018. A_UINT32 ip_dest_addr_95_64;
  7019. A_UINT32 ip_dest_addr_127_96;
  7020. union {
  7021. A_UINT32 spi;
  7022. struct {
  7023. A_UINT32 l4_src_port:16,
  7024. l4_dest_port:16;
  7025. } ip;
  7026. } u;
  7027. A_UINT32 l4_proto:8,
  7028. reserved:24;
  7029. } POSTPACK;
  7030. /**
  7031. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7032. *
  7033. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7034. *
  7035. * @details
  7036. * The host will send this Full monitor mode register configuration message.
  7037. * This message can be sent per SOC or per PDEV which is differentiated
  7038. * by pdev id values.
  7039. *
  7040. * |31 16|15 11|10 8|7 3|2|1|0|
  7041. * |-------------------------------------------------------------|
  7042. * | reserved | pdev_id | MSG_TYPE |
  7043. * |-------------------------------------------------------------|
  7044. * | reserved |Release Ring |N|Z|E|
  7045. * |-------------------------------------------------------------|
  7046. *
  7047. * where E is 1-bit full monitor mode enable/disable.
  7048. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7049. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7050. *
  7051. * The following field definitions describe the format of the full monitor
  7052. * mode configuration message sent from the host to target for each pdev.
  7053. *
  7054. * Header fields:
  7055. * dword0 - b'7:0 - msg_type: This will be set to
  7056. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7057. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7058. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7059. * specified pdev's LMAC ring.
  7060. * b'31:16 - reserved : Reserved for future use.
  7061. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7062. * monitor mode rxdma register is to be enabled or disabled.
  7063. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7064. * additional descriptors at ppdu end for zero mpdus
  7065. * enabled or disabled.
  7066. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7067. * additional descriptors at ppdu end for non zero mpdus
  7068. * enabled or disabled.
  7069. * b'10:3 - release_ring: This indicates the destination ring
  7070. * selection for the descriptor at the end of PPDU
  7071. * 0 - REO ring select
  7072. * 1 - FW ring select
  7073. * 2 - SW ring select
  7074. * 3 - Release ring select
  7075. * Refer to htt_rx_full_mon_release_ring.
  7076. * b'31:11 - reserved for future use
  7077. */
  7078. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7079. A_UINT32 msg_type:8,
  7080. pdev_id:8,
  7081. reserved0:16;
  7082. A_UINT32 full_monitor_mode_enable:1,
  7083. addnl_descs_zero_mpdus_end:1,
  7084. addnl_descs_non_zero_mpdus_end:1,
  7085. release_ring:8,
  7086. reserved1:21;
  7087. } POSTPACK;
  7088. /**
  7089. * Enumeration for full monitor mode destination ring select
  7090. * 0 - REO destination ring select
  7091. * 1 - FW destination ring select
  7092. * 2 - SW destination ring select
  7093. * 3 - Release destination ring select
  7094. */
  7095. enum htt_rx_full_mon_release_ring {
  7096. HTT_RX_MON_RING_REO,
  7097. HTT_RX_MON_RING_FW,
  7098. HTT_RX_MON_RING_SW,
  7099. HTT_RX_MON_RING_RELEASE,
  7100. };
  7101. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7102. /* DWORD 0: Pdev ID */
  7103. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7104. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7105. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7106. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7107. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7108. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7109. do { \
  7110. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7111. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7112. } while (0)
  7113. /* DWORD 1:ENABLE */
  7114. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7115. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7116. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7117. do { \
  7118. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7119. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7120. } while (0)
  7121. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7122. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7123. /* DWORD 1:ZERO_MPDU */
  7124. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7125. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7126. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7127. do { \
  7128. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7129. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7130. } while (0)
  7131. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7132. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7133. /* DWORD 1:NON_ZERO_MPDU */
  7134. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7135. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7136. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7137. do { \
  7138. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7139. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7140. } while (0)
  7141. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7142. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7143. /* DWORD 1:RELEASE_RINGS */
  7144. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7145. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7146. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7147. do { \
  7148. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7149. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7150. } while (0)
  7151. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7152. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7153. /**
  7154. * Enumeration for IP Protocol or IPSEC Protocol
  7155. * IPsec describes the framework for providing security at IP layer.
  7156. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7157. */
  7158. enum htt_rx_flow_proto {
  7159. HTT_RX_FLOW_IP_PROTO,
  7160. HTT_RX_FLOW_IPSEC_PROTO,
  7161. };
  7162. /**
  7163. * Enumeration for FSE Cache Invalidation
  7164. * 0 - No Cache Invalidation required
  7165. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7166. * 2 - Complete FSE Cache Invalidation
  7167. * 3 - FSE Disable
  7168. * 4 - FSE Enable
  7169. */
  7170. enum htt_rx_fse_operation {
  7171. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7172. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7173. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7174. HTT_RX_FSE_DISABLE,
  7175. HTT_RX_FSE_ENABLE,
  7176. };
  7177. /* DWORD 0: Pdev ID */
  7178. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7179. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7180. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7181. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7182. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7183. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7184. do { \
  7185. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7186. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7187. } while (0)
  7188. /* DWORD 1:IP PROTO or IPSEC */
  7189. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7190. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7191. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7192. do { \
  7193. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7194. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7195. } while (0)
  7196. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7197. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7198. /* DWORD 1:FSE Operation */
  7199. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7200. #define HTT_RX_FSE_OPERATION_S 1
  7201. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7202. do { \
  7203. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7204. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7205. } while (0)
  7206. #define HTT_RX_FSE_OPERATION_GET(word) \
  7207. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7208. /* DWORD 2-9:IP Address */
  7209. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7210. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7211. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7212. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7213. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7214. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7215. do { \
  7216. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7217. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7218. } while (0)
  7219. /* DWORD 10:Source Port Number */
  7220. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7221. #define HTT_RX_FSE_SOURCEPORT_S 0
  7222. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7223. do { \
  7224. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7225. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7226. } while (0)
  7227. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7228. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7229. /* DWORD 11:Destination Port Number */
  7230. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7231. #define HTT_RX_FSE_DESTPORT_S 16
  7232. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7235. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7236. } while (0)
  7237. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7238. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7239. /* DWORD 10-11:SPI (In case of IPSEC) */
  7240. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7241. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7242. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7243. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7244. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7245. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7246. do { \
  7247. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7248. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7249. } while (0)
  7250. /* DWORD 12:L4 PROTO */
  7251. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7252. #define HTT_RX_FSE_L4_PROTO_S 0
  7253. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7254. do { \
  7255. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7256. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7257. } while (0)
  7258. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7259. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7260. /**
  7261. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7262. *
  7263. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7264. *
  7265. * |31 24|23 |15 8|7 2|1|0|
  7266. * |----------------+----------------+----------------+----------------|
  7267. * | reserved | pdev_id | msg_type |
  7268. * |---------------------------------+----------------+----------------|
  7269. * | reserved |E|F|
  7270. * |---------------------------------+----------------+----------------|
  7271. * Where E = Configure the target to provide the 3-tuple hash value in
  7272. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7273. * F = Configure the target to provide the 3-tuple hash value in
  7274. * flow_id_toeplitz field of rx_msdu_start tlv
  7275. *
  7276. * The following field definitions describe the format of the 3 tuple hash value
  7277. * message sent from the host to target as part of initialization sequence.
  7278. *
  7279. * Header fields:
  7280. * dword0 - b'7:0 - msg_type: This will be set to
  7281. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7282. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7283. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7284. * specified pdev's LMAC ring.
  7285. * b'31:16 - reserved : Reserved for future use
  7286. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7287. * b'1 - toeplitz_hash_2_or_4_field_enable
  7288. * b'31:2 - reserved : Reserved for future use
  7289. * ---------+------+----------------------------------------------------------
  7290. * bit1 | bit0 | Functionality
  7291. * ---------+------+----------------------------------------------------------
  7292. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7293. * | | in flow_id_toeplitz field
  7294. * ---------+------+----------------------------------------------------------
  7295. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7296. * | | in toeplitz_hash_2_or_4 field
  7297. * ---------+------+----------------------------------------------------------
  7298. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7299. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7300. * ---------+------+----------------------------------------------------------
  7301. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7302. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7303. * | | toeplitz_hash_2_or_4 field
  7304. *----------------------------------------------------------------------------
  7305. */
  7306. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7307. A_UINT32 msg_type :8,
  7308. pdev_id :8,
  7309. reserved0 :16;
  7310. A_UINT32 flow_id_toeplitz_field_enable :1,
  7311. toeplitz_hash_2_or_4_field_enable :1,
  7312. reserved1 :30;
  7313. } POSTPACK;
  7314. /* DWORD0 : pdev_id configuration Macros */
  7315. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7316. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7317. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7318. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7319. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7320. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7321. do { \
  7322. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7323. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7324. } while (0)
  7325. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7326. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7327. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7328. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7329. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7330. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7331. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7332. do { \
  7333. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7334. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7335. } while (0)
  7336. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7337. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7338. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7339. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7340. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7341. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7342. do { \
  7343. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7344. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7345. } while (0)
  7346. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7347. /**
  7348. * @brief host --> target Host PA Address Size
  7349. *
  7350. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7351. *
  7352. * @details
  7353. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7354. * provide the physical start address and size of each of the memory
  7355. * areas within host DDR that the target FW may need to access.
  7356. *
  7357. * For example, the host can use this message to allow the target FW
  7358. * to set up access to the host's pools of TQM link descriptors.
  7359. * The message would appear as follows:
  7360. *
  7361. * |31 24|23 16|15 8|7 0|
  7362. * |----------------+----------------+----------------+----------------|
  7363. * | reserved | num_entries | msg_type |
  7364. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7365. * | mem area 0 size |
  7366. * |----------------+----------------+----------------+----------------|
  7367. * | mem area 0 physical_address_lo |
  7368. * |----------------+----------------+----------------+----------------|
  7369. * | mem area 0 physical_address_hi |
  7370. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7371. * | mem area 1 size |
  7372. * |----------------+----------------+----------------+----------------|
  7373. * | mem area 1 physical_address_lo |
  7374. * |----------------+----------------+----------------+----------------|
  7375. * | mem area 1 physical_address_hi |
  7376. * |----------------+----------------+----------------+----------------|
  7377. * ...
  7378. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7379. * | mem area N size |
  7380. * |----------------+----------------+----------------+----------------|
  7381. * | mem area N physical_address_lo |
  7382. * |----------------+----------------+----------------+----------------|
  7383. * | mem area N physical_address_hi |
  7384. * |----------------+----------------+----------------+----------------|
  7385. *
  7386. * The message is interpreted as follows:
  7387. * dword0 - b'0:7 - msg_type: This will be set to
  7388. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7389. * b'8:15 - number_entries: Indicated the number of host memory
  7390. * areas specified within the remainder of the message
  7391. * b'16:31 - reserved.
  7392. * dword1 - b'0:31 - memory area 0 size in bytes
  7393. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7394. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7395. * and similar for memory area 1 through memory area N.
  7396. */
  7397. PREPACK struct htt_h2t_host_paddr_size {
  7398. A_UINT32 msg_type: 8,
  7399. num_entries: 8,
  7400. reserved: 16;
  7401. } POSTPACK;
  7402. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7403. A_UINT32 size;
  7404. A_UINT32 physical_address_lo;
  7405. A_UINT32 physical_address_hi;
  7406. } POSTPACK;
  7407. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7408. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7409. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7410. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7411. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7412. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7413. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7416. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7417. } while (0)
  7418. /**
  7419. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7420. *
  7421. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7422. *
  7423. * @details
  7424. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7425. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7426. *
  7427. * The message would appear as follows:
  7428. *
  7429. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7430. * |---------------------------------+---+---+----------+-+-----------|
  7431. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7432. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7433. *
  7434. *
  7435. * The message is interpreted as follows:
  7436. * dword0 - b'0:7 - msg_type: This will be set to
  7437. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7438. * b'8 - override bit to drive MSDUs to PPE ring
  7439. * b'9:13 - REO destination ring indication
  7440. * b'14 - Multi buffer msdu override enable bit
  7441. * b'15 - Intra BSS override
  7442. * b'16 - Decap raw override
  7443. * b'17 - Decap Native wifi override
  7444. * b'18 - IP frag override
  7445. * b'19:31 - reserved
  7446. */
  7447. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7448. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7449. override: 1,
  7450. reo_destination_indication: 5,
  7451. multi_buffer_msdu_override_en: 1,
  7452. intra_bss_override: 1,
  7453. decap_raw_override: 1,
  7454. decap_nwifi_override: 1,
  7455. ip_frag_override: 1,
  7456. reserved: 13;
  7457. } POSTPACK;
  7458. /* DWORD 0: Override */
  7459. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7460. #define HTT_PPE_CFG_OVERRIDE_S 8
  7461. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7462. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7463. HTT_PPE_CFG_OVERRIDE_S)
  7464. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7465. do { \
  7466. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7467. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7468. } while (0)
  7469. /* DWORD 0: REO Destination Indication*/
  7470. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7471. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7472. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7473. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7474. HTT_PPE_CFG_REO_DEST_IND_S)
  7475. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7476. do { \
  7477. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7478. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7479. } while (0)
  7480. /* DWORD 0: Multi buffer MSDU override */
  7481. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7482. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7483. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7484. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7485. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7486. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7487. do { \
  7488. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7489. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7490. } while (0)
  7491. /* DWORD 0: Intra BSS override */
  7492. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7493. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7494. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7495. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7496. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7497. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7498. do { \
  7499. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7500. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7501. } while (0)
  7502. /* DWORD 0: Decap RAW override */
  7503. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7504. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7505. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7506. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7507. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7508. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7509. do { \
  7510. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7511. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7512. } while (0)
  7513. /* DWORD 0: Decap NWIFI override */
  7514. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7515. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7516. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7517. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7518. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7519. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7520. do { \
  7521. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7522. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7523. } while (0)
  7524. /* DWORD 0: IP frag override */
  7525. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7526. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7527. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7528. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7529. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7530. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7531. do { \
  7532. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7533. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7534. } while (0)
  7535. /*
  7536. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7537. *
  7538. * @details
  7539. * The following field definitions describe the format of the HTT host
  7540. * to target FW VDEV TX RX stats retrieve message.
  7541. * The message specifies the type of stats the host wants to retrieve.
  7542. *
  7543. * |31 27|26 25|24 17|16|15 8|7 0|
  7544. * |-----------------------------------------------------------|
  7545. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7546. * |-----------------------------------------------------------|
  7547. * | vdev_id lower bitmask |
  7548. * |-----------------------------------------------------------|
  7549. * | vdev_id upper bitmask |
  7550. * |-----------------------------------------------------------|
  7551. * Header fields:
  7552. * Where:
  7553. * dword0 - b'7:0 - msg_type: This will be set to
  7554. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7555. * b'15:8 - pdev id
  7556. * b'16(E) - Enable/Disable the vdev HW stats
  7557. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7558. * b'25:26(R) - Reset stats bits
  7559. * 0: don't reset stats
  7560. * 1: reset stats once
  7561. * 2: reset stats at the start of each periodic interval
  7562. * b'27:31 - reserved for future use
  7563. * dword1 - b'0:31 - vdev_id lower bitmask
  7564. * dword2 - b'0:31 - vdev_id upper bitmask
  7565. */
  7566. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7567. A_UINT32 msg_type :8,
  7568. pdev_id :8,
  7569. enable :1,
  7570. periodic_interval :8,
  7571. reset_stats_bits :2,
  7572. reserved0 :5;
  7573. A_UINT32 vdev_id_lower_bitmask;
  7574. A_UINT32 vdev_id_upper_bitmask;
  7575. } POSTPACK;
  7576. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7577. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7578. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7579. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7580. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7581. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7582. do { \
  7583. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7584. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7585. } while (0)
  7586. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7587. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7588. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7589. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7590. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7591. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7592. do { \
  7593. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7594. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7595. } while (0)
  7596. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7597. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7598. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7599. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7600. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7601. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7602. do { \
  7603. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7604. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7605. } while (0)
  7606. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7607. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7608. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7609. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7610. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7611. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7612. do { \
  7613. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7614. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7615. } while (0)
  7616. /*=== target -> host messages ===============================================*/
  7617. enum htt_t2h_msg_type {
  7618. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7619. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7620. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7621. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7622. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7623. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7624. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7625. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7626. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7627. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7628. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7629. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7630. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7631. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7632. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7633. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7634. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7635. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7636. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7637. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7638. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7639. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7640. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7641. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7642. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7643. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7644. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7645. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7646. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7647. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7648. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7649. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7650. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7651. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7652. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7653. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7654. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7655. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7656. /* TX_OFFLOAD_DELIVER_IND:
  7657. * Forward the target's locally-generated packets to the host,
  7658. * to provide to the monitor mode interface.
  7659. */
  7660. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7661. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7662. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7663. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7664. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7665. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7666. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7667. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7668. HTT_T2H_MSG_TYPE_TEST,
  7669. /* keep this last */
  7670. HTT_T2H_NUM_MSGS
  7671. };
  7672. /*
  7673. * HTT target to host message type -
  7674. * stored in bits 7:0 of the first word of the message
  7675. */
  7676. #define HTT_T2H_MSG_TYPE_M 0xff
  7677. #define HTT_T2H_MSG_TYPE_S 0
  7678. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7679. do { \
  7680. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7681. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7682. } while (0)
  7683. #define HTT_T2H_MSG_TYPE_GET(word) \
  7684. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7685. /**
  7686. * @brief target -> host version number confirmation message definition
  7687. *
  7688. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7689. *
  7690. * |31 24|23 16|15 8|7 0|
  7691. * |----------------+----------------+----------------+----------------|
  7692. * | reserved | major number | minor number | msg type |
  7693. * |-------------------------------------------------------------------|
  7694. * : option request TLV (optional) |
  7695. * :...................................................................:
  7696. *
  7697. * The VER_CONF message may consist of a single 4-byte word, or may be
  7698. * extended with TLVs that specify HTT options selected by the target.
  7699. * The following option TLVs may be appended to the VER_CONF message:
  7700. * - LL_BUS_ADDR_SIZE
  7701. * - HL_SUPPRESS_TX_COMPL_IND
  7702. * - MAX_TX_QUEUE_GROUPS
  7703. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7704. * may be appended to the VER_CONF message (but only one TLV of each type).
  7705. *
  7706. * Header fields:
  7707. * - MSG_TYPE
  7708. * Bits 7:0
  7709. * Purpose: identifies this as a version number confirmation message
  7710. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7711. * - VER_MINOR
  7712. * Bits 15:8
  7713. * Purpose: Specify the minor number of the HTT message library version
  7714. * in use by the target firmware.
  7715. * The minor number specifies the specific revision within a range
  7716. * of fundamentally compatible HTT message definition revisions.
  7717. * Compatible revisions involve adding new messages or perhaps
  7718. * adding new fields to existing messages, in a backwards-compatible
  7719. * manner.
  7720. * Incompatible revisions involve changing the message type values,
  7721. * or redefining existing messages.
  7722. * Value: minor number
  7723. * - VER_MAJOR
  7724. * Bits 15:8
  7725. * Purpose: Specify the major number of the HTT message library version
  7726. * in use by the target firmware.
  7727. * The major number specifies the family of minor revisions that are
  7728. * fundamentally compatible with each other, but not with prior or
  7729. * later families.
  7730. * Value: major number
  7731. */
  7732. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7733. #define HTT_VER_CONF_MINOR_S 8
  7734. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7735. #define HTT_VER_CONF_MAJOR_S 16
  7736. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7737. do { \
  7738. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7739. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7740. } while (0)
  7741. #define HTT_VER_CONF_MINOR_GET(word) \
  7742. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7743. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7746. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7747. } while (0)
  7748. #define HTT_VER_CONF_MAJOR_GET(word) \
  7749. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7750. #define HTT_VER_CONF_BYTES 4
  7751. /**
  7752. * @brief - target -> host HTT Rx In order indication message
  7753. *
  7754. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7755. *
  7756. * @details
  7757. *
  7758. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7759. * |----------------+-------------------+---------------------+---------------|
  7760. * | peer ID | P| F| O| ext TID | msg type |
  7761. * |--------------------------------------------------------------------------|
  7762. * | MSDU count | Reserved | vdev id |
  7763. * |--------------------------------------------------------------------------|
  7764. * | MSDU 0 bus address (bits 31:0) |
  7765. #if HTT_PADDR64
  7766. * | MSDU 0 bus address (bits 63:32) |
  7767. #endif
  7768. * |--------------------------------------------------------------------------|
  7769. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7770. * |--------------------------------------------------------------------------|
  7771. * | MSDU 1 bus address (bits 31:0) |
  7772. #if HTT_PADDR64
  7773. * | MSDU 1 bus address (bits 63:32) |
  7774. #endif
  7775. * |--------------------------------------------------------------------------|
  7776. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7777. * |--------------------------------------------------------------------------|
  7778. */
  7779. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7780. *
  7781. * @details
  7782. * bits
  7783. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7784. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7785. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7786. * | | frag | | | | fail |chksum fail|
  7787. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7788. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7789. */
  7790. struct htt_rx_in_ord_paddr_ind_hdr_t
  7791. {
  7792. A_UINT32 /* word 0 */
  7793. msg_type: 8,
  7794. ext_tid: 5,
  7795. offload: 1,
  7796. frag: 1,
  7797. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7798. peer_id: 16;
  7799. A_UINT32 /* word 1 */
  7800. vap_id: 8,
  7801. /* NOTE:
  7802. * This reserved_1 field is not truly reserved - certain targets use
  7803. * this field internally to store debug information, and do not zero
  7804. * out the contents of the field before uploading the message to the
  7805. * host. Thus, any host-target communication supported by this field
  7806. * is limited to using values that are never used by the debug
  7807. * information stored by certain targets in the reserved_1 field.
  7808. * In particular, the targets in question don't use the value 0x3
  7809. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7810. * so this previously-unused value within these bits is available to
  7811. * use as the host / target PKT_CAPTURE_MODE flag.
  7812. */
  7813. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7814. /* if pkt_capture_mode == 0x3, host should
  7815. * send rx frames to monitor mode interface
  7816. */
  7817. msdu_cnt: 16;
  7818. };
  7819. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7820. {
  7821. A_UINT32 dma_addr;
  7822. A_UINT32
  7823. length: 16,
  7824. fw_desc: 8,
  7825. msdu_info:8;
  7826. };
  7827. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7828. {
  7829. A_UINT32 dma_addr_lo;
  7830. A_UINT32 dma_addr_hi;
  7831. A_UINT32
  7832. length: 16,
  7833. fw_desc: 8,
  7834. msdu_info:8;
  7835. };
  7836. #if HTT_PADDR64
  7837. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7838. #else
  7839. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7840. #endif
  7841. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7842. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7843. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7844. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7845. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7846. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7847. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7848. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7849. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7850. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7851. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7852. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7853. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7854. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7855. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7856. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7857. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7858. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7859. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7860. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7861. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7862. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7863. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7864. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7865. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7866. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7867. /* for systems using 64-bit format for bus addresses */
  7868. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7869. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7870. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7871. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7872. /* for systems using 32-bit format for bus addresses */
  7873. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7874. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7875. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7876. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7877. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7878. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7879. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7880. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7881. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7882. do { \
  7883. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7884. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7885. } while (0)
  7886. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7887. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7888. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7889. do { \
  7890. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7891. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7892. } while (0)
  7893. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7894. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7895. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7896. do { \
  7897. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7898. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7899. } while (0)
  7900. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7901. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7902. /*
  7903. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7904. * deliver the rx frames to the monitor mode interface.
  7905. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7906. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7907. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7908. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7909. */
  7910. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7911. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7914. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7915. } while (0)
  7916. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7917. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7918. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7919. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7920. do { \
  7921. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7922. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7923. } while (0)
  7924. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7925. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7926. /* for systems using 64-bit format for bus addresses */
  7927. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7928. do { \
  7929. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7930. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7931. } while (0)
  7932. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7933. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7934. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7935. do { \
  7936. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7937. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7938. } while (0)
  7939. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7940. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7941. /* for systems using 32-bit format for bus addresses */
  7942. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7943. do { \
  7944. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7945. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7946. } while (0)
  7947. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7948. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7949. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7950. do { \
  7951. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7952. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7953. } while (0)
  7954. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7955. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7956. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7959. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7960. } while (0)
  7961. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7962. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7963. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7966. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7967. } while (0)
  7968. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7969. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7970. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7973. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7974. } while (0)
  7975. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7976. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7977. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7980. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7981. } while (0)
  7982. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7983. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7984. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7985. do { \
  7986. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7987. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7988. } while (0)
  7989. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7990. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7991. /* definitions used within target -> host rx indication message */
  7992. PREPACK struct htt_rx_ind_hdr_prefix_t
  7993. {
  7994. A_UINT32 /* word 0 */
  7995. msg_type: 8,
  7996. ext_tid: 5,
  7997. release_valid: 1,
  7998. flush_valid: 1,
  7999. reserved0: 1,
  8000. peer_id: 16;
  8001. A_UINT32 /* word 1 */
  8002. flush_start_seq_num: 6,
  8003. flush_end_seq_num: 6,
  8004. release_start_seq_num: 6,
  8005. release_end_seq_num: 6,
  8006. num_mpdu_ranges: 8;
  8007. } POSTPACK;
  8008. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8009. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8010. #define HTT_TGT_RSSI_INVALID 0x80
  8011. PREPACK struct htt_rx_ppdu_desc_t
  8012. {
  8013. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8014. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8015. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8016. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8017. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8018. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8019. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8020. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8021. A_UINT32 /* word 0 */
  8022. rssi_cmb: 8,
  8023. timestamp_submicrosec: 8,
  8024. phy_err_code: 8,
  8025. phy_err: 1,
  8026. legacy_rate: 4,
  8027. legacy_rate_sel: 1,
  8028. end_valid: 1,
  8029. start_valid: 1;
  8030. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8031. union {
  8032. A_UINT32 /* word 1 */
  8033. rssi0_pri20: 8,
  8034. rssi0_ext20: 8,
  8035. rssi0_ext40: 8,
  8036. rssi0_ext80: 8;
  8037. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8038. } u0;
  8039. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8040. union {
  8041. A_UINT32 /* word 2 */
  8042. rssi1_pri20: 8,
  8043. rssi1_ext20: 8,
  8044. rssi1_ext40: 8,
  8045. rssi1_ext80: 8;
  8046. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8047. } u1;
  8048. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8049. union {
  8050. A_UINT32 /* word 3 */
  8051. rssi2_pri20: 8,
  8052. rssi2_ext20: 8,
  8053. rssi2_ext40: 8,
  8054. rssi2_ext80: 8;
  8055. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8056. } u2;
  8057. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8058. union {
  8059. A_UINT32 /* word 4 */
  8060. rssi3_pri20: 8,
  8061. rssi3_ext20: 8,
  8062. rssi3_ext40: 8,
  8063. rssi3_ext80: 8;
  8064. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8065. } u3;
  8066. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8067. A_UINT32 tsf32; /* word 5 */
  8068. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8069. A_UINT32 timestamp_microsec; /* word 6 */
  8070. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8071. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8072. A_UINT32 /* word 7 */
  8073. vht_sig_a1: 24,
  8074. preamble_type: 8;
  8075. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8076. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8077. A_UINT32 /* word 8 */
  8078. vht_sig_a2: 24,
  8079. /* sa_ant_matrix
  8080. * For cases where a single rx chain has options to be connected to
  8081. * different rx antennas, show which rx antennas were in use during
  8082. * receipt of a given PPDU.
  8083. * This sa_ant_matrix provides a bitmask of the antennas used while
  8084. * receiving this frame.
  8085. */
  8086. sa_ant_matrix: 8;
  8087. } POSTPACK;
  8088. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8089. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8090. PREPACK struct htt_rx_ind_hdr_suffix_t
  8091. {
  8092. A_UINT32 /* word 0 */
  8093. fw_rx_desc_bytes: 16,
  8094. reserved0: 16;
  8095. } POSTPACK;
  8096. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8097. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8098. PREPACK struct htt_rx_ind_hdr_t
  8099. {
  8100. struct htt_rx_ind_hdr_prefix_t prefix;
  8101. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8102. struct htt_rx_ind_hdr_suffix_t suffix;
  8103. } POSTPACK;
  8104. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8105. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8106. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8107. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8108. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8109. /*
  8110. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8111. * the offset into the HTT rx indication message at which the
  8112. * FW rx PPDU descriptor resides
  8113. */
  8114. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8115. /*
  8116. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8117. * the offset into the HTT rx indication message at which the
  8118. * header suffix (FW rx MSDU byte count) resides
  8119. */
  8120. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8121. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8122. /*
  8123. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8124. * the offset into the HTT rx indication message at which the per-MSDU
  8125. * information starts
  8126. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8127. * per-MSDU information portion of the message. The per-MSDU info itself
  8128. * starts at byte 12.
  8129. */
  8130. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8131. /**
  8132. * @brief target -> host rx indication message definition
  8133. *
  8134. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8135. *
  8136. * @details
  8137. * The following field definitions describe the format of the rx indication
  8138. * message sent from the target to the host.
  8139. * The message consists of three major sections:
  8140. * 1. a fixed-length header
  8141. * 2. a variable-length list of firmware rx MSDU descriptors
  8142. * 3. one or more 4-octet MPDU range information elements
  8143. * The fixed length header itself has two sub-sections
  8144. * 1. the message meta-information, including identification of the
  8145. * sender and type of the received data, and a 4-octet flush/release IE
  8146. * 2. the firmware rx PPDU descriptor
  8147. *
  8148. * The format of the message is depicted below.
  8149. * in this depiction, the following abbreviations are used for information
  8150. * elements within the message:
  8151. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8152. * elements associated with the PPDU start are valid.
  8153. * Specifically, the following fields are valid only if SV is set:
  8154. * RSSI (all variants), L, legacy rate, preamble type, service,
  8155. * VHT-SIG-A
  8156. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8157. * elements associated with the PPDU end are valid.
  8158. * Specifically, the following fields are valid only if EV is set:
  8159. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8160. * - L - Legacy rate selector - if legacy rates are used, this flag
  8161. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8162. * (L == 0) PHY.
  8163. * - P - PHY error flag - boolean indication of whether the rx frame had
  8164. * a PHY error
  8165. *
  8166. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8167. * |----------------+-------------------+---------------------+---------------|
  8168. * | peer ID | |RV|FV| ext TID | msg type |
  8169. * |--------------------------------------------------------------------------|
  8170. * | num | release | release | flush | flush |
  8171. * | MPDU | end | start | end | start |
  8172. * | ranges | seq num | seq num | seq num | seq num |
  8173. * |==========================================================================|
  8174. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8175. * |V|V| | rate | | | timestamp | RSSI |
  8176. * |--------------------------------------------------------------------------|
  8177. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8178. * |--------------------------------------------------------------------------|
  8179. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8180. * |--------------------------------------------------------------------------|
  8181. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8182. * |--------------------------------------------------------------------------|
  8183. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8184. * |--------------------------------------------------------------------------|
  8185. * | TSF LSBs |
  8186. * |--------------------------------------------------------------------------|
  8187. * | microsec timestamp |
  8188. * |--------------------------------------------------------------------------|
  8189. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8190. * |--------------------------------------------------------------------------|
  8191. * | service | HT-SIG / VHT-SIG-A2 |
  8192. * |==========================================================================|
  8193. * | reserved | FW rx desc bytes |
  8194. * |--------------------------------------------------------------------------|
  8195. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8196. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8197. * |--------------------------------------------------------------------------|
  8198. * : : :
  8199. * |--------------------------------------------------------------------------|
  8200. * | alignment | MSDU Rx |
  8201. * | padding | desc Bn |
  8202. * |--------------------------------------------------------------------------|
  8203. * | reserved | MPDU range status | MPDU count |
  8204. * |--------------------------------------------------------------------------|
  8205. * : reserved : MPDU range status : MPDU count :
  8206. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8207. *
  8208. * Header fields:
  8209. * - MSG_TYPE
  8210. * Bits 7:0
  8211. * Purpose: identifies this as an rx indication message
  8212. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8213. * - EXT_TID
  8214. * Bits 12:8
  8215. * Purpose: identify the traffic ID of the rx data, including
  8216. * special "extended" TID values for multicast, broadcast, and
  8217. * non-QoS data frames
  8218. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8219. * - FLUSH_VALID (FV)
  8220. * Bit 13
  8221. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8222. * is valid
  8223. * Value:
  8224. * 1 -> flush IE is valid and needs to be processed
  8225. * 0 -> flush IE is not valid and should be ignored
  8226. * - REL_VALID (RV)
  8227. * Bit 13
  8228. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8229. * is valid
  8230. * Value:
  8231. * 1 -> release IE is valid and needs to be processed
  8232. * 0 -> release IE is not valid and should be ignored
  8233. * - PEER_ID
  8234. * Bits 31:16
  8235. * Purpose: Identify, by ID, which peer sent the rx data
  8236. * Value: ID of the peer who sent the rx data
  8237. * - FLUSH_SEQ_NUM_START
  8238. * Bits 5:0
  8239. * Purpose: Indicate the start of a series of MPDUs to flush
  8240. * Not all MPDUs within this series are necessarily valid - the host
  8241. * must check each sequence number within this range to see if the
  8242. * corresponding MPDU is actually present.
  8243. * This field is only valid if the FV bit is set.
  8244. * Value:
  8245. * The sequence number for the first MPDUs to check to flush.
  8246. * The sequence number is masked by 0x3f.
  8247. * - FLUSH_SEQ_NUM_END
  8248. * Bits 11:6
  8249. * Purpose: Indicate the end of a series of MPDUs to flush
  8250. * Value:
  8251. * The sequence number one larger than the sequence number of the
  8252. * last MPDU to check to flush.
  8253. * The sequence number is masked by 0x3f.
  8254. * Not all MPDUs within this series are necessarily valid - the host
  8255. * must check each sequence number within this range to see if the
  8256. * corresponding MPDU is actually present.
  8257. * This field is only valid if the FV bit is set.
  8258. * - REL_SEQ_NUM_START
  8259. * Bits 17:12
  8260. * Purpose: Indicate the start of a series of MPDUs to release.
  8261. * All MPDUs within this series are present and valid - the host
  8262. * need not check each sequence number within this range to see if
  8263. * the corresponding MPDU is actually present.
  8264. * This field is only valid if the RV bit is set.
  8265. * Value:
  8266. * The sequence number for the first MPDUs to check to release.
  8267. * The sequence number is masked by 0x3f.
  8268. * - REL_SEQ_NUM_END
  8269. * Bits 23:18
  8270. * Purpose: Indicate the end of a series of MPDUs to release.
  8271. * Value:
  8272. * The sequence number one larger than the sequence number of the
  8273. * last MPDU to check to release.
  8274. * The sequence number is masked by 0x3f.
  8275. * All MPDUs within this series are present and valid - the host
  8276. * need not check each sequence number within this range to see if
  8277. * the corresponding MPDU is actually present.
  8278. * This field is only valid if the RV bit is set.
  8279. * - NUM_MPDU_RANGES
  8280. * Bits 31:24
  8281. * Purpose: Indicate how many ranges of MPDUs are present.
  8282. * Each MPDU range consists of a series of contiguous MPDUs within the
  8283. * rx frame sequence which all have the same MPDU status.
  8284. * Value: 1-63 (typically a small number, like 1-3)
  8285. *
  8286. * Rx PPDU descriptor fields:
  8287. * - RSSI_CMB
  8288. * Bits 7:0
  8289. * Purpose: Combined RSSI from all active rx chains, across the active
  8290. * bandwidth.
  8291. * Value: RSSI dB units w.r.t. noise floor
  8292. * - TIMESTAMP_SUBMICROSEC
  8293. * Bits 15:8
  8294. * Purpose: high-resolution timestamp
  8295. * Value:
  8296. * Sub-microsecond time of PPDU reception.
  8297. * This timestamp ranges from [0,MAC clock MHz).
  8298. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8299. * to form a high-resolution, large range rx timestamp.
  8300. * - PHY_ERR_CODE
  8301. * Bits 23:16
  8302. * Purpose:
  8303. * If the rx frame processing resulted in a PHY error, indicate what
  8304. * type of rx PHY error occurred.
  8305. * Value:
  8306. * This field is valid if the "P" (PHY_ERR) flag is set.
  8307. * TBD: document/specify the values for this field
  8308. * - PHY_ERR
  8309. * Bit 24
  8310. * Purpose: indicate whether the rx PPDU had a PHY error
  8311. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8312. * - LEGACY_RATE
  8313. * Bits 28:25
  8314. * Purpose:
  8315. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8316. * specify which rate was used.
  8317. * Value:
  8318. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8319. * flag.
  8320. * If LEGACY_RATE_SEL is 0:
  8321. * 0x8: OFDM 48 Mbps
  8322. * 0x9: OFDM 24 Mbps
  8323. * 0xA: OFDM 12 Mbps
  8324. * 0xB: OFDM 6 Mbps
  8325. * 0xC: OFDM 54 Mbps
  8326. * 0xD: OFDM 36 Mbps
  8327. * 0xE: OFDM 18 Mbps
  8328. * 0xF: OFDM 9 Mbps
  8329. * If LEGACY_RATE_SEL is 1:
  8330. * 0x8: CCK 11 Mbps long preamble
  8331. * 0x9: CCK 5.5 Mbps long preamble
  8332. * 0xA: CCK 2 Mbps long preamble
  8333. * 0xB: CCK 1 Mbps long preamble
  8334. * 0xC: CCK 11 Mbps short preamble
  8335. * 0xD: CCK 5.5 Mbps short preamble
  8336. * 0xE: CCK 2 Mbps short preamble
  8337. * - LEGACY_RATE_SEL
  8338. * Bit 29
  8339. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8340. * Value:
  8341. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8342. * used a legacy rate.
  8343. * 0 -> OFDM, 1 -> CCK
  8344. * - END_VALID
  8345. * Bit 30
  8346. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8347. * the start of the PPDU are valid. Specifically, the following
  8348. * fields are only valid if END_VALID is set:
  8349. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8350. * TIMESTAMP_SUBMICROSEC
  8351. * Value:
  8352. * 0 -> rx PPDU desc end fields are not valid
  8353. * 1 -> rx PPDU desc end fields are valid
  8354. * - START_VALID
  8355. * Bit 31
  8356. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8357. * the end of the PPDU are valid. Specifically, the following
  8358. * fields are only valid if START_VALID is set:
  8359. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8360. * VHT-SIG-A
  8361. * Value:
  8362. * 0 -> rx PPDU desc start fields are not valid
  8363. * 1 -> rx PPDU desc start fields are valid
  8364. * - RSSI0_PRI20
  8365. * Bits 7:0
  8366. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8367. * Value: RSSI dB units w.r.t. noise floor
  8368. *
  8369. * - RSSI0_EXT20
  8370. * Bits 7:0
  8371. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8372. * (if the rx bandwidth was >= 40 MHz)
  8373. * Value: RSSI dB units w.r.t. noise floor
  8374. * - RSSI0_EXT40
  8375. * Bits 7:0
  8376. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8377. * (if the rx bandwidth was >= 80 MHz)
  8378. * Value: RSSI dB units w.r.t. noise floor
  8379. * - RSSI0_EXT80
  8380. * Bits 7:0
  8381. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8382. * (if the rx bandwidth was >= 160 MHz)
  8383. * Value: RSSI dB units w.r.t. noise floor
  8384. *
  8385. * - RSSI1_PRI20
  8386. * Bits 7:0
  8387. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8388. * Value: RSSI dB units w.r.t. noise floor
  8389. * - RSSI1_EXT20
  8390. * Bits 7:0
  8391. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8392. * (if the rx bandwidth was >= 40 MHz)
  8393. * Value: RSSI dB units w.r.t. noise floor
  8394. * - RSSI1_EXT40
  8395. * Bits 7:0
  8396. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8397. * (if the rx bandwidth was >= 80 MHz)
  8398. * Value: RSSI dB units w.r.t. noise floor
  8399. * - RSSI1_EXT80
  8400. * Bits 7:0
  8401. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8402. * (if the rx bandwidth was >= 160 MHz)
  8403. * Value: RSSI dB units w.r.t. noise floor
  8404. *
  8405. * - RSSI2_PRI20
  8406. * Bits 7:0
  8407. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8408. * Value: RSSI dB units w.r.t. noise floor
  8409. * - RSSI2_EXT20
  8410. * Bits 7:0
  8411. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8412. * (if the rx bandwidth was >= 40 MHz)
  8413. * Value: RSSI dB units w.r.t. noise floor
  8414. * - RSSI2_EXT40
  8415. * Bits 7:0
  8416. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8417. * (if the rx bandwidth was >= 80 MHz)
  8418. * Value: RSSI dB units w.r.t. noise floor
  8419. * - RSSI2_EXT80
  8420. * Bits 7:0
  8421. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8422. * (if the rx bandwidth was >= 160 MHz)
  8423. * Value: RSSI dB units w.r.t. noise floor
  8424. *
  8425. * - RSSI3_PRI20
  8426. * Bits 7:0
  8427. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8428. * Value: RSSI dB units w.r.t. noise floor
  8429. * - RSSI3_EXT20
  8430. * Bits 7:0
  8431. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8432. * (if the rx bandwidth was >= 40 MHz)
  8433. * Value: RSSI dB units w.r.t. noise floor
  8434. * - RSSI3_EXT40
  8435. * Bits 7:0
  8436. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8437. * (if the rx bandwidth was >= 80 MHz)
  8438. * Value: RSSI dB units w.r.t. noise floor
  8439. * - RSSI3_EXT80
  8440. * Bits 7:0
  8441. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8442. * (if the rx bandwidth was >= 160 MHz)
  8443. * Value: RSSI dB units w.r.t. noise floor
  8444. *
  8445. * - TSF32
  8446. * Bits 31:0
  8447. * Purpose: specify the time the rx PPDU was received, in TSF units
  8448. * Value: 32 LSBs of the TSF
  8449. * - TIMESTAMP_MICROSEC
  8450. * Bits 31:0
  8451. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8452. * Value: PPDU rx time, in microseconds
  8453. * - VHT_SIG_A1
  8454. * Bits 23:0
  8455. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8456. * from the rx PPDU
  8457. * Value:
  8458. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8459. * VHT-SIG-A1 data.
  8460. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8461. * first 24 bits of the HT-SIG data.
  8462. * Otherwise, this field is invalid.
  8463. * Refer to the the 802.11 protocol for the definition of the
  8464. * HT-SIG and VHT-SIG-A1 fields
  8465. * - VHT_SIG_A2
  8466. * Bits 23:0
  8467. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8468. * from the rx PPDU
  8469. * Value:
  8470. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8471. * VHT-SIG-A2 data.
  8472. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8473. * last 24 bits of the HT-SIG data.
  8474. * Otherwise, this field is invalid.
  8475. * Refer to the the 802.11 protocol for the definition of the
  8476. * HT-SIG and VHT-SIG-A2 fields
  8477. * - PREAMBLE_TYPE
  8478. * Bits 31:24
  8479. * Purpose: indicate the PHY format of the received burst
  8480. * Value:
  8481. * 0x4: Legacy (OFDM/CCK)
  8482. * 0x8: HT
  8483. * 0x9: HT with TxBF
  8484. * 0xC: VHT
  8485. * 0xD: VHT with TxBF
  8486. * - SERVICE
  8487. * Bits 31:24
  8488. * Purpose: TBD
  8489. * Value: TBD
  8490. *
  8491. * Rx MSDU descriptor fields:
  8492. * - FW_RX_DESC_BYTES
  8493. * Bits 15:0
  8494. * Purpose: Indicate how many bytes in the Rx indication are used for
  8495. * FW Rx descriptors
  8496. *
  8497. * Payload fields:
  8498. * - MPDU_COUNT
  8499. * Bits 7:0
  8500. * Purpose: Indicate how many sequential MPDUs share the same status.
  8501. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8502. * - MPDU_STATUS
  8503. * Bits 15:8
  8504. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8505. * received successfully.
  8506. * Value:
  8507. * 0x1: success
  8508. * 0x2: FCS error
  8509. * 0x3: duplicate error
  8510. * 0x4: replay error
  8511. * 0x5: invalid peer
  8512. */
  8513. /* header fields */
  8514. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8515. #define HTT_RX_IND_EXT_TID_S 8
  8516. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8517. #define HTT_RX_IND_FLUSH_VALID_S 13
  8518. #define HTT_RX_IND_REL_VALID_M 0x4000
  8519. #define HTT_RX_IND_REL_VALID_S 14
  8520. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8521. #define HTT_RX_IND_PEER_ID_S 16
  8522. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8523. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8524. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8525. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8526. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8527. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8528. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8529. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8530. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8531. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8532. /* rx PPDU descriptor fields */
  8533. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8534. #define HTT_RX_IND_RSSI_CMB_S 0
  8535. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8536. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8537. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8538. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8539. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8540. #define HTT_RX_IND_PHY_ERR_S 24
  8541. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8542. #define HTT_RX_IND_LEGACY_RATE_S 25
  8543. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8544. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8545. #define HTT_RX_IND_END_VALID_M 0x40000000
  8546. #define HTT_RX_IND_END_VALID_S 30
  8547. #define HTT_RX_IND_START_VALID_M 0x80000000
  8548. #define HTT_RX_IND_START_VALID_S 31
  8549. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8550. #define HTT_RX_IND_RSSI_PRI20_S 0
  8551. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8552. #define HTT_RX_IND_RSSI_EXT20_S 8
  8553. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8554. #define HTT_RX_IND_RSSI_EXT40_S 16
  8555. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8556. #define HTT_RX_IND_RSSI_EXT80_S 24
  8557. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8558. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8559. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8560. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8561. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8562. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8563. #define HTT_RX_IND_SERVICE_M 0xff000000
  8564. #define HTT_RX_IND_SERVICE_S 24
  8565. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8566. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8567. /* rx MSDU descriptor fields */
  8568. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8569. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8570. /* payload fields */
  8571. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8572. #define HTT_RX_IND_MPDU_COUNT_S 0
  8573. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8574. #define HTT_RX_IND_MPDU_STATUS_S 8
  8575. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8576. do { \
  8577. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8578. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8579. } while (0)
  8580. #define HTT_RX_IND_EXT_TID_GET(word) \
  8581. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8582. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8585. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8586. } while (0)
  8587. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8588. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8589. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8592. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8593. } while (0)
  8594. #define HTT_RX_IND_REL_VALID_GET(word) \
  8595. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8596. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8597. do { \
  8598. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8599. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8600. } while (0)
  8601. #define HTT_RX_IND_PEER_ID_GET(word) \
  8602. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8603. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8604. do { \
  8605. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8606. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8607. } while (0)
  8608. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8609. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8610. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8613. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8614. } while (0)
  8615. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8616. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8617. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8618. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8621. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8622. } while (0)
  8623. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8624. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8625. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8626. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8627. do { \
  8628. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8629. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8630. } while (0)
  8631. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8632. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8633. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8634. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8637. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8638. } while (0)
  8639. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8640. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8641. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8642. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8643. do { \
  8644. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8645. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8646. } while (0)
  8647. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8648. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8649. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8650. /* FW rx PPDU descriptor fields */
  8651. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8652. do { \
  8653. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8654. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8655. } while (0)
  8656. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8657. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8658. HTT_RX_IND_RSSI_CMB_S)
  8659. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8660. do { \
  8661. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8662. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8663. } while (0)
  8664. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8665. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8666. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8667. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8668. do { \
  8669. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8670. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8671. } while (0)
  8672. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8673. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8674. HTT_RX_IND_PHY_ERR_CODE_S)
  8675. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8676. do { \
  8677. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8678. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8679. } while (0)
  8680. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8681. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8682. HTT_RX_IND_PHY_ERR_S)
  8683. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8684. do { \
  8685. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8686. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8687. } while (0)
  8688. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8689. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8690. HTT_RX_IND_LEGACY_RATE_S)
  8691. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8692. do { \
  8693. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8694. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8695. } while (0)
  8696. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8697. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8698. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8699. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8700. do { \
  8701. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8702. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8703. } while (0)
  8704. #define HTT_RX_IND_END_VALID_GET(word) \
  8705. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8706. HTT_RX_IND_END_VALID_S)
  8707. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8708. do { \
  8709. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8710. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8711. } while (0)
  8712. #define HTT_RX_IND_START_VALID_GET(word) \
  8713. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8714. HTT_RX_IND_START_VALID_S)
  8715. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8716. do { \
  8717. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8718. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8719. } while (0)
  8720. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8721. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8722. HTT_RX_IND_RSSI_PRI20_S)
  8723. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8726. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8727. } while (0)
  8728. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8729. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8730. HTT_RX_IND_RSSI_EXT20_S)
  8731. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8732. do { \
  8733. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8734. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8735. } while (0)
  8736. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8737. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8738. HTT_RX_IND_RSSI_EXT40_S)
  8739. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8740. do { \
  8741. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8742. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8743. } while (0)
  8744. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8745. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8746. HTT_RX_IND_RSSI_EXT80_S)
  8747. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8748. do { \
  8749. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8750. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8751. } while (0)
  8752. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8753. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8754. HTT_RX_IND_VHT_SIG_A1_S)
  8755. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8756. do { \
  8757. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8758. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8759. } while (0)
  8760. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8761. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8762. HTT_RX_IND_VHT_SIG_A2_S)
  8763. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8766. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8767. } while (0)
  8768. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8769. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8770. HTT_RX_IND_PREAMBLE_TYPE_S)
  8771. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8772. do { \
  8773. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8774. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8775. } while (0)
  8776. #define HTT_RX_IND_SERVICE_GET(word) \
  8777. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8778. HTT_RX_IND_SERVICE_S)
  8779. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8780. do { \
  8781. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8782. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8783. } while (0)
  8784. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8785. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8786. HTT_RX_IND_SA_ANT_MATRIX_S)
  8787. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8788. do { \
  8789. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8790. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8791. } while (0)
  8792. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8793. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8794. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8795. do { \
  8796. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8797. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8798. } while (0)
  8799. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8800. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8801. #define HTT_RX_IND_HL_BYTES \
  8802. (HTT_RX_IND_HDR_BYTES + \
  8803. 4 /* single FW rx MSDU descriptor */ + \
  8804. 4 /* single MPDU range information element */)
  8805. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8806. /* Could we use one macro entry? */
  8807. #define HTT_WORD_SET(word, field, value) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(field, value); \
  8810. (word) |= ((value) << field ## _S); \
  8811. } while (0)
  8812. #define HTT_WORD_GET(word, field) \
  8813. (((word) & field ## _M) >> field ## _S)
  8814. PREPACK struct hl_htt_rx_ind_base {
  8815. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8816. } POSTPACK;
  8817. /*
  8818. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8819. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8820. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8821. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8822. * htt_rx_ind_hl_rx_desc_t.
  8823. */
  8824. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8825. struct htt_rx_ind_hl_rx_desc_t {
  8826. A_UINT8 ver;
  8827. A_UINT8 len;
  8828. struct {
  8829. A_UINT8
  8830. first_msdu: 1,
  8831. last_msdu: 1,
  8832. c3_failed: 1,
  8833. c4_failed: 1,
  8834. ipv6: 1,
  8835. tcp: 1,
  8836. udp: 1,
  8837. reserved: 1;
  8838. } flags;
  8839. /* NOTE: no reserved space - don't append any new fields here */
  8840. };
  8841. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8842. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8843. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8844. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8845. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8846. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8847. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8848. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8849. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8850. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8851. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8852. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8853. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8854. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8855. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8856. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8857. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8858. /* This structure is used in HL, the basic descriptor information
  8859. * used by host. the structure is translated by FW from HW desc
  8860. * or generated by FW. But in HL monitor mode, the host would use
  8861. * the same structure with LL.
  8862. */
  8863. PREPACK struct hl_htt_rx_desc_base {
  8864. A_UINT32
  8865. seq_num:12,
  8866. encrypted:1,
  8867. chan_info_present:1,
  8868. resv0:2,
  8869. mcast_bcast:1,
  8870. fragment:1,
  8871. key_id_oct:8,
  8872. resv1:6;
  8873. A_UINT32
  8874. pn_31_0;
  8875. union {
  8876. struct {
  8877. A_UINT16 pn_47_32;
  8878. A_UINT16 pn_63_48;
  8879. } pn16;
  8880. A_UINT32 pn_63_32;
  8881. } u0;
  8882. A_UINT32
  8883. pn_95_64;
  8884. A_UINT32
  8885. pn_127_96;
  8886. } POSTPACK;
  8887. /*
  8888. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8889. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8890. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8891. * Please see htt_chan_change_t for description of the fields.
  8892. */
  8893. PREPACK struct htt_chan_info_t
  8894. {
  8895. A_UINT32 primary_chan_center_freq_mhz: 16,
  8896. contig_chan1_center_freq_mhz: 16;
  8897. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8898. phy_mode: 8,
  8899. reserved: 8;
  8900. } POSTPACK;
  8901. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8902. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8903. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8904. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8905. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8906. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8907. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8908. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8909. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8910. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8911. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8912. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8913. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8914. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8915. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8916. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8917. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8918. /* Channel information */
  8919. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8920. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8921. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8922. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8923. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8924. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8925. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8926. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8927. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8928. do { \
  8929. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8930. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8931. } while (0)
  8932. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8933. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8934. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8935. do { \
  8936. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8937. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8938. } while (0)
  8939. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8940. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8941. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8942. do { \
  8943. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8944. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8945. } while (0)
  8946. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8947. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8948. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8949. do { \
  8950. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8951. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8952. } while (0)
  8953. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8954. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8955. /*
  8956. * @brief target -> host message definition for FW offloaded pkts
  8957. *
  8958. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8959. *
  8960. * @details
  8961. * The following field definitions describe the format of the firmware
  8962. * offload deliver message sent from the target to the host.
  8963. *
  8964. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8965. *
  8966. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8967. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8968. * | reserved_1 | msg type |
  8969. * |--------------------------------------------------------------------------|
  8970. * | phy_timestamp_l32 |
  8971. * |--------------------------------------------------------------------------|
  8972. * | WORD2 (see below) |
  8973. * |--------------------------------------------------------------------------|
  8974. * | seqno | framectrl |
  8975. * |--------------------------------------------------------------------------|
  8976. * | reserved_3 | vdev_id | tid_num|
  8977. * |--------------------------------------------------------------------------|
  8978. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8979. * |--------------------------------------------------------------------------|
  8980. *
  8981. * where:
  8982. * STAT = status
  8983. * F = format (802.3 vs. 802.11)
  8984. *
  8985. * definition for word 2
  8986. *
  8987. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8988. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8989. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8990. * |--------------------------------------------------------------------------|
  8991. *
  8992. * where:
  8993. * PR = preamble
  8994. * BF = beamformed
  8995. */
  8996. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8997. {
  8998. A_UINT32 /* word 0 */
  8999. msg_type:8, /* [ 7: 0] */
  9000. reserved_1:24; /* [31: 8] */
  9001. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9002. A_UINT32 /* word 2 */
  9003. /* preamble:
  9004. * 0-OFDM,
  9005. * 1-CCk,
  9006. * 2-HT,
  9007. * 3-VHT
  9008. */
  9009. preamble: 2, /* [1:0] */
  9010. /* mcs:
  9011. * In case of HT preamble interpret
  9012. * MCS along with NSS.
  9013. * Valid values for HT are 0 to 7.
  9014. * HT mcs 0 with NSS 2 is mcs 8.
  9015. * Valid values for VHT are 0 to 9.
  9016. */
  9017. mcs: 4, /* [5:2] */
  9018. /* rate:
  9019. * This is applicable only for
  9020. * CCK and OFDM preamble type
  9021. * rate 0: OFDM 48 Mbps,
  9022. * 1: OFDM 24 Mbps,
  9023. * 2: OFDM 12 Mbps
  9024. * 3: OFDM 6 Mbps
  9025. * 4: OFDM 54 Mbps
  9026. * 5: OFDM 36 Mbps
  9027. * 6: OFDM 18 Mbps
  9028. * 7: OFDM 9 Mbps
  9029. * rate 0: CCK 11 Mbps Long
  9030. * 1: CCK 5.5 Mbps Long
  9031. * 2: CCK 2 Mbps Long
  9032. * 3: CCK 1 Mbps Long
  9033. * 4: CCK 11 Mbps Short
  9034. * 5: CCK 5.5 Mbps Short
  9035. * 6: CCK 2 Mbps Short
  9036. */
  9037. rate : 3, /* [ 8: 6] */
  9038. rssi : 8, /* [16: 9] units=dBm */
  9039. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9040. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9041. stbc : 1, /* [22] */
  9042. sgi : 1, /* [23] */
  9043. ldpc : 1, /* [24] */
  9044. beamformed: 1, /* [25] */
  9045. reserved_2: 6; /* [31:26] */
  9046. A_UINT32 /* word 3 */
  9047. framectrl:16, /* [15: 0] */
  9048. seqno:16; /* [31:16] */
  9049. A_UINT32 /* word 4 */
  9050. tid_num:5, /* [ 4: 0] actual TID number */
  9051. vdev_id:8, /* [12: 5] */
  9052. reserved_3:19; /* [31:13] */
  9053. A_UINT32 /* word 5 */
  9054. /* status:
  9055. * 0: tx_ok
  9056. * 1: retry
  9057. * 2: drop
  9058. * 3: filtered
  9059. * 4: abort
  9060. * 5: tid delete
  9061. * 6: sw abort
  9062. * 7: dropped by peer migration
  9063. */
  9064. status:3, /* [2:0] */
  9065. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9066. tx_mpdu_bytes:16, /* [19:4] */
  9067. /* Indicates retry count of offloaded/local generated Data tx frames */
  9068. tx_retry_cnt:6, /* [25:20] */
  9069. reserved_4:6; /* [31:26] */
  9070. } POSTPACK;
  9071. /* FW offload deliver ind message header fields */
  9072. /* DWORD one */
  9073. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9074. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9075. /* DWORD two */
  9076. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9077. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9078. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9079. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9080. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9081. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9082. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9083. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9084. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9085. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9086. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9087. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9088. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9089. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9090. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9091. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9092. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9093. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9094. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9095. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9096. /* DWORD three*/
  9097. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9098. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9099. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9100. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9101. /* DWORD four */
  9102. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9103. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9104. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9105. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9106. /* DWORD five */
  9107. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9108. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9109. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9110. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9111. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9112. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9113. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9114. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9115. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9116. do { \
  9117. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9118. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9119. } while (0)
  9120. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9121. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9122. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9123. do { \
  9124. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9125. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9126. } while (0)
  9127. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9128. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9129. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9130. do { \
  9131. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9132. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9133. } while (0)
  9134. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9135. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9136. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9137. do { \
  9138. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9139. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9140. } while (0)
  9141. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9142. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9143. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9144. do { \
  9145. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9146. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9147. } while (0)
  9148. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9149. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9150. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9151. do { \
  9152. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9153. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9154. } while (0)
  9155. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9156. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9157. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9158. do { \
  9159. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9160. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9161. } while (0)
  9162. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9163. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9164. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9167. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9168. } while (0)
  9169. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9170. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9171. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9172. do { \
  9173. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9174. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9175. } while (0)
  9176. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9177. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9178. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9179. do { \
  9180. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9181. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9182. } while (0)
  9183. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9184. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9185. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9188. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9189. } while (0)
  9190. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9191. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9192. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9193. do { \
  9194. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9195. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9196. } while (0)
  9197. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9198. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9199. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9200. do { \
  9201. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9202. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9203. } while (0)
  9204. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9205. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9206. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9207. do { \
  9208. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9209. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9210. } while (0)
  9211. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9212. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9213. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9214. do { \
  9215. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9216. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9217. } while (0)
  9218. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9219. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9220. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9223. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9224. } while (0)
  9225. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9226. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9227. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9228. do { \
  9229. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9230. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9231. } while (0)
  9232. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9233. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9234. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9235. do { \
  9236. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9237. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9238. } while (0)
  9239. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9240. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9241. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9242. do { \
  9243. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9244. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9245. } while (0)
  9246. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9247. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9248. /*
  9249. * @brief target -> host rx reorder flush message definition
  9250. *
  9251. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9252. *
  9253. * @details
  9254. * The following field definitions describe the format of the rx flush
  9255. * message sent from the target to the host.
  9256. * The message consists of a 4-octet header, followed by one or more
  9257. * 4-octet payload information elements.
  9258. *
  9259. * |31 24|23 8|7 0|
  9260. * |--------------------------------------------------------------|
  9261. * | TID | peer ID | msg type |
  9262. * |--------------------------------------------------------------|
  9263. * | seq num end | seq num start | MPDU status | reserved |
  9264. * |--------------------------------------------------------------|
  9265. * First DWORD:
  9266. * - MSG_TYPE
  9267. * Bits 7:0
  9268. * Purpose: identifies this as an rx flush message
  9269. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9270. * - PEER_ID
  9271. * Bits 23:8 (only bits 18:8 actually used)
  9272. * Purpose: identify which peer's rx data is being flushed
  9273. * Value: (rx) peer ID
  9274. * - TID
  9275. * Bits 31:24 (only bits 27:24 actually used)
  9276. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9277. * Value: traffic identifier
  9278. * Second DWORD:
  9279. * - MPDU_STATUS
  9280. * Bits 15:8
  9281. * Purpose:
  9282. * Indicate whether the flushed MPDUs should be discarded or processed.
  9283. * Value:
  9284. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9285. * stages of rx processing
  9286. * other: discard the MPDUs
  9287. * It is anticipated that flush messages will always have
  9288. * MPDU status == 1, but the status flag is included for
  9289. * flexibility.
  9290. * - SEQ_NUM_START
  9291. * Bits 23:16
  9292. * Purpose:
  9293. * Indicate the start of a series of consecutive MPDUs being flushed.
  9294. * Not all MPDUs within this range are necessarily valid - the host
  9295. * must check each sequence number within this range to see if the
  9296. * corresponding MPDU is actually present.
  9297. * Value:
  9298. * The sequence number for the first MPDU in the sequence.
  9299. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9300. * - SEQ_NUM_END
  9301. * Bits 30:24
  9302. * Purpose:
  9303. * Indicate the end of a series of consecutive MPDUs being flushed.
  9304. * Value:
  9305. * The sequence number one larger than the sequence number of the
  9306. * last MPDU being flushed.
  9307. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9308. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9309. * are to be released for further rx processing.
  9310. * Not all MPDUs within this range are necessarily valid - the host
  9311. * must check each sequence number within this range to see if the
  9312. * corresponding MPDU is actually present.
  9313. */
  9314. /* first DWORD */
  9315. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9316. #define HTT_RX_FLUSH_PEER_ID_S 8
  9317. #define HTT_RX_FLUSH_TID_M 0xff000000
  9318. #define HTT_RX_FLUSH_TID_S 24
  9319. /* second DWORD */
  9320. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9321. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9322. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9323. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9324. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9325. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9326. #define HTT_RX_FLUSH_BYTES 8
  9327. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9328. do { \
  9329. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9330. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9331. } while (0)
  9332. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9333. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9334. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9335. do { \
  9336. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9337. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9338. } while (0)
  9339. #define HTT_RX_FLUSH_TID_GET(word) \
  9340. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9341. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9342. do { \
  9343. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9344. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9345. } while (0)
  9346. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9347. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9348. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9349. do { \
  9350. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9351. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9352. } while (0)
  9353. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9354. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9355. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9356. do { \
  9357. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9358. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9359. } while (0)
  9360. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9361. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9362. /*
  9363. * @brief target -> host rx pn check indication message
  9364. *
  9365. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9366. *
  9367. * @details
  9368. * The following field definitions describe the format of the Rx PN check
  9369. * indication message sent from the target to the host.
  9370. * The message consists of a 4-octet header, followed by the start and
  9371. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9372. * IE is one octet containing the sequence number that failed the PN
  9373. * check.
  9374. *
  9375. * |31 24|23 8|7 0|
  9376. * |--------------------------------------------------------------|
  9377. * | TID | peer ID | msg type |
  9378. * |--------------------------------------------------------------|
  9379. * | Reserved | PN IE count | seq num end | seq num start|
  9380. * |--------------------------------------------------------------|
  9381. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9382. * |--------------------------------------------------------------|
  9383. * First DWORD:
  9384. * - MSG_TYPE
  9385. * Bits 7:0
  9386. * Purpose: Identifies this as an rx pn check indication message
  9387. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9388. * - PEER_ID
  9389. * Bits 23:8 (only bits 18:8 actually used)
  9390. * Purpose: identify which peer
  9391. * Value: (rx) peer ID
  9392. * - TID
  9393. * Bits 31:24 (only bits 27:24 actually used)
  9394. * Purpose: identify traffic identifier
  9395. * Value: traffic identifier
  9396. * Second DWORD:
  9397. * - SEQ_NUM_START
  9398. * Bits 7:0
  9399. * Purpose:
  9400. * Indicates the starting sequence number of the MPDU in this
  9401. * series of MPDUs that went though PN check.
  9402. * Value:
  9403. * The sequence number for the first MPDU in the sequence.
  9404. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9405. * - SEQ_NUM_END
  9406. * Bits 15:8
  9407. * Purpose:
  9408. * Indicates the ending sequence number of the MPDU in this
  9409. * series of MPDUs that went though PN check.
  9410. * Value:
  9411. * The sequence number one larger then the sequence number of the last
  9412. * MPDU being flushed.
  9413. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9414. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9415. * for invalid PN numbers and are ready to be released for further processing.
  9416. * Not all MPDUs within this range are necessarily valid - the host
  9417. * must check each sequence number within this range to see if the
  9418. * corresponding MPDU is actually present.
  9419. * - PN_IE_COUNT
  9420. * Bits 23:16
  9421. * Purpose:
  9422. * Used to determine the variable number of PN information elements in this
  9423. * message
  9424. *
  9425. * PN information elements:
  9426. * - PN_IE_x-
  9427. * Purpose:
  9428. * Each PN information element contains the sequence number of the MPDU that
  9429. * has failed the target PN check.
  9430. * Value:
  9431. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9432. * that failed the PN check.
  9433. */
  9434. /* first DWORD */
  9435. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9436. #define HTT_RX_PN_IND_PEER_ID_S 8
  9437. #define HTT_RX_PN_IND_TID_M 0xff000000
  9438. #define HTT_RX_PN_IND_TID_S 24
  9439. /* second DWORD */
  9440. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9441. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9442. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9443. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9444. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9445. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9446. #define HTT_RX_PN_IND_BYTES 8
  9447. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9448. do { \
  9449. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9450. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9451. } while (0)
  9452. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9453. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9454. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9455. do { \
  9456. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9457. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9458. } while (0)
  9459. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9460. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9461. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9462. do { \
  9463. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9464. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9465. } while (0)
  9466. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9467. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9468. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9469. do { \
  9470. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9471. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9472. } while (0)
  9473. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9474. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9475. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9476. do { \
  9477. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9478. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9479. } while (0)
  9480. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9481. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9482. /*
  9483. * @brief target -> host rx offload deliver message for LL system
  9484. *
  9485. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9486. *
  9487. * @details
  9488. * In a low latency system this message is sent whenever the offload
  9489. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9490. * The DMA of the actual packets into host memory is done before sending out
  9491. * this message. This message indicates only how many MSDUs to reap. The
  9492. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9493. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9494. * DMA'd by the MAC directly into host memory these packets do not contain
  9495. * the MAC descriptors in the header portion of the packet. Instead they contain
  9496. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9497. * message, the packets are delivered directly to the NW stack without going
  9498. * through the regular reorder buffering and PN checking path since it has
  9499. * already been done in target.
  9500. *
  9501. * |31 24|23 16|15 8|7 0|
  9502. * |-----------------------------------------------------------------------|
  9503. * | Total MSDU count | reserved | msg type |
  9504. * |-----------------------------------------------------------------------|
  9505. *
  9506. * @brief target -> host rx offload deliver message for HL system
  9507. *
  9508. * @details
  9509. * In a high latency system this message is sent whenever the offload manager
  9510. * flushes out the packets it has coalesced in its coalescing buffer. The
  9511. * actual packets are also carried along with this message. When the host
  9512. * receives this message, it is expected to deliver these packets to the NW
  9513. * stack directly instead of routing them through the reorder buffering and
  9514. * PN checking path since it has already been done in target.
  9515. *
  9516. * |31 24|23 16|15 8|7 0|
  9517. * |-----------------------------------------------------------------------|
  9518. * | Total MSDU count | reserved | msg type |
  9519. * |-----------------------------------------------------------------------|
  9520. * | peer ID | MSDU length |
  9521. * |-----------------------------------------------------------------------|
  9522. * | MSDU payload | FW Desc | tid | vdev ID |
  9523. * |-----------------------------------------------------------------------|
  9524. * | MSDU payload contd. |
  9525. * |-----------------------------------------------------------------------|
  9526. * | peer ID | MSDU length |
  9527. * |-----------------------------------------------------------------------|
  9528. * | MSDU payload | FW Desc | tid | vdev ID |
  9529. * |-----------------------------------------------------------------------|
  9530. * | MSDU payload contd. |
  9531. * |-----------------------------------------------------------------------|
  9532. *
  9533. */
  9534. /* first DWORD */
  9535. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9537. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9539. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9541. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9542. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9543. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9544. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9546. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9548. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9549. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9550. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9551. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9552. do { \
  9553. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9554. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9555. } while (0)
  9556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9557. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9559. do { \
  9560. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9561. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9562. } while (0)
  9563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9564. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9566. do { \
  9567. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9568. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9569. } while (0)
  9570. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9571. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9572. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9573. do { \
  9574. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9575. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9576. } while (0)
  9577. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9578. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9579. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9580. do { \
  9581. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9582. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9583. } while (0)
  9584. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9585. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9586. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9587. do { \
  9588. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9589. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9590. } while (0)
  9591. /**
  9592. * @brief target -> host rx peer map/unmap message definition
  9593. *
  9594. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9595. *
  9596. * @details
  9597. * The following diagram shows the format of the rx peer map message sent
  9598. * from the target to the host. This layout assumes the target operates
  9599. * as little-endian.
  9600. *
  9601. * This message always contains a SW peer ID. The main purpose of the
  9602. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9603. * with, so that the host can use that peer ID to determine which peer
  9604. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9605. * other purposes, such as identifying during tx completions which peer
  9606. * the tx frames in question were transmitted to.
  9607. *
  9608. * In certain generations of chips, the peer map message also contains
  9609. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9610. * to identify which peer the frame needs to be forwarded to (i.e. the
  9611. * peer assocated with the Destination MAC Address within the packet),
  9612. * and particularly which vdev needs to transmit the frame (for cases
  9613. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9614. * meaning as AST_INDEX_0.
  9615. * This DA-based peer ID that is provided for certain rx frames
  9616. * (the rx frames that need to be re-transmitted as tx frames)
  9617. * is the ID that the HW uses for referring to the peer in question,
  9618. * rather than the peer ID that the SW+FW use to refer to the peer.
  9619. *
  9620. *
  9621. * |31 24|23 16|15 8|7 0|
  9622. * |-----------------------------------------------------------------------|
  9623. * | SW peer ID | VDEV ID | msg type |
  9624. * |-----------------------------------------------------------------------|
  9625. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9626. * |-----------------------------------------------------------------------|
  9627. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9628. * |-----------------------------------------------------------------------|
  9629. *
  9630. *
  9631. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9632. *
  9633. * The following diagram shows the format of the rx peer unmap message sent
  9634. * from the target to the host.
  9635. *
  9636. * |31 24|23 16|15 8|7 0|
  9637. * |-----------------------------------------------------------------------|
  9638. * | SW peer ID | VDEV ID | msg type |
  9639. * |-----------------------------------------------------------------------|
  9640. *
  9641. * The following field definitions describe the format of the rx peer map
  9642. * and peer unmap messages sent from the target to the host.
  9643. * - MSG_TYPE
  9644. * Bits 7:0
  9645. * Purpose: identifies this as an rx peer map or peer unmap message
  9646. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9647. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9648. * - VDEV_ID
  9649. * Bits 15:8
  9650. * Purpose: Indicates which virtual device the peer is associated
  9651. * with.
  9652. * Value: vdev ID (used in the host to look up the vdev object)
  9653. * - PEER_ID (a.k.a. SW_PEER_ID)
  9654. * Bits 31:16
  9655. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9656. * freeing (unmap)
  9657. * Value: (rx) peer ID
  9658. * - MAC_ADDR_L32 (peer map only)
  9659. * Bits 31:0
  9660. * Purpose: Identifies which peer node the peer ID is for.
  9661. * Value: lower 4 bytes of peer node's MAC address
  9662. * - MAC_ADDR_U16 (peer map only)
  9663. * Bits 15:0
  9664. * Purpose: Identifies which peer node the peer ID is for.
  9665. * Value: upper 2 bytes of peer node's MAC address
  9666. * - HW_PEER_ID
  9667. * Bits 31:16
  9668. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9669. * address, so for rx frames marked for rx --> tx forwarding, the
  9670. * host can determine from the HW peer ID provided as meta-data with
  9671. * the rx frame which peer the frame is supposed to be forwarded to.
  9672. * Value: ID used by the MAC HW to identify the peer
  9673. */
  9674. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9675. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9676. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9677. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9678. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9679. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9680. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9681. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9682. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9683. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9684. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9685. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9686. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9687. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9688. do { \
  9689. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9690. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9691. } while (0)
  9692. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9693. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9694. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9695. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9696. do { \
  9697. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9698. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9699. } while (0)
  9700. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9701. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9702. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9703. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9704. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9705. do { \
  9706. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9707. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9708. } while (0)
  9709. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9710. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9711. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9712. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9713. #define HTT_RX_PEER_MAP_BYTES 12
  9714. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9715. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9716. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9717. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9718. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9719. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9720. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9721. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9722. #define HTT_RX_PEER_UNMAP_BYTES 4
  9723. /**
  9724. * @brief target -> host rx peer map V2 message definition
  9725. *
  9726. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9727. *
  9728. * @details
  9729. * The following diagram shows the format of the rx peer map v2 message sent
  9730. * from the target to the host. This layout assumes the target operates
  9731. * as little-endian.
  9732. *
  9733. * This message always contains a SW peer ID. The main purpose of the
  9734. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9735. * with, so that the host can use that peer ID to determine which peer
  9736. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9737. * other purposes, such as identifying during tx completions which peer
  9738. * the tx frames in question were transmitted to.
  9739. *
  9740. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9741. * is used during rx --> tx frame forwarding to identify which peer the
  9742. * frame needs to be forwarded to (i.e. the peer assocated with the
  9743. * Destination MAC Address within the packet), and particularly which vdev
  9744. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9745. * This DA-based peer ID that is provided for certain rx frames
  9746. * (the rx frames that need to be re-transmitted as tx frames)
  9747. * is the ID that the HW uses for referring to the peer in question,
  9748. * rather than the peer ID that the SW+FW use to refer to the peer.
  9749. *
  9750. * The HW peer id here is the same meaning as AST_INDEX_0.
  9751. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9752. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9753. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9754. * AST is valid.
  9755. *
  9756. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9757. * |-------------------------------------------------------------------------|
  9758. * | SW peer ID | VDEV ID | msg type |
  9759. * |-------------------------------------------------------------------------|
  9760. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9761. * |-------------------------------------------------------------------------|
  9762. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9763. * |-------------------------------------------------------------------------|
  9764. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9765. * |-------------------------------------------------------------------------|
  9766. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9767. * |-------------------------------------------------------------------------|
  9768. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9769. * |-------------------------------------------------------------------------|
  9770. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9771. * |-------------------------------------------------------------------------|
  9772. * | Reserved_2 |
  9773. * |-------------------------------------------------------------------------|
  9774. * Where:
  9775. * NH = Next Hop
  9776. * ASTVM = AST valid mask
  9777. * OA = on-chip AST valid bit
  9778. * ASTFM = AST flow mask
  9779. *
  9780. * The following field definitions describe the format of the rx peer map v2
  9781. * messages sent from the target to the host.
  9782. * - MSG_TYPE
  9783. * Bits 7:0
  9784. * Purpose: identifies this as an rx peer map v2 message
  9785. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9786. * - VDEV_ID
  9787. * Bits 15:8
  9788. * Purpose: Indicates which virtual device the peer is associated with.
  9789. * Value: vdev ID (used in the host to look up the vdev object)
  9790. * - SW_PEER_ID
  9791. * Bits 31:16
  9792. * Purpose: The peer ID (index) that WAL is allocating
  9793. * Value: (rx) peer ID
  9794. * - MAC_ADDR_L32
  9795. * Bits 31:0
  9796. * Purpose: Identifies which peer node the peer ID is for.
  9797. * Value: lower 4 bytes of peer node's MAC address
  9798. * - MAC_ADDR_U16
  9799. * Bits 15:0
  9800. * Purpose: Identifies which peer node the peer ID is for.
  9801. * Value: upper 2 bytes of peer node's MAC address
  9802. * - HW_PEER_ID / AST_INDEX_0
  9803. * Bits 31:16
  9804. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9805. * address, so for rx frames marked for rx --> tx forwarding, the
  9806. * host can determine from the HW peer ID provided as meta-data with
  9807. * the rx frame which peer the frame is supposed to be forwarded to.
  9808. * Value: ID used by the MAC HW to identify the peer
  9809. * - AST_HASH_VALUE
  9810. * Bits 15:0
  9811. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9812. * override feature.
  9813. * - NEXT_HOP
  9814. * Bit 16
  9815. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9816. * (Wireless Distribution System).
  9817. * - AST_VALID_MASK
  9818. * Bits 19:17
  9819. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9820. * - ONCHIP_AST_VALID_FLAG
  9821. * Bit 20
  9822. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9823. * is valid.
  9824. * - AST_INDEX_1
  9825. * Bits 15:0
  9826. * Purpose: indicate the second AST index for this peer
  9827. * - AST_0_FLOW_MASK
  9828. * Bits 19:16
  9829. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9830. * - AST_1_FLOW_MASK
  9831. * Bits 23:20
  9832. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9833. * - AST_2_FLOW_MASK
  9834. * Bits 27:24
  9835. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9836. * - AST_3_FLOW_MASK
  9837. * Bits 31:28
  9838. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9839. * - AST_INDEX_2
  9840. * Bits 15:0
  9841. * Purpose: indicate the third AST index for this peer
  9842. * - TID_VALID_HI_PRI
  9843. * Bits 23:16
  9844. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9845. * - TID_VALID_LOW_PRI
  9846. * Bits 31:24
  9847. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9848. * - AST_INDEX_3
  9849. * Bits 15:0
  9850. * Purpose: indicate the fourth AST index for this peer
  9851. * - ONCHIP_AST_IDX / RESERVED
  9852. * Bits 31:16
  9853. * Purpose: This field is valid only when split AST feature is enabled.
  9854. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9855. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9856. * address, this ast_idx is used for LMAC modules for RXPCU.
  9857. * Value: ID used by the LMAC HW to identify the peer
  9858. */
  9859. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9860. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9861. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9862. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9863. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9864. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9865. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9866. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9867. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9868. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9869. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9870. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9871. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9872. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9873. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9874. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9875. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9876. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9877. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9878. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9879. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9880. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9881. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9882. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9883. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9884. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9885. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9886. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9887. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9888. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9889. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9890. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9891. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9892. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9893. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9894. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9895. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9896. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9897. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9898. do { \
  9899. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9900. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9901. } while (0)
  9902. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9903. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9904. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9905. do { \
  9906. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9907. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9908. } while (0)
  9909. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9910. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9911. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9912. do { \
  9913. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9914. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9915. } while (0)
  9916. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9917. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9918. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9919. do { \
  9920. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9921. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9922. } while (0)
  9923. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9924. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9925. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9926. do { \
  9927. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9928. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9929. } while (0)
  9930. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9931. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9932. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9933. do { \
  9934. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9935. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9936. } while (0)
  9937. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9938. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9939. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9942. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9943. } while (0)
  9944. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9945. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9946. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9947. do { \
  9948. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9949. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9950. } while (0)
  9951. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9952. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9953. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9954. do { \
  9955. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9956. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9957. } while (0)
  9958. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9959. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9960. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9961. do { \
  9962. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9963. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9964. } while (0)
  9965. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9966. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9967. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9968. do { \
  9969. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9970. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9971. } while (0)
  9972. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9973. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9974. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9975. do { \
  9976. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9977. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9978. } while (0)
  9979. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9980. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9981. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9982. do { \
  9983. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9984. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9985. } while (0)
  9986. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9987. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9988. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9989. do { \
  9990. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9991. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9992. } while (0)
  9993. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9994. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9995. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9998. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9999. } while (0)
  10000. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10001. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10002. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10003. do { \
  10004. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10005. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10006. } while (0)
  10007. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10008. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10009. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10010. do { \
  10011. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10012. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10013. } while (0)
  10014. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10015. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10016. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10024. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10025. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10026. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10027. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10028. /**
  10029. * @brief target -> host rx peer map V3 message definition
  10030. *
  10031. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10032. *
  10033. * @details
  10034. * The following diagram shows the format of the rx peer map v3 message sent
  10035. * from the target to the host.
  10036. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10037. * This layout assumes the target operates as little-endian.
  10038. *
  10039. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10040. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10041. * | SW peer ID | VDEV ID | msg type |
  10042. * |-----------------+--------------------+-----------------+-----------------|
  10043. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10044. * |-----------------+--------------------+-----------------+-----------------|
  10045. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10046. * |-----------------+--------+-----------+-----------------+-----------------|
  10047. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10048. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10049. * | (8bits) | | (4bits) | |
  10050. * |-----------------+--------+--+--+--+--------------------------------------|
  10051. * | RESERVED |E |O | | |
  10052. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10053. * | |V |V | | |
  10054. * |-----------------+--------------------+-----------------------------------|
  10055. * | HTT_MSDU_IDX_ | RESERVED | |
  10056. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10057. * | (8bits) | | |
  10058. * |-----------------+--------------------+-----------------------------------|
  10059. * | Reserved_2 |
  10060. * |--------------------------------------------------------------------------|
  10061. * | Reserved_3 |
  10062. * |--------------------------------------------------------------------------|
  10063. *
  10064. * Where:
  10065. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10066. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10067. * NH = Next Hop
  10068. * The following field definitions describe the format of the rx peer map v3
  10069. * messages sent from the target to the host.
  10070. * - MSG_TYPE
  10071. * Bits 7:0
  10072. * Purpose: identifies this as a peer map v3 message
  10073. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10074. * - VDEV_ID
  10075. * Bits 15:8
  10076. * Purpose: Indicates which virtual device the peer is associated with.
  10077. * - SW_PEER_ID
  10078. * Bits 31:16
  10079. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10080. * - MAC_ADDR_L32
  10081. * Bits 31:0
  10082. * Purpose: Identifies which peer node the peer ID is for.
  10083. * Value: lower 4 bytes of peer node's MAC address
  10084. * - MAC_ADDR_U16
  10085. * Bits 15:0
  10086. * Purpose: Identifies which peer node the peer ID is for.
  10087. * Value: upper 2 bytes of peer node's MAC address
  10088. * - MULTICAST_SW_PEER_ID
  10089. * Bits 31:16
  10090. * Purpose: The multicast peer ID (index)
  10091. * Value: set to HTT_INVALID_PEER if not valid
  10092. * - HW_PEER_ID / AST_INDEX
  10093. * Bits 15:0
  10094. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10095. * address, so for rx frames marked for rx --> tx forwarding, the
  10096. * host can determine from the HW peer ID provided as meta-data with
  10097. * the rx frame which peer the frame is supposed to be forwarded to.
  10098. * - CACHE_SET_NUM
  10099. * Bits 19:16
  10100. * Purpose: Cache Set Number for AST_INDEX
  10101. * Cache set number that should be used to cache the index based
  10102. * search results, for address and flow search.
  10103. * This value should be equal to LSB 4 bits of the hash value
  10104. * of match data, in case of search index points to an entry which
  10105. * may be used in content based search also. The value can be
  10106. * anything when the entry pointed by search index will not be
  10107. * used for content based search.
  10108. * - HTT_MSDU_IDX_VALID_MASK
  10109. * Bits 31:24
  10110. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10111. * - ONCHIP_AST_IDX / RESERVED
  10112. * Bits 15:0
  10113. * Purpose: This field is valid only when split AST feature is enabled.
  10114. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10115. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10116. * address, this ast_idx is used for LMAC modules for RXPCU.
  10117. * - NEXT_HOP
  10118. * Bits 16
  10119. * Purpose: Flag indicates next_hop AST entry used for WDS
  10120. * (Wireless Distribution System).
  10121. * - ONCHIP_AST_VALID
  10122. * Bits 17
  10123. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10124. * - EXT_AST_VALID
  10125. * Bits 18
  10126. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10127. * - EXT_AST_INDEX
  10128. * Bits 15:0
  10129. * Purpose: This field describes Extended AST index
  10130. * Valid if EXT_AST_VALID flag set
  10131. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10132. * Bits 31:24
  10133. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10134. */
  10135. /* dword 0 */
  10136. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10137. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10138. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10139. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10140. /* dword 1 */
  10141. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10142. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10143. /* dword 2 */
  10144. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10145. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10146. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10147. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10148. /* dword 3 */
  10149. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10150. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10151. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10152. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10153. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10154. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10155. /* dword 4 */
  10156. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10157. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10158. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10159. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10160. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10161. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10162. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10163. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10164. /* dword 5 */
  10165. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10166. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10167. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10168. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10169. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10170. do { \
  10171. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10172. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10173. } while (0)
  10174. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10175. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10176. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10177. do { \
  10178. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10179. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10180. } while (0)
  10181. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10182. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10183. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10184. do { \
  10185. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10186. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10187. } while (0)
  10188. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10189. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10190. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10191. do { \
  10192. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10193. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10194. } while (0)
  10195. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10196. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10197. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10198. do { \
  10199. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10200. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10201. } while (0)
  10202. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10203. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10204. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10205. do { \
  10206. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10207. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10208. } while (0)
  10209. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10210. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10211. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10212. do { \
  10213. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10214. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10215. } while (0)
  10216. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10217. (((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)
  10218. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10219. do { \
  10220. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10221. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10222. } while (0)
  10223. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10224. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10225. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10226. do { \
  10227. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10228. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10229. } while (0)
  10230. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10231. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10232. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10233. do { \
  10234. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10235. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10236. } while (0)
  10237. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10238. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10239. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10240. do { \
  10241. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10242. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10243. } while (0)
  10244. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10245. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10246. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10247. do { \
  10248. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10249. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10250. } while (0)
  10251. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10252. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10253. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10254. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10255. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10256. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10257. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10258. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10259. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10260. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10261. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10262. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10263. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10264. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10265. /**
  10266. * @brief target -> host rx peer unmap V2 message definition
  10267. *
  10268. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10269. *
  10270. * The following diagram shows the format of the rx peer unmap message sent
  10271. * from the target to the host.
  10272. *
  10273. * |31 24|23 16|15 8|7 0|
  10274. * |-----------------------------------------------------------------------|
  10275. * | SW peer ID | VDEV ID | msg type |
  10276. * |-----------------------------------------------------------------------|
  10277. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10278. * |-----------------------------------------------------------------------|
  10279. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10280. * |-----------------------------------------------------------------------|
  10281. * | Peer Delete Duration |
  10282. * |-----------------------------------------------------------------------|
  10283. * | Reserved_0 | WDS Free Count |
  10284. * |-----------------------------------------------------------------------|
  10285. * | Reserved_1 |
  10286. * |-----------------------------------------------------------------------|
  10287. * | Reserved_2 |
  10288. * |-----------------------------------------------------------------------|
  10289. *
  10290. *
  10291. * The following field definitions describe the format of the rx peer unmap
  10292. * messages sent from the target to the host.
  10293. * - MSG_TYPE
  10294. * Bits 7:0
  10295. * Purpose: identifies this as an rx peer unmap v2 message
  10296. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10297. * - VDEV_ID
  10298. * Bits 15:8
  10299. * Purpose: Indicates which virtual device the peer is associated
  10300. * with.
  10301. * Value: vdev ID (used in the host to look up the vdev object)
  10302. * - SW_PEER_ID
  10303. * Bits 31:16
  10304. * Purpose: The peer ID (index) that WAL is freeing
  10305. * Value: (rx) peer ID
  10306. * - MAC_ADDR_L32
  10307. * Bits 31:0
  10308. * Purpose: Identifies which peer node the peer ID is for.
  10309. * Value: lower 4 bytes of peer node's MAC address
  10310. * - MAC_ADDR_U16
  10311. * Bits 15:0
  10312. * Purpose: Identifies which peer node the peer ID is for.
  10313. * Value: upper 2 bytes of peer node's MAC address
  10314. * - NEXT_HOP
  10315. * Bits 16
  10316. * Purpose: Bit indicates next_hop AST entry used for WDS
  10317. * (Wireless Distribution System).
  10318. * - PEER_DELETE_DURATION
  10319. * Bits 31:0
  10320. * Purpose: Time taken to delete peer, in msec,
  10321. * Used for monitoring / debugging PEER delete response delay
  10322. * - PEER_WDS_FREE_COUNT
  10323. * Bits 15:0
  10324. * Purpose: Count of WDS entries deleted associated to peer deleted
  10325. */
  10326. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10327. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10328. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10329. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10330. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10331. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10332. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10333. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10334. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10335. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10336. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10337. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10338. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10339. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10340. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10341. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10342. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10343. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10344. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10345. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10346. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10347. do { \
  10348. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10349. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10350. } while (0)
  10351. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10352. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10353. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10354. do { \
  10355. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10356. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10357. } while (0)
  10358. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10359. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10360. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10361. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10362. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10363. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10364. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10365. /**
  10366. * @brief target -> host rx peer mlo map message definition
  10367. *
  10368. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10369. *
  10370. * @details
  10371. * The following diagram shows the format of the rx mlo peer map message sent
  10372. * from the target to the host. This layout assumes the target operates
  10373. * as little-endian.
  10374. *
  10375. * MCC:
  10376. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10377. *
  10378. * WIN:
  10379. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10380. * It will be sent on the Assoc Link.
  10381. *
  10382. * This message always contains a MLO peer ID. The main purpose of the
  10383. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10384. * with, so that the host can use that MLO peer ID to determine which peer
  10385. * transmitted the rx frame.
  10386. *
  10387. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10388. * |-------------------------------------------------------------------------|
  10389. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10390. * |-------------------------------------------------------------------------|
  10391. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10392. * |-------------------------------------------------------------------------|
  10393. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10394. * |-------------------------------------------------------------------------|
  10395. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10396. * |-------------------------------------------------------------------------|
  10397. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10398. * |-------------------------------------------------------------------------|
  10399. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10400. * |-------------------------------------------------------------------------|
  10401. * |RSVD |
  10402. * |-------------------------------------------------------------------------|
  10403. * |RSVD |
  10404. * |-------------------------------------------------------------------------|
  10405. * | htt_tlv_hdr_t |
  10406. * |-------------------------------------------------------------------------|
  10407. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10408. * |-------------------------------------------------------------------------|
  10409. * | htt_tlv_hdr_t |
  10410. * |-------------------------------------------------------------------------|
  10411. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10412. * |-------------------------------------------------------------------------|
  10413. * | htt_tlv_hdr_t |
  10414. * |-------------------------------------------------------------------------|
  10415. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10416. * |-------------------------------------------------------------------------|
  10417. *
  10418. * Where:
  10419. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10420. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10421. * V (valid) - 1 Bit Bit17
  10422. * CHIPID - 3 Bits
  10423. * TIDMASK - 8 Bits
  10424. * CACHE_SET_NUM - 8 Bits
  10425. *
  10426. * The following field definitions describe the format of the rx MLO peer map
  10427. * messages sent from the target to the host.
  10428. * - MSG_TYPE
  10429. * Bits 7:0
  10430. * Purpose: identifies this as an rx mlo peer map message
  10431. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10432. *
  10433. * - MLO_PEER_ID
  10434. * Bits 23:8
  10435. * Purpose: The MLO peer ID (index).
  10436. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10437. * Value: MLO peer ID
  10438. *
  10439. * - NUMLINK
  10440. * Bits: 26:24 (3Bits)
  10441. * Purpose: Indicate the max number of logical links supported per client.
  10442. * Value: number of logical links
  10443. *
  10444. * - PRC
  10445. * Bits: 29:27 (3Bits)
  10446. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10447. * if there is migration of the primary chip.
  10448. * Value: Primary REO CHIPID
  10449. *
  10450. * - MAC_ADDR_L32
  10451. * Bits 31:0
  10452. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10453. * Value: lower 4 bytes of peer node's MAC address
  10454. *
  10455. * - MAC_ADDR_U16
  10456. * Bits 15:0
  10457. * Purpose: Identifies which peer node the peer ID is for.
  10458. * Value: upper 2 bytes of peer node's MAC address
  10459. *
  10460. * - PRIMARY_TCL_AST_IDX
  10461. * Bits 15:0
  10462. * Purpose: Primary TCL AST index for this peer.
  10463. *
  10464. * - V
  10465. * 1 Bit Position 16
  10466. * Purpose: If the ast idx is valid.
  10467. *
  10468. * - CHIPID
  10469. * Bits 19:17
  10470. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10471. *
  10472. * - TIDMASK
  10473. * Bits 27:20
  10474. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10475. *
  10476. * - CACHE_SET_NUM
  10477. * Bits 31:28
  10478. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10479. * Cache set number that should be used to cache the index based
  10480. * search results, for address and flow search.
  10481. * This value should be equal to LSB four bits of the hash value
  10482. * of match data, in case of search index points to an entry which
  10483. * may be used in content based search also. The value can be
  10484. * anything when the entry pointed by search index will not be
  10485. * used for content based search.
  10486. *
  10487. * - htt_tlv_hdr_t
  10488. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10489. *
  10490. * Bits 11:0
  10491. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10492. *
  10493. * Bits 23:12
  10494. * Purpose: Length, Length of the value that follows the header
  10495. *
  10496. * Bits 31:28
  10497. * Purpose: Reserved.
  10498. *
  10499. *
  10500. * - SW_PEER_ID
  10501. * Bits 15:0
  10502. * Purpose: The peer ID (index) that WAL is allocating
  10503. * Value: (rx) peer ID
  10504. *
  10505. * - VDEV_ID
  10506. * Bits 23:16
  10507. * Purpose: Indicates which virtual device the peer is associated with.
  10508. * Value: vdev ID (used in the host to look up the vdev object)
  10509. *
  10510. * - CHIPID
  10511. * Bits 26:24
  10512. * Purpose: Indicates which Chip id the peer is associated with.
  10513. * Value: chip ID (Provided by Host as part of QMI exchange)
  10514. */
  10515. typedef enum {
  10516. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10517. } MLO_PEER_MAP_TLV_TAG_ID;
  10518. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10519. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10520. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10521. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10522. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10523. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10524. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10525. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10526. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10527. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10528. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10529. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10530. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10531. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10532. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10533. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10534. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10535. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10536. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10537. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10538. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10539. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10540. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10541. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10542. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10543. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10544. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10545. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10546. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10547. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10548. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10549. do { \
  10550. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10551. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10552. } while (0)
  10553. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10554. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10555. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10556. do { \
  10557. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10558. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10559. } while (0)
  10560. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10561. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10562. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10563. do { \
  10564. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10565. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10566. } while (0)
  10567. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10568. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10569. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10570. do { \
  10571. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10572. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10573. } while (0)
  10574. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10575. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10576. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10577. do { \
  10578. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10579. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10580. } while (0)
  10581. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10582. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10583. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10584. do { \
  10585. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10586. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10587. } while (0)
  10588. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10589. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10590. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10591. do { \
  10592. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10593. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10594. } while (0)
  10595. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10596. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10597. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10598. do { \
  10599. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10600. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10601. } while (0)
  10602. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10603. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10604. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10605. do { \
  10606. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10607. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10608. } while (0)
  10609. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10610. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10611. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10612. do { \
  10613. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10614. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10615. } while (0)
  10616. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10617. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10618. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10619. do { \
  10620. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10621. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10622. } while (0)
  10623. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10624. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10625. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10626. do { \
  10627. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10628. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10629. } while (0)
  10630. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10631. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10632. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10633. do { \
  10634. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10635. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10636. } while (0)
  10637. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10638. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10639. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10640. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10641. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10642. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10643. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10644. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10645. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10646. *
  10647. * The following diagram shows the format of the rx mlo peer unmap message sent
  10648. * from the target to the host.
  10649. *
  10650. * |31 24|23 16|15 8|7 0|
  10651. * |-----------------------------------------------------------------------|
  10652. * | RSVD_24_31 | MLO peer ID | msg type |
  10653. * |-----------------------------------------------------------------------|
  10654. */
  10655. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10656. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10657. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10658. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10659. /**
  10660. * @brief target -> host message specifying security parameters
  10661. *
  10662. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10663. *
  10664. * @details
  10665. * The following diagram shows the format of the security specification
  10666. * message sent from the target to the host.
  10667. * This security specification message tells the host whether a PN check is
  10668. * necessary on rx data frames, and if so, how large the PN counter is.
  10669. * This message also tells the host about the security processing to apply
  10670. * to defragmented rx frames - specifically, whether a Message Integrity
  10671. * Check is required, and the Michael key to use.
  10672. *
  10673. * |31 24|23 16|15|14 8|7 0|
  10674. * |-----------------------------------------------------------------------|
  10675. * | peer ID | U| security type | msg type |
  10676. * |-----------------------------------------------------------------------|
  10677. * | Michael Key K0 |
  10678. * |-----------------------------------------------------------------------|
  10679. * | Michael Key K1 |
  10680. * |-----------------------------------------------------------------------|
  10681. * | WAPI RSC Low0 |
  10682. * |-----------------------------------------------------------------------|
  10683. * | WAPI RSC Low1 |
  10684. * |-----------------------------------------------------------------------|
  10685. * | WAPI RSC Hi0 |
  10686. * |-----------------------------------------------------------------------|
  10687. * | WAPI RSC Hi1 |
  10688. * |-----------------------------------------------------------------------|
  10689. *
  10690. * The following field definitions describe the format of the security
  10691. * indication message sent from the target to the host.
  10692. * - MSG_TYPE
  10693. * Bits 7:0
  10694. * Purpose: identifies this as a security specification message
  10695. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10696. * - SEC_TYPE
  10697. * Bits 14:8
  10698. * Purpose: specifies which type of security applies to the peer
  10699. * Value: htt_sec_type enum value
  10700. * - UNICAST
  10701. * Bit 15
  10702. * Purpose: whether this security is applied to unicast or multicast data
  10703. * Value: 1 -> unicast, 0 -> multicast
  10704. * - PEER_ID
  10705. * Bits 31:16
  10706. * Purpose: The ID number for the peer the security specification is for
  10707. * Value: peer ID
  10708. * - MICHAEL_KEY_K0
  10709. * Bits 31:0
  10710. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10711. * Value: Michael Key K0 (if security type is TKIP)
  10712. * - MICHAEL_KEY_K1
  10713. * Bits 31:0
  10714. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10715. * Value: Michael Key K1 (if security type is TKIP)
  10716. * - WAPI_RSC_LOW0
  10717. * Bits 31:0
  10718. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10719. * Value: WAPI RSC Low0 (if security type is WAPI)
  10720. * - WAPI_RSC_LOW1
  10721. * Bits 31:0
  10722. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10723. * Value: WAPI RSC Low1 (if security type is WAPI)
  10724. * - WAPI_RSC_HI0
  10725. * Bits 31:0
  10726. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10727. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10728. * - WAPI_RSC_HI1
  10729. * Bits 31:0
  10730. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10731. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10732. */
  10733. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10734. #define HTT_SEC_IND_SEC_TYPE_S 8
  10735. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10736. #define HTT_SEC_IND_UNICAST_S 15
  10737. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10738. #define HTT_SEC_IND_PEER_ID_S 16
  10739. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10740. do { \
  10741. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10742. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10743. } while (0)
  10744. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10745. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10746. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10747. do { \
  10748. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10749. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10750. } while (0)
  10751. #define HTT_SEC_IND_UNICAST_GET(word) \
  10752. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10753. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10754. do { \
  10755. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10756. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10757. } while (0)
  10758. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10759. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10760. #define HTT_SEC_IND_BYTES 28
  10761. /**
  10762. * @brief target -> host rx ADDBA / DELBA message definitions
  10763. *
  10764. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10765. *
  10766. * @details
  10767. * The following diagram shows the format of the rx ADDBA message sent
  10768. * from the target to the host:
  10769. *
  10770. * |31 20|19 16|15 8|7 0|
  10771. * |---------------------------------------------------------------------|
  10772. * | peer ID | TID | window size | msg type |
  10773. * |---------------------------------------------------------------------|
  10774. *
  10775. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10776. *
  10777. * The following diagram shows the format of the rx DELBA message sent
  10778. * from the target to the host:
  10779. *
  10780. * |31 20|19 16|15 10|9 8|7 0|
  10781. * |---------------------------------------------------------------------|
  10782. * | peer ID | TID | window size | IR| msg type |
  10783. * |---------------------------------------------------------------------|
  10784. *
  10785. * The following field definitions describe the format of the rx ADDBA
  10786. * and DELBA messages sent from the target to the host.
  10787. * - MSG_TYPE
  10788. * Bits 7:0
  10789. * Purpose: identifies this as an rx ADDBA or DELBA message
  10790. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10791. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10792. * - IR (initiator / recipient)
  10793. * Bits 9:8 (DELBA only)
  10794. * Purpose: specify whether the DELBA handshake was initiated by the
  10795. * local STA/AP, or by the peer STA/AP
  10796. * Value:
  10797. * 0 - unspecified
  10798. * 1 - initiator (a.k.a. originator)
  10799. * 2 - recipient (a.k.a. responder)
  10800. * 3 - unused / reserved
  10801. * - WIN_SIZE
  10802. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10803. * Purpose: Specifies the length of the block ack window (max = 64).
  10804. * Value:
  10805. * block ack window length specified by the received ADDBA/DELBA
  10806. * management message.
  10807. * - TID
  10808. * Bits 19:16
  10809. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10810. * Value:
  10811. * TID specified by the received ADDBA or DELBA management message.
  10812. * - PEER_ID
  10813. * Bits 31:20
  10814. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10815. * Value:
  10816. * ID (hash value) used by the host for fast, direct lookup of
  10817. * host SW peer info, including rx reorder states.
  10818. */
  10819. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10820. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10821. #define HTT_RX_ADDBA_TID_M 0xf0000
  10822. #define HTT_RX_ADDBA_TID_S 16
  10823. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10824. #define HTT_RX_ADDBA_PEER_ID_S 20
  10825. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10826. do { \
  10827. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10828. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10829. } while (0)
  10830. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10831. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10832. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10833. do { \
  10834. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10835. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10836. } while (0)
  10837. #define HTT_RX_ADDBA_TID_GET(word) \
  10838. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10839. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10840. do { \
  10841. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10842. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10843. } while (0)
  10844. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10845. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10846. #define HTT_RX_ADDBA_BYTES 4
  10847. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10848. #define HTT_RX_DELBA_INITIATOR_S 8
  10849. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10850. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10851. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10852. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10853. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10854. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10855. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10856. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10857. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10858. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10859. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10860. do { \
  10861. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10862. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10863. } while (0)
  10864. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10865. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10866. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10867. do { \
  10868. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10869. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10870. } while (0)
  10871. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10872. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10873. #define HTT_RX_DELBA_BYTES 4
  10874. /**
  10875. * @brief tx queue group information element definition
  10876. *
  10877. * @details
  10878. * The following diagram shows the format of the tx queue group
  10879. * information element, which can be included in target --> host
  10880. * messages to specify the number of tx "credits" (tx descriptors
  10881. * for LL, or tx buffers for HL) available to a particular group
  10882. * of host-side tx queues, and which host-side tx queues belong to
  10883. * the group.
  10884. *
  10885. * |31|30 24|23 16|15|14|13 0|
  10886. * |------------------------------------------------------------------------|
  10887. * | X| reserved | tx queue grp ID | A| S| credit count |
  10888. * |------------------------------------------------------------------------|
  10889. * | vdev ID mask | AC mask |
  10890. * |------------------------------------------------------------------------|
  10891. *
  10892. * The following definitions describe the fields within the tx queue group
  10893. * information element:
  10894. * - credit_count
  10895. * Bits 13:1
  10896. * Purpose: specify how many tx credits are available to the tx queue group
  10897. * Value: An absolute or relative, positive or negative credit value
  10898. * The 'A' bit specifies whether the value is absolute or relative.
  10899. * The 'S' bit specifies whether the value is positive or negative.
  10900. * A negative value can only be relative, not absolute.
  10901. * An absolute value replaces any prior credit value the host has for
  10902. * the tx queue group in question.
  10903. * A relative value is added to the prior credit value the host has for
  10904. * the tx queue group in question.
  10905. * - sign
  10906. * Bit 14
  10907. * Purpose: specify whether the credit count is positive or negative
  10908. * Value: 0 -> positive, 1 -> negative
  10909. * - absolute
  10910. * Bit 15
  10911. * Purpose: specify whether the credit count is absolute or relative
  10912. * Value: 0 -> relative, 1 -> absolute
  10913. * - txq_group_id
  10914. * Bits 23:16
  10915. * Purpose: indicate which tx queue group's credit and/or membership are
  10916. * being specified
  10917. * Value: 0 to max_tx_queue_groups-1
  10918. * - reserved
  10919. * Bits 30:16
  10920. * Value: 0x0
  10921. * - eXtension
  10922. * Bit 31
  10923. * Purpose: specify whether another tx queue group info element follows
  10924. * Value: 0 -> no more tx queue group information elements
  10925. * 1 -> another tx queue group information element immediately follows
  10926. * - ac_mask
  10927. * Bits 15:0
  10928. * Purpose: specify which Access Categories belong to the tx queue group
  10929. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10930. * the tx queue group.
  10931. * The AC bit-mask values are obtained by left-shifting by the
  10932. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10933. * - vdev_id_mask
  10934. * Bits 31:16
  10935. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10936. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10937. * belong to the tx queue group.
  10938. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10939. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10940. */
  10941. PREPACK struct htt_txq_group {
  10942. A_UINT32
  10943. credit_count: 14,
  10944. sign: 1,
  10945. absolute: 1,
  10946. tx_queue_group_id: 8,
  10947. reserved0: 7,
  10948. extension: 1;
  10949. A_UINT32
  10950. ac_mask: 16,
  10951. vdev_id_mask: 16;
  10952. } POSTPACK;
  10953. /* first word */
  10954. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10955. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10956. #define HTT_TXQ_GROUP_SIGN_S 14
  10957. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10958. #define HTT_TXQ_GROUP_ABS_S 15
  10959. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10960. #define HTT_TXQ_GROUP_ID_S 16
  10961. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10962. #define HTT_TXQ_GROUP_EXT_S 31
  10963. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10964. /* second word */
  10965. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10966. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10967. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10968. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10969. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10970. do { \
  10971. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10972. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10973. } while (0)
  10974. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10975. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10976. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10977. do { \
  10978. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10979. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10980. } while (0)
  10981. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10982. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10983. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10984. do { \
  10985. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10986. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10987. } while (0)
  10988. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10989. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10990. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10991. do { \
  10992. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10993. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10994. } while (0)
  10995. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10996. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10997. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10998. do { \
  10999. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11000. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11001. } while (0)
  11002. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11003. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11004. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11007. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11008. } while (0)
  11009. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11010. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11011. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11014. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11015. } while (0)
  11016. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11017. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11018. /**
  11019. * @brief target -> host TX completion indication message definition
  11020. *
  11021. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11022. *
  11023. * @details
  11024. * The following diagram shows the format of the TX completion indication sent
  11025. * from the target to the host
  11026. *
  11027. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11028. * |-------------------------------------------------------------------|
  11029. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11030. * |-------------------------------------------------------------------|
  11031. * payload:| MSDU1 ID | MSDU0 ID |
  11032. * |-------------------------------------------------------------------|
  11033. * : MSDU3 ID | MSDU2 ID :
  11034. * |-------------------------------------------------------------------|
  11035. * | struct htt_tx_compl_ind_append_retries |
  11036. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11037. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11038. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11039. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11040. * |-------------------------------------------------------------------|
  11041. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11042. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11043. * | MSDU0 tx_tsf64_low |
  11044. * |-------------------------------------------------------------------|
  11045. * | MSDU0 tx_tsf64_high |
  11046. * |-------------------------------------------------------------------|
  11047. * | MSDU1 tx_tsf64_low |
  11048. * |-------------------------------------------------------------------|
  11049. * | MSDU1 tx_tsf64_high |
  11050. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11051. * | phy_timestamp |
  11052. * |-------------------------------------------------------------------|
  11053. * | rate specs (see below) |
  11054. * |-------------------------------------------------------------------|
  11055. * | seqctrl | framectrl |
  11056. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11057. * Where:
  11058. * A0 = append (a.k.a. append0)
  11059. * A1 = append1
  11060. * TP = MSDU tx power presence
  11061. * A2 = append2
  11062. * A3 = append3
  11063. * A4 = append4
  11064. *
  11065. * The following field definitions describe the format of the TX completion
  11066. * indication sent from the target to the host
  11067. * Header fields:
  11068. * - msg_type
  11069. * Bits 7:0
  11070. * Purpose: identifies this as HTT TX completion indication
  11071. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11072. * - status
  11073. * Bits 10:8
  11074. * Purpose: the TX completion status of payload fragmentations descriptors
  11075. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11076. * - tid
  11077. * Bits 14:11
  11078. * Purpose: the tid associated with those fragmentation descriptors. It is
  11079. * valid or not, depending on the tid_invalid bit.
  11080. * Value: 0 to 15
  11081. * - tid_invalid
  11082. * Bits 15:15
  11083. * Purpose: this bit indicates whether the tid field is valid or not
  11084. * Value: 0 indicates valid; 1 indicates invalid
  11085. * - num
  11086. * Bits 23:16
  11087. * Purpose: the number of payload in this indication
  11088. * Value: 1 to 255
  11089. * - append (a.k.a. append0)
  11090. * Bits 24:24
  11091. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11092. * the number of tx retries for one MSDU at the end of this message
  11093. * Value: 0 indicates no appending; 1 indicates appending
  11094. * - append1
  11095. * Bits 25:25
  11096. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11097. * contains the timestamp info for each TX msdu id in payload.
  11098. * The order of the timestamps matches the order of the MSDU IDs.
  11099. * Note that a big-endian host needs to account for the reordering
  11100. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11101. * conversion) when determining which tx timestamp corresponds to
  11102. * which MSDU ID.
  11103. * Value: 0 indicates no appending; 1 indicates appending
  11104. * - msdu_tx_power_presence
  11105. * Bits 26:26
  11106. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11107. * for each MSDU referenced by the TX_COMPL_IND message.
  11108. * The tx power is reported in 0.5 dBm units.
  11109. * The order of the per-MSDU tx power reports matches the order
  11110. * of the MSDU IDs.
  11111. * Note that a big-endian host needs to account for the reordering
  11112. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11113. * conversion) when determining which Tx Power corresponds to
  11114. * which MSDU ID.
  11115. * Value: 0 indicates MSDU tx power reports are not appended,
  11116. * 1 indicates MSDU tx power reports are appended
  11117. * - append2
  11118. * Bits 27:27
  11119. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11120. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11121. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11122. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11123. * for each MSDU, for convenience.
  11124. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11125. * this append2 bit is set).
  11126. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11127. * dB above the noise floor.
  11128. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11129. * 1 indicates MSDU ACK RSSI values are appended.
  11130. * - append3
  11131. * Bits 28:28
  11132. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11133. * contains the tx tsf info based on wlan global TSF for
  11134. * each TX msdu id in payload.
  11135. * The order of the tx tsf matches the order of the MSDU IDs.
  11136. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11137. * values to indicate the the lower 32 bits and higher 32 bits of
  11138. * the tx tsf.
  11139. * The tx_tsf64 here represents the time MSDU was acked and the
  11140. * tx_tsf64 has microseconds units.
  11141. * Value: 0 indicates no appending; 1 indicates appending
  11142. * - append4
  11143. * Bits 29:29
  11144. * Purpose: Indicate whether data frame control fields and fields required
  11145. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11146. * message. The order of the this message matches the order of
  11147. * the MSDU IDs.
  11148. * Value: 0 indicates frame control fields and fields required for
  11149. * radio tap header values are not appended,
  11150. * 1 indicates frame control fields and fields required for
  11151. * radio tap header values are appended.
  11152. * Payload fields:
  11153. * - hmsdu_id
  11154. * Bits 15:0
  11155. * Purpose: this ID is used to track the Tx buffer in host
  11156. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11157. */
  11158. PREPACK struct htt_tx_data_hdr_information {
  11159. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11160. A_UINT32 /* word 1 */
  11161. /* preamble:
  11162. * 0-OFDM,
  11163. * 1-CCk,
  11164. * 2-HT,
  11165. * 3-VHT
  11166. */
  11167. preamble: 2, /* [1:0] */
  11168. /* mcs:
  11169. * In case of HT preamble interpret
  11170. * MCS along with NSS.
  11171. * Valid values for HT are 0 to 7.
  11172. * HT mcs 0 with NSS 2 is mcs 8.
  11173. * Valid values for VHT are 0 to 9.
  11174. */
  11175. mcs: 4, /* [5:2] */
  11176. /* rate:
  11177. * This is applicable only for
  11178. * CCK and OFDM preamble type
  11179. * rate 0: OFDM 48 Mbps,
  11180. * 1: OFDM 24 Mbps,
  11181. * 2: OFDM 12 Mbps
  11182. * 3: OFDM 6 Mbps
  11183. * 4: OFDM 54 Mbps
  11184. * 5: OFDM 36 Mbps
  11185. * 6: OFDM 18 Mbps
  11186. * 7: OFDM 9 Mbps
  11187. * rate 0: CCK 11 Mbps Long
  11188. * 1: CCK 5.5 Mbps Long
  11189. * 2: CCK 2 Mbps Long
  11190. * 3: CCK 1 Mbps Long
  11191. * 4: CCK 11 Mbps Short
  11192. * 5: CCK 5.5 Mbps Short
  11193. * 6: CCK 2 Mbps Short
  11194. */
  11195. rate : 3, /* [ 8: 6] */
  11196. rssi : 8, /* [16: 9] units=dBm */
  11197. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11198. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11199. stbc : 1, /* [22] */
  11200. sgi : 1, /* [23] */
  11201. ldpc : 1, /* [24] */
  11202. beamformed: 1, /* [25] */
  11203. /* tx_retry_cnt:
  11204. * Indicates retry count of data tx frames provided by the host.
  11205. */
  11206. tx_retry_cnt: 6; /* [31:26] */
  11207. A_UINT32 /* word 2 */
  11208. framectrl:16, /* [15: 0] */
  11209. seqno:16; /* [31:16] */
  11210. } POSTPACK;
  11211. #define HTT_TX_COMPL_IND_STATUS_S 8
  11212. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11213. #define HTT_TX_COMPL_IND_TID_S 11
  11214. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11215. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11216. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11217. #define HTT_TX_COMPL_IND_NUM_S 16
  11218. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11219. #define HTT_TX_COMPL_IND_APPEND_S 24
  11220. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11221. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11222. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11223. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11224. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11225. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11226. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11227. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11228. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11229. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11230. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11231. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11234. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11235. } while (0)
  11236. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11237. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11238. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11241. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11242. } while (0)
  11243. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11244. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11245. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11246. do { \
  11247. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11248. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11249. } while (0)
  11250. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11251. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11252. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11253. do { \
  11254. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11255. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11256. } while (0)
  11257. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11258. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11259. HTT_TX_COMPL_IND_TID_INV_S)
  11260. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11261. do { \
  11262. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11263. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11264. } while (0)
  11265. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11266. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11267. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11268. do { \
  11269. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11270. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11271. } while (0)
  11272. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11273. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11274. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11275. do { \
  11276. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11277. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11278. } while (0)
  11279. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11280. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11281. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11282. do { \
  11283. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11284. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11285. } while (0)
  11286. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11287. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11288. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11289. do { \
  11290. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11291. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11292. } while (0)
  11293. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11294. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11295. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11296. do { \
  11297. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11298. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11299. } while (0)
  11300. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11301. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11302. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11303. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11304. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11305. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11306. #define HTT_TX_COMPL_IND_STAT_OK 0
  11307. /* DISCARD:
  11308. * current meaning:
  11309. * MSDUs were queued for transmission but filtered by HW or SW
  11310. * without any over the air attempts
  11311. * legacy meaning (HL Rome):
  11312. * MSDUs were discarded by the target FW without any over the air
  11313. * attempts due to lack of space
  11314. */
  11315. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11316. /* NO_ACK:
  11317. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11318. */
  11319. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11320. /* POSTPONE:
  11321. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11322. * be downloaded again later (in the appropriate order), when they are
  11323. * deliverable.
  11324. */
  11325. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11326. /*
  11327. * The PEER_DEL tx completion status is used for HL cases
  11328. * where the peer the frame is for has been deleted.
  11329. * The host has already discarded its copy of the frame, but
  11330. * it still needs the tx completion to restore its credit.
  11331. */
  11332. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11333. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11334. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11335. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11336. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11337. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11338. PREPACK struct htt_tx_compl_ind_base {
  11339. A_UINT32 hdr;
  11340. A_UINT16 payload[1/*or more*/];
  11341. } POSTPACK;
  11342. PREPACK struct htt_tx_compl_ind_append_retries {
  11343. A_UINT16 msdu_id;
  11344. A_UINT8 tx_retries;
  11345. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11346. 0: this is the last append_retries struct */
  11347. } POSTPACK;
  11348. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11349. A_UINT32 timestamp[1/*or more*/];
  11350. } POSTPACK;
  11351. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11352. A_UINT32 tx_tsf64_low;
  11353. A_UINT32 tx_tsf64_high;
  11354. } POSTPACK;
  11355. /* htt_tx_data_hdr_information payload extension fields: */
  11356. /* DWORD zero */
  11357. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11358. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11359. /* DWORD one */
  11360. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11361. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11362. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11363. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11364. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11365. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11366. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11367. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11368. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11369. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11370. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11371. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11372. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11373. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11374. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11375. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11376. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11377. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11378. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11379. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11380. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11381. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11382. /* DWORD two */
  11383. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11384. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11385. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11386. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11387. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11388. do { \
  11389. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11390. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11391. } while (0)
  11392. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11393. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11394. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11395. do { \
  11396. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11397. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11398. } while (0)
  11399. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11400. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11401. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11402. do { \
  11403. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11404. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11405. } while (0)
  11406. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11407. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11408. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11409. do { \
  11410. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11411. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11412. } while (0)
  11413. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11414. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11415. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11416. do { \
  11417. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11418. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11419. } while (0)
  11420. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11421. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11422. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11423. do { \
  11424. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11425. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11426. } while (0)
  11427. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11428. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11429. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11430. do { \
  11431. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11432. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11433. } while (0)
  11434. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11435. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11436. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11437. do { \
  11438. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11439. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11440. } while (0)
  11441. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11442. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11443. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11444. do { \
  11445. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11446. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11447. } while (0)
  11448. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11449. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11450. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11451. do { \
  11452. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11453. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11454. } while (0)
  11455. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11456. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11457. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11458. do { \
  11459. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11460. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11461. } while (0)
  11462. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11463. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11464. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11465. do { \
  11466. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11467. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11468. } while (0)
  11469. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11470. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11471. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11472. do { \
  11473. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11474. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11475. } while (0)
  11476. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11477. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11478. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11479. do { \
  11480. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11481. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11482. } while (0)
  11483. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11484. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11485. /**
  11486. * @brief target -> host rate-control update indication message
  11487. *
  11488. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11489. *
  11490. * @details
  11491. * The following diagram shows the format of the RC Update message
  11492. * sent from the target to the host, while processing the tx-completion
  11493. * of a transmitted PPDU.
  11494. *
  11495. * |31 24|23 16|15 8|7 0|
  11496. * |-------------------------------------------------------------|
  11497. * | peer ID | vdev ID | msg_type |
  11498. * |-------------------------------------------------------------|
  11499. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11500. * |-------------------------------------------------------------|
  11501. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11502. * |-------------------------------------------------------------|
  11503. * | : |
  11504. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11505. * | : |
  11506. * |-------------------------------------------------------------|
  11507. * | : |
  11508. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11509. * | : |
  11510. * |-------------------------------------------------------------|
  11511. * : :
  11512. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11513. *
  11514. */
  11515. typedef struct {
  11516. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11517. A_UINT32 rate_code_flags;
  11518. A_UINT32 flags; /* Encodes information such as excessive
  11519. retransmission, aggregate, some info
  11520. from .11 frame control,
  11521. STBC, LDPC, (SGI and Tx Chain Mask
  11522. are encoded in ptx_rc->flags field),
  11523. AMPDU truncation (BT/time based etc.),
  11524. RTS/CTS attempt */
  11525. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11526. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11527. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11528. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11529. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11530. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11531. } HTT_RC_TX_DONE_PARAMS;
  11532. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11533. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11534. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11535. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11536. #define HTT_RC_UPDATE_VDEVID_S 8
  11537. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11538. #define HTT_RC_UPDATE_PEERID_S 16
  11539. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11540. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11541. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11542. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11543. do { \
  11544. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11545. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11546. } while (0)
  11547. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11548. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11549. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11550. do { \
  11551. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11552. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11553. } while (0)
  11554. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11555. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11556. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11557. do { \
  11558. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11559. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11560. } while (0)
  11561. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11562. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11563. /**
  11564. * @brief target -> host rx fragment indication message definition
  11565. *
  11566. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11567. *
  11568. * @details
  11569. * The following field definitions describe the format of the rx fragment
  11570. * indication message sent from the target to the host.
  11571. * The rx fragment indication message shares the format of the
  11572. * rx indication message, but not all fields from the rx indication message
  11573. * are relevant to the rx fragment indication message.
  11574. *
  11575. *
  11576. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11577. * |-----------+-------------------+---------------------+-------------|
  11578. * | peer ID | |FV| ext TID | msg type |
  11579. * |-------------------------------------------------------------------|
  11580. * | | flush | flush |
  11581. * | | end | start |
  11582. * | | seq num | seq num |
  11583. * |-------------------------------------------------------------------|
  11584. * | reserved | FW rx desc bytes |
  11585. * |-------------------------------------------------------------------|
  11586. * | | FW MSDU Rx |
  11587. * | | desc B0 |
  11588. * |-------------------------------------------------------------------|
  11589. * Header fields:
  11590. * - MSG_TYPE
  11591. * Bits 7:0
  11592. * Purpose: identifies this as an rx fragment indication message
  11593. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11594. * - EXT_TID
  11595. * Bits 12:8
  11596. * Purpose: identify the traffic ID of the rx data, including
  11597. * special "extended" TID values for multicast, broadcast, and
  11598. * non-QoS data frames
  11599. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11600. * - FLUSH_VALID (FV)
  11601. * Bit 13
  11602. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11603. * is valid
  11604. * Value:
  11605. * 1 -> flush IE is valid and needs to be processed
  11606. * 0 -> flush IE is not valid and should be ignored
  11607. * - PEER_ID
  11608. * Bits 31:16
  11609. * Purpose: Identify, by ID, which peer sent the rx data
  11610. * Value: ID of the peer who sent the rx data
  11611. * - FLUSH_SEQ_NUM_START
  11612. * Bits 5:0
  11613. * Purpose: Indicate the start of a series of MPDUs to flush
  11614. * Not all MPDUs within this series are necessarily valid - the host
  11615. * must check each sequence number within this range to see if the
  11616. * corresponding MPDU is actually present.
  11617. * This field is only valid if the FV bit is set.
  11618. * Value:
  11619. * The sequence number for the first MPDUs to check to flush.
  11620. * The sequence number is masked by 0x3f.
  11621. * - FLUSH_SEQ_NUM_END
  11622. * Bits 11:6
  11623. * Purpose: Indicate the end of a series of MPDUs to flush
  11624. * Value:
  11625. * The sequence number one larger than the sequence number of the
  11626. * last MPDU to check to flush.
  11627. * The sequence number is masked by 0x3f.
  11628. * Not all MPDUs within this series are necessarily valid - the host
  11629. * must check each sequence number within this range to see if the
  11630. * corresponding MPDU is actually present.
  11631. * This field is only valid if the FV bit is set.
  11632. * Rx descriptor fields:
  11633. * - FW_RX_DESC_BYTES
  11634. * Bits 15:0
  11635. * Purpose: Indicate how many bytes in the Rx indication are used for
  11636. * FW Rx descriptors
  11637. * Value: 1
  11638. */
  11639. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11640. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11641. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11642. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11643. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11644. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11645. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11646. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11647. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11648. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11649. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11650. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11651. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11652. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11653. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11654. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11655. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11656. #define HTT_RX_FRAG_IND_BYTES \
  11657. (4 /* msg hdr */ + \
  11658. 4 /* flush spec */ + \
  11659. 4 /* (unused) FW rx desc bytes spec */ + \
  11660. 4 /* FW rx desc */)
  11661. /**
  11662. * @brief target -> host test message definition
  11663. *
  11664. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11665. *
  11666. * @details
  11667. * The following field definitions describe the format of the test
  11668. * message sent from the target to the host.
  11669. * The message consists of a 4-octet header, followed by a variable
  11670. * number of 32-bit integer values, followed by a variable number
  11671. * of 8-bit character values.
  11672. *
  11673. * |31 16|15 8|7 0|
  11674. * |-----------------------------------------------------------|
  11675. * | num chars | num ints | msg type |
  11676. * |-----------------------------------------------------------|
  11677. * | int 0 |
  11678. * |-----------------------------------------------------------|
  11679. * | int 1 |
  11680. * |-----------------------------------------------------------|
  11681. * | ... |
  11682. * |-----------------------------------------------------------|
  11683. * | char 3 | char 2 | char 1 | char 0 |
  11684. * |-----------------------------------------------------------|
  11685. * | | | ... | char 4 |
  11686. * |-----------------------------------------------------------|
  11687. * - MSG_TYPE
  11688. * Bits 7:0
  11689. * Purpose: identifies this as a test message
  11690. * Value: HTT_MSG_TYPE_TEST
  11691. * - NUM_INTS
  11692. * Bits 15:8
  11693. * Purpose: indicate how many 32-bit integers follow the message header
  11694. * - NUM_CHARS
  11695. * Bits 31:16
  11696. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11697. */
  11698. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11699. #define HTT_RX_TEST_NUM_INTS_S 8
  11700. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11701. #define HTT_RX_TEST_NUM_CHARS_S 16
  11702. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11703. do { \
  11704. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11705. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11706. } while (0)
  11707. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11708. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11709. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11710. do { \
  11711. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11712. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11713. } while (0)
  11714. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11715. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11716. /**
  11717. * @brief target -> host packet log message
  11718. *
  11719. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11720. *
  11721. * @details
  11722. * The following field definitions describe the format of the packet log
  11723. * message sent from the target to the host.
  11724. * The message consists of a 4-octet header,followed by a variable number
  11725. * of 32-bit character values.
  11726. *
  11727. * |31 16|15 12|11 10|9 8|7 0|
  11728. * |------------------------------------------------------------------|
  11729. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11730. * |------------------------------------------------------------------|
  11731. * | payload |
  11732. * |------------------------------------------------------------------|
  11733. * - MSG_TYPE
  11734. * Bits 7:0
  11735. * Purpose: identifies this as a pktlog message
  11736. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11737. * - mac_id
  11738. * Bits 9:8
  11739. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11740. * Value: 0-3
  11741. * - pdev_id
  11742. * Bits 11:10
  11743. * Purpose: pdev_id
  11744. * Value: 0-3
  11745. * 0 (for rings at SOC level),
  11746. * 1/2/3 PDEV -> 0/1/2
  11747. * - payload_size
  11748. * Bits 31:16
  11749. * Purpose: explicitly specify the payload size
  11750. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11751. */
  11752. PREPACK struct htt_pktlog_msg {
  11753. A_UINT32 header;
  11754. A_UINT32 payload[1/* or more */];
  11755. } POSTPACK;
  11756. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11757. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11758. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11759. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11760. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11761. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11762. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11765. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11766. } while (0)
  11767. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11768. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11769. HTT_T2H_PKTLOG_MAC_ID_S)
  11770. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11771. do { \
  11772. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11773. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11774. } while (0)
  11775. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11776. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11777. HTT_T2H_PKTLOG_PDEV_ID_S)
  11778. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11779. do { \
  11780. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11781. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11782. } while (0)
  11783. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11784. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11785. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11786. /*
  11787. * Rx reorder statistics
  11788. * NB: all the fields must be defined in 4 octets size.
  11789. */
  11790. struct rx_reorder_stats {
  11791. /* Non QoS MPDUs received */
  11792. A_UINT32 deliver_non_qos;
  11793. /* MPDUs received in-order */
  11794. A_UINT32 deliver_in_order;
  11795. /* Flush due to reorder timer expired */
  11796. A_UINT32 deliver_flush_timeout;
  11797. /* Flush due to move out of window */
  11798. A_UINT32 deliver_flush_oow;
  11799. /* Flush due to DELBA */
  11800. A_UINT32 deliver_flush_delba;
  11801. /* MPDUs dropped due to FCS error */
  11802. A_UINT32 fcs_error;
  11803. /* MPDUs dropped due to monitor mode non-data packet */
  11804. A_UINT32 mgmt_ctrl;
  11805. /* Unicast-data MPDUs dropped due to invalid peer */
  11806. A_UINT32 invalid_peer;
  11807. /* MPDUs dropped due to duplication (non aggregation) */
  11808. A_UINT32 dup_non_aggr;
  11809. /* MPDUs dropped due to processed before */
  11810. A_UINT32 dup_past;
  11811. /* MPDUs dropped due to duplicate in reorder queue */
  11812. A_UINT32 dup_in_reorder;
  11813. /* Reorder timeout happened */
  11814. A_UINT32 reorder_timeout;
  11815. /* invalid bar ssn */
  11816. A_UINT32 invalid_bar_ssn;
  11817. /* reorder reset due to bar ssn */
  11818. A_UINT32 ssn_reset;
  11819. /* Flush due to delete peer */
  11820. A_UINT32 deliver_flush_delpeer;
  11821. /* Flush due to offload*/
  11822. A_UINT32 deliver_flush_offload;
  11823. /* Flush due to out of buffer*/
  11824. A_UINT32 deliver_flush_oob;
  11825. /* MPDUs dropped due to PN check fail */
  11826. A_UINT32 pn_fail;
  11827. /* MPDUs dropped due to unable to allocate memory */
  11828. A_UINT32 store_fail;
  11829. /* Number of times the tid pool alloc succeeded */
  11830. A_UINT32 tid_pool_alloc_succ;
  11831. /* Number of times the MPDU pool alloc succeeded */
  11832. A_UINT32 mpdu_pool_alloc_succ;
  11833. /* Number of times the MSDU pool alloc succeeded */
  11834. A_UINT32 msdu_pool_alloc_succ;
  11835. /* Number of times the tid pool alloc failed */
  11836. A_UINT32 tid_pool_alloc_fail;
  11837. /* Number of times the MPDU pool alloc failed */
  11838. A_UINT32 mpdu_pool_alloc_fail;
  11839. /* Number of times the MSDU pool alloc failed */
  11840. A_UINT32 msdu_pool_alloc_fail;
  11841. /* Number of times the tid pool freed */
  11842. A_UINT32 tid_pool_free;
  11843. /* Number of times the MPDU pool freed */
  11844. A_UINT32 mpdu_pool_free;
  11845. /* Number of times the MSDU pool freed */
  11846. A_UINT32 msdu_pool_free;
  11847. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11848. A_UINT32 msdu_queued;
  11849. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11850. A_UINT32 msdu_recycled;
  11851. /* Number of MPDUs with invalid peer but A2 found in AST */
  11852. A_UINT32 invalid_peer_a2_in_ast;
  11853. /* Number of MPDUs with invalid peer but A3 found in AST */
  11854. A_UINT32 invalid_peer_a3_in_ast;
  11855. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11856. A_UINT32 invalid_peer_bmc_mpdus;
  11857. /* Number of MSDUs with err attention word */
  11858. A_UINT32 rxdesc_err_att;
  11859. /* Number of MSDUs with flag of peer_idx_invalid */
  11860. A_UINT32 rxdesc_err_peer_idx_inv;
  11861. /* Number of MSDUs with flag of peer_idx_timeout */
  11862. A_UINT32 rxdesc_err_peer_idx_to;
  11863. /* Number of MSDUs with flag of overflow */
  11864. A_UINT32 rxdesc_err_ov;
  11865. /* Number of MSDUs with flag of msdu_length_err */
  11866. A_UINT32 rxdesc_err_msdu_len;
  11867. /* Number of MSDUs with flag of mpdu_length_err */
  11868. A_UINT32 rxdesc_err_mpdu_len;
  11869. /* Number of MSDUs with flag of tkip_mic_err */
  11870. A_UINT32 rxdesc_err_tkip_mic;
  11871. /* Number of MSDUs with flag of decrypt_err */
  11872. A_UINT32 rxdesc_err_decrypt;
  11873. /* Number of MSDUs with flag of fcs_err */
  11874. A_UINT32 rxdesc_err_fcs;
  11875. /* Number of Unicast (bc_mc bit is not set in attention word)
  11876. * frames with invalid peer handler
  11877. */
  11878. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11879. /* Number of unicast frame directly (direct bit is set in attention word)
  11880. * to DUT with invalid peer handler
  11881. */
  11882. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11883. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11884. * frames with invalid peer handler
  11885. */
  11886. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11887. /* Number of MSDUs dropped due to no first MSDU flag */
  11888. A_UINT32 rxdesc_no_1st_msdu;
  11889. /* Number of MSDUs droped due to ring overflow */
  11890. A_UINT32 msdu_drop_ring_ov;
  11891. /* Number of MSDUs dropped due to FC mismatch */
  11892. A_UINT32 msdu_drop_fc_mismatch;
  11893. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11894. A_UINT32 msdu_drop_mgmt_remote_ring;
  11895. /* Number of MSDUs dropped due to errors not reported in attention word */
  11896. A_UINT32 msdu_drop_misc;
  11897. /* Number of MSDUs go to offload before reorder */
  11898. A_UINT32 offload_msdu_wal;
  11899. /* Number of data frame dropped by offload after reorder */
  11900. A_UINT32 offload_msdu_reorder;
  11901. /* Number of MPDUs with sequence number in the past and within the BA window */
  11902. A_UINT32 dup_past_within_window;
  11903. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11904. A_UINT32 dup_past_outside_window;
  11905. /* Number of MSDUs with decrypt/MIC error */
  11906. A_UINT32 rxdesc_err_decrypt_mic;
  11907. /* Number of data MSDUs received on both local and remote rings */
  11908. A_UINT32 data_msdus_on_both_rings;
  11909. /* MPDUs never filled */
  11910. A_UINT32 holes_not_filled;
  11911. };
  11912. /*
  11913. * Rx Remote buffer statistics
  11914. * NB: all the fields must be defined in 4 octets size.
  11915. */
  11916. struct rx_remote_buffer_mgmt_stats {
  11917. /* Total number of MSDUs reaped for Rx processing */
  11918. A_UINT32 remote_reaped;
  11919. /* MSDUs recycled within firmware */
  11920. A_UINT32 remote_recycled;
  11921. /* MSDUs stored by Data Rx */
  11922. A_UINT32 data_rx_msdus_stored;
  11923. /* Number of HTT indications from WAL Rx MSDU */
  11924. A_UINT32 wal_rx_ind;
  11925. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11926. A_UINT32 wal_rx_ind_unconsumed;
  11927. /* Number of HTT indications from Data Rx MSDU */
  11928. A_UINT32 data_rx_ind;
  11929. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11930. A_UINT32 data_rx_ind_unconsumed;
  11931. /* Number of HTT indications from ATHBUF */
  11932. A_UINT32 athbuf_rx_ind;
  11933. /* Number of remote buffers requested for refill */
  11934. A_UINT32 refill_buf_req;
  11935. /* Number of remote buffers filled by the host */
  11936. A_UINT32 refill_buf_rsp;
  11937. /* Number of times MAC hw_index = f/w write_index */
  11938. A_INT32 mac_no_bufs;
  11939. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11940. A_INT32 fw_indices_equal;
  11941. /* Number of times f/w finds no buffers to post */
  11942. A_INT32 host_no_bufs;
  11943. };
  11944. /*
  11945. * TXBF MU/SU packets and NDPA statistics
  11946. * NB: all the fields must be defined in 4 octets size.
  11947. */
  11948. struct rx_txbf_musu_ndpa_pkts_stats {
  11949. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11950. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11951. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11952. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11953. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11954. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11955. };
  11956. /*
  11957. * htt_dbg_stats_status -
  11958. * present - The requested stats have been delivered in full.
  11959. * This indicates that either the stats information was contained
  11960. * in its entirety within this message, or else this message
  11961. * completes the delivery of the requested stats info that was
  11962. * partially delivered through earlier STATS_CONF messages.
  11963. * partial - The requested stats have been delivered in part.
  11964. * One or more subsequent STATS_CONF messages with the same
  11965. * cookie value will be sent to deliver the remainder of the
  11966. * information.
  11967. * error - The requested stats could not be delivered, for example due
  11968. * to a shortage of memory to construct a message holding the
  11969. * requested stats.
  11970. * invalid - The requested stat type is either not recognized, or the
  11971. * target is configured to not gather the stats type in question.
  11972. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11973. * series_done - This special value indicates that no further stats info
  11974. * elements are present within a series of stats info elems
  11975. * (within a stats upload confirmation message).
  11976. */
  11977. enum htt_dbg_stats_status {
  11978. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11979. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11980. HTT_DBG_STATS_STATUS_ERROR = 2,
  11981. HTT_DBG_STATS_STATUS_INVALID = 3,
  11982. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11983. };
  11984. /**
  11985. * @brief target -> host statistics upload
  11986. *
  11987. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11988. *
  11989. * @details
  11990. * The following field definitions describe the format of the HTT target
  11991. * to host stats upload confirmation message.
  11992. * The message contains a cookie echoed from the HTT host->target stats
  11993. * upload request, which identifies which request the confirmation is
  11994. * for, and a series of tag-length-value stats information elements.
  11995. * The tag-length header for each stats info element also includes a
  11996. * status field, to indicate whether the request for the stat type in
  11997. * question was fully met, partially met, unable to be met, or invalid
  11998. * (if the stat type in question is disabled in the target).
  11999. * A special value of all 1's in this status field is used to indicate
  12000. * the end of the series of stats info elements.
  12001. *
  12002. *
  12003. * |31 16|15 8|7 5|4 0|
  12004. * |------------------------------------------------------------|
  12005. * | reserved | msg type |
  12006. * |------------------------------------------------------------|
  12007. * | cookie LSBs |
  12008. * |------------------------------------------------------------|
  12009. * | cookie MSBs |
  12010. * |------------------------------------------------------------|
  12011. * | stats entry length | reserved | S |stat type|
  12012. * |------------------------------------------------------------|
  12013. * | |
  12014. * | type-specific stats info |
  12015. * | |
  12016. * |------------------------------------------------------------|
  12017. * | stats entry length | reserved | S |stat type|
  12018. * |------------------------------------------------------------|
  12019. * | |
  12020. * | type-specific stats info |
  12021. * | |
  12022. * |------------------------------------------------------------|
  12023. * | n/a | reserved | 111 | n/a |
  12024. * |------------------------------------------------------------|
  12025. * Header fields:
  12026. * - MSG_TYPE
  12027. * Bits 7:0
  12028. * Purpose: identifies this is a statistics upload confirmation message
  12029. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12030. * - COOKIE_LSBS
  12031. * Bits 31:0
  12032. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12033. * message with its preceding host->target stats request message.
  12034. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12035. * - COOKIE_MSBS
  12036. * Bits 31:0
  12037. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12038. * message with its preceding host->target stats request message.
  12039. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12040. *
  12041. * Stats Information Element tag-length header fields:
  12042. * - STAT_TYPE
  12043. * Bits 4:0
  12044. * Purpose: identifies the type of statistics info held in the
  12045. * following information element
  12046. * Value: htt_dbg_stats_type
  12047. * - STATUS
  12048. * Bits 7:5
  12049. * Purpose: indicate whether the requested stats are present
  12050. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12051. * the completion of the stats entry series
  12052. * - LENGTH
  12053. * Bits 31:16
  12054. * Purpose: indicate the stats information size
  12055. * Value: This field specifies the number of bytes of stats information
  12056. * that follows the element tag-length header.
  12057. * It is expected but not required that this length is a multiple of
  12058. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12059. * subsequent stats entry header will begin on a 4-byte aligned
  12060. * boundary.
  12061. */
  12062. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12063. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12064. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12065. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12066. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12067. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12068. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12069. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12070. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12071. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12072. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12075. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12076. } while (0)
  12077. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12078. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12079. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12080. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12083. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12084. } while (0)
  12085. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12086. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12087. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12088. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12089. do { \
  12090. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12091. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12092. } while (0)
  12093. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12094. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12095. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12096. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12097. #define HTT_MAX_AGGR 64
  12098. #define HTT_HL_MAX_AGGR 18
  12099. /**
  12100. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12101. *
  12102. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12103. *
  12104. * @details
  12105. * The following field definitions describe the format of the HTT host
  12106. * to target frag_desc/msdu_ext bank configuration message.
  12107. * The message contains the based address and the min and max id of the
  12108. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12109. * MSDU_EXT/FRAG_DESC.
  12110. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12111. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12112. * the hardware does the mapping/translation.
  12113. *
  12114. * Total banks that can be configured is configured to 16.
  12115. *
  12116. * This should be called before any TX has be initiated by the HTT
  12117. *
  12118. * |31 16|15 8|7 5|4 0|
  12119. * |------------------------------------------------------------|
  12120. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12121. * |------------------------------------------------------------|
  12122. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12123. #if HTT_PADDR64
  12124. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12125. #endif
  12126. * |------------------------------------------------------------|
  12127. * | ... |
  12128. * |------------------------------------------------------------|
  12129. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12130. #if HTT_PADDR64
  12131. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12132. #endif
  12133. * |------------------------------------------------------------|
  12134. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12135. * |------------------------------------------------------------|
  12136. * | ... |
  12137. * |------------------------------------------------------------|
  12138. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12139. * |------------------------------------------------------------|
  12140. * Header fields:
  12141. * - MSG_TYPE
  12142. * Bits 7:0
  12143. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12144. * for systems with 64-bit format for bus addresses:
  12145. * - BANKx_BASE_ADDRESS_LO
  12146. * Bits 31:0
  12147. * Purpose: Provide a mechanism to specify the base address of the
  12148. * MSDU_EXT bank physical/bus address.
  12149. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12150. * - BANKx_BASE_ADDRESS_HI
  12151. * Bits 31:0
  12152. * Purpose: Provide a mechanism to specify the base address of the
  12153. * MSDU_EXT bank physical/bus address.
  12154. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12155. * for systems with 32-bit format for bus addresses:
  12156. * - BANKx_BASE_ADDRESS
  12157. * Bits 31:0
  12158. * Purpose: Provide a mechanism to specify the base address of the
  12159. * MSDU_EXT bank physical/bus address.
  12160. * Value: MSDU_EXT bank physical / bus address
  12161. * - BANKx_MIN_ID
  12162. * Bits 15:0
  12163. * Purpose: Provide a mechanism to specify the min index that needs to
  12164. * mapped.
  12165. * - BANKx_MAX_ID
  12166. * Bits 31:16
  12167. * Purpose: Provide a mechanism to specify the max index that needs to
  12168. * mapped.
  12169. *
  12170. */
  12171. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12172. * safe value.
  12173. * @note MAX supported banks is 16.
  12174. */
  12175. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12176. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12177. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12178. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12179. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12180. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12181. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12183. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12185. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12186. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12187. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12188. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12189. do { \
  12190. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12191. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12192. } while (0)
  12193. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12194. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12195. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12196. do { \
  12197. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12198. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12199. } while (0)
  12200. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12201. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12202. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12203. do { \
  12204. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12205. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12206. } while (0)
  12207. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12208. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12209. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12210. do { \
  12211. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12212. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12213. } while (0)
  12214. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12215. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12216. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12217. do { \
  12218. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12219. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12220. } while (0)
  12221. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12222. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12223. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12224. do { \
  12225. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12226. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12227. } while (0)
  12228. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12229. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12230. /*
  12231. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12232. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12233. * addresses are stored in a XXX-bit field.
  12234. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12235. * htt_tx_frag_desc64_bank_cfg_t structs.
  12236. */
  12237. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12238. _paddr_bits_, \
  12239. _paddr__bank_base_address_) \
  12240. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12241. /** word 0 \
  12242. * msg_type: 8, \
  12243. * pdev_id: 2, \
  12244. * swap: 1, \
  12245. * reserved0: 5, \
  12246. * num_banks: 8, \
  12247. * desc_size: 8; \
  12248. */ \
  12249. A_UINT32 word0; \
  12250. /* \
  12251. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12252. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12253. * the second A_UINT32). \
  12254. */ \
  12255. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12256. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12257. } POSTPACK
  12258. /* define htt_tx_frag_desc32_bank_cfg_t */
  12259. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12260. /* define htt_tx_frag_desc64_bank_cfg_t */
  12261. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12262. /*
  12263. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12264. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12265. */
  12266. #if HTT_PADDR64
  12267. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12268. #else
  12269. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12270. #endif
  12271. /**
  12272. * @brief target -> host HTT TX Credit total count update message definition
  12273. *
  12274. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12275. *
  12276. *|31 16|15|14 9| 8 |7 0 |
  12277. *|---------------------+--+----------+-------+----------|
  12278. *|cur htt credit delta | Q| reserved | sign | msg type |
  12279. *|------------------------------------------------------|
  12280. *
  12281. * Header fields:
  12282. * - MSG_TYPE
  12283. * Bits 7:0
  12284. * Purpose: identifies this as a htt tx credit delta update message
  12285. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12286. * - SIGN
  12287. * Bits 8
  12288. * identifies whether credit delta is positive or negative
  12289. * Value:
  12290. * - 0x0: credit delta is positive, rebalance in some buffers
  12291. * - 0x1: credit delta is negative, rebalance out some buffers
  12292. * - reserved
  12293. * Bits 14:9
  12294. * Value: 0x0
  12295. * - TXQ_GRP
  12296. * Bit 15
  12297. * Purpose: indicates whether any tx queue group information elements
  12298. * are appended to the tx credit update message
  12299. * Value: 0 -> no tx queue group information element is present
  12300. * 1 -> a tx queue group information element immediately follows
  12301. * - DELTA_COUNT
  12302. * Bits 31:16
  12303. * Purpose: Specify current htt credit delta absolute count
  12304. */
  12305. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12306. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12307. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12308. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12309. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12310. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12311. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12312. do { \
  12313. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12314. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12315. } while (0)
  12316. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12317. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12318. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12319. do { \
  12320. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12321. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12322. } while (0)
  12323. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12324. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12325. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12326. do { \
  12327. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12328. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12329. } while (0)
  12330. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12331. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12332. #define HTT_TX_CREDIT_MSG_BYTES 4
  12333. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12334. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12335. /**
  12336. * @brief HTT WDI_IPA Operation Response Message
  12337. *
  12338. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12339. *
  12340. * @details
  12341. * HTT WDI_IPA Operation Response message is sent by target
  12342. * to host confirming suspend or resume operation.
  12343. * |31 24|23 16|15 8|7 0|
  12344. * |----------------+----------------+----------------+----------------|
  12345. * | op_code | Rsvd | msg_type |
  12346. * |-------------------------------------------------------------------|
  12347. * | Rsvd | Response len |
  12348. * |-------------------------------------------------------------------|
  12349. * | |
  12350. * | Response-type specific info |
  12351. * | |
  12352. * | |
  12353. * |-------------------------------------------------------------------|
  12354. * Header fields:
  12355. * - MSG_TYPE
  12356. * Bits 7:0
  12357. * Purpose: Identifies this as WDI_IPA Operation Response message
  12358. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12359. * - OP_CODE
  12360. * Bits 31:16
  12361. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12362. * value: = enum htt_wdi_ipa_op_code
  12363. * - RSP_LEN
  12364. * Bits 16:0
  12365. * Purpose: length for the response-type specific info
  12366. * value: = length in bytes for response-type specific info
  12367. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12368. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12369. */
  12370. PREPACK struct htt_wdi_ipa_op_response_t
  12371. {
  12372. /* DWORD 0: flags and meta-data */
  12373. A_UINT32
  12374. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12375. reserved1: 8,
  12376. op_code: 16;
  12377. A_UINT32
  12378. rsp_len: 16,
  12379. reserved2: 16;
  12380. } POSTPACK;
  12381. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12382. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12383. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12384. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12385. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12386. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12387. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12388. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12389. do { \
  12390. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12391. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12392. } while (0)
  12393. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12394. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12395. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12396. do { \
  12397. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12398. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12399. } while (0)
  12400. enum htt_phy_mode {
  12401. htt_phy_mode_11a = 0,
  12402. htt_phy_mode_11g = 1,
  12403. htt_phy_mode_11b = 2,
  12404. htt_phy_mode_11g_only = 3,
  12405. htt_phy_mode_11na_ht20 = 4,
  12406. htt_phy_mode_11ng_ht20 = 5,
  12407. htt_phy_mode_11na_ht40 = 6,
  12408. htt_phy_mode_11ng_ht40 = 7,
  12409. htt_phy_mode_11ac_vht20 = 8,
  12410. htt_phy_mode_11ac_vht40 = 9,
  12411. htt_phy_mode_11ac_vht80 = 10,
  12412. htt_phy_mode_11ac_vht20_2g = 11,
  12413. htt_phy_mode_11ac_vht40_2g = 12,
  12414. htt_phy_mode_11ac_vht80_2g = 13,
  12415. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12416. htt_phy_mode_11ac_vht160 = 15,
  12417. htt_phy_mode_max,
  12418. };
  12419. /**
  12420. * @brief target -> host HTT channel change indication
  12421. *
  12422. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12423. *
  12424. * @details
  12425. * Specify when a channel change occurs.
  12426. * This allows the host to precisely determine which rx frames arrived
  12427. * on the old channel and which rx frames arrived on the new channel.
  12428. *
  12429. *|31 |7 0 |
  12430. *|-------------------------------------------+----------|
  12431. *| reserved | msg type |
  12432. *|------------------------------------------------------|
  12433. *| primary_chan_center_freq_mhz |
  12434. *|------------------------------------------------------|
  12435. *| contiguous_chan1_center_freq_mhz |
  12436. *|------------------------------------------------------|
  12437. *| contiguous_chan2_center_freq_mhz |
  12438. *|------------------------------------------------------|
  12439. *| phy_mode |
  12440. *|------------------------------------------------------|
  12441. *
  12442. * Header fields:
  12443. * - MSG_TYPE
  12444. * Bits 7:0
  12445. * Purpose: identifies this as a htt channel change indication message
  12446. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12447. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12448. * Bits 31:0
  12449. * Purpose: identify the (center of the) new 20 MHz primary channel
  12450. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12451. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12452. * Bits 31:0
  12453. * Purpose: identify the (center of the) contiguous frequency range
  12454. * comprising the new channel.
  12455. * For example, if the new channel is a 80 MHz channel extending
  12456. * 60 MHz beyond the primary channel, this field would be 30 larger
  12457. * than the primary channel center frequency field.
  12458. * Value: center frequency of the contiguous frequency range comprising
  12459. * the full channel in MHz units
  12460. * (80+80 channels also use the CONTIG_CHAN2 field)
  12461. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12462. * Bits 31:0
  12463. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12464. * within a VHT 80+80 channel.
  12465. * This field is only relevant for VHT 80+80 channels.
  12466. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12467. * channel (arbitrary value for cases besides VHT 80+80)
  12468. * - PHY_MODE
  12469. * Bits 31:0
  12470. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12471. * and band
  12472. * Value: htt_phy_mode enum value
  12473. */
  12474. PREPACK struct htt_chan_change_t
  12475. {
  12476. /* DWORD 0: flags and meta-data */
  12477. A_UINT32
  12478. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12479. reserved1: 24;
  12480. A_UINT32 primary_chan_center_freq_mhz;
  12481. A_UINT32 contig_chan1_center_freq_mhz;
  12482. A_UINT32 contig_chan2_center_freq_mhz;
  12483. A_UINT32 phy_mode;
  12484. } POSTPACK;
  12485. /*
  12486. * Due to historical / backwards-compatibility reasons, maintain the
  12487. * below htt_chan_change_msg struct definition, which needs to be
  12488. * consistent with the above htt_chan_change_t struct definition
  12489. * (aside from the htt_chan_change_t definition including the msg_type
  12490. * dword within the message, and the htt_chan_change_msg only containing
  12491. * the payload of the message that follows the msg_type dword).
  12492. */
  12493. PREPACK struct htt_chan_change_msg {
  12494. A_UINT32 chan_mhz; /* frequency in mhz */
  12495. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12496. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12497. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12498. } POSTPACK;
  12499. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12500. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12501. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12502. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12503. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12504. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12505. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12506. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12507. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12508. do { \
  12509. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12510. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12511. } while (0)
  12512. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12513. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12514. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12515. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12516. do { \
  12517. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12518. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12519. } while (0)
  12520. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12521. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12522. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12523. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12524. do { \
  12525. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12526. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12527. } while (0)
  12528. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12529. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12530. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12531. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12532. do { \
  12533. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12534. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12535. } while (0)
  12536. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12537. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12538. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12539. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12540. /**
  12541. * @brief rx offload packet error message
  12542. *
  12543. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12544. *
  12545. * @details
  12546. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12547. * of target payload like mic err.
  12548. *
  12549. * |31 24|23 16|15 8|7 0|
  12550. * |----------------+----------------+----------------+----------------|
  12551. * | tid | vdev_id | msg_sub_type | msg_type |
  12552. * |-------------------------------------------------------------------|
  12553. * : (sub-type dependent content) :
  12554. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12555. * Header fields:
  12556. * - msg_type
  12557. * Bits 7:0
  12558. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12559. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12560. * - msg_sub_type
  12561. * Bits 15:8
  12562. * Purpose: Identifies which type of rx error is reported by this message
  12563. * value: htt_rx_ofld_pkt_err_type
  12564. * - vdev_id
  12565. * Bits 23:16
  12566. * Purpose: Identifies which vdev received the erroneous rx frame
  12567. * value:
  12568. * - tid
  12569. * Bits 31:24
  12570. * Purpose: Identifies the traffic type of the rx frame
  12571. * value:
  12572. *
  12573. * - The payload fields used if the sub-type == MIC error are shown below.
  12574. * Note - MIC err is per MSDU, while PN is per MPDU.
  12575. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12576. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12577. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12578. * instead of sending separate HTT messages for each wrong MSDU within
  12579. * the MPDU.
  12580. *
  12581. * |31 24|23 16|15 8|7 0|
  12582. * |----------------+----------------+----------------+----------------|
  12583. * | Rsvd | key_id | peer_id |
  12584. * |-------------------------------------------------------------------|
  12585. * | receiver MAC addr 31:0 |
  12586. * |-------------------------------------------------------------------|
  12587. * | Rsvd | receiver MAC addr 47:32 |
  12588. * |-------------------------------------------------------------------|
  12589. * | transmitter MAC addr 31:0 |
  12590. * |-------------------------------------------------------------------|
  12591. * | Rsvd | transmitter MAC addr 47:32 |
  12592. * |-------------------------------------------------------------------|
  12593. * | PN 31:0 |
  12594. * |-------------------------------------------------------------------|
  12595. * | Rsvd | PN 47:32 |
  12596. * |-------------------------------------------------------------------|
  12597. * - peer_id
  12598. * Bits 15:0
  12599. * Purpose: identifies which peer is frame is from
  12600. * value:
  12601. * - key_id
  12602. * Bits 23:16
  12603. * Purpose: identifies key_id of rx frame
  12604. * value:
  12605. * - RA_31_0 (receiver MAC addr 31:0)
  12606. * Bits 31:0
  12607. * Purpose: identifies by MAC address which vdev received the frame
  12608. * value: MAC address lower 4 bytes
  12609. * - RA_47_32 (receiver MAC addr 47:32)
  12610. * Bits 15:0
  12611. * Purpose: identifies by MAC address which vdev received the frame
  12612. * value: MAC address upper 2 bytes
  12613. * - TA_31_0 (transmitter MAC addr 31:0)
  12614. * Bits 31:0
  12615. * Purpose: identifies by MAC address which peer transmitted the frame
  12616. * value: MAC address lower 4 bytes
  12617. * - TA_47_32 (transmitter MAC addr 47:32)
  12618. * Bits 15:0
  12619. * Purpose: identifies by MAC address which peer transmitted the frame
  12620. * value: MAC address upper 2 bytes
  12621. * - PN_31_0
  12622. * Bits 31:0
  12623. * Purpose: Identifies pn of rx frame
  12624. * value: PN lower 4 bytes
  12625. * - PN_47_32
  12626. * Bits 15:0
  12627. * Purpose: Identifies pn of rx frame
  12628. * value:
  12629. * TKIP or CCMP: PN upper 2 bytes
  12630. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12631. */
  12632. enum htt_rx_ofld_pkt_err_type {
  12633. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12634. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12635. };
  12636. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12637. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12638. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12639. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12640. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12641. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12642. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12643. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12644. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12645. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12646. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12647. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12648. do { \
  12649. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12650. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12651. } while (0)
  12652. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12653. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12654. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12655. do { \
  12656. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12657. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12658. } while (0)
  12659. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12660. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12661. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12662. do { \
  12663. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12664. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12665. } while (0)
  12666. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12675. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12685. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12686. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12688. do { \
  12689. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12690. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12691. } while (0)
  12692. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12693. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12694. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12695. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12696. do { \
  12697. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12698. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12699. } while (0)
  12700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12701. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12702. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12703. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12704. do { \
  12705. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12706. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12707. } while (0)
  12708. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12709. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12710. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12711. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12714. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12715. } while (0)
  12716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12717. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12718. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12719. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12720. do { \
  12721. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12722. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12723. } while (0)
  12724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12725. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12726. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12727. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12728. do { \
  12729. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12730. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12731. } while (0)
  12732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12733. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12734. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12735. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12736. do { \
  12737. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12738. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12739. } while (0)
  12740. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12741. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12742. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12743. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12744. do { \
  12745. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12746. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12747. } while (0)
  12748. /**
  12749. * @brief target -> host peer rate report message
  12750. *
  12751. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12752. *
  12753. * @details
  12754. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12755. * justified rate of all the peers.
  12756. *
  12757. * |31 24|23 16|15 8|7 0|
  12758. * |----------------+----------------+----------------+----------------|
  12759. * | peer_count | | msg_type |
  12760. * |-------------------------------------------------------------------|
  12761. * : Payload (variant number of peer rate report) :
  12762. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12763. * Header fields:
  12764. * - msg_type
  12765. * Bits 7:0
  12766. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12767. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12768. * - reserved
  12769. * Bits 15:8
  12770. * Purpose:
  12771. * value:
  12772. * - peer_count
  12773. * Bits 31:16
  12774. * Purpose: Specify how many peer rate report elements are present in the payload.
  12775. * value:
  12776. *
  12777. * Payload:
  12778. * There are variant number of peer rate report follow the first 32 bits.
  12779. * The peer rate report is defined as follows.
  12780. *
  12781. * |31 20|19 16|15 0|
  12782. * |-----------------------+---------+---------------------------------|-
  12783. * | reserved | phy | peer_id | \
  12784. * |-------------------------------------------------------------------| -> report #0
  12785. * | rate | /
  12786. * |-----------------------+---------+---------------------------------|-
  12787. * | reserved | phy | peer_id | \
  12788. * |-------------------------------------------------------------------| -> report #1
  12789. * | rate | /
  12790. * |-----------------------+---------+---------------------------------|-
  12791. * | reserved | phy | peer_id | \
  12792. * |-------------------------------------------------------------------| -> report #2
  12793. * | rate | /
  12794. * |-------------------------------------------------------------------|-
  12795. * : :
  12796. * : :
  12797. * : :
  12798. * :-------------------------------------------------------------------:
  12799. *
  12800. * - peer_id
  12801. * Bits 15:0
  12802. * Purpose: identify the peer
  12803. * value:
  12804. * - phy
  12805. * Bits 19:16
  12806. * Purpose: identify which phy is in use
  12807. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12808. * Please see enum htt_peer_report_phy_type for detail.
  12809. * - reserved
  12810. * Bits 31:20
  12811. * Purpose:
  12812. * value:
  12813. * - rate
  12814. * Bits 31:0
  12815. * Purpose: represent the justified rate of the peer specified by peer_id
  12816. * value:
  12817. */
  12818. enum htt_peer_rate_report_phy_type {
  12819. HTT_PEER_RATE_REPORT_11B = 0,
  12820. HTT_PEER_RATE_REPORT_11A_G,
  12821. HTT_PEER_RATE_REPORT_11N,
  12822. HTT_PEER_RATE_REPORT_11AC,
  12823. };
  12824. #define HTT_PEER_RATE_REPORT_SIZE 8
  12825. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12826. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12827. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12828. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12829. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12830. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12831. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12832. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12833. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12834. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12835. do { \
  12836. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12837. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12838. } while (0)
  12839. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12840. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12841. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12842. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12843. do { \
  12844. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12845. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12846. } while (0)
  12847. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12848. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12849. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12850. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12851. do { \
  12852. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12853. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12854. } while (0)
  12855. /**
  12856. * @brief target -> host flow pool map message
  12857. *
  12858. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12859. *
  12860. * @details
  12861. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12862. * a flow of descriptors.
  12863. *
  12864. * This message is in TLV format and indicates the parameters to be setup a
  12865. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12866. * receive descriptors from a specified pool.
  12867. *
  12868. * The message would appear as follows:
  12869. *
  12870. * |31 24|23 16|15 8|7 0|
  12871. * |----------------+----------------+----------------+----------------|
  12872. * header | reserved | num_flows | msg_type |
  12873. * |-------------------------------------------------------------------|
  12874. * | |
  12875. * : payload :
  12876. * | |
  12877. * |-------------------------------------------------------------------|
  12878. *
  12879. * The header field is one DWORD long and is interpreted as follows:
  12880. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12881. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12882. * this message
  12883. * b'16-31 - reserved: These bits are reserved for future use
  12884. *
  12885. * Payload:
  12886. * The payload would contain multiple objects of the following structure. Each
  12887. * object represents a flow.
  12888. *
  12889. * |31 24|23 16|15 8|7 0|
  12890. * |----------------+----------------+----------------+----------------|
  12891. * header | reserved | num_flows | msg_type |
  12892. * |-------------------------------------------------------------------|
  12893. * payload0| flow_type |
  12894. * |-------------------------------------------------------------------|
  12895. * | flow_id |
  12896. * |-------------------------------------------------------------------|
  12897. * | reserved0 | flow_pool_id |
  12898. * |-------------------------------------------------------------------|
  12899. * | reserved1 | flow_pool_size |
  12900. * |-------------------------------------------------------------------|
  12901. * | reserved2 |
  12902. * |-------------------------------------------------------------------|
  12903. * payload1| flow_type |
  12904. * |-------------------------------------------------------------------|
  12905. * | flow_id |
  12906. * |-------------------------------------------------------------------|
  12907. * | reserved0 | flow_pool_id |
  12908. * |-------------------------------------------------------------------|
  12909. * | reserved1 | flow_pool_size |
  12910. * |-------------------------------------------------------------------|
  12911. * | reserved2 |
  12912. * |-------------------------------------------------------------------|
  12913. * | . |
  12914. * | . |
  12915. * | . |
  12916. * |-------------------------------------------------------------------|
  12917. *
  12918. * Each payload is 5 DWORDS long and is interpreted as follows:
  12919. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12920. * this flow is associated. It can be VDEV, peer,
  12921. * or tid (AC). Based on enum htt_flow_type.
  12922. *
  12923. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12924. * object. For flow_type vdev it is set to the
  12925. * vdevid, for peer it is peerid and for tid, it is
  12926. * tid_num.
  12927. *
  12928. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12929. * in the host for this flow
  12930. * b'16:31 - reserved0: This field in reserved for the future. In case
  12931. * we have a hierarchical implementation (HCM) of
  12932. * pools, it can be used to indicate the ID of the
  12933. * parent-pool.
  12934. *
  12935. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12936. * Descriptors for this flow will be
  12937. * allocated from this pool in the host.
  12938. * b'16:31 - reserved1: This field in reserved for the future. In case
  12939. * we have a hierarchical implementation of pools,
  12940. * it can be used to indicate the max number of
  12941. * descriptors in the pool. The b'0:15 can be used
  12942. * to indicate min number of descriptors in the
  12943. * HCM scheme.
  12944. *
  12945. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12946. * we have a hierarchical implementation of pools,
  12947. * b'0:15 can be used to indicate the
  12948. * priority-based borrowing (PBB) threshold of
  12949. * the flow's pool. The b'16:31 are still left
  12950. * reserved.
  12951. */
  12952. enum htt_flow_type {
  12953. FLOW_TYPE_VDEV = 0,
  12954. /* Insert new flow types above this line */
  12955. };
  12956. PREPACK struct htt_flow_pool_map_payload_t {
  12957. A_UINT32 flow_type;
  12958. A_UINT32 flow_id;
  12959. A_UINT32 flow_pool_id:16,
  12960. reserved0:16;
  12961. A_UINT32 flow_pool_size:16,
  12962. reserved1:16;
  12963. A_UINT32 reserved2;
  12964. } POSTPACK;
  12965. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12966. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12967. (sizeof(struct htt_flow_pool_map_payload_t))
  12968. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12969. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12970. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12971. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12972. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12973. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12974. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12975. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12976. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12977. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12978. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12979. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12980. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12981. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12982. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12983. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12984. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12985. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12986. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12987. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12988. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12989. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12990. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12991. do { \
  12992. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12993. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12994. } while (0)
  12995. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12996. do { \
  12997. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12998. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12999. } while (0)
  13000. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13003. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13004. } while (0)
  13005. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13006. do { \
  13007. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13008. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13009. } while (0)
  13010. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13011. do { \
  13012. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13013. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13014. } while (0)
  13015. /**
  13016. * @brief target -> host flow pool unmap message
  13017. *
  13018. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13019. *
  13020. * @details
  13021. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13022. * down a flow of descriptors.
  13023. * This message indicates that for the flow (whose ID is provided) is wanting
  13024. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13025. * pool of descriptors from where descriptors are being allocated for this
  13026. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13027. * be unmapped by the host.
  13028. *
  13029. * The message would appear as follows:
  13030. *
  13031. * |31 24|23 16|15 8|7 0|
  13032. * |----------------+----------------+----------------+----------------|
  13033. * | reserved0 | msg_type |
  13034. * |-------------------------------------------------------------------|
  13035. * | flow_type |
  13036. * |-------------------------------------------------------------------|
  13037. * | flow_id |
  13038. * |-------------------------------------------------------------------|
  13039. * | reserved1 | flow_pool_id |
  13040. * |-------------------------------------------------------------------|
  13041. *
  13042. * The message is interpreted as follows:
  13043. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13044. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13045. * b'8:31 - reserved0: Reserved for future use
  13046. *
  13047. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13048. * this flow is associated. It can be VDEV, peer,
  13049. * or tid (AC). Based on enum htt_flow_type.
  13050. *
  13051. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13052. * object. For flow_type vdev it is set to the
  13053. * vdevid, for peer it is peerid and for tid, it is
  13054. * tid_num.
  13055. *
  13056. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13057. * used in the host for this flow
  13058. * b'16:31 - reserved0: This field in reserved for the future.
  13059. *
  13060. */
  13061. PREPACK struct htt_flow_pool_unmap_t {
  13062. A_UINT32 msg_type:8,
  13063. reserved0:24;
  13064. A_UINT32 flow_type;
  13065. A_UINT32 flow_id;
  13066. A_UINT32 flow_pool_id:16,
  13067. reserved1:16;
  13068. } POSTPACK;
  13069. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13070. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13071. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13072. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13073. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13074. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13075. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13076. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13077. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13078. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13079. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13080. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13081. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13082. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13083. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13084. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13085. do { \
  13086. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13087. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13088. } while (0)
  13089. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13090. do { \
  13091. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13092. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13093. } while (0)
  13094. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13095. do { \
  13096. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13097. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13098. } while (0)
  13099. /**
  13100. * @brief target -> host SRING setup done message
  13101. *
  13102. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13103. *
  13104. * @details
  13105. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13106. * SRNG ring setup is done
  13107. *
  13108. * This message indicates whether the last setup operation is successful.
  13109. * It will be sent to host when host set respose_required bit in
  13110. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13111. * The message would appear as follows:
  13112. *
  13113. * |31 24|23 16|15 8|7 0|
  13114. * |--------------- +----------------+----------------+----------------|
  13115. * | setup_status | ring_id | pdev_id | msg_type |
  13116. * |-------------------------------------------------------------------|
  13117. *
  13118. * The message is interpreted as follows:
  13119. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13120. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13121. * b'8:15 - pdev_id:
  13122. * 0 (for rings at SOC/UMAC level),
  13123. * 1/2/3 mac id (for rings at LMAC level)
  13124. * b'16:23 - ring_id: Identify the ring which is set up
  13125. * More details can be got from enum htt_srng_ring_id
  13126. * b'24:31 - setup_status: Indicate status of setup operation
  13127. * Refer to htt_ring_setup_status
  13128. */
  13129. PREPACK struct htt_sring_setup_done_t {
  13130. A_UINT32 msg_type: 8,
  13131. pdev_id: 8,
  13132. ring_id: 8,
  13133. setup_status: 8;
  13134. } POSTPACK;
  13135. enum htt_ring_setup_status {
  13136. htt_ring_setup_status_ok = 0,
  13137. htt_ring_setup_status_error,
  13138. };
  13139. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13140. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13141. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13142. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13143. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13144. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13145. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13146. do { \
  13147. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13148. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13149. } while (0)
  13150. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13151. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13152. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13153. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13154. HTT_SRING_SETUP_DONE_RING_ID_S)
  13155. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13156. do { \
  13157. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13158. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13159. } while (0)
  13160. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13161. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13162. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13163. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13164. HTT_SRING_SETUP_DONE_STATUS_S)
  13165. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13166. do { \
  13167. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13168. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13169. } while (0)
  13170. /**
  13171. * @brief target -> flow map flow info
  13172. *
  13173. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13174. *
  13175. * @details
  13176. * HTT TX map flow entry with tqm flow pointer
  13177. * Sent from firmware to host to add tqm flow pointer in corresponding
  13178. * flow search entry. Flow metadata is replayed back to host as part of this
  13179. * struct to enable host to find the specific flow search entry
  13180. *
  13181. * The message would appear as follows:
  13182. *
  13183. * |31 28|27 18|17 14|13 8|7 0|
  13184. * |-------+------------------------------------------+----------------|
  13185. * | rsvd0 | fse_hsh_idx | msg_type |
  13186. * |-------------------------------------------------------------------|
  13187. * | rsvd1 | tid | peer_id |
  13188. * |-------------------------------------------------------------------|
  13189. * | tqm_flow_pntr_lo |
  13190. * |-------------------------------------------------------------------|
  13191. * | tqm_flow_pntr_hi |
  13192. * |-------------------------------------------------------------------|
  13193. * | fse_meta_data |
  13194. * |-------------------------------------------------------------------|
  13195. *
  13196. * The message is interpreted as follows:
  13197. *
  13198. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13199. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13200. *
  13201. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13202. * for this flow entry
  13203. *
  13204. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13205. *
  13206. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13207. *
  13208. * dword1 - b'14:17 - tid
  13209. *
  13210. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13211. *
  13212. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13213. *
  13214. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13215. *
  13216. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13217. * given by host
  13218. */
  13219. PREPACK struct htt_tx_map_flow_info {
  13220. A_UINT32
  13221. msg_type: 8,
  13222. fse_hsh_idx: 20,
  13223. rsvd0: 4;
  13224. A_UINT32
  13225. peer_id: 14,
  13226. tid: 4,
  13227. rsvd1: 14;
  13228. A_UINT32 tqm_flow_pntr_lo;
  13229. A_UINT32 tqm_flow_pntr_hi;
  13230. struct htt_tx_flow_metadata fse_meta_data;
  13231. } POSTPACK;
  13232. /* DWORD 0 */
  13233. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13234. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13235. /* DWORD 1 */
  13236. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13237. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13238. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13239. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13240. /* DWORD 0 */
  13241. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13242. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13243. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13244. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13245. do { \
  13246. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13247. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13248. } while (0)
  13249. /* DWORD 1 */
  13250. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13251. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13252. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13253. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13254. do { \
  13255. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13256. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13257. } while (0)
  13258. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13259. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13260. HTT_TX_MAP_FLOW_INFO_TID_S)
  13261. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13262. do { \
  13263. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13264. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13265. } while (0)
  13266. /*
  13267. * htt_dbg_ext_stats_status -
  13268. * present - The requested stats have been delivered in full.
  13269. * This indicates that either the stats information was contained
  13270. * in its entirety within this message, or else this message
  13271. * completes the delivery of the requested stats info that was
  13272. * partially delivered through earlier STATS_CONF messages.
  13273. * partial - The requested stats have been delivered in part.
  13274. * One or more subsequent STATS_CONF messages with the same
  13275. * cookie value will be sent to deliver the remainder of the
  13276. * information.
  13277. * error - The requested stats could not be delivered, for example due
  13278. * to a shortage of memory to construct a message holding the
  13279. * requested stats.
  13280. * invalid - The requested stat type is either not recognized, or the
  13281. * target is configured to not gather the stats type in question.
  13282. */
  13283. enum htt_dbg_ext_stats_status {
  13284. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13285. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13286. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13287. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13288. };
  13289. /**
  13290. * @brief target -> host ppdu stats upload
  13291. *
  13292. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13293. *
  13294. * @details
  13295. * The following field definitions describe the format of the HTT target
  13296. * to host ppdu stats indication message.
  13297. *
  13298. *
  13299. * |31 16|15 12|11 10|9 8|7 0 |
  13300. * |----------------------------------------------------------------------|
  13301. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13302. * |----------------------------------------------------------------------|
  13303. * | ppdu_id |
  13304. * |----------------------------------------------------------------------|
  13305. * | Timestamp in us |
  13306. * |----------------------------------------------------------------------|
  13307. * | reserved |
  13308. * |----------------------------------------------------------------------|
  13309. * | type-specific stats info |
  13310. * | (see htt_ppdu_stats.h) |
  13311. * |----------------------------------------------------------------------|
  13312. * Header fields:
  13313. * - MSG_TYPE
  13314. * Bits 7:0
  13315. * Purpose: Identifies this is a PPDU STATS indication
  13316. * message.
  13317. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13318. * - mac_id
  13319. * Bits 9:8
  13320. * Purpose: mac_id of this ppdu_id
  13321. * Value: 0-3
  13322. * - pdev_id
  13323. * Bits 11:10
  13324. * Purpose: pdev_id of this ppdu_id
  13325. * Value: 0-3
  13326. * 0 (for rings at SOC level),
  13327. * 1/2/3 PDEV -> 0/1/2
  13328. * - payload_size
  13329. * Bits 31:16
  13330. * Purpose: total tlv size
  13331. * Value: payload_size in bytes
  13332. */
  13333. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13334. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13335. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13336. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13337. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13338. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13339. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13340. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13341. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13342. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13343. do { \
  13344. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13345. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13346. } while (0)
  13347. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13348. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13349. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13350. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13351. do { \
  13352. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13353. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13354. } while (0)
  13355. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13356. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13357. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13358. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13361. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13362. } while (0)
  13363. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13364. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13365. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13366. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13367. do { \
  13368. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13369. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13370. } while (0)
  13371. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13372. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13373. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13374. /* htt_t2h_ppdu_stats_ind_hdr_t
  13375. * This struct contains the fields within the header of the
  13376. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13377. * stats info.
  13378. * This struct assumes little-endian layout, and thus is only
  13379. * suitable for use within processors known to be little-endian
  13380. * (such as the target).
  13381. * In contrast, the above macros provide endian-portable methods
  13382. * to get and set the bitfields within this PPDU_STATS_IND header.
  13383. */
  13384. typedef struct {
  13385. A_UINT32 msg_type: 8, /* bits 7:0 */
  13386. mac_id: 2, /* bits 9:8 */
  13387. pdev_id: 2, /* bits 11:10 */
  13388. reserved1: 4, /* bits 15:12 */
  13389. payload_size: 16; /* bits 31:16 */
  13390. A_UINT32 ppdu_id;
  13391. A_UINT32 timestamp_us;
  13392. A_UINT32 reserved2;
  13393. } htt_t2h_ppdu_stats_ind_hdr_t;
  13394. /**
  13395. * @brief target -> host extended statistics upload
  13396. *
  13397. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13398. *
  13399. * @details
  13400. * The following field definitions describe the format of the HTT target
  13401. * to host stats upload confirmation message.
  13402. * The message contains a cookie echoed from the HTT host->target stats
  13403. * upload request, which identifies which request the confirmation is
  13404. * for, and a single stats can span over multiple HTT stats indication
  13405. * due to the HTT message size limitation so every HTT ext stats indication
  13406. * will have tag-length-value stats information elements.
  13407. * The tag-length header for each HTT stats IND message also includes a
  13408. * status field, to indicate whether the request for the stat type in
  13409. * question was fully met, partially met, unable to be met, or invalid
  13410. * (if the stat type in question is disabled in the target).
  13411. * A Done bit 1's indicate the end of the of stats info elements.
  13412. *
  13413. *
  13414. * |31 16|15 12|11|10 8|7 5|4 0|
  13415. * |--------------------------------------------------------------|
  13416. * | reserved | msg type |
  13417. * |--------------------------------------------------------------|
  13418. * | cookie LSBs |
  13419. * |--------------------------------------------------------------|
  13420. * | cookie MSBs |
  13421. * |--------------------------------------------------------------|
  13422. * | stats entry length | rsvd | D| S | stat type |
  13423. * |--------------------------------------------------------------|
  13424. * | type-specific stats info |
  13425. * | (see htt_stats.h) |
  13426. * |--------------------------------------------------------------|
  13427. * Header fields:
  13428. * - MSG_TYPE
  13429. * Bits 7:0
  13430. * Purpose: Identifies this is a extended statistics upload confirmation
  13431. * message.
  13432. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13433. * - COOKIE_LSBS
  13434. * Bits 31:0
  13435. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13436. * message with its preceding host->target stats request message.
  13437. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13438. * - COOKIE_MSBS
  13439. * Bits 31:0
  13440. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13441. * message with its preceding host->target stats request message.
  13442. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13443. *
  13444. * Stats Information Element tag-length header fields:
  13445. * - STAT_TYPE
  13446. * Bits 7:0
  13447. * Purpose: identifies the type of statistics info held in the
  13448. * following information element
  13449. * Value: htt_dbg_ext_stats_type
  13450. * - STATUS
  13451. * Bits 10:8
  13452. * Purpose: indicate whether the requested stats are present
  13453. * Value: htt_dbg_ext_stats_status
  13454. * - DONE
  13455. * Bits 11
  13456. * Purpose:
  13457. * Indicates the completion of the stats entry, this will be the last
  13458. * stats conf HTT segment for the requested stats type.
  13459. * Value:
  13460. * 0 -> the stats retrieval is ongoing
  13461. * 1 -> the stats retrieval is complete
  13462. * - LENGTH
  13463. * Bits 31:16
  13464. * Purpose: indicate the stats information size
  13465. * Value: This field specifies the number of bytes of stats information
  13466. * that follows the element tag-length header.
  13467. * It is expected but not required that this length is a multiple of
  13468. * 4 bytes.
  13469. */
  13470. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13471. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13472. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13473. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13474. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13475. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13476. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13477. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13478. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13479. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13480. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13481. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13482. do { \
  13483. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13484. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13485. } while (0)
  13486. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13487. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13488. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13489. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13490. do { \
  13491. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13492. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13493. } while (0)
  13494. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13495. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13496. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13497. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13498. do { \
  13499. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13500. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13501. } while (0)
  13502. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13503. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13504. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13505. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13506. do { \
  13507. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13508. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13509. } while (0)
  13510. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13511. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13512. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13513. typedef enum {
  13514. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13515. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13516. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13517. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13518. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13519. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13520. /* Reserved from 128 - 255 for target internal use.*/
  13521. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13522. } HTT_PEER_TYPE;
  13523. /** macro to convert MAC address from char array to HTT word format */
  13524. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13525. (phtt_mac_addr)->mac_addr31to0 = \
  13526. (((c_macaddr)[0] << 0) | \
  13527. ((c_macaddr)[1] << 8) | \
  13528. ((c_macaddr)[2] << 16) | \
  13529. ((c_macaddr)[3] << 24)); \
  13530. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13531. } while (0)
  13532. /**
  13533. * @brief target -> host monitor mac header indication message
  13534. *
  13535. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13536. *
  13537. * @details
  13538. * The following diagram shows the format of the monitor mac header message
  13539. * sent from the target to the host.
  13540. * This message is primarily sent when promiscuous rx mode is enabled.
  13541. * One message is sent per rx PPDU.
  13542. *
  13543. * |31 24|23 16|15 8|7 0|
  13544. * |-------------------------------------------------------------|
  13545. * | peer_id | reserved0 | msg_type |
  13546. * |-------------------------------------------------------------|
  13547. * | reserved1 | num_mpdu |
  13548. * |-------------------------------------------------------------|
  13549. * | struct hw_rx_desc |
  13550. * | (see wal_rx_desc.h) |
  13551. * |-------------------------------------------------------------|
  13552. * | struct ieee80211_frame_addr4 |
  13553. * | (see ieee80211_defs.h) |
  13554. * |-------------------------------------------------------------|
  13555. * | struct ieee80211_frame_addr4 |
  13556. * | (see ieee80211_defs.h) |
  13557. * |-------------------------------------------------------------|
  13558. * | ...... |
  13559. * |-------------------------------------------------------------|
  13560. *
  13561. * Header fields:
  13562. * - msg_type
  13563. * Bits 7:0
  13564. * Purpose: Identifies this is a monitor mac header indication message.
  13565. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13566. * - peer_id
  13567. * Bits 31:16
  13568. * Purpose: Software peer id given by host during association,
  13569. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13570. * for rx PPDUs received from unassociated peers.
  13571. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13572. * - num_mpdu
  13573. * Bits 15:0
  13574. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13575. * delivered within the message.
  13576. * Value: 1 to 32
  13577. * num_mpdu is limited to a maximum value of 32, due to buffer
  13578. * size limits. For PPDUs with more than 32 MPDUs, only the
  13579. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13580. * the PPDU will be provided.
  13581. */
  13582. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13583. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13584. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13585. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13586. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13587. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13588. do { \
  13589. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13590. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13591. } while (0)
  13592. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13593. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13594. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13595. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13596. do { \
  13597. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13598. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13599. } while (0)
  13600. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13601. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13602. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13603. /**
  13604. * @brief target -> host flow pool resize Message
  13605. *
  13606. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13607. *
  13608. * @details
  13609. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13610. * the flow pool associated with the specified ID is resized
  13611. *
  13612. * The message would appear as follows:
  13613. *
  13614. * |31 16|15 8|7 0|
  13615. * |---------------------------------+----------------+----------------|
  13616. * | reserved0 | Msg type |
  13617. * |-------------------------------------------------------------------|
  13618. * | flow pool new size | flow pool ID |
  13619. * |-------------------------------------------------------------------|
  13620. *
  13621. * The message is interpreted as follows:
  13622. * b'0:7 - msg_type: This will be set to 0x21
  13623. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13624. *
  13625. * b'0:15 - flow pool ID: Existing flow pool ID
  13626. *
  13627. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13628. *
  13629. */
  13630. PREPACK struct htt_flow_pool_resize_t {
  13631. A_UINT32 msg_type:8,
  13632. reserved0:24;
  13633. A_UINT32 flow_pool_id:16,
  13634. flow_pool_new_size:16;
  13635. } POSTPACK;
  13636. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13637. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13638. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13639. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13640. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13641. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13642. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13643. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13644. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13645. do { \
  13646. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13647. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13648. } while (0)
  13649. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13650. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13651. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13652. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13653. do { \
  13654. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13655. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13656. } while (0)
  13657. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13658. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13659. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13660. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13661. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13662. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13663. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13664. /*
  13665. * The read and write indices point to the data within the host buffer.
  13666. * Because the first 4 bytes of the host buffer is used for the read index and
  13667. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13668. * The read index and write index are the byte offsets from the base of the
  13669. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13670. * Refer the ASCII text picture below.
  13671. */
  13672. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13673. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13674. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13675. /*
  13676. ***************************************************************************
  13677. *
  13678. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13679. *
  13680. ***************************************************************************
  13681. *
  13682. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13683. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13684. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13685. * written into the Host memory region mentioned below.
  13686. *
  13687. * Read index is updated by the Host. At any point of time, the read index will
  13688. * indicate the index that will next be read by the Host. The read index is
  13689. * in units of bytes offset from the base of the meta-data buffer.
  13690. *
  13691. * Write index is updated by the FW. At any point of time, the write index will
  13692. * indicate from where the FW can start writing any new data. The write index is
  13693. * in units of bytes offset from the base of the meta-data buffer.
  13694. *
  13695. * If the Host is not fast enough in reading the CFR data, any new capture data
  13696. * would be dropped if there is no space left to write the new captures.
  13697. *
  13698. * The last 4 bytes of the memory region will have the magic pattern
  13699. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13700. * not overrun the host buffer.
  13701. *
  13702. * ,--------------------. read and write indices store the
  13703. * | | byte offset from the base of the
  13704. * | ,--------+--------. meta-data buffer to the next
  13705. * | | | | location within the data buffer
  13706. * | | v v that will be read / written
  13707. * ************************************************************************
  13708. * * Read * Write * * Magic *
  13709. * * index * index * CFR data1 ...... CFR data N * pattern *
  13710. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13711. * ************************************************************************
  13712. * |<---------- data buffer ---------->|
  13713. *
  13714. * |<----------------- meta-data buffer allocated in Host ----------------|
  13715. *
  13716. * Note:
  13717. * - Considering the 4 bytes needed to store the Read index (R) and the
  13718. * Write index (W), the initial value is as follows:
  13719. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13720. * - Buffer empty condition:
  13721. * R = W
  13722. *
  13723. * Regarding CFR data format:
  13724. * --------------------------
  13725. *
  13726. * Each CFR tone is stored in HW as 16-bits with the following format:
  13727. * {bits[15:12], bits[11:6], bits[5:0]} =
  13728. * {unsigned exponent (4 bits),
  13729. * signed mantissa_real (6 bits),
  13730. * signed mantissa_imag (6 bits)}
  13731. *
  13732. * CFR_real = mantissa_real * 2^(exponent-5)
  13733. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13734. *
  13735. *
  13736. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13737. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13738. *
  13739. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13740. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13741. * .
  13742. * .
  13743. * .
  13744. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13745. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13746. */
  13747. /* Bandwidth of peer CFR captures */
  13748. typedef enum {
  13749. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13750. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13751. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13752. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13753. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13754. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13755. } HTT_PEER_CFR_CAPTURE_BW;
  13756. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13757. * was captured
  13758. */
  13759. typedef enum {
  13760. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13761. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13762. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13763. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13764. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13765. } HTT_PEER_CFR_CAPTURE_MODE;
  13766. typedef enum {
  13767. /* This message type is currently used for the below purpose:
  13768. *
  13769. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13770. * wmi_peer_cfr_capture_cmd.
  13771. * If payload_present bit is set to 0 then the associated memory region
  13772. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13773. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13774. * message; the CFR dump will be present at the end of the message,
  13775. * after the chan_phy_mode.
  13776. */
  13777. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13778. /* Always keep this last */
  13779. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13780. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13781. /**
  13782. * @brief target -> host CFR dump completion indication message definition
  13783. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13784. *
  13785. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13786. *
  13787. * @details
  13788. * The following diagram shows the format of the Channel Frequency Response
  13789. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13790. * the channel capture of a peer is copied by Firmware into the Host memory
  13791. *
  13792. * **************************************************************************
  13793. *
  13794. * Message format when the CFR capture message type is
  13795. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13796. *
  13797. * **************************************************************************
  13798. *
  13799. * |31 16|15 |8|7 0|
  13800. * |----------------------------------------------------------------|
  13801. * header: | reserved |P| msg_type |
  13802. * word 0 | | | |
  13803. * |----------------------------------------------------------------|
  13804. * payload: | cfr_capture_msg_type |
  13805. * word 1 | |
  13806. * |----------------------------------------------------------------|
  13807. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13808. * word 2 | | | | | | | | |
  13809. * |----------------------------------------------------------------|
  13810. * | mac_addr31to0 |
  13811. * word 3 | |
  13812. * |----------------------------------------------------------------|
  13813. * | unused / reserved | mac_addr47to32 |
  13814. * word 4 | | |
  13815. * |----------------------------------------------------------------|
  13816. * | index |
  13817. * word 5 | |
  13818. * |----------------------------------------------------------------|
  13819. * | length |
  13820. * word 6 | |
  13821. * |----------------------------------------------------------------|
  13822. * | timestamp |
  13823. * word 7 | |
  13824. * |----------------------------------------------------------------|
  13825. * | counter |
  13826. * word 8 | |
  13827. * |----------------------------------------------------------------|
  13828. * | chan_mhz |
  13829. * word 9 | |
  13830. * |----------------------------------------------------------------|
  13831. * | band_center_freq1 |
  13832. * word 10 | |
  13833. * |----------------------------------------------------------------|
  13834. * | band_center_freq2 |
  13835. * word 11 | |
  13836. * |----------------------------------------------------------------|
  13837. * | chan_phy_mode |
  13838. * word 12 | |
  13839. * |----------------------------------------------------------------|
  13840. * where,
  13841. * P - payload present bit (payload_present explained below)
  13842. * req_id - memory request id (mem_req_id explained below)
  13843. * S - status field (status explained below)
  13844. * capbw - capture bandwidth (capture_bw explained below)
  13845. * mode - mode of capture (mode explained below)
  13846. * sts - space time streams (sts_count explained below)
  13847. * chbw - channel bandwidth (channel_bw explained below)
  13848. * captype - capture type (cap_type explained below)
  13849. *
  13850. * The following field definitions describe the format of the CFR dump
  13851. * completion indication sent from the target to the host
  13852. *
  13853. * Header fields:
  13854. *
  13855. * Word 0
  13856. * - msg_type
  13857. * Bits 7:0
  13858. * Purpose: Identifies this as CFR TX completion indication
  13859. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13860. * - payload_present
  13861. * Bit 8
  13862. * Purpose: Identifies how CFR data is sent to host
  13863. * Value: 0 - If CFR Payload is written to host memory
  13864. * 1 - If CFR Payload is sent as part of HTT message
  13865. * (This is the requirement for SDIO/USB where it is
  13866. * not possible to write CFR data to host memory)
  13867. * - reserved
  13868. * Bits 31:9
  13869. * Purpose: Reserved
  13870. * Value: 0
  13871. *
  13872. * Payload fields:
  13873. *
  13874. * Word 1
  13875. * - cfr_capture_msg_type
  13876. * Bits 31:0
  13877. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13878. * to specify the format used for the remainder of the message
  13879. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13880. * (currently only MSG_TYPE_1 is defined)
  13881. *
  13882. * Word 2
  13883. * - mem_req_id
  13884. * Bits 6:0
  13885. * Purpose: Contain the mem request id of the region where the CFR capture
  13886. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13887. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13888. this value is invalid)
  13889. * - status
  13890. * Bit 7
  13891. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13892. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13893. * - capture_bw
  13894. * Bits 10:8
  13895. * Purpose: Carry the bandwidth of the CFR capture
  13896. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13897. * - mode
  13898. * Bits 13:11
  13899. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13900. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13901. * - sts_count
  13902. * Bits 16:14
  13903. * Purpose: Carry the number of space time streams
  13904. * Value: Number of space time streams
  13905. * - channel_bw
  13906. * Bits 19:17
  13907. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13908. * measurement
  13909. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13910. * - cap_type
  13911. * Bits 23:20
  13912. * Purpose: Carry the type of the capture
  13913. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13914. * - vdev_id
  13915. * Bits 31:24
  13916. * Purpose: Carry the virtual device id
  13917. * Value: vdev ID
  13918. *
  13919. * Word 3
  13920. * - mac_addr31to0
  13921. * Bits 31:0
  13922. * Purpose: Contain the bits 31:0 of the peer MAC address
  13923. * Value: Bits 31:0 of the peer MAC address
  13924. *
  13925. * Word 4
  13926. * - mac_addr47to32
  13927. * Bits 15:0
  13928. * Purpose: Contain the bits 47:32 of the peer MAC address
  13929. * Value: Bits 47:32 of the peer MAC address
  13930. *
  13931. * Word 5
  13932. * - index
  13933. * Bits 31:0
  13934. * Purpose: Contain the index at which this CFR dump was written in the Host
  13935. * allocated memory. This index is the number of bytes from the base address.
  13936. * Value: Index position
  13937. *
  13938. * Word 6
  13939. * - length
  13940. * Bits 31:0
  13941. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13942. * Value: Length of the CFR capture of the peer
  13943. *
  13944. * Word 7
  13945. * - timestamp
  13946. * Bits 31:0
  13947. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13948. * clock used for this timestamp is private to the target and not visible to
  13949. * the host i.e., Host can interpret only the relative timestamp deltas from
  13950. * one message to the next, but can't interpret the absolute timestamp from a
  13951. * single message.
  13952. * Value: Timestamp in microseconds
  13953. *
  13954. * Word 8
  13955. * - counter
  13956. * Bits 31:0
  13957. * Purpose: Carry the count of the current CFR capture from FW. This is
  13958. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13959. * in host memory)
  13960. * Value: Count of the current CFR capture
  13961. *
  13962. * Word 9
  13963. * - chan_mhz
  13964. * Bits 31:0
  13965. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13966. * Value: Primary 20 channel frequency
  13967. *
  13968. * Word 10
  13969. * - band_center_freq1
  13970. * Bits 31:0
  13971. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13972. * Value: Center frequency 1 in MHz
  13973. *
  13974. * Word 11
  13975. * - band_center_freq2
  13976. * Bits 31:0
  13977. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13978. * the VDEV
  13979. * 80plus80 mode
  13980. * Value: Center frequency 2 in MHz
  13981. *
  13982. * Word 12
  13983. * - chan_phy_mode
  13984. * Bits 31:0
  13985. * Purpose: Carry the phy mode of the channel, of the VDEV
  13986. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13987. */
  13988. PREPACK struct htt_cfr_dump_ind_type_1 {
  13989. A_UINT32 mem_req_id:7,
  13990. status:1,
  13991. capture_bw:3,
  13992. mode:3,
  13993. sts_count:3,
  13994. channel_bw:3,
  13995. cap_type:4,
  13996. vdev_id:8;
  13997. htt_mac_addr addr;
  13998. A_UINT32 index;
  13999. A_UINT32 length;
  14000. A_UINT32 timestamp;
  14001. A_UINT32 counter;
  14002. struct htt_chan_change_msg chan;
  14003. } POSTPACK;
  14004. PREPACK struct htt_cfr_dump_compl_ind {
  14005. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14006. union {
  14007. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14008. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14009. /* If there is a need to change the memory layout and its associated
  14010. * HTT indication format, a new CFR capture message type can be
  14011. * introduced and added into this union.
  14012. */
  14013. };
  14014. } POSTPACK;
  14015. /*
  14016. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14017. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14018. */
  14019. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14020. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14021. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14022. do { \
  14023. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14024. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14025. } while(0)
  14026. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14027. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14028. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14029. /*
  14030. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14031. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14032. */
  14033. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14034. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14035. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14036. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14037. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14038. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14039. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14040. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14041. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14042. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14043. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14044. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14045. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14046. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14047. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14048. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14049. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14050. do { \
  14051. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14052. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14053. } while (0)
  14054. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14055. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14056. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14057. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14058. do { \
  14059. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14060. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14061. } while (0)
  14062. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14063. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14064. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14065. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14066. do { \
  14067. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14068. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14069. } while (0)
  14070. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14071. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14072. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14073. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14074. do { \
  14075. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14076. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14077. } while (0)
  14078. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14079. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14080. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14081. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14082. do { \
  14083. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14084. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14085. } while (0)
  14086. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14087. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14088. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14089. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14090. do { \
  14091. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14092. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14093. } while (0)
  14094. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14095. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14096. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14097. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14098. do { \
  14099. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14100. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14101. } while (0)
  14102. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14103. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14104. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14105. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14106. do { \
  14107. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14108. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14109. } while (0)
  14110. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14111. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14112. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14113. /**
  14114. * @brief target -> host peer (PPDU) stats message
  14115. *
  14116. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14117. *
  14118. * @details
  14119. * This message is generated by FW when FW is sending stats to host
  14120. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14121. * This message is sent autonomously by the target rather than upon request
  14122. * by the host.
  14123. * The following field definitions describe the format of the HTT target
  14124. * to host peer stats indication message.
  14125. *
  14126. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14127. * or more PPDU stats records.
  14128. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14129. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14130. * then the message would start with the
  14131. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14132. * below.
  14133. *
  14134. * |31 16|15|14|13 11|10 9|8|7 0|
  14135. * |-------------------------------------------------------------|
  14136. * | reserved |MSG_TYPE |
  14137. * |-------------------------------------------------------------|
  14138. * rec 0 | TLV header |
  14139. * rec 0 |-------------------------------------------------------------|
  14140. * rec 0 | ppdu successful bytes |
  14141. * rec 0 |-------------------------------------------------------------|
  14142. * rec 0 | ppdu retry bytes |
  14143. * rec 0 |-------------------------------------------------------------|
  14144. * rec 0 | ppdu failed bytes |
  14145. * rec 0 |-------------------------------------------------------------|
  14146. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14147. * rec 0 |-------------------------------------------------------------|
  14148. * rec 0 | retried MSDUs | successful MSDUs |
  14149. * rec 0 |-------------------------------------------------------------|
  14150. * rec 0 | TX duration | failed MSDUs |
  14151. * rec 0 |-------------------------------------------------------------|
  14152. * ...
  14153. * |-------------------------------------------------------------|
  14154. * rec N | TLV header |
  14155. * rec N |-------------------------------------------------------------|
  14156. * rec N | ppdu successful bytes |
  14157. * rec N |-------------------------------------------------------------|
  14158. * rec N | ppdu retry bytes |
  14159. * rec N |-------------------------------------------------------------|
  14160. * rec N | ppdu failed bytes |
  14161. * rec N |-------------------------------------------------------------|
  14162. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14163. * rec N |-------------------------------------------------------------|
  14164. * rec N | retried MSDUs | successful MSDUs |
  14165. * rec N |-------------------------------------------------------------|
  14166. * rec N | TX duration | failed MSDUs |
  14167. * rec N |-------------------------------------------------------------|
  14168. *
  14169. * where:
  14170. * A = is A-MPDU flag
  14171. * BA = block-ack failure flags
  14172. * BW = bandwidth spec
  14173. * SG = SGI enabled spec
  14174. * S = skipped rate ctrl
  14175. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14176. *
  14177. * Header
  14178. * ------
  14179. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14180. * dword0 - b'8:31 - reserved : Reserved for future use
  14181. *
  14182. * payload include below peer_stats information
  14183. * --------------------------------------------
  14184. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14185. * @tx_success_bytes : total successful bytes in the PPDU.
  14186. * @tx_retry_bytes : total retried bytes in the PPDU.
  14187. * @tx_failed_bytes : total failed bytes in the PPDU.
  14188. * @tx_ratecode : rate code used for the PPDU.
  14189. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14190. * @ba_ack_failed : BA/ACK failed for this PPDU
  14191. * b00 -> BA received
  14192. * b01 -> BA failed once
  14193. * b10 -> BA failed twice, when HW retry is enabled.
  14194. * @bw : BW
  14195. * b00 -> 20 MHz
  14196. * b01 -> 40 MHz
  14197. * b10 -> 80 MHz
  14198. * b11 -> 160 MHz (or 80+80)
  14199. * @sg : SGI enabled
  14200. * @s : skipped ratectrl
  14201. * @peer_id : peer id
  14202. * @tx_success_msdus : successful MSDUs
  14203. * @tx_retry_msdus : retried MSDUs
  14204. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14205. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14206. */
  14207. /**
  14208. * @brief target -> host backpressure event
  14209. *
  14210. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14211. *
  14212. * @details
  14213. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14214. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14215. * This message will only be sent if the backpressure condition has existed
  14216. * continuously for an initial period (100 ms).
  14217. * Repeat messages with updated information will be sent after each
  14218. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14219. * This message indicates the ring id along with current head and tail index
  14220. * locations (i.e. write and read indices).
  14221. * The backpressure time indicates the time in ms for which continous
  14222. * backpressure has been observed in the ring.
  14223. *
  14224. * The message format is as follows:
  14225. *
  14226. * |31 24|23 16|15 8|7 0|
  14227. * |----------------+----------------+----------------+----------------|
  14228. * | ring_id | ring_type | pdev_id | msg_type |
  14229. * |-------------------------------------------------------------------|
  14230. * | tail_idx | head_idx |
  14231. * |-------------------------------------------------------------------|
  14232. * | backpressure_time_ms |
  14233. * |-------------------------------------------------------------------|
  14234. *
  14235. * The message is interpreted as follows:
  14236. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14237. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14238. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14239. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14240. the msg is for LMAC ring.
  14241. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14242. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14243. * htt_backpressure_lmac_ring_id. This represents
  14244. * the ring id for which continous backpressure is seen
  14245. *
  14246. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14247. * the ring indicated by the ring_id
  14248. *
  14249. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14250. * the ring indicated by the ring id
  14251. *
  14252. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14253. * backpressure has been seen in the ring
  14254. * indicated by the ring_id.
  14255. * Units = milliseconds
  14256. */
  14257. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14258. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14259. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14260. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14261. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14262. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14263. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14264. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14265. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14266. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14267. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14268. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14269. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14270. do { \
  14271. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14272. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14273. } while (0)
  14274. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14275. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14276. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14277. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14278. do { \
  14279. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14280. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14281. } while (0)
  14282. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14283. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14284. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14285. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14288. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14289. } while (0)
  14290. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14291. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14292. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14293. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14294. do { \
  14295. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14296. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14297. } while (0)
  14298. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14299. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14300. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14301. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14302. do { \
  14303. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14304. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14305. } while (0)
  14306. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14307. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14308. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14309. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14310. do { \
  14311. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14312. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14313. } while (0)
  14314. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14315. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14316. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14317. enum htt_backpressure_ring_type {
  14318. HTT_SW_RING_TYPE_UMAC,
  14319. HTT_SW_RING_TYPE_LMAC,
  14320. HTT_SW_RING_TYPE_MAX,
  14321. };
  14322. /* Ring id for which the message is sent to host */
  14323. enum htt_backpressure_umac_ringid {
  14324. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14325. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14326. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14327. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14328. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14329. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14330. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14331. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14332. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14333. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14334. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14335. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14336. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14337. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14338. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14339. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14340. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14341. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14342. HTT_SW_UMAC_RING_IDX_MAX,
  14343. };
  14344. enum htt_backpressure_lmac_ringid {
  14345. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14346. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14347. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14348. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14349. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14350. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14351. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14352. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14353. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14354. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14355. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14356. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14357. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14358. HTT_SW_LMAC_RING_IDX_MAX,
  14359. };
  14360. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14361. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14362. pdev_id: 8,
  14363. ring_type: 8, /* htt_backpressure_ring_type */
  14364. /*
  14365. * ring_id holds an enum value from either
  14366. * htt_backpressure_umac_ringid or
  14367. * htt_backpressure_lmac_ringid, based on
  14368. * the ring_type setting.
  14369. */
  14370. ring_id: 8;
  14371. A_UINT16 head_idx;
  14372. A_UINT16 tail_idx;
  14373. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14374. } POSTPACK;
  14375. /*
  14376. * Defines two 32 bit words that can be used by the target to indicate a per
  14377. * user RU allocation and rate information.
  14378. *
  14379. * This information is currently provided in the "sw_response_reference_ptr"
  14380. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14381. * "rx_ppdu_end_user_stats" TLV.
  14382. *
  14383. * VALID:
  14384. * The consumer of these words must explicitly check the valid bit,
  14385. * and only attempt interpretation of any of the remaining fields if
  14386. * the valid bit is set to 1.
  14387. *
  14388. * VERSION:
  14389. * The consumer of these words must also explicitly check the version bit,
  14390. * and only use the V0 definition if the VERSION field is set to 0.
  14391. *
  14392. * Version 1 is currently undefined, with the exception of the VALID and
  14393. * VERSION fields.
  14394. *
  14395. * Version 0:
  14396. *
  14397. * The fields below are duplicated per BW.
  14398. *
  14399. * The consumer must determine which BW field to use, based on the UL OFDMA
  14400. * PPDU BW indicated by HW.
  14401. *
  14402. * RU_START: RU26 start index for the user.
  14403. * Note that this is always using the RU26 index, regardless
  14404. * of the actual RU assigned to the user
  14405. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14406. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14407. *
  14408. * For example, 20MHz (the value in the top row is RU_START)
  14409. *
  14410. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14411. * RU Size 1 (52): | | | | | |
  14412. * RU Size 2 (106): | | | |
  14413. * RU Size 3 (242): | |
  14414. *
  14415. * RU_SIZE: Indicates the RU size, as defined by enum
  14416. * htt_ul_ofdma_user_info_ru_size.
  14417. *
  14418. * LDPC: LDPC enabled (if 0, BCC is used)
  14419. *
  14420. * DCM: DCM enabled
  14421. *
  14422. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14423. * |---------------------------------+--------------------------------|
  14424. * |Ver|Valid| FW internal |
  14425. * |---------------------------------+--------------------------------|
  14426. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14427. * |---------------------------------+--------------------------------|
  14428. */
  14429. enum htt_ul_ofdma_user_info_ru_size {
  14430. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14431. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14432. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14433. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14434. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14435. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14436. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14437. };
  14438. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14439. struct htt_ul_ofdma_user_info_v0 {
  14440. A_UINT32 word0;
  14441. A_UINT32 word1;
  14442. };
  14443. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14444. A_UINT32 w0_fw_rsvd:30; \
  14445. A_UINT32 w0_valid:1; \
  14446. A_UINT32 w0_version:1;
  14447. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14448. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14449. };
  14450. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14451. A_UINT32 w1_nss:3; \
  14452. A_UINT32 w1_mcs:4; \
  14453. A_UINT32 w1_ldpc:1; \
  14454. A_UINT32 w1_dcm:1; \
  14455. A_UINT32 w1_ru_start:7; \
  14456. A_UINT32 w1_ru_size:3; \
  14457. A_UINT32 w1_trig_type:4; \
  14458. A_UINT32 w1_unused:9;
  14459. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14460. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14461. };
  14462. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14463. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14464. union {
  14465. A_UINT32 word0;
  14466. struct {
  14467. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14468. };
  14469. };
  14470. union {
  14471. A_UINT32 word1;
  14472. struct {
  14473. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14474. };
  14475. };
  14476. } POSTPACK;
  14477. enum HTT_UL_OFDMA_TRIG_TYPE {
  14478. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14479. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14480. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14481. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14482. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14483. };
  14484. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14485. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14486. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14487. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14488. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14489. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14490. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14492. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14494. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14495. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14496. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14497. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14499. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14501. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14502. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14503. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14504. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14505. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14506. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14507. /*--- word 0 ---*/
  14508. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14509. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14510. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14511. do { \
  14512. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14513. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14514. } while (0)
  14515. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14516. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14517. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14518. do { \
  14519. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14520. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14521. } while (0)
  14522. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14523. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14524. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14525. do { \
  14526. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14527. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14528. } while (0)
  14529. /*--- word 1 ---*/
  14530. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14531. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14532. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14533. do { \
  14534. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14535. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14536. } while (0)
  14537. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14538. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14539. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14540. do { \
  14541. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14542. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14543. } while (0)
  14544. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14545. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14546. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14547. do { \
  14548. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14549. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14550. } while (0)
  14551. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14552. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14553. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14554. do { \
  14555. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14556. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14557. } while (0)
  14558. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14559. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14560. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14561. do { \
  14562. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14563. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14564. } while (0)
  14565. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14566. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14567. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14568. do { \
  14569. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14570. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14571. } while (0)
  14572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14573. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14575. do { \
  14576. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14577. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14578. } while (0)
  14579. /**
  14580. * @brief target -> host channel calibration data message
  14581. *
  14582. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14583. *
  14584. * @brief host -> target channel calibration data message
  14585. *
  14586. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14587. *
  14588. * @details
  14589. * The following field definitions describe the format of the channel
  14590. * calibration data message sent from the target to the host when
  14591. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14592. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14593. * The message is defined as htt_chan_caldata_msg followed by a variable
  14594. * number of 32-bit character values.
  14595. *
  14596. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14597. * |------------------------------------------------------------------|
  14598. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14599. * |------------------------------------------------------------------|
  14600. * | payload size | mhz |
  14601. * |------------------------------------------------------------------|
  14602. * | center frequency 2 | center frequency 1 |
  14603. * |------------------------------------------------------------------|
  14604. * | check sum |
  14605. * |------------------------------------------------------------------|
  14606. * | payload |
  14607. * |------------------------------------------------------------------|
  14608. * message info field:
  14609. * - MSG_TYPE
  14610. * Bits 7:0
  14611. * Purpose: identifies this as a channel calibration data message
  14612. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14613. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14614. * - SUB_TYPE
  14615. * Bits 11:8
  14616. * Purpose: T2H: indicates whether target is providing chan cal data
  14617. * to the host to store, or requesting that the host
  14618. * download previously-stored data.
  14619. * H2T: indicates whether the host is providing the requested
  14620. * channel cal data, or if it is rejecting the data
  14621. * request because it does not have the requested data.
  14622. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14623. * - CHKSUM_VALID
  14624. * Bit 12
  14625. * Purpose: indicates if the checksum field is valid
  14626. * value:
  14627. * - FRAG
  14628. * Bit 19:16
  14629. * Purpose: indicates the fragment index for message
  14630. * value: 0 for first fragment, 1 for second fragment, ...
  14631. * - APPEND
  14632. * Bit 20
  14633. * Purpose: indicates if this is the last fragment
  14634. * value: 0 = final fragment, 1 = more fragments will be appended
  14635. *
  14636. * channel and payload size field
  14637. * - MHZ
  14638. * Bits 15:0
  14639. * Purpose: indicates the channel primary frequency
  14640. * Value:
  14641. * - PAYLOAD_SIZE
  14642. * Bits 31:16
  14643. * Purpose: indicates the bytes of calibration data in payload
  14644. * Value:
  14645. *
  14646. * center frequency field
  14647. * - CENTER FREQUENCY 1
  14648. * Bits 15:0
  14649. * Purpose: indicates the channel center frequency
  14650. * Value: channel center frequency, in MHz units
  14651. * - CENTER FREQUENCY 2
  14652. * Bits 31:16
  14653. * Purpose: indicates the secondary channel center frequency,
  14654. * only for 11acvht 80plus80 mode
  14655. * Value: secondary channel center frequeny, in MHz units, if applicable
  14656. *
  14657. * checksum field
  14658. * - CHECK_SUM
  14659. * Bits 31:0
  14660. * Purpose: check the payload data, it is just for this fragment.
  14661. * This is intended for the target to check that the channel
  14662. * calibration data returned by the host is the unmodified data
  14663. * that was previously provided to the host by the target.
  14664. * value: checksum of fragment payload
  14665. */
  14666. PREPACK struct htt_chan_caldata_msg {
  14667. /* DWORD 0: message info */
  14668. A_UINT32
  14669. msg_type: 8,
  14670. sub_type: 4 ,
  14671. chksum_valid: 1, /** 1:valid, 0:invalid */
  14672. reserved1: 3,
  14673. frag_idx: 4, /** fragment index for calibration data */
  14674. appending: 1, /** 0: no fragment appending,
  14675. * 1: extra fragment appending */
  14676. reserved2: 11;
  14677. /* DWORD 1: channel and payload size */
  14678. A_UINT32
  14679. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14680. payload_size: 16; /** unit: bytes */
  14681. /* DWORD 2: center frequency */
  14682. A_UINT32
  14683. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14684. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14685. * valid only for 11acvht 80plus80 mode */
  14686. /* DWORD 3: check sum */
  14687. A_UINT32 chksum;
  14688. /* variable length for calibration data */
  14689. A_UINT32 payload[1/* or more */];
  14690. } POSTPACK;
  14691. /* T2H SUBTYPE */
  14692. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14693. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14694. /* H2T SUBTYPE */
  14695. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14696. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14697. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14698. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14699. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14700. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14701. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14702. do { \
  14703. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14704. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14705. } while (0)
  14706. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14707. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14708. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14709. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14710. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14713. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14714. } while (0)
  14715. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14716. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14717. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14718. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14719. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14720. do { \
  14721. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14722. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14723. } while (0)
  14724. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14725. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14726. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14727. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14728. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14729. do { \
  14730. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14731. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14732. } while (0)
  14733. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14734. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14735. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14736. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14737. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14738. do { \
  14739. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14740. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14741. } while (0)
  14742. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14743. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14744. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14745. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14746. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14747. do { \
  14748. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14749. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14750. } while (0)
  14751. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14752. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14753. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14754. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14755. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14756. do { \
  14757. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14758. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14759. } while (0)
  14760. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14761. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14762. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14763. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14764. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14765. do { \
  14766. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14767. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14768. } while (0)
  14769. /**
  14770. * @brief target -> host FSE CMEM based send
  14771. *
  14772. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14773. *
  14774. * @details
  14775. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14776. * FSE placement in CMEM is enabled.
  14777. *
  14778. * This message sends the non-secure CMEM base address.
  14779. * It will be sent to host in response to message
  14780. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14781. * The message would appear as follows:
  14782. *
  14783. * |31 24|23 16|15 8|7 0|
  14784. * |----------------+----------------+----------------+----------------|
  14785. * | reserved | num_entries | msg_type |
  14786. * |----------------+----------------+----------------+----------------|
  14787. * | base_address_lo |
  14788. * |----------------+----------------+----------------+----------------|
  14789. * | base_address_hi |
  14790. * |-------------------------------------------------------------------|
  14791. *
  14792. * The message is interpreted as follows:
  14793. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14794. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14795. * b'8:15 - number_entries: Indicated the number of entries
  14796. * programmed.
  14797. * b'16:31 - reserved.
  14798. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14799. * CMEM base address
  14800. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14801. * CMEM base address
  14802. */
  14803. PREPACK struct htt_cmem_base_send_t {
  14804. A_UINT32 msg_type: 8,
  14805. num_entries: 8,
  14806. reserved: 16;
  14807. A_UINT32 base_address_lo;
  14808. A_UINT32 base_address_hi;
  14809. } POSTPACK;
  14810. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14811. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14812. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14813. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14814. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14815. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14816. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14817. do { \
  14818. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14819. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14820. } while (0)
  14821. /**
  14822. * @brief - HTT PPDU ID format
  14823. *
  14824. * @details
  14825. * The following field definitions describe the format of the PPDU ID.
  14826. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14827. *
  14828. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14829. * +--------------------------------------------------------------------------
  14830. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14831. * +--------------------------------------------------------------------------
  14832. *
  14833. * sch id :Schedule command id
  14834. * Bits [11 : 0] : monotonically increasing counter to track the
  14835. * PPDU posted to a specific transmit queue.
  14836. *
  14837. * hwq_id: Hardware Queue ID.
  14838. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14839. *
  14840. * mac_id: MAC ID
  14841. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14842. *
  14843. * seq_idx: Sequence index.
  14844. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14845. * a particular TXOP.
  14846. *
  14847. * tqm_cmd: HWSCH/TQM flag.
  14848. * Bit [23] : Always set to 0.
  14849. *
  14850. * seq_cmd_type: Sequence command type.
  14851. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14852. * Refer to enum HTT_STATS_FTYPE for values.
  14853. */
  14854. PREPACK struct htt_ppdu_id {
  14855. A_UINT32
  14856. sch_id: 12,
  14857. hwq_id: 5,
  14858. mac_id: 2,
  14859. seq_idx: 2,
  14860. reserved1: 2,
  14861. tqm_cmd: 1,
  14862. seq_cmd_type: 6,
  14863. reserved2: 2;
  14864. } POSTPACK;
  14865. #define HTT_PPDU_ID_SCH_ID_S 0
  14866. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14867. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14868. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14869. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14870. do { \
  14871. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14872. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14873. } while (0)
  14874. #define HTT_PPDU_ID_HWQ_ID_S 12
  14875. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14876. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14877. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14878. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14879. do { \
  14880. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14881. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14882. } while (0)
  14883. #define HTT_PPDU_ID_MAC_ID_S 17
  14884. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14885. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14886. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14887. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14888. do { \
  14889. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14890. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14891. } while (0)
  14892. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14893. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14894. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14895. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14896. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14897. do { \
  14898. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14899. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14900. } while (0)
  14901. #define HTT_PPDU_ID_TQM_CMD_S 23
  14902. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14903. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14904. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14905. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14906. do { \
  14907. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14908. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14909. } while (0)
  14910. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14911. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14912. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14913. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14914. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14915. do { \
  14916. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14917. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14918. } while (0)
  14919. /**
  14920. * @brief target -> RX PEER METADATA V0 format
  14921. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14922. * message from target, and will confirm to the target which peer metadata
  14923. * version to use in the wmi_init message.
  14924. *
  14925. * The following diagram shows the format of the RX PEER METADATA.
  14926. *
  14927. * |31 24|23 16|15 8|7 0|
  14928. * |-----------------------------------------------------------------------|
  14929. * | Reserved | VDEV ID | PEER ID |
  14930. * |-----------------------------------------------------------------------|
  14931. */
  14932. PREPACK struct htt_rx_peer_metadata_v0 {
  14933. A_UINT32
  14934. peer_id: 16,
  14935. vdev_id: 8,
  14936. reserved1: 8;
  14937. } POSTPACK;
  14938. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14939. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14940. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14941. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14942. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14943. do { \
  14944. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14945. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14946. } while (0)
  14947. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14948. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14949. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14950. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14951. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14952. do { \
  14953. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14954. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14955. } while (0)
  14956. /**
  14957. * @brief target -> RX PEER METADATA V1 format
  14958. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14959. * message from target, and will confirm to the target which peer metadata
  14960. * version to use in the wmi_init message.
  14961. *
  14962. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14963. *
  14964. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14965. * |-----------------------------------------------------------------------|
  14966. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14967. * |-----------------------------------------------------------------------|
  14968. */
  14969. PREPACK struct htt_rx_peer_metadata_v1 {
  14970. A_UINT32
  14971. peer_id: 13,
  14972. ml_peer_valid: 1,
  14973. reserved1: 2,
  14974. vdev_id: 8,
  14975. lmac_id: 2,
  14976. chip_id: 3,
  14977. reserved2: 3;
  14978. } POSTPACK;
  14979. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14980. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14981. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14982. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14983. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14984. do { \
  14985. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14986. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14987. } while (0)
  14988. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14989. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14990. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14991. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14992. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14993. do { \
  14994. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14995. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14996. } while (0)
  14997. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14998. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14999. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15000. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15001. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15002. do { \
  15003. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15004. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15005. } while (0)
  15006. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15007. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15008. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15009. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15010. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15011. do { \
  15012. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15013. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15014. } while (0)
  15015. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15016. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15017. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15018. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15019. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15020. do { \
  15021. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15022. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15023. } while (0)
  15024. /*
  15025. * In some systems, the host SW wants to specify priorities between
  15026. * different MSDU / flow queues within the same peer-TID.
  15027. * The below enums are used for the host to identify to the target
  15028. * which MSDU queue's priority it wants to adjust.
  15029. */
  15030. /*
  15031. * The MSDUQ index describe index of TCL HW, where each index is
  15032. * used for queuing particular types of MSDUs.
  15033. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15034. */
  15035. enum HTT_MSDUQ_INDEX {
  15036. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15037. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15038. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15039. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15040. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15041. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15042. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15043. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15044. HTT_MSDUQ_MAX_INDEX,
  15045. };
  15046. /* MSDU qtype definition */
  15047. enum HTT_MSDU_QTYPE {
  15048. /*
  15049. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15050. * relative priority. Instead, the relative priority of CRIT_0 versus
  15051. * CRIT_1 is controlled by the FW, through the configuration parameters
  15052. * it applies to the queues.
  15053. */
  15054. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15055. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15056. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15057. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15058. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15059. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15060. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15061. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15062. /* New MSDU_QTYPE should be added above this line */
  15063. /*
  15064. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15065. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15066. * any host/target message definitions. The QTYPE_MAX value can
  15067. * only be used internally within the host or within the target.
  15068. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15069. * it must regard the unexpected value as a default qtype value,
  15070. * or ignore it.
  15071. */
  15072. HTT_MSDU_QTYPE_MAX,
  15073. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15074. };
  15075. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15076. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15077. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15078. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15079. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15080. };
  15081. /**
  15082. * @brief target -> host mlo timestamp offset indication
  15083. *
  15084. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15085. *
  15086. * @details
  15087. * The following field definitions describe the format of the HTT target
  15088. * to host mlo timestamp offset indication message.
  15089. *
  15090. *
  15091. * |31 16|15 12|11 10|9 8|7 0 |
  15092. * |----------------------------------------------------------------------|
  15093. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15094. * |----------------------------------------------------------------------|
  15095. * | Sync time stamp lo in us |
  15096. * |----------------------------------------------------------------------|
  15097. * | Sync time stamp hi in us |
  15098. * |----------------------------------------------------------------------|
  15099. * | mlo time stamp offset lo in us |
  15100. * |----------------------------------------------------------------------|
  15101. * | mlo time stamp offset hi in us |
  15102. * |----------------------------------------------------------------------|
  15103. * | mlo time stamp offset clocks in clock ticks |
  15104. * |----------------------------------------------------------------------|
  15105. * |31 26|25 16|15 0 |
  15106. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15107. * | | compensation in clks | |
  15108. * |----------------------------------------------------------------------|
  15109. * |31 22|21 0 |
  15110. * | rsvd 3 | mlo time stamp comp timer period |
  15111. * |----------------------------------------------------------------------|
  15112. * The message is interpreted as follows:
  15113. *
  15114. * dword0 - b'0:7 - msg_type: This will be set to
  15115. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15116. * value: 0x28
  15117. *
  15118. * dword0 - b'9:8 - pdev_id
  15119. *
  15120. * dword0 - b'11:10 - chip_id
  15121. *
  15122. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15123. *
  15124. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15125. *
  15126. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15127. * which last sync interrupt was received
  15128. *
  15129. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15130. * which last sync interrupt was received
  15131. *
  15132. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15133. *
  15134. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15135. *
  15136. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15137. *
  15138. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15139. *
  15140. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15141. * for sub us resolution
  15142. *
  15143. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15144. *
  15145. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15146. * is applied, in us
  15147. *
  15148. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15149. */
  15150. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15151. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15152. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15153. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15154. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15155. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15156. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15157. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15158. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15159. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15160. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15161. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15162. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15163. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15164. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15165. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15166. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15167. do { \
  15168. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15169. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15170. } while (0)
  15171. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15172. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15173. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15174. do { \
  15175. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15176. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15177. } while (0)
  15178. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15179. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15180. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15181. do { \
  15182. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15183. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15184. } while (0)
  15185. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15186. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15187. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15188. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15189. do { \
  15190. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15191. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15192. } while (0)
  15193. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15194. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15195. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15196. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15197. do { \
  15198. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15199. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15200. } while (0)
  15201. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15202. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15203. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15204. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15205. do { \
  15206. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15207. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15208. } while (0)
  15209. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15210. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15211. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15212. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15213. do { \
  15214. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15215. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15216. } while (0)
  15217. typedef struct {
  15218. A_UINT32 msg_type: 8, /* bits 7:0 */
  15219. pdev_id: 2, /* bits 9:8 */
  15220. chip_id: 2, /* bits 11:10 */
  15221. reserved1: 4, /* bits 15:12 */
  15222. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15223. A_UINT32 sync_timestamp_lo_us;
  15224. A_UINT32 sync_timestamp_hi_us;
  15225. A_UINT32 mlo_timestamp_offset_lo_us;
  15226. A_UINT32 mlo_timestamp_offset_hi_us;
  15227. A_UINT32 mlo_timestamp_offset_clks;
  15228. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15229. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15230. reserved2: 6; /* bits 31:26 */
  15231. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15232. reserved3: 10; /* bits 31:22 */
  15233. } htt_t2h_mlo_offset_ind_t;
  15234. /*
  15235. * @brief target -> host VDEV TX RX STATS
  15236. *
  15237. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15238. *
  15239. * @details
  15240. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15241. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15242. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15243. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15244. * periodically by target even in the absence of any further HTT request
  15245. * messages from host.
  15246. *
  15247. * The message is formatted as follows:
  15248. *
  15249. * |31 16|15 8|7 0|
  15250. * |---------------------------------+----------------+----------------|
  15251. * | payload_size | pdev_id | msg_type |
  15252. * |---------------------------------+----------------+----------------|
  15253. * | reserved0 |
  15254. * |-------------------------------------------------------------------|
  15255. * | reserved1 |
  15256. * |-------------------------------------------------------------------|
  15257. * | reserved2 |
  15258. * |-------------------------------------------------------------------|
  15259. * | |
  15260. * | VDEV specific Tx Rx stats info |
  15261. * | |
  15262. * |-------------------------------------------------------------------|
  15263. *
  15264. * The message is interpreted as follows:
  15265. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15266. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15267. * b'8:15 - pdev_id
  15268. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15269. * message header fields (msg_type through reserved2)
  15270. * dword1 - b'0:31 - reserved0.
  15271. * dword2 - b'0:31 - reserved1.
  15272. * dword3 - b'0:31 - reserved2.
  15273. */
  15274. typedef struct {
  15275. A_UINT32 msg_type: 8,
  15276. pdev_id: 8,
  15277. payload_size: 16;
  15278. A_UINT32 reserved0;
  15279. A_UINT32 reserved1;
  15280. A_UINT32 reserved2;
  15281. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15282. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15283. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15284. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15285. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15286. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15287. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15288. do { \
  15289. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15290. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15291. } while (0)
  15292. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15293. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15294. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15295. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15296. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15297. do { \
  15298. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15299. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15300. } while (0)
  15301. /* SOC related stats */
  15302. typedef struct {
  15303. htt_tlv_hdr_t tlv_hdr;
  15304. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15305. * This can be due to either the peer is deleted or deletion is ongoing
  15306. * */
  15307. A_UINT32 inv_peers_msdu_drop_count_lo;
  15308. A_UINT32 inv_peers_msdu_drop_count_hi;
  15309. } htt_t2h_soc_txrx_stats_common_tlv;
  15310. /* VDEV HW Tx/Rx stats */
  15311. typedef struct {
  15312. htt_tlv_hdr_t tlv_hdr;
  15313. A_UINT32 vdev_id;
  15314. /* Rx msdu byte cnt */
  15315. A_UINT32 rx_msdu_byte_cnt_lo;
  15316. A_UINT32 rx_msdu_byte_cnt_hi;
  15317. /* Rx msdu cnt */
  15318. A_UINT32 rx_msdu_cnt_lo;
  15319. A_UINT32 rx_msdu_cnt_hi;
  15320. /* tx msdu byte cnt */
  15321. A_UINT32 tx_msdu_byte_cnt_lo;
  15322. A_UINT32 tx_msdu_byte_cnt_hi;
  15323. /* tx msdu cnt */
  15324. A_UINT32 tx_msdu_cnt_lo;
  15325. A_UINT32 tx_msdu_cnt_hi;
  15326. /* tx excessive retry discarded msdu cnt */
  15327. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15328. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15329. /* TX congestion ctrl msdu drop cnt */
  15330. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15331. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15332. /* discarded tx msdus cnt coz of time to live expiry */
  15333. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15334. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15335. /* tx excessive retry discarded msdu byte cnt */
  15336. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15337. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15338. /* TX congestion ctrl msdu drop byte cnt */
  15339. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15340. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15341. /* discarded tx msdus byte cnt coz of time to live expiry */
  15342. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15343. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15344. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15345. #endif