htt.h 764 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. */
  215. #define HTT_CURRENT_VERSION_MAJOR 3
  216. #define HTT_CURRENT_VERSION_MINOR 95
  217. #define HTT_NUM_TX_FRAG_DESC 1024
  218. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  219. #define HTT_CHECK_SET_VAL(field, val) \
  220. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  221. /* macros to assist in sign-extending fields from HTT messages */
  222. #define HTT_SIGN_BIT_MASK(field) \
  223. ((field ## _M + (1 << field ## _S)) >> 1)
  224. #define HTT_SIGN_BIT(_val, field) \
  225. (_val & HTT_SIGN_BIT_MASK(field))
  226. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  227. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  228. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  229. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  230. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  231. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  232. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  233. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  234. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  235. /*
  236. * TEMPORARY:
  237. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  238. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  239. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  240. * updated.
  241. */
  242. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  246. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  247. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  248. * updated.
  249. */
  250. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  251. /*
  252. * htt_dbg_stats_type -
  253. * bit positions for each stats type within a stats type bitmask
  254. * The bitmask contains 24 bits.
  255. */
  256. enum htt_dbg_stats_type {
  257. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  258. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  259. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  260. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  261. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  262. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  263. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  264. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  265. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  266. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  267. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  268. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  269. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  270. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  271. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  272. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  273. /* bits 16-23 currently reserved */
  274. /* keep this last */
  275. HTT_DBG_NUM_STATS
  276. };
  277. /*=== HTT option selection TLVs ===
  278. * Certain HTT messages have alternatives or options.
  279. * For such cases, the host and target need to agree on which option to use.
  280. * Option specification TLVs can be appended to the VERSION_REQ and
  281. * VERSION_CONF messages to select options other than the default.
  282. * These TLVs are entirely optional - if they are not provided, there is a
  283. * well-defined default for each option. If they are provided, they can be
  284. * provided in any order. Each TLV can be present or absent independent of
  285. * the presence / absence of other TLVs.
  286. *
  287. * The HTT option selection TLVs use the following format:
  288. * |31 16|15 8|7 0|
  289. * |---------------------------------+----------------+----------------|
  290. * | value (payload) | length | tag |
  291. * |-------------------------------------------------------------------|
  292. * The value portion need not be only 2 bytes; it can be extended by any
  293. * integer number of 4-byte units. The total length of the TLV, including
  294. * the tag and length fields, must be a multiple of 4 bytes. The length
  295. * field specifies the total TLV size in 4-byte units. Thus, the typical
  296. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  297. * field, would store 0x1 in its length field, to show that the TLV occupies
  298. * a single 4-byte unit.
  299. */
  300. /*--- TLV header format - applies to all HTT option TLVs ---*/
  301. enum HTT_OPTION_TLV_TAGS {
  302. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  303. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  304. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  305. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  306. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  307. };
  308. PREPACK struct htt_option_tlv_header_t {
  309. A_UINT8 tag;
  310. A_UINT8 length;
  311. } POSTPACK;
  312. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  313. #define HTT_OPTION_TLV_TAG_S 0
  314. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  315. #define HTT_OPTION_TLV_LENGTH_S 8
  316. /*
  317. * value0 - 16 bit value field stored in word0
  318. * The TLV's value field may be longer than 2 bytes, in which case
  319. * the remainder of the value is stored in word1, word2, etc.
  320. */
  321. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  322. #define HTT_OPTION_TLV_VALUE0_S 16
  323. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_TAG_GET(word) \
  329. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  330. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  336. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  337. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  343. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  344. /*--- format of specific HTT option TLVs ---*/
  345. /*
  346. * HTT option TLV for specifying LL bus address size
  347. * Some chips require bus addresses used by the target to access buffers
  348. * within the host's memory to be 32 bits; others require bus addresses
  349. * used by the target to access buffers within the host's memory to be
  350. * 64 bits.
  351. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  352. * a suffix to the VERSION_CONF message to specify which bus address format
  353. * the target requires.
  354. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  355. * default to providing bus addresses to the target in 32-bit format.
  356. */
  357. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  360. };
  361. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  362. struct htt_option_tlv_header_t hdr;
  363. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  364. } POSTPACK;
  365. /*
  366. * HTT option TLV for specifying whether HL systems should indicate
  367. * over-the-air tx completion for individual frames, or should instead
  368. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  369. * requests an OTA tx completion for a particular tx frame.
  370. * This option does not apply to LL systems, where the TX_COMPL_IND
  371. * is mandatory.
  372. * This option is primarily intended for HL systems in which the tx frame
  373. * downloads over the host --> target bus are as slow as or slower than
  374. * the transmissions over the WLAN PHY. For cases where the bus is faster
  375. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  376. * and consquently will send one TX_COMPL_IND message that covers several
  377. * tx frames. For cases where the WLAN PHY is faster than the bus,
  378. * the target will end up transmitting very short A-MPDUs, and consequently
  379. * sending many TX_COMPL_IND messages, which each cover a very small number
  380. * of tx frames.
  381. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  382. * a suffix to the VERSION_REQ message to request whether the host desires to
  383. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  384. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  385. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  386. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  387. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  388. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  389. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  390. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  391. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  392. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  393. * TLV.
  394. */
  395. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  396. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  397. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  398. };
  399. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  400. struct htt_option_tlv_header_t hdr;
  401. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  402. } POSTPACK;
  403. /*
  404. * HTT option TLV for specifying how many tx queue groups the target
  405. * may establish.
  406. * This TLV specifies the maximum value the target may send in the
  407. * txq_group_id field of any TXQ_GROUP information elements sent by
  408. * the target to the host. This allows the host to pre-allocate an
  409. * appropriate number of tx queue group structs.
  410. *
  411. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  412. * a suffix to the VERSION_REQ message to specify whether the host supports
  413. * tx queue groups at all, and if so if there is any limit on the number of
  414. * tx queue groups that the host supports.
  415. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  416. * a suffix to the VERSION_CONF message. If the host has specified in the
  417. * VER_REQ message a limit on the number of tx queue groups the host can
  418. * supprt, the target shall limit its specification of the maximum tx groups
  419. * to be no larger than this host-specified limit.
  420. *
  421. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  422. * shall preallocate 4 tx queue group structs, and the target shall not
  423. * specify a txq_group_id larger than 3.
  424. */
  425. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  426. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  427. /*
  428. * values 1 through N specify the max number of tx queue groups
  429. * the sender supports
  430. */
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  432. };
  433. /* TEMPORARY backwards-compatibility alias for a typo fix -
  434. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  435. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  436. * to support the old name (with the typo) until all references to the
  437. * old name are replaced with the new name.
  438. */
  439. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  440. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying whether the target supports an extended
  446. * version of the HTT tx descriptor. If the target provides this TLV
  447. * and specifies in the TLV that the target supports an extended version
  448. * of the HTT tx descriptor, the target must check the "extension" bit in
  449. * the HTT tx descriptor, and if the extension bit is set, to expect a
  450. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  451. * descriptor. Furthermore, the target must provide room for the HTT
  452. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  453. * This option is intended for systems where the host needs to explicitly
  454. * control the transmission parameters such as tx power for individual
  455. * tx frames.
  456. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  457. * as a suffix to the VERSION_CONF message to explicitly specify whether
  458. * the target supports the HTT tx MSDU extension descriptor.
  459. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  460. * by the host as lack of target support for the HTT tx MSDU extension
  461. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  462. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  463. * the HTT tx MSDU extension descriptor.
  464. * The host is not required to provide the HTT tx MSDU extension descriptor
  465. * just because the target supports it; the target must check the
  466. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  467. * extension descriptor is present.
  468. */
  469. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  472. };
  473. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  474. struct htt_option_tlv_header_t hdr;
  475. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  476. } POSTPACK;
  477. typedef struct {
  478. union {
  479. /* BIT [11 : 0] :- tag
  480. * BIT [23 : 12] :- length
  481. * BIT [31 : 24] :- reserved
  482. */
  483. A_UINT32 tag__length;
  484. /*
  485. * The following struct is not endian-portable.
  486. * It is suitable for use within the target, which is known to be
  487. * little-endian.
  488. * The host should use the above endian-portable macros to access
  489. * the tag and length bitfields in an endian-neutral manner.
  490. */
  491. struct {
  492. A_UINT32 tag : 12, /* BIT [11 : 0] */
  493. length : 12, /* BIT [23 : 12] */
  494. reserved : 8; /* BIT [31 : 24] */
  495. };
  496. };
  497. } htt_tlv_hdr_t;
  498. typedef enum {
  499. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  500. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  501. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  502. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  503. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  504. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  505. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  506. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  507. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  510. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  511. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  512. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  513. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  514. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  515. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  516. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  517. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  520. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  521. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  522. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  523. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  524. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  525. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  526. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  527. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  528. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  529. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  530. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  531. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  532. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  533. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  534. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  535. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  536. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  537. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  538. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  539. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  540. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  541. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  542. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  543. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  544. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  545. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  546. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  550. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  553. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  554. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  555. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  556. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  557. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  558. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  559. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  560. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  561. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  562. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  563. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  564. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  565. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  566. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  567. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  568. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  569. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  570. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  571. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  572. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  573. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  574. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  575. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  576. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  577. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  578. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  579. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  580. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  581. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  582. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  583. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  584. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  585. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  586. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  587. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  588. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  589. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  590. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  591. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  592. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  593. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  594. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  597. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  598. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  600. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  601. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  602. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  603. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  607. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  608. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  609. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  610. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  612. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  616. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  617. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  618. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  619. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  620. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  621. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  622. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  623. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  624. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  625. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  626. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  627. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  628. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  629. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  630. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  631. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  632. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  633. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  634. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  635. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  636. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  637. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  638. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  639. HTT_STATS_MAX_TAG,
  640. } htt_tlv_tag_t;
  641. #define HTT_STATS_TLV_TAG_M 0x00000fff
  642. #define HTT_STATS_TLV_TAG_S 0
  643. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  644. #define HTT_STATS_TLV_LENGTH_S 12
  645. #define HTT_STATS_TLV_TAG_GET(_var) \
  646. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  647. HTT_STATS_TLV_TAG_S)
  648. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  649. do { \
  650. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  651. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  652. } while (0)
  653. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  654. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  655. HTT_STATS_TLV_LENGTH_S)
  656. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  657. do { \
  658. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  659. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  660. } while (0)
  661. /*=== host -> target messages ===============================================*/
  662. enum htt_h2t_msg_type {
  663. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  664. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  665. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  666. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  667. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  668. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  669. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  670. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  671. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  672. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  673. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  674. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  675. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  676. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  677. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  678. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  679. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  680. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  681. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  682. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  683. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  684. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  685. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  686. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  687. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  688. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  689. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  690. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  691. /* keep this last */
  692. HTT_H2T_NUM_MSGS
  693. };
  694. /*
  695. * HTT host to target message type -
  696. * stored in bits 7:0 of the first word of the message
  697. */
  698. #define HTT_H2T_MSG_TYPE_M 0xff
  699. #define HTT_H2T_MSG_TYPE_S 0
  700. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  701. do { \
  702. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  703. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  704. } while (0)
  705. #define HTT_H2T_MSG_TYPE_GET(word) \
  706. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  707. /**
  708. * @brief host -> target version number request message definition
  709. *
  710. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  711. *
  712. *
  713. * |31 24|23 16|15 8|7 0|
  714. * |----------------+----------------+----------------+----------------|
  715. * | reserved | msg type |
  716. * |-------------------------------------------------------------------|
  717. * : option request TLV (optional) |
  718. * :...................................................................:
  719. *
  720. * The VER_REQ message may consist of a single 4-byte word, or may be
  721. * extended with TLVs that specify which HTT options the host is requesting
  722. * from the target.
  723. * The following option TLVs may be appended to the VER_REQ message:
  724. * - HL_SUPPRESS_TX_COMPL_IND
  725. * - HL_MAX_TX_QUEUE_GROUPS
  726. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  727. * may be appended to the VER_REQ message (but only one TLV of each type).
  728. *
  729. * Header fields:
  730. * - MSG_TYPE
  731. * Bits 7:0
  732. * Purpose: identifies this as a version number request message
  733. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  734. */
  735. #define HTT_VER_REQ_BYTES 4
  736. /* TBDXXX: figure out a reasonable number */
  737. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  738. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  739. /**
  740. * @brief HTT tx MSDU descriptor
  741. *
  742. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  743. *
  744. * @details
  745. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  746. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  747. * the target firmware needs for the FW's tx processing, particularly
  748. * for creating the HW msdu descriptor.
  749. * The same HTT tx descriptor is used for HL and LL systems, though
  750. * a few fields within the tx descriptor are used only by LL or
  751. * only by HL.
  752. * The HTT tx descriptor is defined in two manners: by a struct with
  753. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  754. * definitions.
  755. * The target should use the struct def, for simplicitly and clarity,
  756. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  757. * neutral. Specifically, the host shall use the get/set macros built
  758. * around the mask + shift defs.
  759. */
  760. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  765. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  766. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  767. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  768. #define HTT_TX_VDEV_ID_WORD 0
  769. #define HTT_TX_VDEV_ID_MASK 0x3f
  770. #define HTT_TX_VDEV_ID_SHIFT 16
  771. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  772. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  773. #define HTT_TX_MSDU_LEN_DWORD 1
  774. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  775. /*
  776. * HTT_VAR_PADDR macros
  777. * Allow physical / bus addresses to be either a single 32-bit value,
  778. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  779. */
  780. #define HTT_VAR_PADDR32(var_name) \
  781. A_UINT32 var_name
  782. #define HTT_VAR_PADDR64_LE(var_name) \
  783. struct { \
  784. /* little-endian: lo precedes hi */ \
  785. A_UINT32 lo; \
  786. A_UINT32 hi; \
  787. } var_name
  788. /*
  789. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  790. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  791. * addresses are stored in a XXX-bit field.
  792. * This macro is used to define both htt_tx_msdu_desc32_t and
  793. * htt_tx_msdu_desc64_t structs.
  794. */
  795. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  796. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  797. { \
  798. /* DWORD 0: flags and meta-data */ \
  799. A_UINT32 \
  800. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  801. \
  802. /* pkt_subtype - \
  803. * Detailed specification of the tx frame contents, extending the \
  804. * general specification provided by pkt_type. \
  805. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  806. * pkt_type | pkt_subtype \
  807. * ============================================================== \
  808. * 802.3 | bit 0:3 - Reserved \
  809. * | bit 4: 0x0 - Copy-Engine Classification Results \
  810. * | not appended to the HTT message \
  811. * | 0x1 - Copy-Engine Classification Results \
  812. * | appended to the HTT message in the \
  813. * | format: \
  814. * | [HTT tx desc, frame header, \
  815. * | CE classification results] \
  816. * | The CE classification results begin \
  817. * | at the next 4-byte boundary after \
  818. * | the frame header. \
  819. * ------------+------------------------------------------------- \
  820. * Eth2 | bit 0:3 - Reserved \
  821. * | bit 4: 0x0 - Copy-Engine Classification Results \
  822. * | not appended to the HTT message \
  823. * | 0x1 - Copy-Engine Classification Results \
  824. * | appended to the HTT message. \
  825. * | See the above specification of the \
  826. * | CE classification results location. \
  827. * ------------+------------------------------------------------- \
  828. * native WiFi | bit 0:3 - Reserved \
  829. * | bit 4: 0x0 - Copy-Engine Classification Results \
  830. * | not appended to the HTT message \
  831. * | 0x1 - Copy-Engine Classification Results \
  832. * | appended to the HTT message. \
  833. * | See the above specification of the \
  834. * | CE classification results location. \
  835. * ------------+------------------------------------------------- \
  836. * mgmt | 0x0 - 802.11 MAC header absent \
  837. * | 0x1 - 802.11 MAC header present \
  838. * ------------+------------------------------------------------- \
  839. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  840. * | 0x1 - 802.11 MAC header present \
  841. * | bit 1: 0x0 - allow aggregation \
  842. * | 0x1 - don't allow aggregation \
  843. * | bit 2: 0x0 - perform encryption \
  844. * | 0x1 - don't perform encryption \
  845. * | bit 3: 0x0 - perform tx classification / queuing \
  846. * | 0x1 - don't perform tx classification; \
  847. * | insert the frame into the "misc" \
  848. * | tx queue \
  849. * | bit 4: 0x0 - Copy-Engine Classification Results \
  850. * | not appended to the HTT message \
  851. * | 0x1 - Copy-Engine Classification Results \
  852. * | appended to the HTT message. \
  853. * | See the above specification of the \
  854. * | CE classification results location. \
  855. */ \
  856. pkt_subtype: 5, \
  857. \
  858. /* pkt_type - \
  859. * General specification of the tx frame contents. \
  860. * The htt_pkt_type enum should be used to specify and check the \
  861. * value of this field. \
  862. */ \
  863. pkt_type: 3, \
  864. \
  865. /* vdev_id - \
  866. * ID for the vdev that is sending this tx frame. \
  867. * For certain non-standard packet types, e.g. pkt_type == raw \
  868. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  869. * This field is used primarily for determining where to queue \
  870. * broadcast and multicast frames. \
  871. */ \
  872. vdev_id: 6, \
  873. /* ext_tid - \
  874. * The extended traffic ID. \
  875. * If the TID is unknown, the extended TID is set to \
  876. * HTT_TX_EXT_TID_INVALID. \
  877. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  878. * value of the QoS TID. \
  879. * If the tx frame is non-QoS data, then the extended TID is set to \
  880. * HTT_TX_EXT_TID_NON_QOS. \
  881. * If the tx frame is multicast or broadcast, then the extended TID \
  882. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  883. */ \
  884. ext_tid: 5, \
  885. \
  886. /* postponed - \
  887. * This flag indicates whether the tx frame has been downloaded to \
  888. * the target before but discarded by the target, and now is being \
  889. * downloaded again; or if this is a new frame that is being \
  890. * downloaded for the first time. \
  891. * This flag allows the target to determine the correct order for \
  892. * transmitting new vs. old frames. \
  893. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  894. * This flag only applies to HL systems, since in LL systems, \
  895. * the tx flow control is handled entirely within the target. \
  896. */ \
  897. postponed: 1, \
  898. \
  899. /* extension - \
  900. * This flag indicates whether a HTT tx MSDU extension descriptor \
  901. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  902. * \
  903. * 0x0 - no extension MSDU descriptor is present \
  904. * 0x1 - an extension MSDU descriptor immediately follows the \
  905. * regular MSDU descriptor \
  906. */ \
  907. extension: 1, \
  908. \
  909. /* cksum_offload - \
  910. * This flag indicates whether checksum offload is enabled or not \
  911. * for this frame. Target FW use this flag to turn on HW checksumming \
  912. * 0x0 - No checksum offload \
  913. * 0x1 - L3 header checksum only \
  914. * 0x2 - L4 checksum only \
  915. * 0x3 - L3 header checksum + L4 checksum \
  916. */ \
  917. cksum_offload: 2, \
  918. \
  919. /* tx_comp_req - \
  920. * This flag indicates whether Tx Completion \
  921. * from fw is required or not. \
  922. * This flag is only relevant if tx completion is not \
  923. * universally enabled. \
  924. * For all LL systems, tx completion is mandatory, \
  925. * so this flag will be irrelevant. \
  926. * For HL systems tx completion is optional, but HL systems in which \
  927. * the bus throughput exceeds the WLAN throughput will \
  928. * probably want to always use tx completion, and thus \
  929. * would not check this flag. \
  930. * This flag is required when tx completions are not used universally, \
  931. * but are still required for certain tx frames for which \
  932. * an OTA delivery acknowledgment is needed by the host. \
  933. * In practice, this would be for HL systems in which the \
  934. * bus throughput is less than the WLAN throughput. \
  935. * \
  936. * 0x0 - Tx Completion Indication from Fw not required \
  937. * 0x1 - Tx Completion Indication from Fw is required \
  938. */ \
  939. tx_compl_req: 1; \
  940. \
  941. \
  942. /* DWORD 1: MSDU length and ID */ \
  943. A_UINT32 \
  944. len: 16, /* MSDU length, in bytes */ \
  945. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  946. * and this id is used to calculate fragmentation \
  947. * descriptor pointer inside the target based on \
  948. * the base address, configured inside the target. \
  949. */ \
  950. \
  951. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  952. /* frags_desc_ptr - \
  953. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  954. * where the tx frame's fragments reside in memory. \
  955. * This field only applies to LL systems, since in HL systems the \
  956. * (degenerate single-fragment) fragmentation descriptor is created \
  957. * within the target. \
  958. */ \
  959. _paddr__frags_desc_ptr_; \
  960. \
  961. /* DWORD 3 (or 4): peerid, chanfreq */ \
  962. /* \
  963. * Peer ID : Target can use this value to know which peer-id packet \
  964. * destined to. \
  965. * It's intended to be specified by host in case of NAWDS. \
  966. */ \
  967. A_UINT16 peerid; \
  968. \
  969. /* \
  970. * Channel frequency: This identifies the desired channel \
  971. * frequency (in mhz) for tx frames. This is used by FW to help \
  972. * determine when it is safe to transmit or drop frames for \
  973. * off-channel operation. \
  974. * The default value of zero indicates to FW that the corresponding \
  975. * VDEV's home channel (if there is one) is the desired channel \
  976. * frequency. \
  977. */ \
  978. A_UINT16 chanfreq; \
  979. \
  980. /* Reason reserved is commented is increasing the htt structure size \
  981. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  982. * A_UINT32 reserved_dword3_bits0_31; \
  983. */ \
  984. } POSTPACK
  985. /* define a htt_tx_msdu_desc32_t type */
  986. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  987. /* define a htt_tx_msdu_desc64_t type */
  988. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  989. /*
  990. * Make htt_tx_msdu_desc_t be an alias for either
  991. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  992. */
  993. #if HTT_PADDR64
  994. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  995. #else
  996. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  997. #endif
  998. /* decriptor information for Management frame*/
  999. /*
  1000. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1001. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1002. */
  1003. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1004. extern A_UINT32 mgmt_hdr_len;
  1005. PREPACK struct htt_mgmt_tx_desc_t {
  1006. A_UINT32 msg_type;
  1007. #if HTT_PADDR64
  1008. A_UINT64 frag_paddr; /* DMAble address of the data */
  1009. #else
  1010. A_UINT32 frag_paddr; /* DMAble address of the data */
  1011. #endif
  1012. A_UINT32 desc_id; /* returned to host during completion
  1013. * to free the meory*/
  1014. A_UINT32 len; /* Fragment length */
  1015. A_UINT32 vdev_id; /* virtual device ID*/
  1016. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1017. } POSTPACK;
  1018. PREPACK struct htt_mgmt_tx_compl_ind {
  1019. A_UINT32 desc_id;
  1020. A_UINT32 status;
  1021. } POSTPACK;
  1022. /*
  1023. * This SDU header size comes from the summation of the following:
  1024. * 1. Max of:
  1025. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1026. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1027. * b. 802.11 header, for raw frames: 36 bytes
  1028. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1029. * QoS header, HT header)
  1030. * c. 802.3 header, for ethernet frames: 14 bytes
  1031. * (destination address, source address, ethertype / length)
  1032. * 2. Max of:
  1033. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1034. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1035. * 3. 802.1Q VLAN header: 4 bytes
  1036. * 4. LLC/SNAP header: 8 bytes
  1037. */
  1038. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1039. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1040. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1041. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1042. A_COMPILE_TIME_ASSERT(
  1043. htt_encap_hdr_size_max_check_nwifi,
  1044. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1045. A_COMPILE_TIME_ASSERT(
  1046. htt_encap_hdr_size_max_check_enet,
  1047. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1048. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1049. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1050. #define HTT_TX_HDR_SIZE_802_1Q 4
  1051. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1052. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1053. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1054. HTT_TX_HDR_SIZE_802_1Q + \
  1055. HTT_TX_HDR_SIZE_LLC_SNAP)
  1056. #define HTT_HL_TX_FRM_HDR_LEN \
  1057. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1058. #define HTT_LL_TX_FRM_HDR_LEN \
  1059. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1060. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1061. /* dword 0 */
  1062. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1063. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1064. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1065. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1066. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1067. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1068. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1069. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1070. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1071. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1072. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1073. #define HTT_TX_DESC_PKT_TYPE_S 13
  1074. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1075. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1076. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1077. #define HTT_TX_DESC_VDEV_ID_S 16
  1078. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1079. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1080. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1081. #define HTT_TX_DESC_EXT_TID_S 22
  1082. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1083. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1084. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1085. #define HTT_TX_DESC_POSTPONED_S 27
  1086. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1087. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1088. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1089. #define HTT_TX_DESC_EXTENSION_S 28
  1090. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1091. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1092. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1093. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1094. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1095. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1096. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1097. #define HTT_TX_DESC_TX_COMP_S 31
  1098. /* dword 1 */
  1099. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1100. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1101. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1102. #define HTT_TX_DESC_FRM_LEN_S 0
  1103. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1104. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1105. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1106. #define HTT_TX_DESC_FRM_ID_S 16
  1107. /* dword 2 */
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1110. /* for systems using 64-bit format for bus addresses */
  1111. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1112. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1115. /* for systems using 32-bit format for bus addresses */
  1116. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1117. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1118. /* dword 3 */
  1119. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1122. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1124. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1125. #if HTT_PADDR64
  1126. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1127. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1128. #else
  1129. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1130. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1131. #endif
  1132. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1133. #define HTT_TX_DESC_PEER_ID_S 0
  1134. /*
  1135. * TEMPORARY:
  1136. * The original definitions for the PEER_ID fields contained typos
  1137. * (with _DESC_PADDR appended to this PEER_ID field name).
  1138. * Retain deprecated original names for PEER_ID fields until all code that
  1139. * refers to them has been updated.
  1140. */
  1141. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1142. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1143. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1144. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1145. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1146. HTT_TX_DESC_PEER_ID_M
  1147. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1148. HTT_TX_DESC_PEER_ID_S
  1149. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1152. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1154. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1155. #if HTT_PADDR64
  1156. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1157. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1158. #else
  1159. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1160. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1161. #endif
  1162. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1163. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1164. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1165. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1166. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1167. do { \
  1168. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1169. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1170. } while (0)
  1171. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1172. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1173. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1174. do { \
  1175. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1176. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1177. } while (0)
  1178. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1179. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1180. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1181. do { \
  1182. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1183. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1184. } while (0)
  1185. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1186. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1187. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1188. do { \
  1189. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1190. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1191. } while (0)
  1192. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1193. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1194. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1195. do { \
  1196. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1197. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1198. } while (0)
  1199. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1200. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1201. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1202. do { \
  1203. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1204. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1205. } while (0)
  1206. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1207. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1208. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1209. do { \
  1210. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1211. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1212. } while (0)
  1213. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1214. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1215. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1218. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1219. } while (0)
  1220. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1221. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1222. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1226. } while (0)
  1227. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1229. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1236. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1243. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1250. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1254. } while (0)
  1255. /* enums used in the HTT tx MSDU extension descriptor */
  1256. enum {
  1257. htt_tx_guard_interval_regular = 0,
  1258. htt_tx_guard_interval_short = 1,
  1259. };
  1260. enum {
  1261. htt_tx_preamble_type_ofdm = 0,
  1262. htt_tx_preamble_type_cck = 1,
  1263. htt_tx_preamble_type_ht = 2,
  1264. htt_tx_preamble_type_vht = 3,
  1265. };
  1266. enum {
  1267. htt_tx_bandwidth_5MHz = 0,
  1268. htt_tx_bandwidth_10MHz = 1,
  1269. htt_tx_bandwidth_20MHz = 2,
  1270. htt_tx_bandwidth_40MHz = 3,
  1271. htt_tx_bandwidth_80MHz = 4,
  1272. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1273. };
  1274. /**
  1275. * @brief HTT tx MSDU extension descriptor
  1276. * @details
  1277. * If the target supports HTT tx MSDU extension descriptors, the host has
  1278. * the option of appending the following struct following the regular
  1279. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1280. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1281. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1282. * tx specs for each frame.
  1283. */
  1284. PREPACK struct htt_tx_msdu_desc_ext_t {
  1285. /* DWORD 0: flags */
  1286. A_UINT32
  1287. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1288. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1289. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1290. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1291. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1292. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1293. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1294. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1295. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1296. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1297. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1298. /* DWORD 1: tx power, tx rate, tx BW */
  1299. A_UINT32
  1300. /* pwr -
  1301. * Specify what power the tx frame needs to be transmitted at.
  1302. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1303. * The value needs to be appropriately sign-extended when extracting
  1304. * the value from the message and storing it in a variable that is
  1305. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1306. * automatically handles this sign-extension.)
  1307. * If the transmission uses multiple tx chains, this power spec is
  1308. * the total transmit power, assuming incoherent combination of
  1309. * per-chain power to produce the total power.
  1310. */
  1311. pwr: 8,
  1312. /* mcs_mask -
  1313. * Specify the allowable values for MCS index (modulation and coding)
  1314. * to use for transmitting the frame.
  1315. *
  1316. * For HT / VHT preamble types, this mask directly corresponds to
  1317. * the HT or VHT MCS indices that are allowed. For each bit N set
  1318. * within the mask, MCS index N is allowed for transmitting the frame.
  1319. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1320. * rates versus OFDM rates, so the host has the option of specifying
  1321. * that the target must transmit the frame with CCK or OFDM rates
  1322. * (not HT or VHT), but leaving the decision to the target whether
  1323. * to use CCK or OFDM.
  1324. *
  1325. * For CCK and OFDM, the bits within this mask are interpreted as
  1326. * follows:
  1327. * bit 0 -> CCK 1 Mbps rate is allowed
  1328. * bit 1 -> CCK 2 Mbps rate is allowed
  1329. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1330. * bit 3 -> CCK 11 Mbps rate is allowed
  1331. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1332. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1333. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1334. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1335. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1336. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1337. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1338. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1339. *
  1340. * The MCS index specification needs to be compatible with the
  1341. * bandwidth mask specification. For example, a MCS index == 9
  1342. * specification is inconsistent with a preamble type == VHT,
  1343. * Nss == 1, and channel bandwidth == 20 MHz.
  1344. *
  1345. * Furthermore, the host has only a limited ability to specify to
  1346. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1347. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1348. */
  1349. mcs_mask: 12,
  1350. /* nss_mask -
  1351. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1352. * Each bit in this mask corresponds to a Nss value:
  1353. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1354. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1355. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1356. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1357. * The values in the Nss mask must be suitable for the recipient, e.g.
  1358. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1359. * recipient which only supports 2x2 MIMO.
  1360. */
  1361. nss_mask: 4,
  1362. /* guard_interval -
  1363. * Specify a htt_tx_guard_interval enum value to indicate whether
  1364. * the transmission should use a regular guard interval or a
  1365. * short guard interval.
  1366. */
  1367. guard_interval: 1,
  1368. /* preamble_type_mask -
  1369. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1370. * may choose from for transmitting this frame.
  1371. * The bits in this mask correspond to the values in the
  1372. * htt_tx_preamble_type enum. For example, to allow the target
  1373. * to transmit the frame as either CCK or OFDM, this field would
  1374. * be set to
  1375. * (1 << htt_tx_preamble_type_ofdm) |
  1376. * (1 << htt_tx_preamble_type_cck)
  1377. */
  1378. preamble_type_mask: 4,
  1379. reserved1_31_29: 3; /* unused, set to 0x0 */
  1380. /* DWORD 2: tx chain mask, tx retries */
  1381. A_UINT32
  1382. /* chain_mask - specify which chains to transmit from */
  1383. chain_mask: 4,
  1384. /* retry_limit -
  1385. * Specify the maximum number of transmissions, including the
  1386. * initial transmission, to attempt before giving up if no ack
  1387. * is received.
  1388. * If the tx rate is specified, then all retries shall use the
  1389. * same rate as the initial transmission.
  1390. * If no tx rate is specified, the target can choose whether to
  1391. * retain the original rate during the retransmissions, or to
  1392. * fall back to a more robust rate.
  1393. */
  1394. retry_limit: 4,
  1395. /* bandwidth_mask -
  1396. * Specify what channel widths may be used for the transmission.
  1397. * A value of zero indicates "don't care" - the target may choose
  1398. * the transmission bandwidth.
  1399. * The bits within this mask correspond to the htt_tx_bandwidth
  1400. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1401. * The bandwidth_mask must be consistent with the preamble_type_mask
  1402. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1403. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1404. */
  1405. bandwidth_mask: 6,
  1406. reserved2_31_14: 18; /* unused, set to 0x0 */
  1407. /* DWORD 3: tx expiry time (TSF) LSBs */
  1408. A_UINT32 expire_tsf_lo;
  1409. /* DWORD 4: tx expiry time (TSF) MSBs */
  1410. A_UINT32 expire_tsf_hi;
  1411. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1412. } POSTPACK;
  1413. /* DWORD 0 */
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1431. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1432. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1433. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1434. /* DWORD 1 */
  1435. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1436. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1437. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1438. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1439. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1440. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1441. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1442. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1443. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1444. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1445. /* DWORD 2 */
  1446. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1447. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1448. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1449. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1450. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1451. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1452. /* DWORD 0 */
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1454. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1455. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1456. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1457. do { \
  1458. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1459. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1460. } while (0)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1462. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1463. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1465. do { \
  1466. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1467. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1468. } while (0)
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1470. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1471. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1473. do { \
  1474. HTT_CHECK_SET_VAL( \
  1475. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1476. ((_var) |= ((_val) \
  1477. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1478. } while (0)
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1480. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1481. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1483. do { \
  1484. HTT_CHECK_SET_VAL( \
  1485. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1486. ((_var) |= ((_val) \
  1487. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1488. } while (0)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1490. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1491. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1493. do { \
  1494. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1495. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1496. } while (0)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1498. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1499. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1501. do { \
  1502. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1503. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1504. } while (0)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1506. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1507. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1509. do { \
  1510. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1511. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1512. } while (0)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1514. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1515. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1517. do { \
  1518. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1519. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1520. } while (0)
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1522. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1523. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1525. do { \
  1526. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1527. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1528. } while (0)
  1529. /* DWORD 1 */
  1530. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1531. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1532. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1534. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1535. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1536. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1537. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1538. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1540. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1541. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1542. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1543. do { \
  1544. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1545. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1570. } while (0)
  1571. /* DWORD 2 */
  1572. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1595. } while (0)
  1596. typedef enum {
  1597. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1598. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1599. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1600. } htt_11ax_ltf_subtype_t;
  1601. typedef enum {
  1602. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1605. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1606. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1607. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1608. } htt_tx_ext2_preamble_type_t;
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1618. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1619. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1620. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1621. /**
  1622. * @brief HTT tx MSDU extension descriptor v2
  1623. * @details
  1624. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1625. * is received as tcl_exit_base->host_meta_info in firmware.
  1626. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1627. * are already part of tcl_exit_base.
  1628. */
  1629. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1630. /* DWORD 0: flags */
  1631. A_UINT32
  1632. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1633. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1634. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1635. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1636. valid_retries : 1, /* if set, tx retries spec is valid */
  1637. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1638. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1639. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1640. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1641. valid_key_flags : 1, /* if set, key flags is valid */
  1642. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1643. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1644. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1645. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1646. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1647. 1 = ENCRYPT,
  1648. 2 ~ 3 - Reserved */
  1649. /* retry_limit -
  1650. * Specify the maximum number of transmissions, including the
  1651. * initial transmission, to attempt before giving up if no ack
  1652. * is received.
  1653. * If the tx rate is specified, then all retries shall use the
  1654. * same rate as the initial transmission.
  1655. * If no tx rate is specified, the target can choose whether to
  1656. * retain the original rate during the retransmissions, or to
  1657. * fall back to a more robust rate.
  1658. */
  1659. retry_limit : 4,
  1660. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1661. * Valid only for 11ax preamble types HE_SU
  1662. * and HE_EXT_SU
  1663. */
  1664. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1665. * Valid only for 11ax preamble types HE_SU
  1666. * and HE_EXT_SU
  1667. */
  1668. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1669. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1670. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1671. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1672. */
  1673. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1674. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1675. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1676. * Use cases:
  1677. * Any time firmware uses TQM-BYPASS for Data
  1678. * TID, firmware expect host to set this bit.
  1679. */
  1680. /* DWORD 1: tx power, tx rate */
  1681. A_UINT32
  1682. power : 8, /* unit of the power field is 0.5 dbm
  1683. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1684. * signed value ranging from -64dbm to 63.5 dbm
  1685. */
  1686. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1687. * Setting more than one MCS isn't currently
  1688. * supported by the target (but is supported
  1689. * in the interface in case in the future
  1690. * the target supports specifications of
  1691. * a limited set of MCS values.
  1692. */
  1693. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1694. * Setting more than one Nss isn't currently
  1695. * supported by the target (but is supported
  1696. * in the interface in case in the future
  1697. * the target supports specifications of
  1698. * a limited set of Nss values.
  1699. */
  1700. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1701. update_peer_cache : 1; /* When set these custom values will be
  1702. * used for all packets, until the next
  1703. * update via this ext header.
  1704. * This is to make sure not all packets
  1705. * need to include this header.
  1706. */
  1707. /* DWORD 2: tx chain mask, tx retries */
  1708. A_UINT32
  1709. /* chain_mask - specify which chains to transmit from */
  1710. chain_mask : 8,
  1711. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1712. * TODO: Update Enum values for key_flags
  1713. */
  1714. /*
  1715. * Channel frequency: This identifies the desired channel
  1716. * frequency (in MHz) for tx frames. This is used by FW to help
  1717. * determine when it is safe to transmit or drop frames for
  1718. * off-channel operation.
  1719. * The default value of zero indicates to FW that the corresponding
  1720. * VDEV's home channel (if there is one) is the desired channel
  1721. * frequency.
  1722. */
  1723. chanfreq : 16;
  1724. /* DWORD 3: tx expiry time (TSF) LSBs */
  1725. A_UINT32 expire_tsf_lo;
  1726. /* DWORD 4: tx expiry time (TSF) MSBs */
  1727. A_UINT32 expire_tsf_hi;
  1728. /* DWORD 5: flags to control routing / processing of the MSDU */
  1729. A_UINT32
  1730. /* learning_frame
  1731. * When this flag is set, this frame will be dropped by FW
  1732. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1733. */
  1734. learning_frame : 1,
  1735. /* send_as_standalone
  1736. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1737. * i.e. with no A-MSDU or A-MPDU aggregation.
  1738. * The scope is extended to other use-cases.
  1739. */
  1740. send_as_standalone : 1,
  1741. /* is_host_opaque_valid
  1742. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1743. * with valid information.
  1744. */
  1745. is_host_opaque_valid : 1,
  1746. rsvd0 : 29;
  1747. /* DWORD 6 : Host opaque cookie for special frames */
  1748. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1749. rsvd1 : 16;
  1750. /*
  1751. * This structure can be expanded further up to 40 bytes
  1752. * by adding further DWORDs as needed.
  1753. */
  1754. } POSTPACK;
  1755. /* DWORD 0 */
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1779. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1780. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1781. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1782. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1783. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1784. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1785. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1786. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1787. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1788. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1789. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1790. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1791. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1792. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1793. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1794. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1795. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1796. /* DWORD 1 */
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1798. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1799. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1801. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1802. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1803. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1804. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1805. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1806. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1807. /* DWORD 2 */
  1808. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1809. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1810. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1811. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1812. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1813. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1814. /* DWORD 5 */
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1821. /* DWORD 6 */
  1822. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1823. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1824. /* DWORD 0 */
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1848. } while (0)
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1850. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1851. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL( \
  1855. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1856. ((_var) |= ((_val) \
  1857. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1858. } while (0)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1860. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1861. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1865. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1866. } while (0)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1868. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1869. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1873. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1874. } while (0)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL( \
  1881. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1882. ((_var) |= ((_val) \
  1883. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1884. } while (0)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1892. } while (0)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1900. } while (0)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1902. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1903. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1908. } while (0)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1939. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1988. } while (0)
  1989. /* DWORD 1 */
  1990. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1994. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1995. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1996. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1997. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1998. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1999. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2025. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2026. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2030. } while (0)
  2031. /* DWORD 2 */
  2032. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2055. } while (0)
  2056. /* DWORD 5 */
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2080. } while (0)
  2081. /* DWORD 6 */
  2082. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2083. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2084. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2085. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2089. } while (0)
  2090. typedef enum {
  2091. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2092. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2093. } htt_tcl_metadata_type;
  2094. /**
  2095. * @brief HTT TCL command number format
  2096. * @details
  2097. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2098. * available to firmware as tcl_exit_base->tcl_status_number.
  2099. * For regular / multicast packets host will send vdev and mac id and for
  2100. * NAWDS packets, host will send peer id.
  2101. * A_UINT32 is used to avoid endianness conversion problems.
  2102. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2103. */
  2104. typedef struct {
  2105. A_UINT32
  2106. type: 1, /* vdev_id based or peer_id based */
  2107. rsvd: 31;
  2108. } htt_tx_tcl_vdev_or_peer_t;
  2109. typedef struct {
  2110. A_UINT32
  2111. type: 1, /* vdev_id based or peer_id based */
  2112. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2113. vdev_id: 8,
  2114. pdev_id: 2,
  2115. host_inspected:1,
  2116. rsvd: 19;
  2117. } htt_tx_tcl_vdev_metadata;
  2118. typedef struct {
  2119. A_UINT32
  2120. type: 1, /* vdev_id based or peer_id based */
  2121. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2122. peer_id: 14,
  2123. rsvd: 16;
  2124. } htt_tx_tcl_peer_metadata;
  2125. PREPACK struct htt_tx_tcl_metadata {
  2126. union {
  2127. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2128. htt_tx_tcl_vdev_metadata vdev_meta;
  2129. htt_tx_tcl_peer_metadata peer_meta;
  2130. };
  2131. } POSTPACK;
  2132. /* DWORD 0 */
  2133. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2134. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2135. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2136. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2137. /* VDEV metadata */
  2138. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2139. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2140. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2141. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2142. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2143. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2144. /* PEER metadata */
  2145. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2146. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2147. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2148. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2149. HTT_TX_TCL_METADATA_TYPE_S)
  2150. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2154. } while (0)
  2155. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2156. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2157. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2158. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2162. } while (0)
  2163. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2164. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2165. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2166. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2170. } while (0)
  2171. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2172. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2173. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2174. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2178. } while (0)
  2179. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2180. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2181. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2182. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2186. } while (0)
  2187. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2188. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2189. HTT_TX_TCL_METADATA_PEER_ID_S)
  2190. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2191. do { \
  2192. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2193. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2194. } while (0)
  2195. typedef enum {
  2196. HTT_TX_FW2WBM_TX_STATUS_OK,
  2197. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2198. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2199. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2200. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2201. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2202. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2203. HTT_TX_FW2WBM_TX_STATUS_MAX
  2204. } htt_tx_fw2wbm_tx_status_t;
  2205. typedef enum {
  2206. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2207. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2208. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2209. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2210. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2211. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2212. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2213. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2214. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2215. } htt_tx_fw2wbm_reinject_reason_t;
  2216. /**
  2217. * @brief HTT TX WBM Completion from firmware to host
  2218. * @details
  2219. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2220. * DWORD 3 and 4 for software based completions (Exception frames and
  2221. * TQM bypass frames)
  2222. * For software based completions, wbm_release_ring->release_source_module will
  2223. * be set to release_source_fw
  2224. */
  2225. PREPACK struct htt_tx_wbm_completion {
  2226. A_UINT32
  2227. sch_cmd_id: 24,
  2228. exception_frame: 1, /* If set, this packet was queued via exception path */
  2229. rsvd0_31_25: 7;
  2230. A_UINT32
  2231. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2232. * reception of an ACK or BA, this field indicates
  2233. * the RSSI of the received ACK or BA frame.
  2234. * When the frame is removed as result of a direct
  2235. * remove command from the SW, this field is set
  2236. * to 0x0 (which is never a valid value when real
  2237. * RSSI is available).
  2238. * Units: dB w.r.t noise floor
  2239. */
  2240. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2241. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2242. rsvd1_31_16: 16;
  2243. } POSTPACK;
  2244. /* DWORD 0 */
  2245. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2246. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2247. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2248. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2249. /* DWORD 1 */
  2250. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2251. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2252. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2253. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2254. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2255. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2256. /* DWORD 0 */
  2257. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2258. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2259. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2260. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2264. } while (0)
  2265. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2267. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2268. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2272. } while (0)
  2273. /* DWORD 1 */
  2274. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2276. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2277. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2281. } while (0)
  2282. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2283. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2284. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2285. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2289. } while (0)
  2290. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2291. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2292. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2293. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2294. do { \
  2295. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2296. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2297. } while (0)
  2298. /**
  2299. * @brief HTT TX WBM Completion from firmware to host
  2300. * @details
  2301. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2302. * (WBM) offload HW.
  2303. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2304. * For software based completions, release_source_module will
  2305. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2306. * struct wbm_release_ring and then switch to this after looking at
  2307. * release_source_module.
  2308. */
  2309. PREPACK struct htt_tx_wbm_completion_v2 {
  2310. A_UINT32
  2311. used_by_hw0; /* Refer to struct wbm_release_ring */
  2312. A_UINT32
  2313. used_by_hw1; /* Refer to struct wbm_release_ring */
  2314. A_UINT32
  2315. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2316. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2317. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2318. exception_frame: 1,
  2319. rsvd0: 12, /* For future use */
  2320. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2321. rsvd1: 1; /* For future use */
  2322. A_UINT32
  2323. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2324. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2325. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2326. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2327. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2328. */
  2329. A_UINT32
  2330. data1: 32;
  2331. A_UINT32
  2332. data2: 32;
  2333. A_UINT32
  2334. used_by_hw3; /* Refer to struct wbm_release_ring */
  2335. } POSTPACK;
  2336. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2337. /* DWORD 3 */
  2338. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2339. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2340. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2341. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2342. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2343. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2344. /* DWORD 3 */
  2345. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2346. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2347. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2348. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2352. } while (0)
  2353. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2354. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2355. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2356. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2360. } while (0)
  2361. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2362. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2363. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2364. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2368. } while (0)
  2369. typedef enum {
  2370. TX_FRAME_TYPE_UNDEFINED = 0,
  2371. TX_FRAME_TYPE_EAPOL = 1,
  2372. } htt_tx_wbm_status_frame_type;
  2373. /**
  2374. * @brief HTT TX WBM transmit status from firmware to host
  2375. * @details
  2376. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2377. * (WBM) offload HW.
  2378. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2379. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2380. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2381. */
  2382. PREPACK struct htt_tx_wbm_transmit_status {
  2383. A_UINT32
  2384. sch_cmd_id: 24,
  2385. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2386. * reception of an ACK or BA, this field indicates
  2387. * the RSSI of the received ACK or BA frame.
  2388. * When the frame is removed as result of a direct
  2389. * remove command from the SW, this field is set
  2390. * to 0x0 (which is never a valid value when real
  2391. * RSSI is available).
  2392. * Units: dB w.r.t noise floor
  2393. */
  2394. A_UINT32
  2395. sw_peer_id: 16,
  2396. tid_num: 5,
  2397. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2398. * and tid_num fields contain valid data.
  2399. * If this "valid" flag is not set, the
  2400. * sw_peer_id and tid_num fields must be ignored.
  2401. */
  2402. mcast: 1,
  2403. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2404. * contains valid data.
  2405. */
  2406. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2407. reserved: 4;
  2408. A_UINT32
  2409. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2410. * packets in the wbm completion path
  2411. */
  2412. } POSTPACK;
  2413. /* DWORD 4 */
  2414. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2415. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2416. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2417. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2418. /* DWORD 5 */
  2419. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2420. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2421. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2422. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2423. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2424. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2425. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2426. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2427. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2428. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2429. /* DWORD 4 */
  2430. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2431. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2432. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2433. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2437. } while (0)
  2438. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2439. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2440. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2441. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2445. } while (0)
  2446. /* DWORD 5 */
  2447. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2448. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2449. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2450. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2454. } while (0)
  2455. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2456. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2457. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2458. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2461. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2462. } while (0)
  2463. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2464. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2465. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2466. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2467. do { \
  2468. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2469. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2470. } while (0)
  2471. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2472. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2473. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2474. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2475. do { \
  2476. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2477. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2478. } while (0)
  2479. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2480. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2481. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2482. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2483. do { \
  2484. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2485. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2486. } while (0)
  2487. /**
  2488. * @brief HTT TX WBM reinject status from firmware to host
  2489. * @details
  2490. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2491. * (WBM) offload HW.
  2492. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2493. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2494. */
  2495. PREPACK struct htt_tx_wbm_reinject_status {
  2496. A_UINT32
  2497. reserved0: 32;
  2498. A_UINT32
  2499. reserved1: 32;
  2500. A_UINT32
  2501. reserved2: 32;
  2502. } POSTPACK;
  2503. /**
  2504. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2505. * @details
  2506. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2507. * (WBM) offload HW.
  2508. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2509. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2510. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2511. * STA side.
  2512. */
  2513. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2514. A_UINT32
  2515. mec_sa_addr_31_0;
  2516. A_UINT32
  2517. mec_sa_addr_47_32: 16,
  2518. sa_ast_index: 16;
  2519. A_UINT32
  2520. vdev_id: 8,
  2521. reserved0: 24;
  2522. } POSTPACK;
  2523. /* DWORD 4 - mec_sa_addr_31_0 */
  2524. /* DWORD 5 */
  2525. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2526. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2527. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2528. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2529. /* DWORD 6 */
  2530. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2531. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2532. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2533. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2534. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2535. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2538. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2539. } while (0)
  2540. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2541. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2542. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2543. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2546. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2547. } while (0)
  2548. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2549. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2550. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2551. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2554. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2555. } while (0)
  2556. typedef enum {
  2557. TX_FLOW_PRIORITY_BE,
  2558. TX_FLOW_PRIORITY_HIGH,
  2559. TX_FLOW_PRIORITY_LOW,
  2560. } htt_tx_flow_priority_t;
  2561. typedef enum {
  2562. TX_FLOW_LATENCY_SENSITIVE,
  2563. TX_FLOW_LATENCY_INSENSITIVE,
  2564. } htt_tx_flow_latency_t;
  2565. typedef enum {
  2566. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2567. TX_FLOW_INTERACTIVE_TRAFFIC,
  2568. TX_FLOW_PERIODIC_TRAFFIC,
  2569. TX_FLOW_BURSTY_TRAFFIC,
  2570. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2571. } htt_tx_flow_traffic_pattern_t;
  2572. /**
  2573. * @brief HTT TX Flow search metadata format
  2574. * @details
  2575. * Host will set this metadata in flow table's flow search entry along with
  2576. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2577. * firmware and TQM ring if the flow search entry wins.
  2578. * This metadata is available to firmware in that first MSDU's
  2579. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2580. * to one of the available flows for specific tid and returns the tqm flow
  2581. * pointer as part of htt_tx_map_flow_info message.
  2582. */
  2583. PREPACK struct htt_tx_flow_metadata {
  2584. A_UINT32
  2585. rsvd0_1_0: 2,
  2586. tid: 4,
  2587. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2588. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2589. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2590. * Else choose final tid based on latency, priority.
  2591. */
  2592. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2593. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2594. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2595. } POSTPACK;
  2596. /* DWORD 0 */
  2597. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2598. #define HTT_TX_FLOW_METADATA_TID_S 2
  2599. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2600. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2601. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2602. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2603. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2604. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2605. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2606. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2607. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2608. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2609. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2610. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2611. /* DWORD 0 */
  2612. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2613. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2614. HTT_TX_FLOW_METADATA_TID_S)
  2615. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2618. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2619. } while (0)
  2620. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2621. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2622. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2623. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2626. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2627. } while (0)
  2628. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2629. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2630. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2631. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2634. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2635. } while (0)
  2636. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2637. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2638. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2639. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2642. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2643. } while (0)
  2644. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2645. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2646. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2647. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2651. } while (0)
  2652. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2653. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2654. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2655. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2658. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2659. } while (0)
  2660. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2661. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2662. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2663. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2664. do { \
  2665. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2666. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2667. } while (0)
  2668. /**
  2669. * @brief host -> target ADD WDS Entry
  2670. *
  2671. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2672. *
  2673. * @brief host -> target DELETE WDS Entry
  2674. *
  2675. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2676. *
  2677. * @details
  2678. * HTT wds entry from source port learning
  2679. * Host will learn wds entries from rx and send this message to firmware
  2680. * to enable firmware to configure/delete AST entries for wds clients.
  2681. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2682. * and when SA's entry is deleted, firmware removes this AST entry
  2683. *
  2684. * The message would appear as follows:
  2685. *
  2686. * |31 30|29 |17 16|15 8|7 0|
  2687. * |----------------+----------------+----------------+----------------|
  2688. * | rsvd0 |PDVID| vdev_id | msg_type |
  2689. * |-------------------------------------------------------------------|
  2690. * | sa_addr_31_0 |
  2691. * |-------------------------------------------------------------------|
  2692. * | | ta_peer_id | sa_addr_47_32 |
  2693. * |-------------------------------------------------------------------|
  2694. * Where PDVID = pdev_id
  2695. *
  2696. * The message is interpreted as follows:
  2697. *
  2698. * dword0 - b'0:7 - msg_type: This will be set to
  2699. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2700. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2701. *
  2702. * dword0 - b'8:15 - vdev_id
  2703. *
  2704. * dword0 - b'16:17 - pdev_id
  2705. *
  2706. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2707. *
  2708. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2709. *
  2710. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2711. *
  2712. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2713. */
  2714. PREPACK struct htt_wds_entry {
  2715. A_UINT32
  2716. msg_type: 8,
  2717. vdev_id: 8,
  2718. pdev_id: 2,
  2719. rsvd0: 14;
  2720. A_UINT32 sa_addr_31_0;
  2721. A_UINT32
  2722. sa_addr_47_32: 16,
  2723. ta_peer_id: 14,
  2724. rsvd2: 2;
  2725. } POSTPACK;
  2726. /* DWORD 0 */
  2727. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2728. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2729. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2730. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2731. /* DWORD 2 */
  2732. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2733. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2734. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2735. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2736. /* DWORD 0 */
  2737. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2738. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2739. HTT_WDS_ENTRY_VDEV_ID_S)
  2740. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2743. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2744. } while (0)
  2745. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2746. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2747. HTT_WDS_ENTRY_PDEV_ID_S)
  2748. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2749. do { \
  2750. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2751. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2752. } while (0)
  2753. /* DWORD 2 */
  2754. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2755. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2756. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2757. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2760. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2761. } while (0)
  2762. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2763. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2764. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2765. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2768. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2769. } while (0)
  2770. /**
  2771. * @brief MAC DMA rx ring setup specification
  2772. *
  2773. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2774. *
  2775. * @details
  2776. * To allow for dynamic rx ring reconfiguration and to avoid race
  2777. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2778. * it uses. Instead, it sends this message to the target, indicating how
  2779. * the rx ring used by the host should be set up and maintained.
  2780. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2781. * specifications.
  2782. *
  2783. * |31 16|15 8|7 0|
  2784. * |---------------------------------------------------------------|
  2785. * header: | reserved | num rings | msg type |
  2786. * |---------------------------------------------------------------|
  2787. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2788. #if HTT_PADDR64
  2789. * | FW_IDX shadow register physical address (bits 63:32) |
  2790. #endif
  2791. * |---------------------------------------------------------------|
  2792. * | rx ring base physical address (bits 31:0) |
  2793. #if HTT_PADDR64
  2794. * | rx ring base physical address (bits 63:32) |
  2795. #endif
  2796. * |---------------------------------------------------------------|
  2797. * | rx ring buffer size | rx ring length |
  2798. * |---------------------------------------------------------------|
  2799. * | FW_IDX initial value | enabled flags |
  2800. * |---------------------------------------------------------------|
  2801. * | MSDU payload offset | 802.11 header offset |
  2802. * |---------------------------------------------------------------|
  2803. * | PPDU end offset | PPDU start offset |
  2804. * |---------------------------------------------------------------|
  2805. * | MPDU end offset | MPDU start offset |
  2806. * |---------------------------------------------------------------|
  2807. * | MSDU end offset | MSDU start offset |
  2808. * |---------------------------------------------------------------|
  2809. * | frag info offset | rx attention offset |
  2810. * |---------------------------------------------------------------|
  2811. * payload 2, if present, has the same format as payload 1
  2812. * Header fields:
  2813. * - MSG_TYPE
  2814. * Bits 7:0
  2815. * Purpose: identifies this as an rx ring configuration message
  2816. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2817. * - NUM_RINGS
  2818. * Bits 15:8
  2819. * Purpose: indicates whether the host is setting up one rx ring or two
  2820. * Value: 1 or 2
  2821. * Payload:
  2822. * for systems using 64-bit format for bus addresses:
  2823. * - IDX_SHADOW_REG_PADDR_LO
  2824. * Bits 31:0
  2825. * Value: lower 4 bytes of physical address of the host's
  2826. * FW_IDX shadow register
  2827. * - IDX_SHADOW_REG_PADDR_HI
  2828. * Bits 31:0
  2829. * Value: upper 4 bytes of physical address of the host's
  2830. * FW_IDX shadow register
  2831. * - RING_BASE_PADDR_LO
  2832. * Bits 31:0
  2833. * Value: lower 4 bytes of physical address of the host's rx ring
  2834. * - RING_BASE_PADDR_HI
  2835. * Bits 31:0
  2836. * Value: uppper 4 bytes of physical address of the host's rx ring
  2837. * for systems using 32-bit format for bus addresses:
  2838. * - IDX_SHADOW_REG_PADDR
  2839. * Bits 31:0
  2840. * Value: physical address of the host's FW_IDX shadow register
  2841. * - RING_BASE_PADDR
  2842. * Bits 31:0
  2843. * Value: physical address of the host's rx ring
  2844. * - RING_LEN
  2845. * Bits 15:0
  2846. * Value: number of elements in the rx ring
  2847. * - RING_BUF_SZ
  2848. * Bits 31:16
  2849. * Value: size of the buffers referenced by the rx ring, in byte units
  2850. * - ENABLED_FLAGS
  2851. * Bits 15:0
  2852. * Value: 1-bit flags to show whether different rx fields are enabled
  2853. * bit 0: 802.11 header enabled (1) or disabled (0)
  2854. * bit 1: MSDU payload enabled (1) or disabled (0)
  2855. * bit 2: PPDU start enabled (1) or disabled (0)
  2856. * bit 3: PPDU end enabled (1) or disabled (0)
  2857. * bit 4: MPDU start enabled (1) or disabled (0)
  2858. * bit 5: MPDU end enabled (1) or disabled (0)
  2859. * bit 6: MSDU start enabled (1) or disabled (0)
  2860. * bit 7: MSDU end enabled (1) or disabled (0)
  2861. * bit 8: rx attention enabled (1) or disabled (0)
  2862. * bit 9: frag info enabled (1) or disabled (0)
  2863. * bit 10: unicast rx enabled (1) or disabled (0)
  2864. * bit 11: multicast rx enabled (1) or disabled (0)
  2865. * bit 12: ctrl rx enabled (1) or disabled (0)
  2866. * bit 13: mgmt rx enabled (1) or disabled (0)
  2867. * bit 14: null rx enabled (1) or disabled (0)
  2868. * bit 15: phy data rx enabled (1) or disabled (0)
  2869. * - IDX_INIT_VAL
  2870. * Bits 31:16
  2871. * Purpose: Specify the initial value for the FW_IDX.
  2872. * Value: the number of buffers initially present in the host's rx ring
  2873. * - OFFSET_802_11_HDR
  2874. * Bits 15:0
  2875. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2876. * - OFFSET_MSDU_PAYLOAD
  2877. * Bits 31:16
  2878. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2879. * - OFFSET_PPDU_START
  2880. * Bits 15:0
  2881. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2882. * - OFFSET_PPDU_END
  2883. * Bits 31:16
  2884. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2885. * - OFFSET_MPDU_START
  2886. * Bits 15:0
  2887. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2888. * - OFFSET_MPDU_END
  2889. * Bits 31:16
  2890. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2891. * - OFFSET_MSDU_START
  2892. * Bits 15:0
  2893. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2894. * - OFFSET_MSDU_END
  2895. * Bits 31:16
  2896. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2897. * - OFFSET_RX_ATTN
  2898. * Bits 15:0
  2899. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2900. * - OFFSET_FRAG_INFO
  2901. * Bits 31:16
  2902. * Value: offset in QUAD-bytes of frag info table
  2903. */
  2904. /* header fields */
  2905. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2906. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2907. /* payload fields */
  2908. /* for systems using a 64-bit format for bus addresses */
  2909. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2910. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2911. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2912. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2913. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2914. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2915. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2916. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2917. /* for systems using a 32-bit format for bus addresses */
  2918. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2919. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2920. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2921. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2922. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2923. #define HTT_RX_RING_CFG_LEN_S 0
  2924. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2925. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2926. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2927. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2928. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2929. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2930. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2931. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2932. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2933. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2934. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2935. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2936. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2937. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2938. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2939. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2940. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2941. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2942. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2943. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2944. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2945. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2946. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2947. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2948. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2949. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2950. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2951. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2952. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2953. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2954. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2955. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2956. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2957. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2958. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2959. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2960. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2961. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2962. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2963. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2964. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2965. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2967. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2968. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2969. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2970. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2971. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2972. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2973. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2974. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2975. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2976. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2977. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2978. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2979. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2980. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2981. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2982. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2983. #if HTT_PADDR64
  2984. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2985. #else
  2986. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2987. #endif
  2988. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2989. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2990. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2991. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2992. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2995. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2996. } while (0)
  2997. /* degenerate case for 32-bit fields */
  2998. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2999. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3000. ((_var) = (_val))
  3001. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3002. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3003. ((_var) = (_val))
  3004. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3005. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3006. ((_var) = (_val))
  3007. /* degenerate case for 32-bit fields */
  3008. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3009. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3010. ((_var) = (_val))
  3011. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3012. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3013. ((_var) = (_val))
  3014. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3015. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3016. ((_var) = (_val))
  3017. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3018. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3019. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3022. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3023. } while (0)
  3024. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3025. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3026. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3029. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3030. } while (0)
  3031. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3032. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3033. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3034. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3037. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3038. } while (0)
  3039. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3040. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3041. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3042. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3045. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3046. } while (0)
  3047. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3048. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3049. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3050. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3051. do { \
  3052. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3053. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3054. } while (0)
  3055. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3056. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3057. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3058. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3059. do { \
  3060. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3061. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3062. } while (0)
  3063. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3064. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3065. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3066. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3067. do { \
  3068. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3069. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3070. } while (0)
  3071. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3072. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3073. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3074. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3075. do { \
  3076. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3077. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3078. } while (0)
  3079. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3080. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3081. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3082. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3083. do { \
  3084. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3085. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3086. } while (0)
  3087. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3088. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3089. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3090. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3091. do { \
  3092. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3093. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3094. } while (0)
  3095. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3096. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3097. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3098. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3099. do { \
  3100. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3101. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3102. } while (0)
  3103. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3104. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3105. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3106. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3107. do { \
  3108. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3109. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3110. } while (0)
  3111. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3112. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3113. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3114. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3117. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3118. } while (0)
  3119. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3120. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3121. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3122. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3123. do { \
  3124. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3125. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3126. } while (0)
  3127. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3128. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3129. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3130. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3133. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3134. } while (0)
  3135. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3136. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3137. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3138. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3141. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3142. } while (0)
  3143. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3144. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3145. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3146. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3147. do { \
  3148. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3149. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3150. } while (0)
  3151. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3152. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3153. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3154. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3155. do { \
  3156. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3157. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3158. } while (0)
  3159. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3160. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3161. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3162. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3163. do { \
  3164. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3165. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3166. } while (0)
  3167. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3168. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3169. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3170. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3171. do { \
  3172. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3173. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3174. } while (0)
  3175. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3176. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3177. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3178. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3179. do { \
  3180. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3181. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3182. } while (0)
  3183. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3184. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3185. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3186. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3187. do { \
  3188. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3189. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3190. } while (0)
  3191. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3192. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3193. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3194. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3195. do { \
  3196. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3197. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3198. } while (0)
  3199. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3200. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3201. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3202. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3203. do { \
  3204. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3205. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3206. } while (0)
  3207. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3208. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3209. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3210. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3211. do { \
  3212. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3213. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3214. } while (0)
  3215. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3216. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3217. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3218. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3219. do { \
  3220. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3221. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3222. } while (0)
  3223. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3224. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3225. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3226. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3227. do { \
  3228. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3229. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3230. } while (0)
  3231. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3232. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3233. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3234. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3235. do { \
  3236. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3237. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3238. } while (0)
  3239. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3240. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3241. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3242. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3243. do { \
  3244. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3245. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3246. } while (0)
  3247. /**
  3248. * @brief host -> target FW statistics retrieve
  3249. *
  3250. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3251. *
  3252. * @details
  3253. * The following field definitions describe the format of the HTT host
  3254. * to target FW stats retrieve message. The message specifies the type of
  3255. * stats host wants to retrieve.
  3256. *
  3257. * |31 24|23 16|15 8|7 0|
  3258. * |-----------------------------------------------------------|
  3259. * | stats types request bitmask | msg type |
  3260. * |-----------------------------------------------------------|
  3261. * | stats types reset bitmask | reserved |
  3262. * |-----------------------------------------------------------|
  3263. * | stats type | config value |
  3264. * |-----------------------------------------------------------|
  3265. * | cookie LSBs |
  3266. * |-----------------------------------------------------------|
  3267. * | cookie MSBs |
  3268. * |-----------------------------------------------------------|
  3269. * Header fields:
  3270. * - MSG_TYPE
  3271. * Bits 7:0
  3272. * Purpose: identifies this is a stats upload request message
  3273. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3274. * - UPLOAD_TYPES
  3275. * Bits 31:8
  3276. * Purpose: identifies which types of FW statistics to upload
  3277. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3278. * - RESET_TYPES
  3279. * Bits 31:8
  3280. * Purpose: identifies which types of FW statistics to reset
  3281. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3282. * - CFG_VAL
  3283. * Bits 23:0
  3284. * Purpose: give an opaque configuration value to the specified stats type
  3285. * Value: stats-type specific configuration value
  3286. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3287. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3288. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3289. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3290. * - CFG_STAT_TYPE
  3291. * Bits 31:24
  3292. * Purpose: specify which stats type (if any) the config value applies to
  3293. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3294. * a valid configuration specification
  3295. * - COOKIE_LSBS
  3296. * Bits 31:0
  3297. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3298. * message with its preceding host->target stats request message.
  3299. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3300. * - COOKIE_MSBS
  3301. * Bits 31:0
  3302. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3303. * message with its preceding host->target stats request message.
  3304. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3305. */
  3306. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3307. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3308. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3309. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3310. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3311. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3312. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3313. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3314. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3315. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3316. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3317. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3318. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3319. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3320. do { \
  3321. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3322. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3323. } while (0)
  3324. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3325. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3326. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3327. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3328. do { \
  3329. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3330. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3331. } while (0)
  3332. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3333. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3334. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3335. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3336. do { \
  3337. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3338. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3339. } while (0)
  3340. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3341. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3342. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3343. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3344. do { \
  3345. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3346. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3347. } while (0)
  3348. /**
  3349. * @brief host -> target HTT out-of-band sync request
  3350. *
  3351. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3352. *
  3353. * @details
  3354. * The HTT SYNC tells the target to suspend processing of subsequent
  3355. * HTT host-to-target messages until some other target agent locally
  3356. * informs the target HTT FW that the current sync counter is equal to
  3357. * or greater than (in a modulo sense) the sync counter specified in
  3358. * the SYNC message.
  3359. * This allows other host-target components to synchronize their operation
  3360. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3361. * security key has been downloaded to and activated by the target.
  3362. * In the absence of any explicit synchronization counter value
  3363. * specification, the target HTT FW will use zero as the default current
  3364. * sync value.
  3365. *
  3366. * |31 24|23 16|15 8|7 0|
  3367. * |-----------------------------------------------------------|
  3368. * | reserved | sync count | msg type |
  3369. * |-----------------------------------------------------------|
  3370. * Header fields:
  3371. * - MSG_TYPE
  3372. * Bits 7:0
  3373. * Purpose: identifies this as a sync message
  3374. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3375. * - SYNC_COUNT
  3376. * Bits 15:8
  3377. * Purpose: specifies what sync value the HTT FW will wait for from
  3378. * an out-of-band specification to resume its operation
  3379. * Value: in-band sync counter value to compare against the out-of-band
  3380. * counter spec.
  3381. * The HTT target FW will suspend its host->target message processing
  3382. * as long as
  3383. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3384. */
  3385. #define HTT_H2T_SYNC_MSG_SZ 4
  3386. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3387. #define HTT_H2T_SYNC_COUNT_S 8
  3388. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3389. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3390. HTT_H2T_SYNC_COUNT_S)
  3391. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3392. do { \
  3393. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3394. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3395. } while (0)
  3396. /**
  3397. * @brief host -> target HTT aggregation configuration
  3398. *
  3399. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3400. */
  3401. #define HTT_AGGR_CFG_MSG_SZ 4
  3402. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3403. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3404. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3405. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3406. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3407. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3408. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3409. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3412. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3413. } while (0)
  3414. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3415. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3416. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3417. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3420. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3421. } while (0)
  3422. /**
  3423. * @brief host -> target HTT configure max amsdu info per vdev
  3424. *
  3425. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3426. *
  3427. * @details
  3428. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3429. *
  3430. * |31 21|20 16|15 8|7 0|
  3431. * |-----------------------------------------------------------|
  3432. * | reserved | vdev id | max amsdu | msg type |
  3433. * |-----------------------------------------------------------|
  3434. * Header fields:
  3435. * - MSG_TYPE
  3436. * Bits 7:0
  3437. * Purpose: identifies this as a aggr cfg ex message
  3438. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3439. * - MAX_NUM_AMSDU_SUBFRM
  3440. * Bits 15:8
  3441. * Purpose: max MSDUs per A-MSDU
  3442. * - VDEV_ID
  3443. * Bits 20:16
  3444. * Purpose: ID of the vdev to which this limit is applied
  3445. */
  3446. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3447. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3448. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3449. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3450. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3451. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3452. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3453. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3454. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3457. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3458. } while (0)
  3459. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3460. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3461. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3462. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3465. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3466. } while (0)
  3467. /**
  3468. * @brief HTT WDI_IPA Config Message
  3469. *
  3470. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3471. *
  3472. * @details
  3473. * The HTT WDI_IPA config message is created/sent by host at driver
  3474. * init time. It contains information about data structures used on
  3475. * WDI_IPA TX and RX path.
  3476. * TX CE ring is used for pushing packet metadata from IPA uC
  3477. * to WLAN FW
  3478. * TX Completion ring is used for generating TX completions from
  3479. * WLAN FW to IPA uC
  3480. * RX Indication ring is used for indicating RX packets from FW
  3481. * to IPA uC
  3482. * RX Ring2 is used as either completion ring or as second
  3483. * indication ring. when Ring2 is used as completion ring, IPA uC
  3484. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3485. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3486. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3487. * indicated in RX Indication ring. Please see WDI_IPA specification
  3488. * for more details.
  3489. * |31 24|23 16|15 8|7 0|
  3490. * |----------------+----------------+----------------+----------------|
  3491. * | tx pkt pool size | Rsvd | msg_type |
  3492. * |-------------------------------------------------------------------|
  3493. * | tx comp ring base (bits 31:0) |
  3494. #if HTT_PADDR64
  3495. * | tx comp ring base (bits 63:32) |
  3496. #endif
  3497. * |-------------------------------------------------------------------|
  3498. * | tx comp ring size |
  3499. * |-------------------------------------------------------------------|
  3500. * | tx comp WR_IDX physical address (bits 31:0) |
  3501. #if HTT_PADDR64
  3502. * | tx comp WR_IDX physical address (bits 63:32) |
  3503. #endif
  3504. * |-------------------------------------------------------------------|
  3505. * | tx CE WR_IDX physical address (bits 31:0) |
  3506. #if HTT_PADDR64
  3507. * | tx CE WR_IDX physical address (bits 63:32) |
  3508. #endif
  3509. * |-------------------------------------------------------------------|
  3510. * | rx indication ring base (bits 31:0) |
  3511. #if HTT_PADDR64
  3512. * | rx indication ring base (bits 63:32) |
  3513. #endif
  3514. * |-------------------------------------------------------------------|
  3515. * | rx indication ring size |
  3516. * |-------------------------------------------------------------------|
  3517. * | rx ind RD_IDX physical address (bits 31:0) |
  3518. #if HTT_PADDR64
  3519. * | rx ind RD_IDX physical address (bits 63:32) |
  3520. #endif
  3521. * |-------------------------------------------------------------------|
  3522. * | rx ind WR_IDX physical address (bits 31:0) |
  3523. #if HTT_PADDR64
  3524. * | rx ind WR_IDX physical address (bits 63:32) |
  3525. #endif
  3526. * |-------------------------------------------------------------------|
  3527. * |-------------------------------------------------------------------|
  3528. * | rx ring2 base (bits 31:0) |
  3529. #if HTT_PADDR64
  3530. * | rx ring2 base (bits 63:32) |
  3531. #endif
  3532. * |-------------------------------------------------------------------|
  3533. * | rx ring2 size |
  3534. * |-------------------------------------------------------------------|
  3535. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3536. #if HTT_PADDR64
  3537. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3538. #endif
  3539. * |-------------------------------------------------------------------|
  3540. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3541. #if HTT_PADDR64
  3542. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3543. #endif
  3544. * |-------------------------------------------------------------------|
  3545. *
  3546. * Header fields:
  3547. * Header fields:
  3548. * - MSG_TYPE
  3549. * Bits 7:0
  3550. * Purpose: Identifies this as WDI_IPA config message
  3551. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3552. * - TX_PKT_POOL_SIZE
  3553. * Bits 15:0
  3554. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3555. * WDI_IPA TX path
  3556. * For systems using 32-bit format for bus addresses:
  3557. * - TX_COMP_RING_BASE_ADDR
  3558. * Bits 31:0
  3559. * Purpose: TX Completion Ring base address in DDR
  3560. * - TX_COMP_RING_SIZE
  3561. * Bits 31:0
  3562. * Purpose: TX Completion Ring size (must be power of 2)
  3563. * - TX_COMP_WR_IDX_ADDR
  3564. * Bits 31:0
  3565. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3566. * updates the Write Index for WDI_IPA TX completion ring
  3567. * - TX_CE_WR_IDX_ADDR
  3568. * Bits 31:0
  3569. * Purpose: DDR address where IPA uC
  3570. * updates the WR Index for TX CE ring
  3571. * (needed for fusion platforms)
  3572. * - RX_IND_RING_BASE_ADDR
  3573. * Bits 31:0
  3574. * Purpose: RX Indication Ring base address in DDR
  3575. * - RX_IND_RING_SIZE
  3576. * Bits 31:0
  3577. * Purpose: RX Indication Ring size
  3578. * - RX_IND_RD_IDX_ADDR
  3579. * Bits 31:0
  3580. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3581. * RX indication ring
  3582. * - RX_IND_WR_IDX_ADDR
  3583. * Bits 31:0
  3584. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3585. * updates the Write Index for WDI_IPA RX indication ring
  3586. * - RX_RING2_BASE_ADDR
  3587. * Bits 31:0
  3588. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3589. * - RX_RING2_SIZE
  3590. * Bits 31:0
  3591. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3592. * - RX_RING2_RD_IDX_ADDR
  3593. * Bits 31:0
  3594. * Purpose: If Second RX ring is Indication ring, DDR address where
  3595. * IPA uC updates the Read Index for Ring2.
  3596. * If Second RX ring is completion ring, this is NOT used
  3597. * - RX_RING2_WR_IDX_ADDR
  3598. * Bits 31:0
  3599. * Purpose: If Second RX ring is Indication ring, DDR address where
  3600. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3601. * If second RX ring is completion ring, DDR address where
  3602. * IPA uC updates the Write Index for Ring 2.
  3603. * For systems using 64-bit format for bus addresses:
  3604. * - TX_COMP_RING_BASE_ADDR_LO
  3605. * Bits 31:0
  3606. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3607. * - TX_COMP_RING_BASE_ADDR_HI
  3608. * Bits 31:0
  3609. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3610. * - TX_COMP_RING_SIZE
  3611. * Bits 31:0
  3612. * Purpose: TX Completion Ring size (must be power of 2)
  3613. * - TX_COMP_WR_IDX_ADDR_LO
  3614. * Bits 31:0
  3615. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3616. * Lower 4 bytes of DDR address where WIFI FW
  3617. * updates the Write Index for WDI_IPA TX completion ring
  3618. * - TX_COMP_WR_IDX_ADDR_HI
  3619. * Bits 31:0
  3620. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3621. * Higher 4 bytes of DDR address where WIFI FW
  3622. * updates the Write Index for WDI_IPA TX completion ring
  3623. * - TX_CE_WR_IDX_ADDR_LO
  3624. * Bits 31:0
  3625. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3626. * updates the WR Index for TX CE ring
  3627. * (needed for fusion platforms)
  3628. * - TX_CE_WR_IDX_ADDR_HI
  3629. * Bits 31:0
  3630. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3631. * updates the WR Index for TX CE ring
  3632. * (needed for fusion platforms)
  3633. * - RX_IND_RING_BASE_ADDR_LO
  3634. * Bits 31:0
  3635. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3636. * - RX_IND_RING_BASE_ADDR_HI
  3637. * Bits 31:0
  3638. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3639. * - RX_IND_RING_SIZE
  3640. * Bits 31:0
  3641. * Purpose: RX Indication Ring size
  3642. * - RX_IND_RD_IDX_ADDR_LO
  3643. * Bits 31:0
  3644. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3645. * for WDI_IPA RX indication ring
  3646. * - RX_IND_RD_IDX_ADDR_HI
  3647. * Bits 31:0
  3648. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3649. * for WDI_IPA RX indication ring
  3650. * - RX_IND_WR_IDX_ADDR_LO
  3651. * Bits 31:0
  3652. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3653. * Lower 4 bytes of DDR address where WIFI FW
  3654. * updates the Write Index for WDI_IPA RX indication ring
  3655. * - RX_IND_WR_IDX_ADDR_HI
  3656. * Bits 31:0
  3657. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3658. * Higher 4 bytes of DDR address where WIFI FW
  3659. * updates the Write Index for WDI_IPA RX indication ring
  3660. * - RX_RING2_BASE_ADDR_LO
  3661. * Bits 31:0
  3662. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3663. * - RX_RING2_BASE_ADDR_HI
  3664. * Bits 31:0
  3665. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3666. * - RX_RING2_SIZE
  3667. * Bits 31:0
  3668. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3669. * - RX_RING2_RD_IDX_ADDR_LO
  3670. * Bits 31:0
  3671. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3672. * DDR address where IPA uC updates the Read Index for Ring2.
  3673. * If Second RX ring is completion ring, this is NOT used
  3674. * - RX_RING2_RD_IDX_ADDR_HI
  3675. * Bits 31:0
  3676. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3677. * DDR address where IPA uC updates the Read Index for Ring2.
  3678. * If Second RX ring is completion ring, this is NOT used
  3679. * - RX_RING2_WR_IDX_ADDR_LO
  3680. * Bits 31:0
  3681. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3682. * DDR address where WIFI FW updates the Write Index
  3683. * for WDI_IPA RX ring2
  3684. * If second RX ring is completion ring, lower 4 bytes of
  3685. * DDR address where IPA uC updates the Write Index for Ring 2.
  3686. * - RX_RING2_WR_IDX_ADDR_HI
  3687. * Bits 31:0
  3688. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3689. * DDR address where WIFI FW updates the Write Index
  3690. * for WDI_IPA RX ring2
  3691. * If second RX ring is completion ring, higher 4 bytes of
  3692. * DDR address where IPA uC updates the Write Index for Ring 2.
  3693. */
  3694. #if HTT_PADDR64
  3695. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3696. #else
  3697. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3698. #endif
  3699. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3700. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3701. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3707. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3709. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3711. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3713. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3715. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3717. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3719. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3721. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3761. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3762. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3763. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3764. do { \
  3765. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3766. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3767. } while (0)
  3768. /* for systems using 32-bit format for bus addr */
  3769. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3770. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3771. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3772. do { \
  3773. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3774. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3775. } while (0)
  3776. /* for systems using 64-bit format for bus addr */
  3777. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3778. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3779. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3780. do { \
  3781. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3782. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3783. } while (0)
  3784. /* for systems using 64-bit format for bus addr */
  3785. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3786. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3787. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3788. do { \
  3789. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3790. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3791. } while (0)
  3792. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3793. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3794. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3795. do { \
  3796. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3797. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3798. } while (0)
  3799. /* for systems using 32-bit format for bus addr */
  3800. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3801. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3802. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3803. do { \
  3804. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3805. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3806. } while (0)
  3807. /* for systems using 64-bit format for bus addr */
  3808. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3809. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3810. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3811. do { \
  3812. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3813. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3814. } while (0)
  3815. /* for systems using 64-bit format for bus addr */
  3816. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3817. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3818. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3819. do { \
  3820. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3821. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3822. } while (0)
  3823. /* for systems using 32-bit format for bus addr */
  3824. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3825. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3826. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3829. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3830. } while (0)
  3831. /* for systems using 64-bit format for bus addr */
  3832. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3833. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3834. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3835. do { \
  3836. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3837. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3838. } while (0)
  3839. /* for systems using 64-bit format for bus addr */
  3840. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3841. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3842. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3843. do { \
  3844. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3845. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3846. } while (0)
  3847. /* for systems using 32-bit format for bus addr */
  3848. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3849. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3850. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3851. do { \
  3852. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3853. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3854. } while (0)
  3855. /* for systems using 64-bit format for bus addr */
  3856. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3857. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3858. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3859. do { \
  3860. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3861. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3862. } while (0)
  3863. /* for systems using 64-bit format for bus addr */
  3864. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3865. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3866. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3867. do { \
  3868. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3869. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3870. } while (0)
  3871. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3872. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3873. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3874. do { \
  3875. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3876. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3877. } while (0)
  3878. /* for systems using 32-bit format for bus addr */
  3879. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3880. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3881. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3882. do { \
  3883. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3884. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3885. } while (0)
  3886. /* for systems using 64-bit format for bus addr */
  3887. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3888. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3889. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3890. do { \
  3891. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3892. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3893. } while (0)
  3894. /* for systems using 64-bit format for bus addr */
  3895. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3896. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3897. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3898. do { \
  3899. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3900. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3901. } while (0)
  3902. /* for systems using 32-bit format for bus addr */
  3903. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3904. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3905. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3906. do { \
  3907. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3908. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3909. } while (0)
  3910. /* for systems using 64-bit format for bus addr */
  3911. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3912. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3913. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3914. do { \
  3915. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3916. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3917. } while (0)
  3918. /* for systems using 64-bit format for bus addr */
  3919. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3920. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3921. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3922. do { \
  3923. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3924. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3925. } while (0)
  3926. /* for systems using 32-bit format for bus addr */
  3927. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3928. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3929. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3930. do { \
  3931. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3932. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3933. } while (0)
  3934. /* for systems using 64-bit format for bus addr */
  3935. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3936. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3937. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3938. do { \
  3939. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3940. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3941. } while (0)
  3942. /* for systems using 64-bit format for bus addr */
  3943. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3944. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3945. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3946. do { \
  3947. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3948. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3949. } while (0)
  3950. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3951. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3952. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3953. do { \
  3954. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3955. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3956. } while (0)
  3957. /* for systems using 32-bit format for bus addr */
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3959. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3961. do { \
  3962. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3963. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3964. } while (0)
  3965. /* for systems using 64-bit format for bus addr */
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3967. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3969. do { \
  3970. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3971. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3972. } while (0)
  3973. /* for systems using 64-bit format for bus addr */
  3974. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3975. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3976. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3977. do { \
  3978. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3979. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3980. } while (0)
  3981. /* for systems using 32-bit format for bus addr */
  3982. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3983. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3984. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3985. do { \
  3986. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3987. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3988. } while (0)
  3989. /* for systems using 64-bit format for bus addr */
  3990. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3991. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3992. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3993. do { \
  3994. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3995. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3996. } while (0)
  3997. /* for systems using 64-bit format for bus addr */
  3998. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3999. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4000. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4001. do { \
  4002. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4003. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4004. } while (0)
  4005. /*
  4006. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4007. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4008. * addresses are stored in a XXX-bit field.
  4009. * This macro is used to define both htt_wdi_ipa_config32_t and
  4010. * htt_wdi_ipa_config64_t structs.
  4011. */
  4012. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4013. _paddr__tx_comp_ring_base_addr_, \
  4014. _paddr__tx_comp_wr_idx_addr_, \
  4015. _paddr__tx_ce_wr_idx_addr_, \
  4016. _paddr__rx_ind_ring_base_addr_, \
  4017. _paddr__rx_ind_rd_idx_addr_, \
  4018. _paddr__rx_ind_wr_idx_addr_, \
  4019. _paddr__rx_ring2_base_addr_,\
  4020. _paddr__rx_ring2_rd_idx_addr_,\
  4021. _paddr__rx_ring2_wr_idx_addr_) \
  4022. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4023. { \
  4024. /* DWORD 0: flags and meta-data */ \
  4025. A_UINT32 \
  4026. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4027. reserved: 8, \
  4028. tx_pkt_pool_size: 16;\
  4029. /* DWORD 1 */\
  4030. _paddr__tx_comp_ring_base_addr_;\
  4031. /* DWORD 2 (or 3)*/\
  4032. A_UINT32 tx_comp_ring_size;\
  4033. /* DWORD 3 (or 4)*/\
  4034. _paddr__tx_comp_wr_idx_addr_;\
  4035. /* DWORD 4 (or 6)*/\
  4036. _paddr__tx_ce_wr_idx_addr_;\
  4037. /* DWORD 5 (or 8)*/\
  4038. _paddr__rx_ind_ring_base_addr_;\
  4039. /* DWORD 6 (or 10)*/\
  4040. A_UINT32 rx_ind_ring_size;\
  4041. /* DWORD 7 (or 11)*/\
  4042. _paddr__rx_ind_rd_idx_addr_;\
  4043. /* DWORD 8 (or 13)*/\
  4044. _paddr__rx_ind_wr_idx_addr_;\
  4045. /* DWORD 9 (or 15)*/\
  4046. _paddr__rx_ring2_base_addr_;\
  4047. /* DWORD 10 (or 17) */\
  4048. A_UINT32 rx_ring2_size;\
  4049. /* DWORD 11 (or 18) */\
  4050. _paddr__rx_ring2_rd_idx_addr_;\
  4051. /* DWORD 12 (or 20) */\
  4052. _paddr__rx_ring2_wr_idx_addr_;\
  4053. } POSTPACK
  4054. /* define a htt_wdi_ipa_config32_t type */
  4055. 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));
  4056. /* define a htt_wdi_ipa_config64_t type */
  4057. 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));
  4058. #if HTT_PADDR64
  4059. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4060. #else
  4061. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4062. #endif
  4063. enum htt_wdi_ipa_op_code {
  4064. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4065. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4066. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4067. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4068. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4069. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4070. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4071. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4072. /* keep this last */
  4073. HTT_WDI_IPA_OPCODE_MAX
  4074. };
  4075. /**
  4076. * @brief HTT WDI_IPA Operation Request Message
  4077. *
  4078. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4079. *
  4080. * @details
  4081. * HTT WDI_IPA Operation Request message is sent by host
  4082. * to either suspend or resume WDI_IPA TX or RX path.
  4083. * |31 24|23 16|15 8|7 0|
  4084. * |----------------+----------------+----------------+----------------|
  4085. * | op_code | Rsvd | msg_type |
  4086. * |-------------------------------------------------------------------|
  4087. *
  4088. * Header fields:
  4089. * - MSG_TYPE
  4090. * Bits 7:0
  4091. * Purpose: Identifies this as WDI_IPA Operation Request message
  4092. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4093. * - OP_CODE
  4094. * Bits 31:16
  4095. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4096. * value: = enum htt_wdi_ipa_op_code
  4097. */
  4098. PREPACK struct htt_wdi_ipa_op_request_t
  4099. {
  4100. /* DWORD 0: flags and meta-data */
  4101. A_UINT32
  4102. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4103. reserved: 8,
  4104. op_code: 16;
  4105. } POSTPACK;
  4106. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4107. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4108. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4109. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4110. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4111. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4114. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4115. } while (0)
  4116. /*
  4117. * @brief host -> target HTT_SRING_SETUP message
  4118. *
  4119. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4120. *
  4121. * @details
  4122. * After target is booted up, Host can send SRING setup message for
  4123. * each host facing LMAC SRING. Target setups up HW registers based
  4124. * on setup message and confirms back to Host if response_required is set.
  4125. * Host should wait for confirmation message before sending new SRING
  4126. * setup message
  4127. *
  4128. * The message would appear as follows:
  4129. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4130. * |--------------- +-----------------+-----------------+-----------------|
  4131. * | ring_type | ring_id | pdev_id | msg_type |
  4132. * |----------------------------------------------------------------------|
  4133. * | ring_base_addr_lo |
  4134. * |----------------------------------------------------------------------|
  4135. * | ring_base_addr_hi |
  4136. * |----------------------------------------------------------------------|
  4137. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4138. * |----------------------------------------------------------------------|
  4139. * | ring_head_offset32_remote_addr_lo |
  4140. * |----------------------------------------------------------------------|
  4141. * | ring_head_offset32_remote_addr_hi |
  4142. * |----------------------------------------------------------------------|
  4143. * | ring_tail_offset32_remote_addr_lo |
  4144. * |----------------------------------------------------------------------|
  4145. * | ring_tail_offset32_remote_addr_hi |
  4146. * |----------------------------------------------------------------------|
  4147. * | ring_msi_addr_lo |
  4148. * |----------------------------------------------------------------------|
  4149. * | ring_msi_addr_hi |
  4150. * |----------------------------------------------------------------------|
  4151. * | ring_msi_data |
  4152. * |----------------------------------------------------------------------|
  4153. * | intr_timer_th |IM| intr_batch_counter_th |
  4154. * |----------------------------------------------------------------------|
  4155. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4156. * |----------------------------------------------------------------------|
  4157. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4158. * |----------------------------------------------------------------------|
  4159. * Where
  4160. * IM = sw_intr_mode
  4161. * RR = response_required
  4162. * PTCF = prefetch_timer_cfg
  4163. * IP = IPA drop flag
  4164. *
  4165. * The message is interpreted as follows:
  4166. * dword0 - b'0:7 - msg_type: This will be set to
  4167. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4168. * b'8:15 - pdev_id:
  4169. * 0 (for rings at SOC/UMAC level),
  4170. * 1/2/3 mac id (for rings at LMAC level)
  4171. * b'16:23 - ring_id: identify which ring is to setup,
  4172. * more details can be got from enum htt_srng_ring_id
  4173. * b'24:31 - ring_type: identify type of host rings,
  4174. * more details can be got from enum htt_srng_ring_type
  4175. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4176. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4177. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4178. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4179. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4180. * SW_TO_HW_RING.
  4181. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4182. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4183. * Lower 32 bits of memory address of the remote variable
  4184. * storing the 4-byte word offset that identifies the head
  4185. * element within the ring.
  4186. * (The head offset variable has type A_UINT32.)
  4187. * Valid for HW_TO_SW and SW_TO_SW rings.
  4188. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4189. * Upper 32 bits of memory address of the remote variable
  4190. * storing the 4-byte word offset that identifies the head
  4191. * element within the ring.
  4192. * (The head offset variable has type A_UINT32.)
  4193. * Valid for HW_TO_SW and SW_TO_SW rings.
  4194. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4195. * Lower 32 bits of memory address of the remote variable
  4196. * storing the 4-byte word offset that identifies the tail
  4197. * element within the ring.
  4198. * (The tail offset variable has type A_UINT32.)
  4199. * Valid for HW_TO_SW and SW_TO_SW rings.
  4200. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4201. * Upper 32 bits of memory address of the remote variable
  4202. * storing the 4-byte word offset that identifies the tail
  4203. * element within the ring.
  4204. * (The tail offset variable has type A_UINT32.)
  4205. * Valid for HW_TO_SW and SW_TO_SW rings.
  4206. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4207. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4208. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4209. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4210. * dword10 - b'0:31 - ring_msi_data: MSI data
  4211. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4212. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4213. * dword11 - b'0:14 - intr_batch_counter_th:
  4214. * batch counter threshold is in units of 4-byte words.
  4215. * HW internally maintains and increments batch count.
  4216. * (see SRING spec for detail description).
  4217. * When batch count reaches threshold value, an interrupt
  4218. * is generated by HW.
  4219. * b'15 - sw_intr_mode:
  4220. * This configuration shall be static.
  4221. * Only programmed at power up.
  4222. * 0: generate pulse style sw interrupts
  4223. * 1: generate level style sw interrupts
  4224. * b'16:31 - intr_timer_th:
  4225. * The timer init value when timer is idle or is
  4226. * initialized to start downcounting.
  4227. * In 8us units (to cover a range of 0 to 524 ms)
  4228. * dword12 - b'0:15 - intr_low_threshold:
  4229. * Used only by Consumer ring to generate ring_sw_int_p.
  4230. * Ring entries low threshold water mark, that is used
  4231. * in combination with the interrupt timer as well as
  4232. * the the clearing of the level interrupt.
  4233. * b'16:18 - prefetch_timer_cfg:
  4234. * Used only by Consumer ring to set timer mode to
  4235. * support Application prefetch handling.
  4236. * The external tail offset/pointer will be updated
  4237. * at following intervals:
  4238. * 3'b000: (Prefetch feature disabled; used only for debug)
  4239. * 3'b001: 1 usec
  4240. * 3'b010: 4 usec
  4241. * 3'b011: 8 usec (default)
  4242. * 3'b100: 16 usec
  4243. * Others: Reserverd
  4244. * b'19 - response_required:
  4245. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4246. * b'20 - ipa_drop_flag:
  4247. Indicates that host will config ipa drop threshold percentage
  4248. * b'21:31 - reserved: reserved for future use
  4249. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4250. * b'8:15 - ipa drop high threshold percentage:
  4251. * b'16:31 - Reserved
  4252. */
  4253. PREPACK struct htt_sring_setup_t {
  4254. A_UINT32 msg_type: 8,
  4255. pdev_id: 8,
  4256. ring_id: 8,
  4257. ring_type: 8;
  4258. A_UINT32 ring_base_addr_lo;
  4259. A_UINT32 ring_base_addr_hi;
  4260. A_UINT32 ring_size: 16,
  4261. ring_entry_size: 8,
  4262. ring_misc_cfg_flag: 8;
  4263. A_UINT32 ring_head_offset32_remote_addr_lo;
  4264. A_UINT32 ring_head_offset32_remote_addr_hi;
  4265. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4266. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4267. A_UINT32 ring_msi_addr_lo;
  4268. A_UINT32 ring_msi_addr_hi;
  4269. A_UINT32 ring_msi_data;
  4270. A_UINT32 intr_batch_counter_th: 15,
  4271. sw_intr_mode: 1,
  4272. intr_timer_th: 16;
  4273. A_UINT32 intr_low_threshold: 16,
  4274. prefetch_timer_cfg: 3,
  4275. response_required: 1,
  4276. ipa_drop_flag: 1,
  4277. reserved1: 11;
  4278. A_UINT32 ipa_drop_low_threshold: 8,
  4279. ipa_drop_high_threshold: 8,
  4280. reserved: 16;
  4281. } POSTPACK;
  4282. enum htt_srng_ring_type {
  4283. HTT_HW_TO_SW_RING = 0,
  4284. HTT_SW_TO_HW_RING,
  4285. HTT_SW_TO_SW_RING,
  4286. /* Insert new ring types above this line */
  4287. };
  4288. enum htt_srng_ring_id {
  4289. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4290. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4291. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4292. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4293. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4294. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4295. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4296. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4297. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4298. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4299. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4300. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4301. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4302. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4303. HTT_RX_MON_MON2HOST_DEST_RING1, /* 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 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5304. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5305. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5306. * |-----+--------+--------+-----+------+--------------------------------|
  5307. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5308. * |---------------------------------------------------------------+-----|
  5309. * | rsvd3 | E |
  5310. * |---------------------------------------------------------------------|
  5311. * | tlv_filter_mask_in0 |
  5312. * |---------------------------------------------------------------------|
  5313. * | tlv_filter_mask_in1 |
  5314. * |---------------------------------------------------------------------|
  5315. * | tlv_filter_mask_in2 |
  5316. * |---------------------------------------------------------------------|
  5317. * | tlv_filter_mask_in3 |
  5318. * |------------------------------------+--------------------------------|
  5319. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5320. * |------------------------------------+--------------------------------|
  5321. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5322. * |------------------------------------+--------------------------------|
  5323. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5324. * |-----------------------+-----+------+--------------------------------|
  5325. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5326. * |---------------------------------------------------------------------|
  5327. *
  5328. * Where:
  5329. * PS = pkt_swap
  5330. * SS = status_swap
  5331. * The message is interpreted as follows:
  5332. * dword0 - b'0:7 - msg_type: This will be set to
  5333. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5334. * b'8:15 - pdev_id:
  5335. * 0 (for rings at SOC/UMAC level),
  5336. * 1/2/3 mac id (for rings at LMAC level)
  5337. * b'16:23 - ring_id : Identify the ring to configure.
  5338. * More details can be got from enum htt_srng_ring_id
  5339. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5340. * BUF_RING_CFG_0 defs within HW .h files,
  5341. * e.g. wmac_top_reg_seq_hwioreg.h
  5342. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5343. * BUF_RING_CFG_0 defs within HW .h files,
  5344. * e.g. wmac_top_reg_seq_hwioreg.h
  5345. * b'26:31 - rsvd1: reserved for future use
  5346. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5347. * in byte units.
  5348. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5349. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5350. * Each bit out of 3 bits represents if configurable length
  5351. * is valid and needs to programmed.
  5352. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5353. * 64, 128, 256.
  5354. * If all 3 bits are set config length is > 256
  5355. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5356. * 64, 128, 256.
  5357. * If all 3 bits are set config length is > 256
  5358. * b'25:27 - 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. * - b'28:31 - rsvd2: Reserved for future use
  5362. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5363. * b'3:31 - rsvd3: Reserved for future use
  5364. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5365. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5366. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5367. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5368. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5369. * - b'16:31 - tx_peer_entry_word_mask:
  5370. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5371. * - b'16:31 - tx_msdu_start_word_mask:
  5372. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5373. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5374. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5375. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5376. * Each bit out of 3 bits represents if MSDU/MPDU
  5377. * logging is enabled
  5378. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5379. * 0 -> MSDU level logging is enabled
  5380. * (valid only if bit is set in
  5381. * pkt_type_msdu_or_mpdu_logging)
  5382. * 1 -> MPDU level logging is enabled
  5383. * (valid only if bit is set in
  5384. * pkt_type_msdu_or_mpdu_logging)
  5385. * - b'22:31 - rsvd4 for future use
  5386. */
  5387. PREPACK struct htt_tx_monitor_cfg_t {
  5388. A_UINT32 msg_type: 8,
  5389. pdev_id: 8,
  5390. ring_id: 8,
  5391. status_swap: 1,
  5392. pkt_swap: 1,
  5393. rsvd1: 6;
  5394. A_UINT32 ring_buffer_size: 16,
  5395. pkt_type_config_length: 3,
  5396. config_length_mgmt: 3,
  5397. config_length_ctrl: 3,
  5398. config_length_data: 3,
  5399. rsvd2: 4;
  5400. A_UINT32 pkt_type_enable_flags: 3,
  5401. rsvd3: 29;
  5402. A_UINT32 tlv_filter_mask_in0;
  5403. A_UINT32 tlv_filter_mask_in1;
  5404. A_UINT32 tlv_filter_mask_in2;
  5405. A_UINT32 tlv_filter_mask_in3;
  5406. A_UINT32 tx_fes_setup_word_mask: 16,
  5407. tx_peer_entry_word_mask: 16;
  5408. A_UINT32 tx_queue_ext_word_mask: 16,
  5409. tx_msdu_start_word_mask: 16;
  5410. A_UINT32 tx_mpdu_start_word_mask: 16,
  5411. pcu_ppdu_setup_word_mask: 16;
  5412. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5413. pkt_type_msdu_or_mpdu_logging: 3,
  5414. enable_msdu_or_mpdu_logging: 3,
  5415. rsvd4: 10;
  5416. } POSTPACK;
  5417. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5418. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5419. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5420. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5421. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5422. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5423. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5426. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5427. } while (0)
  5428. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5429. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5430. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5431. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5432. HTT_TX_MONITOR_CFG_RING_ID_S)
  5433. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5434. do { \
  5435. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5436. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5437. } while (0)
  5438. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5439. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5440. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5441. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5442. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5443. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5446. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5447. } while (0)
  5448. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5449. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5450. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5451. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5452. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5453. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5454. do { \
  5455. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5456. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5457. } while (0)
  5458. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5459. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5460. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5461. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5462. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5463. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5466. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5467. } while (0)
  5468. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5469. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5470. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5471. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5472. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5473. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5474. do { \
  5475. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5476. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5477. } while (0)
  5478. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5479. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5480. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5481. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5482. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5483. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5484. do { \
  5485. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5486. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5487. } while (0)
  5488. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5489. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5490. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5491. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5492. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5493. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5496. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5497. } while (0)
  5498. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5499. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5500. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5501. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5502. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5503. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5506. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5507. } while (0)
  5508. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5509. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5510. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5511. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5512. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5513. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5516. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5517. } while (0)
  5518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5519. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5520. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5521. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5522. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5523. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5526. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5527. } while (0)
  5528. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5529. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5530. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5531. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5532. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5533. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5536. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5537. } while (0)
  5538. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5539. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5540. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5541. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5542. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5543. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5546. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5547. } while (0)
  5548. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5549. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5550. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5551. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5552. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5553. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5556. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5557. } while (0)
  5558. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5559. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5560. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5561. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5562. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5563. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5566. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5567. } while (0)
  5568. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5569. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5570. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5571. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5572. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5573. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5576. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5577. } while (0)
  5578. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5579. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5580. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5581. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5582. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5583. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5586. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5587. } while (0)
  5588. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5589. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5590. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5591. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5592. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5593. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5596. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5597. } while (0)
  5598. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5599. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5600. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5601. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5602. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5603. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5606. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5607. } while (0)
  5608. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5609. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5610. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5611. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5612. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5613. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5616. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5617. } while (0)
  5618. /*
  5619. * pkt_type_config_length
  5620. */
  5621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5627. /*
  5628. * pkt_type_enable_flags
  5629. */
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5636. /*
  5637. * pkt_type_msdu_or_mpdu_logging
  5638. * */
  5639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5644. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5645. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5646. do { \
  5647. HTT_CHECK_SET_VAL(httsym, value); \
  5648. (word) |= (value) << httsym##_S; \
  5649. } while (0)
  5650. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5651. (((word) & httsym##_M) >> httsym##_S)
  5652. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5653. * type -> MGMT, CTRL, DATA*/
  5654. #define htt_tx_ring_pkt_type_set( \
  5655. word, mode, type, val) \
  5656. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5657. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5658. #define htt_tx_ring_pkt_type_get( \
  5659. word, mode, type) \
  5660. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5661. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5662. /* Definition to filter in TLVs */
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5727. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5728. do { \
  5729. HTT_CHECK_SET_VAL(httsym, enable); \
  5730. (word) |= (enable) << httsym##_S; \
  5731. } while (0)
  5732. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5733. (((word) & httsym##_M) >> httsym##_S)
  5734. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5735. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5736. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5737. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5738. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5739. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5804. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(httsym, enable); \
  5807. (word) |= (enable) << httsym##_S; \
  5808. } while (0)
  5809. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5810. (((word) & httsym##_M) >> httsym##_S)
  5811. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5812. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5813. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5814. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5815. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5816. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5881. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5882. do { \
  5883. HTT_CHECK_SET_VAL(httsym, enable); \
  5884. (word) |= (enable) << httsym##_S; \
  5885. } while (0)
  5886. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5887. (((word) & httsym##_M) >> httsym##_S)
  5888. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5889. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5890. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5891. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5892. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5893. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5938. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5939. do { \
  5940. HTT_CHECK_SET_VAL(httsym, enable); \
  5941. (word) |= (enable) << httsym##_S; \
  5942. } while (0)
  5943. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5944. (((word) & httsym##_M) >> httsym##_S)
  5945. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5946. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5947. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5948. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5949. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5950. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5951. /**
  5952. * @brief host --> target Receive Flow Steering configuration message definition
  5953. *
  5954. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5955. *
  5956. * host --> target Receive Flow Steering configuration message definition.
  5957. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5958. * The reason for this is we want RFS to be configured and ready before MAC
  5959. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5960. *
  5961. * |31 24|23 16|15 9|8|7 0|
  5962. * |----------------+----------------+----------------+----------------|
  5963. * | reserved |E| msg type |
  5964. * |-------------------------------------------------------------------|
  5965. * Where E = RFS enable flag
  5966. *
  5967. * The RFS_CONFIG message consists of a single 4-byte word.
  5968. *
  5969. * Header fields:
  5970. * - MSG_TYPE
  5971. * Bits 7:0
  5972. * Purpose: identifies this as a RFS config msg
  5973. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5974. * - RFS_CONFIG
  5975. * Bit 8
  5976. * Purpose: Tells target whether to enable (1) or disable (0)
  5977. * flow steering feature when sending rx indication messages to host
  5978. */
  5979. #define HTT_H2T_RFS_CONFIG_M 0x100
  5980. #define HTT_H2T_RFS_CONFIG_S 8
  5981. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5982. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5983. HTT_H2T_RFS_CONFIG_S)
  5984. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5987. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5988. } while (0)
  5989. #define HTT_RFS_CFG_REQ_BYTES 4
  5990. /**
  5991. * @brief host -> target FW extended statistics retrieve
  5992. *
  5993. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5994. *
  5995. * @details
  5996. * The following field definitions describe the format of the HTT host
  5997. * to target FW extended stats retrieve message.
  5998. * The message specifies the type of stats the host wants to retrieve.
  5999. *
  6000. * |31 24|23 16|15 8|7 0|
  6001. * |-----------------------------------------------------------|
  6002. * | reserved | stats type | pdev_mask | msg type |
  6003. * |-----------------------------------------------------------|
  6004. * | config param [0] |
  6005. * |-----------------------------------------------------------|
  6006. * | config param [1] |
  6007. * |-----------------------------------------------------------|
  6008. * | config param [2] |
  6009. * |-----------------------------------------------------------|
  6010. * | config param [3] |
  6011. * |-----------------------------------------------------------|
  6012. * | reserved |
  6013. * |-----------------------------------------------------------|
  6014. * | cookie LSBs |
  6015. * |-----------------------------------------------------------|
  6016. * | cookie MSBs |
  6017. * |-----------------------------------------------------------|
  6018. * Header fields:
  6019. * - MSG_TYPE
  6020. * Bits 7:0
  6021. * Purpose: identifies this is a extended stats upload request message
  6022. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6023. * - PDEV_MASK
  6024. * Bits 8:15
  6025. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6026. * Value: This is a overloaded field, refer to usage and interpretation of
  6027. * PDEV in interface document.
  6028. * Bit 8 : Reserved for SOC stats
  6029. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6030. * Indicates MACID_MASK in DBS
  6031. * - STATS_TYPE
  6032. * Bits 23:16
  6033. * Purpose: identifies which FW statistics to upload
  6034. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6035. * - Reserved
  6036. * Bits 31:24
  6037. * - CONFIG_PARAM [0]
  6038. * Bits 31:0
  6039. * Purpose: give an opaque configuration value to the specified stats type
  6040. * Value: stats-type specific configuration value
  6041. * Refer to htt_stats.h for interpretation for each stats sub_type
  6042. * - CONFIG_PARAM [1]
  6043. * Bits 31:0
  6044. * Purpose: give an opaque configuration value to the specified stats type
  6045. * Value: stats-type specific configuration value
  6046. * Refer to htt_stats.h for interpretation for each stats sub_type
  6047. * - CONFIG_PARAM [2]
  6048. * Bits 31:0
  6049. * Purpose: give an opaque configuration value to the specified stats type
  6050. * Value: stats-type specific configuration value
  6051. * Refer to htt_stats.h for interpretation for each stats sub_type
  6052. * - CONFIG_PARAM [3]
  6053. * Bits 31:0
  6054. * Purpose: give an opaque configuration value to the specified stats type
  6055. * Value: stats-type specific configuration value
  6056. * Refer to htt_stats.h for interpretation for each stats sub_type
  6057. * - Reserved [31:0] for future use.
  6058. * - COOKIE_LSBS
  6059. * Bits 31:0
  6060. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6061. * message with its preceding host->target stats request message.
  6062. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6063. * - COOKIE_MSBS
  6064. * Bits 31:0
  6065. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6066. * message with its preceding host->target stats request message.
  6067. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6068. */
  6069. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6070. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6071. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6072. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6073. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6074. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6075. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6076. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6077. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6078. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6079. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6080. do { \
  6081. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6082. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6083. } while (0)
  6084. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6085. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6086. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6087. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6088. do { \
  6089. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6090. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6091. } while (0)
  6092. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6093. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6094. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6095. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6096. do { \
  6097. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6098. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6099. } while (0)
  6100. /**
  6101. * @brief host -> target FW PPDU_STATS request message
  6102. *
  6103. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6104. *
  6105. * @details
  6106. * The following field definitions describe the format of the HTT host
  6107. * to target FW for PPDU_STATS_CFG msg.
  6108. * The message allows the host to configure the PPDU_STATS_IND messages
  6109. * produced by the target.
  6110. *
  6111. * |31 24|23 16|15 8|7 0|
  6112. * |-----------------------------------------------------------|
  6113. * | REQ bit mask | pdev_mask | msg type |
  6114. * |-----------------------------------------------------------|
  6115. * Header fields:
  6116. * - MSG_TYPE
  6117. * Bits 7:0
  6118. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6119. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6120. * - PDEV_MASK
  6121. * Bits 8:15
  6122. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6123. * Value: This is a overloaded field, refer to usage and interpretation of
  6124. * PDEV in interface document.
  6125. * Bit 8 : Reserved for SOC stats
  6126. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6127. * Indicates MACID_MASK in DBS
  6128. * - REQ_TLV_BIT_MASK
  6129. * Bits 16:31
  6130. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6131. * needs to be included in the target's PPDU_STATS_IND messages.
  6132. * Value: refer htt_ppdu_stats_tlv_tag_t
  6133. *
  6134. */
  6135. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6136. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6137. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6138. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6139. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6140. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6141. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6142. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6143. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6144. do { \
  6145. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6146. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6147. } while (0)
  6148. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6149. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6150. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6151. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6152. do { \
  6153. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6154. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6155. } while (0)
  6156. /**
  6157. * @brief Host-->target HTT RX FSE setup message
  6158. *
  6159. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6160. *
  6161. * @details
  6162. * Through this message, the host will provide details of the flow tables
  6163. * in host DDR along with hash keys.
  6164. * This message can be sent per SOC or per PDEV, which is differentiated
  6165. * by pdev id values.
  6166. * The host will allocate flow search table and sends table size,
  6167. * physical DMA address of flow table, and hash keys to firmware to
  6168. * program into the RXOLE FSE HW block.
  6169. *
  6170. * The following field definitions describe the format of the RX FSE setup
  6171. * message sent from the host to target
  6172. *
  6173. * Header fields:
  6174. * dword0 - b'7:0 - msg_type: This will be set to
  6175. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6176. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6177. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6178. * pdev's LMAC ring.
  6179. * b'31:16 - reserved : Reserved for future use
  6180. * dword1 - b'19:0 - number of records: This field indicates the number of
  6181. * entries in the flow table. For example: 8k number of
  6182. * records is equivalent to
  6183. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6184. * b'27:20 - max search: This field specifies the skid length to FSE
  6185. * parser HW module whenever match is not found at the
  6186. * exact index pointed by hash.
  6187. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6188. * Refer htt_ip_da_sa_prefix below for more details.
  6189. * b'31:30 - reserved: Reserved for future use
  6190. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6191. * table allocated by host in DDR
  6192. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6193. * table allocated by host in DDR
  6194. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6195. * entry hashing
  6196. *
  6197. *
  6198. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6199. * |---------------------------------------------------------------|
  6200. * | reserved | pdev_id | MSG_TYPE |
  6201. * |---------------------------------------------------------------|
  6202. * |resvd|IPDSA| max_search | Number of records |
  6203. * |---------------------------------------------------------------|
  6204. * | base address lo |
  6205. * |---------------------------------------------------------------|
  6206. * | base address high |
  6207. * |---------------------------------------------------------------|
  6208. * | toeplitz key 31_0 |
  6209. * |---------------------------------------------------------------|
  6210. * | toeplitz key 63_32 |
  6211. * |---------------------------------------------------------------|
  6212. * | toeplitz key 95_64 |
  6213. * |---------------------------------------------------------------|
  6214. * | toeplitz key 127_96 |
  6215. * |---------------------------------------------------------------|
  6216. * | toeplitz key 159_128 |
  6217. * |---------------------------------------------------------------|
  6218. * | toeplitz key 191_160 |
  6219. * |---------------------------------------------------------------|
  6220. * | toeplitz key 223_192 |
  6221. * |---------------------------------------------------------------|
  6222. * | toeplitz key 255_224 |
  6223. * |---------------------------------------------------------------|
  6224. * | toeplitz key 287_256 |
  6225. * |---------------------------------------------------------------|
  6226. * | reserved | toeplitz key 314_288(26:0 bits) |
  6227. * |---------------------------------------------------------------|
  6228. * where:
  6229. * IPDSA = ip_da_sa
  6230. */
  6231. /**
  6232. * @brief: htt_ip_da_sa_prefix
  6233. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6234. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6235. * documentation per RFC3849
  6236. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6237. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6238. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6239. */
  6240. enum htt_ip_da_sa_prefix {
  6241. HTT_RX_IPV6_20010db8,
  6242. HTT_RX_IPV4_MAPPED_IPV6,
  6243. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6244. HTT_RX_IPV6_64FF9B,
  6245. };
  6246. /**
  6247. * @brief Host-->target HTT RX FISA configure and enable
  6248. *
  6249. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6250. *
  6251. * @details
  6252. * The host will send this command down to configure and enable the FISA
  6253. * operational params.
  6254. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6255. * register.
  6256. * Should configure both the MACs.
  6257. *
  6258. * dword0 - b'7:0 - msg_type:
  6259. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6260. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6261. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6262. * pdev's LMAC ring.
  6263. * b'31:16 - reserved : Reserved for future use
  6264. *
  6265. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6266. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6267. * packets. 1 flow search will be skipped
  6268. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6269. * tcp,udp packets
  6270. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6271. * calculation
  6272. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6273. * calculation
  6274. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6275. * calculation
  6276. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6277. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6278. * length
  6279. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6280. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6281. * length
  6282. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6283. * num jump
  6284. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6285. * num jump
  6286. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6287. * data type switch has happend for MPDU Sequence num jump
  6288. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6289. * for MPDU Sequence num jump
  6290. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6291. * for decrypt errors
  6292. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6293. * while aggregating a msdu
  6294. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6295. * The aggregation is done until (number of MSDUs aggregated
  6296. * < LIMIT + 1)
  6297. * b'31:18 - Reserved
  6298. *
  6299. * fisa_control_value - 32bit value FW can write to register
  6300. *
  6301. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6302. * Threshold value for FISA timeout (units are microseconds).
  6303. * When the global timestamp exceeds this threshold, FISA
  6304. * aggregation will be restarted.
  6305. * A value of 0 means timeout is disabled.
  6306. * Compare the threshold register with timestamp field in
  6307. * flow entry to generate timeout for the flow.
  6308. *
  6309. * |31 18 |17 16|15 8|7 0|
  6310. * |-------------------------------------------------------------|
  6311. * | reserved | pdev_mask | msg type |
  6312. * |-------------------------------------------------------------|
  6313. * | reserved | FISA_CTRL |
  6314. * |-------------------------------------------------------------|
  6315. * | FISA_TIMEOUT_THRESH |
  6316. * |-------------------------------------------------------------|
  6317. */
  6318. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6319. A_UINT32 msg_type:8,
  6320. pdev_id:8,
  6321. reserved0:16;
  6322. /**
  6323. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6324. * [17:0]
  6325. */
  6326. union {
  6327. /*
  6328. * fisa_control_bits structure is deprecated.
  6329. * Please use fisa_control_bits_v2 going forward.
  6330. */
  6331. struct {
  6332. A_UINT32 fisa_enable: 1,
  6333. ipsec_skip_search: 1,
  6334. nontcp_skip_search: 1,
  6335. add_ipv4_fixed_hdr_len: 1,
  6336. add_ipv6_fixed_hdr_len: 1,
  6337. add_tcp_fixed_hdr_len: 1,
  6338. add_udp_hdr_len: 1,
  6339. chksum_cum_ip_len_en: 1,
  6340. disable_tid_check: 1,
  6341. disable_ta_check: 1,
  6342. disable_qos_check: 1,
  6343. disable_raw_check: 1,
  6344. disable_decrypt_err_check: 1,
  6345. disable_msdu_drop_check: 1,
  6346. fisa_aggr_limit: 4,
  6347. reserved: 14;
  6348. } fisa_control_bits;
  6349. struct {
  6350. A_UINT32 fisa_enable: 1,
  6351. fisa_aggr_limit: 4,
  6352. reserved: 27;
  6353. } fisa_control_bits_v2;
  6354. A_UINT32 fisa_control_value;
  6355. } u_fisa_control;
  6356. /**
  6357. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6358. * timeout threshold for aggregation. Unit in usec.
  6359. * [31:0]
  6360. */
  6361. A_UINT32 fisa_timeout_threshold;
  6362. } POSTPACK;
  6363. /* DWord 0: pdev-ID */
  6364. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6365. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6366. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6367. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6368. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6369. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6370. do { \
  6371. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6372. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6373. } while (0)
  6374. /* Dword 1: fisa_control_value fisa config */
  6375. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6376. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6377. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6378. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6379. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6380. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6383. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6384. } while (0)
  6385. /* Dword 1: fisa_control_value ipsec_skip_search */
  6386. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6387. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6388. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6389. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6390. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6391. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6394. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6395. } while (0)
  6396. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6397. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6398. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6399. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6400. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6401. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6402. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6403. do { \
  6404. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6405. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6406. } while (0)
  6407. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6408. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6409. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6410. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6411. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6412. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6413. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6416. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6417. } while (0)
  6418. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6419. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6420. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6421. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6422. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6423. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6424. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6427. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6428. } while (0)
  6429. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6430. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6431. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6432. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6433. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6434. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6435. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6436. do { \
  6437. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6438. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6439. } while (0)
  6440. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6441. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6442. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6443. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6444. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6445. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6446. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6447. do { \
  6448. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6449. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6450. } while (0)
  6451. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6452. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6453. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6454. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6455. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6456. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6457. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6458. do { \
  6459. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6460. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6461. } while (0)
  6462. /* Dword 1: fisa_control_value disable_tid_check */
  6463. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6464. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6465. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6466. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6467. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6468. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6469. do { \
  6470. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6471. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6472. } while (0)
  6473. /* Dword 1: fisa_control_value disable_ta_check */
  6474. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6475. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6476. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6477. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6478. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6479. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6480. do { \
  6481. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6482. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6483. } while (0)
  6484. /* Dword 1: fisa_control_value disable_qos_check */
  6485. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6486. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6487. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6488. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6489. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6490. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6493. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6494. } while (0)
  6495. /* Dword 1: fisa_control_value disable_raw_check */
  6496. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6497. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6498. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6499. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6500. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6501. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6504. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6505. } while (0)
  6506. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6507. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6508. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6509. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6510. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6511. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6512. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6515. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6516. } while (0)
  6517. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6518. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6519. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6520. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6521. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6522. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6523. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6526. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6527. } while (0)
  6528. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6529. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6530. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6531. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6532. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6533. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6534. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6535. do { \
  6536. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6537. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6538. } while (0)
  6539. /* Dword 1: fisa_control_value fisa config */
  6540. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6541. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6542. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6543. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6544. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6545. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6546. do { \
  6547. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6548. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6549. } while (0)
  6550. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6551. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6552. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6553. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6554. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6555. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6556. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6557. do { \
  6558. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6559. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6560. } while (0)
  6561. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6562. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6563. pdev_id:8,
  6564. reserved0:16;
  6565. A_UINT32 num_records:20,
  6566. max_search:8,
  6567. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6568. reserved1:2;
  6569. A_UINT32 base_addr_lo;
  6570. A_UINT32 base_addr_hi;
  6571. A_UINT32 toeplitz31_0;
  6572. A_UINT32 toeplitz63_32;
  6573. A_UINT32 toeplitz95_64;
  6574. A_UINT32 toeplitz127_96;
  6575. A_UINT32 toeplitz159_128;
  6576. A_UINT32 toeplitz191_160;
  6577. A_UINT32 toeplitz223_192;
  6578. A_UINT32 toeplitz255_224;
  6579. A_UINT32 toeplitz287_256;
  6580. A_UINT32 toeplitz314_288:27,
  6581. reserved2:5;
  6582. } POSTPACK;
  6583. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6584. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6585. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6586. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6587. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6588. /* DWORD 0: Pdev ID */
  6589. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6590. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6591. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6592. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6593. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6594. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6595. do { \
  6596. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6597. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6598. } while (0)
  6599. /* DWORD 1:num of records */
  6600. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6601. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6602. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6603. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6604. HTT_RX_FSE_SETUP_NUM_REC_S)
  6605. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6606. do { \
  6607. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6608. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6609. } while (0)
  6610. /* DWORD 1:max_search */
  6611. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6612. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6613. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6614. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6615. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6616. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6617. do { \
  6618. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6619. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6620. } while (0)
  6621. /* DWORD 1:ip_da_sa prefix */
  6622. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6623. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6624. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6625. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6626. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6627. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6628. do { \
  6629. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6630. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6631. } while (0)
  6632. /* DWORD 2: Base Address LO */
  6633. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6634. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6635. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6636. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6637. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6638. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6639. do { \
  6640. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6641. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6642. } while (0)
  6643. /* DWORD 3: Base Address High */
  6644. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6645. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6646. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6647. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6648. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6649. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6650. do { \
  6651. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6652. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6653. } while (0)
  6654. /* DWORD 4-12: Hash Value */
  6655. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6656. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6657. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6658. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6659. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6660. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6663. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6664. } while (0)
  6665. /* DWORD 13: Hash Value 314:288 bits */
  6666. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6667. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6668. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6669. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6670. do { \
  6671. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6672. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6673. } while (0)
  6674. /**
  6675. * @brief Host-->target HTT RX FSE operation message
  6676. *
  6677. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6678. *
  6679. * @details
  6680. * The host will send this Flow Search Engine (FSE) operation message for
  6681. * every flow add/delete operation.
  6682. * The FSE operation includes FSE full cache invalidation or individual entry
  6683. * invalidation.
  6684. * This message can be sent per SOC or per PDEV which is differentiated
  6685. * by pdev id values.
  6686. *
  6687. * |31 16|15 8|7 1|0|
  6688. * |-------------------------------------------------------------|
  6689. * | reserved | pdev_id | MSG_TYPE |
  6690. * |-------------------------------------------------------------|
  6691. * | reserved | operation |I|
  6692. * |-------------------------------------------------------------|
  6693. * | ip_src_addr_31_0 |
  6694. * |-------------------------------------------------------------|
  6695. * | ip_src_addr_63_32 |
  6696. * |-------------------------------------------------------------|
  6697. * | ip_src_addr_95_64 |
  6698. * |-------------------------------------------------------------|
  6699. * | ip_src_addr_127_96 |
  6700. * |-------------------------------------------------------------|
  6701. * | ip_dst_addr_31_0 |
  6702. * |-------------------------------------------------------------|
  6703. * | ip_dst_addr_63_32 |
  6704. * |-------------------------------------------------------------|
  6705. * | ip_dst_addr_95_64 |
  6706. * |-------------------------------------------------------------|
  6707. * | ip_dst_addr_127_96 |
  6708. * |-------------------------------------------------------------|
  6709. * | l4_dst_port | l4_src_port |
  6710. * | (32-bit SPI incase of IPsec) |
  6711. * |-------------------------------------------------------------|
  6712. * | reserved | l4_proto |
  6713. * |-------------------------------------------------------------|
  6714. *
  6715. * where I is 1-bit ipsec_valid.
  6716. *
  6717. * The following field definitions describe the format of the RX FSE operation
  6718. * message sent from the host to target for every add/delete flow entry to flow
  6719. * table.
  6720. *
  6721. * Header fields:
  6722. * dword0 - b'7:0 - msg_type: This will be set to
  6723. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6724. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6725. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6726. * specified pdev's LMAC ring.
  6727. * b'31:16 - reserved : Reserved for future use
  6728. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6729. * (Internet Protocol Security).
  6730. * IPsec describes the framework for providing security at
  6731. * IP layer. IPsec is defined for both versions of IP:
  6732. * IPV4 and IPV6.
  6733. * Please refer to htt_rx_flow_proto enumeration below for
  6734. * more info.
  6735. * ipsec_valid = 1 for IPSEC packets
  6736. * ipsec_valid = 0 for IP Packets
  6737. * b'7:1 - operation: This indicates types of FSE operation.
  6738. * Refer to htt_rx_fse_operation enumeration:
  6739. * 0 - No Cache Invalidation required
  6740. * 1 - Cache invalidate only one entry given by IP
  6741. * src/dest address at DWORD[2:9]
  6742. * 2 - Complete FSE Cache Invalidation
  6743. * 3 - FSE Disable
  6744. * 4 - FSE Enable
  6745. * b'31:8 - reserved: Reserved for future use
  6746. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6747. * for per flow addition/deletion
  6748. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6749. * and the subsequent 3 A_UINT32 will be padding bytes.
  6750. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6751. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6752. * from 0 to 65535 but only 0 to 1023 are designated as
  6753. * well-known ports. Refer to [RFC1700] for more details.
  6754. * This field is valid only if
  6755. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6756. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6757. * range from 0 to 65535 but only 0 to 1023 are designated
  6758. * as well-known ports. Refer to [RFC1700] for more details.
  6759. * This field is valid only if
  6760. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6761. * - SPI (31:0): Security Parameters Index is an
  6762. * identification tag added to the header while using IPsec
  6763. * for tunneling the IP traffici.
  6764. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6765. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6766. * Assigned Internet Protocol Numbers.
  6767. * l4_proto numbers for standard protocol like UDP/TCP
  6768. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6769. * l4_proto = 17 for UDP etc.
  6770. * b'31:8 - reserved: Reserved for future use.
  6771. *
  6772. */
  6773. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6774. A_UINT32 msg_type:8,
  6775. pdev_id:8,
  6776. reserved0:16;
  6777. A_UINT32 ipsec_valid:1,
  6778. operation:7,
  6779. reserved1:24;
  6780. A_UINT32 ip_src_addr_31_0;
  6781. A_UINT32 ip_src_addr_63_32;
  6782. A_UINT32 ip_src_addr_95_64;
  6783. A_UINT32 ip_src_addr_127_96;
  6784. A_UINT32 ip_dest_addr_31_0;
  6785. A_UINT32 ip_dest_addr_63_32;
  6786. A_UINT32 ip_dest_addr_95_64;
  6787. A_UINT32 ip_dest_addr_127_96;
  6788. union {
  6789. A_UINT32 spi;
  6790. struct {
  6791. A_UINT32 l4_src_port:16,
  6792. l4_dest_port:16;
  6793. } ip;
  6794. } u;
  6795. A_UINT32 l4_proto:8,
  6796. reserved:24;
  6797. } POSTPACK;
  6798. /**
  6799. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6800. *
  6801. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6802. *
  6803. * @details
  6804. * The host will send this Full monitor mode register configuration message.
  6805. * This message can be sent per SOC or per PDEV which is differentiated
  6806. * by pdev id values.
  6807. *
  6808. * |31 16|15 11|10 8|7 3|2|1|0|
  6809. * |-------------------------------------------------------------|
  6810. * | reserved | pdev_id | MSG_TYPE |
  6811. * |-------------------------------------------------------------|
  6812. * | reserved |Release Ring |N|Z|E|
  6813. * |-------------------------------------------------------------|
  6814. *
  6815. * where E is 1-bit full monitor mode enable/disable.
  6816. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6817. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6818. *
  6819. * The following field definitions describe the format of the full monitor
  6820. * mode configuration message sent from the host to target for each pdev.
  6821. *
  6822. * Header fields:
  6823. * dword0 - b'7:0 - msg_type: This will be set to
  6824. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6825. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6826. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6827. * specified pdev's LMAC ring.
  6828. * b'31:16 - reserved : Reserved for future use.
  6829. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6830. * monitor mode rxdma register is to be enabled or disabled.
  6831. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6832. * additional descriptors at ppdu end for zero mpdus
  6833. * enabled or disabled.
  6834. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6835. * additional descriptors at ppdu end for non zero mpdus
  6836. * enabled or disabled.
  6837. * b'10:3 - release_ring: This indicates the destination ring
  6838. * selection for the descriptor at the end of PPDU
  6839. * 0 - REO ring select
  6840. * 1 - FW ring select
  6841. * 2 - SW ring select
  6842. * 3 - Release ring select
  6843. * Refer to htt_rx_full_mon_release_ring.
  6844. * b'31:11 - reserved for future use
  6845. */
  6846. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6847. A_UINT32 msg_type:8,
  6848. pdev_id:8,
  6849. reserved0:16;
  6850. A_UINT32 full_monitor_mode_enable:1,
  6851. addnl_descs_zero_mpdus_end:1,
  6852. addnl_descs_non_zero_mpdus_end:1,
  6853. release_ring:8,
  6854. reserved1:21;
  6855. } POSTPACK;
  6856. /**
  6857. * Enumeration for full monitor mode destination ring select
  6858. * 0 - REO destination ring select
  6859. * 1 - FW destination ring select
  6860. * 2 - SW destination ring select
  6861. * 3 - Release destination ring select
  6862. */
  6863. enum htt_rx_full_mon_release_ring {
  6864. HTT_RX_MON_RING_REO,
  6865. HTT_RX_MON_RING_FW,
  6866. HTT_RX_MON_RING_SW,
  6867. HTT_RX_MON_RING_RELEASE,
  6868. };
  6869. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6870. /* DWORD 0: Pdev ID */
  6871. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6872. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6873. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6874. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6875. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6876. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6877. do { \
  6878. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6879. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6880. } while (0)
  6881. /* DWORD 1:ENABLE */
  6882. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6883. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6884. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6885. do { \
  6886. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6887. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6888. } while (0)
  6889. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6890. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6891. /* DWORD 1:ZERO_MPDU */
  6892. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6893. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6894. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6895. do { \
  6896. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6897. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6898. } while (0)
  6899. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6900. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6901. /* DWORD 1:NON_ZERO_MPDU */
  6902. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6903. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6904. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6905. do { \
  6906. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6907. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6908. } while (0)
  6909. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6910. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6911. /* DWORD 1:RELEASE_RINGS */
  6912. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6913. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6914. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6915. do { \
  6916. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6917. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6918. } while (0)
  6919. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6920. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6921. /**
  6922. * Enumeration for IP Protocol or IPSEC Protocol
  6923. * IPsec describes the framework for providing security at IP layer.
  6924. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6925. */
  6926. enum htt_rx_flow_proto {
  6927. HTT_RX_FLOW_IP_PROTO,
  6928. HTT_RX_FLOW_IPSEC_PROTO,
  6929. };
  6930. /**
  6931. * Enumeration for FSE Cache Invalidation
  6932. * 0 - No Cache Invalidation required
  6933. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6934. * 2 - Complete FSE Cache Invalidation
  6935. * 3 - FSE Disable
  6936. * 4 - FSE Enable
  6937. */
  6938. enum htt_rx_fse_operation {
  6939. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6940. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6941. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6942. HTT_RX_FSE_DISABLE,
  6943. HTT_RX_FSE_ENABLE,
  6944. };
  6945. /* DWORD 0: Pdev ID */
  6946. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6947. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6948. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6949. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6950. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6951. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6952. do { \
  6953. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6954. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6955. } while (0)
  6956. /* DWORD 1:IP PROTO or IPSEC */
  6957. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6958. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6959. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6960. do { \
  6961. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6962. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6963. } while (0)
  6964. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6965. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6966. /* DWORD 1:FSE Operation */
  6967. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6968. #define HTT_RX_FSE_OPERATION_S 1
  6969. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6970. do { \
  6971. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6972. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6973. } while (0)
  6974. #define HTT_RX_FSE_OPERATION_GET(word) \
  6975. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6976. /* DWORD 2-9:IP Address */
  6977. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6978. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6979. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6980. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6981. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6982. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6983. do { \
  6984. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6985. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6986. } while (0)
  6987. /* DWORD 10:Source Port Number */
  6988. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6989. #define HTT_RX_FSE_SOURCEPORT_S 0
  6990. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6993. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6994. } while (0)
  6995. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6996. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6997. /* DWORD 11:Destination Port Number */
  6998. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6999. #define HTT_RX_FSE_DESTPORT_S 16
  7000. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7003. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7004. } while (0)
  7005. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7006. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7007. /* DWORD 10-11:SPI (In case of IPSEC) */
  7008. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7009. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7010. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7011. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7012. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7013. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7014. do { \
  7015. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7016. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7017. } while (0)
  7018. /* DWORD 12:L4 PROTO */
  7019. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7020. #define HTT_RX_FSE_L4_PROTO_S 0
  7021. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7022. do { \
  7023. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7024. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7025. } while (0)
  7026. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7027. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7028. /**
  7029. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7030. *
  7031. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7032. *
  7033. * |31 24|23 |15 8|7 2|1|0|
  7034. * |----------------+----------------+----------------+----------------|
  7035. * | reserved | pdev_id | msg_type |
  7036. * |---------------------------------+----------------+----------------|
  7037. * | reserved |E|F|
  7038. * |---------------------------------+----------------+----------------|
  7039. * Where E = Configure the target to provide the 3-tuple hash value in
  7040. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7041. * F = Configure the target to provide the 3-tuple hash value in
  7042. * flow_id_toeplitz field of rx_msdu_start tlv
  7043. *
  7044. * The following field definitions describe the format of the 3 tuple hash value
  7045. * message sent from the host to target as part of initialization sequence.
  7046. *
  7047. * Header fields:
  7048. * dword0 - b'7:0 - msg_type: This will be set to
  7049. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7050. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7051. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7052. * specified pdev's LMAC ring.
  7053. * b'31:16 - reserved : Reserved for future use
  7054. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7055. * b'1 - toeplitz_hash_2_or_4_field_enable
  7056. * b'31:2 - reserved : Reserved for future use
  7057. * ---------+------+----------------------------------------------------------
  7058. * bit1 | bit0 | Functionality
  7059. * ---------+------+----------------------------------------------------------
  7060. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7061. * | | in flow_id_toeplitz field
  7062. * ---------+------+----------------------------------------------------------
  7063. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7064. * | | in toeplitz_hash_2_or_4 field
  7065. * ---------+------+----------------------------------------------------------
  7066. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7067. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7068. * ---------+------+----------------------------------------------------------
  7069. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7070. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7071. * | | toeplitz_hash_2_or_4 field
  7072. *----------------------------------------------------------------------------
  7073. */
  7074. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7075. A_UINT32 msg_type :8,
  7076. pdev_id :8,
  7077. reserved0 :16;
  7078. A_UINT32 flow_id_toeplitz_field_enable :1,
  7079. toeplitz_hash_2_or_4_field_enable :1,
  7080. reserved1 :30;
  7081. } POSTPACK;
  7082. /* DWORD0 : pdev_id configuration Macros */
  7083. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7084. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7085. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7086. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7087. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7088. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7091. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7092. } while (0)
  7093. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7094. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7095. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7096. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7097. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7098. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7099. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7100. do { \
  7101. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7102. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7103. } while (0)
  7104. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7105. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7106. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7107. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7108. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7109. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7110. do { \
  7111. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7112. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7113. } while (0)
  7114. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7115. /**
  7116. * @brief host --> target Host PA Address Size
  7117. *
  7118. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7119. *
  7120. * @details
  7121. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7122. * provide the physical start address and size of each of the memory
  7123. * areas within host DDR that the target FW may need to access.
  7124. *
  7125. * For example, the host can use this message to allow the target FW
  7126. * to set up access to the host's pools of TQM link descriptors.
  7127. * The message would appear as follows:
  7128. *
  7129. * |31 24|23 16|15 8|7 0|
  7130. * |----------------+----------------+----------------+----------------|
  7131. * | reserved | num_entries | msg_type |
  7132. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7133. * | mem area 0 size |
  7134. * |----------------+----------------+----------------+----------------|
  7135. * | mem area 0 physical_address_lo |
  7136. * |----------------+----------------+----------------+----------------|
  7137. * | mem area 0 physical_address_hi |
  7138. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7139. * | mem area 1 size |
  7140. * |----------------+----------------+----------------+----------------|
  7141. * | mem area 1 physical_address_lo |
  7142. * |----------------+----------------+----------------+----------------|
  7143. * | mem area 1 physical_address_hi |
  7144. * |----------------+----------------+----------------+----------------|
  7145. * ...
  7146. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7147. * | mem area N size |
  7148. * |----------------+----------------+----------------+----------------|
  7149. * | mem area N physical_address_lo |
  7150. * |----------------+----------------+----------------+----------------|
  7151. * | mem area N physical_address_hi |
  7152. * |----------------+----------------+----------------+----------------|
  7153. *
  7154. * The message is interpreted as follows:
  7155. * dword0 - b'0:7 - msg_type: This will be set to
  7156. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7157. * b'8:15 - number_entries: Indicated the number of host memory
  7158. * areas specified within the remainder of the message
  7159. * b'16:31 - reserved.
  7160. * dword1 - b'0:31 - memory area 0 size in bytes
  7161. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7162. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7163. * and similar for memory area 1 through memory area N.
  7164. */
  7165. PREPACK struct htt_h2t_host_paddr_size {
  7166. A_UINT32 msg_type: 8,
  7167. num_entries: 8,
  7168. reserved: 16;
  7169. } POSTPACK;
  7170. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7171. A_UINT32 size;
  7172. A_UINT32 physical_address_lo;
  7173. A_UINT32 physical_address_hi;
  7174. } POSTPACK;
  7175. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7176. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7177. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7178. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7179. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7180. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7181. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7182. do { \
  7183. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7184. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7185. } while (0)
  7186. /**
  7187. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7188. *
  7189. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7190. *
  7191. * @details
  7192. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7193. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7194. *
  7195. * The message would appear as follows:
  7196. *
  7197. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7198. * |---------------------------------+---+---+----------+-+-----------|
  7199. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7200. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7201. *
  7202. *
  7203. * The message is interpreted as follows:
  7204. * dword0 - b'0:7 - msg_type: This will be set to
  7205. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7206. * b'8 - override bit to drive MSDUs to PPE ring
  7207. * b'9:13 - REO destination ring indication
  7208. * b'14 - Multi buffer msdu override enable bit
  7209. * b'15 - Intra BSS override
  7210. * b'16 - Decap raw override
  7211. * b'17 - Decap Native wifi override
  7212. * b'18 - IP frag override
  7213. * b'19:31 - reserved
  7214. */
  7215. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7216. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7217. override: 1,
  7218. reo_destination_indication: 5,
  7219. multi_buffer_msdu_override_en: 1,
  7220. intra_bss_override: 1,
  7221. decap_raw_override: 1,
  7222. decap_nwifi_override: 1,
  7223. ip_frag_override: 1,
  7224. reserved: 13;
  7225. } POSTPACK;
  7226. /* DWORD 0: Override */
  7227. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7228. #define HTT_PPE_CFG_OVERRIDE_S 8
  7229. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7230. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7231. HTT_PPE_CFG_OVERRIDE_S)
  7232. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7235. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7236. } while (0)
  7237. /* DWORD 0: REO Destination Indication*/
  7238. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7239. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7240. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7241. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7242. HTT_PPE_CFG_REO_DEST_IND_S)
  7243. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7246. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7247. } while (0)
  7248. /* DWORD 0: Multi buffer MSDU override */
  7249. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7250. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7251. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7252. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7253. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7254. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7255. do { \
  7256. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7257. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7258. } while (0)
  7259. /* DWORD 0: Intra BSS override */
  7260. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7261. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7262. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7263. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7264. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7265. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7266. do { \
  7267. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7268. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7269. } while (0)
  7270. /* DWORD 0: Decap RAW override */
  7271. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7272. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7273. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7274. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7275. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7276. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7277. do { \
  7278. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7279. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7280. } while (0)
  7281. /* DWORD 0: Decap NWIFI override */
  7282. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7283. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7284. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7285. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7286. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7287. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7290. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7291. } while (0)
  7292. /* DWORD 0: IP frag override */
  7293. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7294. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7295. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7296. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7297. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7298. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7299. do { \
  7300. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7301. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7302. } while (0)
  7303. /*
  7304. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7305. *
  7306. * @details
  7307. * The following field definitions describe the format of the HTT host
  7308. * to target FW VDEV TX RX stats retrieve message.
  7309. * The message specifies the type of stats the host wants to retrieve.
  7310. *
  7311. * |31 27|26 25|24 17|16|15 8|7 0|
  7312. * |-----------------------------------------------------------|
  7313. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7314. * |-----------------------------------------------------------|
  7315. * | vdev_id lower bitmask |
  7316. * |-----------------------------------------------------------|
  7317. * | vdev_id upper bitmask |
  7318. * |-----------------------------------------------------------|
  7319. * Header fields:
  7320. * Where:
  7321. * dword0 - b'7:0 - msg_type: This will be set to
  7322. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7323. * b'15:8 - pdev id
  7324. * b'16(E) - Enable/Disable the vdev HW stats
  7325. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7326. * b'25:26(R) - Reset stats bits
  7327. * 0: don't reset stats
  7328. * 1: reset stats once
  7329. * 2: reset stats at the start of each periodic interval
  7330. * b'27:31 - reserved for future use
  7331. * dword1 - b'0:31 - vdev_id lower bitmask
  7332. * dword2 - b'0:31 - vdev_id upper bitmask
  7333. */
  7334. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7335. A_UINT32 msg_type :8,
  7336. pdev_id :8,
  7337. enable :1,
  7338. periodic_interval :8,
  7339. reset_stats_bits :2,
  7340. reserved0 :5;
  7341. A_UINT32 vdev_id_lower_bitmask;
  7342. A_UINT32 vdev_id_upper_bitmask;
  7343. } POSTPACK;
  7344. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7345. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7346. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7347. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7348. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7349. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7352. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7353. } while (0)
  7354. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7355. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7356. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7357. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7358. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7359. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7362. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7363. } while (0)
  7364. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7365. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7366. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7367. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7368. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7369. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7370. do { \
  7371. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7372. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7373. } while (0)
  7374. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7375. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7376. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7377. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7378. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7379. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7380. do { \
  7381. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7382. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7383. } while (0)
  7384. /*=== target -> host messages ===============================================*/
  7385. enum htt_t2h_msg_type {
  7386. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7387. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7388. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7389. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7390. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7391. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7392. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7393. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7394. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7395. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7396. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7397. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7398. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7399. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7400. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7401. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7402. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7403. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7404. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7405. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7406. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7407. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7408. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7409. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7410. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7411. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7412. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7413. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7414. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7415. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7416. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7417. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7418. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7419. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7420. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7421. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7422. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7423. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7424. /* TX_OFFLOAD_DELIVER_IND:
  7425. * Forward the target's locally-generated packets to the host,
  7426. * to provide to the monitor mode interface.
  7427. */
  7428. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7429. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7430. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7431. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7432. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7433. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7434. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7435. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7436. HTT_T2H_MSG_TYPE_TEST,
  7437. /* keep this last */
  7438. HTT_T2H_NUM_MSGS
  7439. };
  7440. /*
  7441. * HTT target to host message type -
  7442. * stored in bits 7:0 of the first word of the message
  7443. */
  7444. #define HTT_T2H_MSG_TYPE_M 0xff
  7445. #define HTT_T2H_MSG_TYPE_S 0
  7446. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7449. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7450. } while (0)
  7451. #define HTT_T2H_MSG_TYPE_GET(word) \
  7452. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7453. /**
  7454. * @brief target -> host version number confirmation message definition
  7455. *
  7456. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7457. *
  7458. * |31 24|23 16|15 8|7 0|
  7459. * |----------------+----------------+----------------+----------------|
  7460. * | reserved | major number | minor number | msg type |
  7461. * |-------------------------------------------------------------------|
  7462. * : option request TLV (optional) |
  7463. * :...................................................................:
  7464. *
  7465. * The VER_CONF message may consist of a single 4-byte word, or may be
  7466. * extended with TLVs that specify HTT options selected by the target.
  7467. * The following option TLVs may be appended to the VER_CONF message:
  7468. * - LL_BUS_ADDR_SIZE
  7469. * - HL_SUPPRESS_TX_COMPL_IND
  7470. * - MAX_TX_QUEUE_GROUPS
  7471. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7472. * may be appended to the VER_CONF message (but only one TLV of each type).
  7473. *
  7474. * Header fields:
  7475. * - MSG_TYPE
  7476. * Bits 7:0
  7477. * Purpose: identifies this as a version number confirmation message
  7478. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7479. * - VER_MINOR
  7480. * Bits 15:8
  7481. * Purpose: Specify the minor number of the HTT message library version
  7482. * in use by the target firmware.
  7483. * The minor number specifies the specific revision within a range
  7484. * of fundamentally compatible HTT message definition revisions.
  7485. * Compatible revisions involve adding new messages or perhaps
  7486. * adding new fields to existing messages, in a backwards-compatible
  7487. * manner.
  7488. * Incompatible revisions involve changing the message type values,
  7489. * or redefining existing messages.
  7490. * Value: minor number
  7491. * - VER_MAJOR
  7492. * Bits 15:8
  7493. * Purpose: Specify the major number of the HTT message library version
  7494. * in use by the target firmware.
  7495. * The major number specifies the family of minor revisions that are
  7496. * fundamentally compatible with each other, but not with prior or
  7497. * later families.
  7498. * Value: major number
  7499. */
  7500. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7501. #define HTT_VER_CONF_MINOR_S 8
  7502. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7503. #define HTT_VER_CONF_MAJOR_S 16
  7504. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7505. do { \
  7506. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7507. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7508. } while (0)
  7509. #define HTT_VER_CONF_MINOR_GET(word) \
  7510. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7511. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7512. do { \
  7513. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7514. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7515. } while (0)
  7516. #define HTT_VER_CONF_MAJOR_GET(word) \
  7517. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7518. #define HTT_VER_CONF_BYTES 4
  7519. /**
  7520. * @brief - target -> host HTT Rx In order indication message
  7521. *
  7522. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7523. *
  7524. * @details
  7525. *
  7526. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7527. * |----------------+-------------------+---------------------+---------------|
  7528. * | peer ID | P| F| O| ext TID | msg type |
  7529. * |--------------------------------------------------------------------------|
  7530. * | MSDU count | Reserved | vdev id |
  7531. * |--------------------------------------------------------------------------|
  7532. * | MSDU 0 bus address (bits 31:0) |
  7533. #if HTT_PADDR64
  7534. * | MSDU 0 bus address (bits 63:32) |
  7535. #endif
  7536. * |--------------------------------------------------------------------------|
  7537. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7538. * |--------------------------------------------------------------------------|
  7539. * | MSDU 1 bus address (bits 31:0) |
  7540. #if HTT_PADDR64
  7541. * | MSDU 1 bus address (bits 63:32) |
  7542. #endif
  7543. * |--------------------------------------------------------------------------|
  7544. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7545. * |--------------------------------------------------------------------------|
  7546. */
  7547. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7548. *
  7549. * @details
  7550. * bits
  7551. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7552. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7553. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7554. * | | frag | | | | fail |chksum fail|
  7555. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7556. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7557. */
  7558. struct htt_rx_in_ord_paddr_ind_hdr_t
  7559. {
  7560. A_UINT32 /* word 0 */
  7561. msg_type: 8,
  7562. ext_tid: 5,
  7563. offload: 1,
  7564. frag: 1,
  7565. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7566. peer_id: 16;
  7567. A_UINT32 /* word 1 */
  7568. vap_id: 8,
  7569. /* NOTE:
  7570. * This reserved_1 field is not truly reserved - certain targets use
  7571. * this field internally to store debug information, and do not zero
  7572. * out the contents of the field before uploading the message to the
  7573. * host. Thus, any host-target communication supported by this field
  7574. * is limited to using values that are never used by the debug
  7575. * information stored by certain targets in the reserved_1 field.
  7576. * In particular, the targets in question don't use the value 0x3
  7577. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7578. * so this previously-unused value within these bits is available to
  7579. * use as the host / target PKT_CAPTURE_MODE flag.
  7580. */
  7581. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7582. /* if pkt_capture_mode == 0x3, host should
  7583. * send rx frames to monitor mode interface
  7584. */
  7585. msdu_cnt: 16;
  7586. };
  7587. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7588. {
  7589. A_UINT32 dma_addr;
  7590. A_UINT32
  7591. length: 16,
  7592. fw_desc: 8,
  7593. msdu_info:8;
  7594. };
  7595. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7596. {
  7597. A_UINT32 dma_addr_lo;
  7598. A_UINT32 dma_addr_hi;
  7599. A_UINT32
  7600. length: 16,
  7601. fw_desc: 8,
  7602. msdu_info:8;
  7603. };
  7604. #if HTT_PADDR64
  7605. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7606. #else
  7607. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7608. #endif
  7609. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7610. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7611. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7612. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7613. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7614. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7615. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7616. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7617. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7618. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7619. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7620. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7621. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7622. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7623. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7624. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7625. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7626. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7628. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7629. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7630. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7631. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7632. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7633. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7634. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7635. /* for systems using 64-bit format for bus addresses */
  7636. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7637. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7638. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7639. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7640. /* for systems using 32-bit format for bus addresses */
  7641. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7642. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7643. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7644. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7645. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7646. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7647. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7648. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7649. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7650. do { \
  7651. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7652. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7653. } while (0)
  7654. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7655. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7656. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7657. do { \
  7658. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7659. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7660. } while (0)
  7661. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7662. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7663. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7664. do { \
  7665. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7666. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7667. } while (0)
  7668. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7669. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7670. /*
  7671. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7672. * deliver the rx frames to the monitor mode interface.
  7673. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7674. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7675. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7676. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7677. */
  7678. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7679. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7682. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7683. } while (0)
  7684. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7685. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7686. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7687. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7690. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7691. } while (0)
  7692. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7693. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7694. /* for systems using 64-bit format for bus addresses */
  7695. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7696. do { \
  7697. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7698. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7699. } while (0)
  7700. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7701. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7702. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7705. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7706. } while (0)
  7707. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7708. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7709. /* for systems using 32-bit format for bus addresses */
  7710. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7713. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7714. } while (0)
  7715. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7716. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7717. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7720. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7721. } while (0)
  7722. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7723. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7724. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7725. do { \
  7726. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7727. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7728. } while (0)
  7729. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7730. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7731. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7734. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7735. } while (0)
  7736. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7737. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7738. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7739. do { \
  7740. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7741. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7742. } while (0)
  7743. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7744. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7745. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7748. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7749. } while (0)
  7750. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7751. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7752. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7753. do { \
  7754. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7755. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7756. } while (0)
  7757. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7758. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7759. /* definitions used within target -> host rx indication message */
  7760. PREPACK struct htt_rx_ind_hdr_prefix_t
  7761. {
  7762. A_UINT32 /* word 0 */
  7763. msg_type: 8,
  7764. ext_tid: 5,
  7765. release_valid: 1,
  7766. flush_valid: 1,
  7767. reserved0: 1,
  7768. peer_id: 16;
  7769. A_UINT32 /* word 1 */
  7770. flush_start_seq_num: 6,
  7771. flush_end_seq_num: 6,
  7772. release_start_seq_num: 6,
  7773. release_end_seq_num: 6,
  7774. num_mpdu_ranges: 8;
  7775. } POSTPACK;
  7776. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7777. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7778. #define HTT_TGT_RSSI_INVALID 0x80
  7779. PREPACK struct htt_rx_ppdu_desc_t
  7780. {
  7781. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7782. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7783. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7784. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7785. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7786. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7787. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7788. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7789. A_UINT32 /* word 0 */
  7790. rssi_cmb: 8,
  7791. timestamp_submicrosec: 8,
  7792. phy_err_code: 8,
  7793. phy_err: 1,
  7794. legacy_rate: 4,
  7795. legacy_rate_sel: 1,
  7796. end_valid: 1,
  7797. start_valid: 1;
  7798. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7799. union {
  7800. A_UINT32 /* word 1 */
  7801. rssi0_pri20: 8,
  7802. rssi0_ext20: 8,
  7803. rssi0_ext40: 8,
  7804. rssi0_ext80: 8;
  7805. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7806. } u0;
  7807. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7808. union {
  7809. A_UINT32 /* word 2 */
  7810. rssi1_pri20: 8,
  7811. rssi1_ext20: 8,
  7812. rssi1_ext40: 8,
  7813. rssi1_ext80: 8;
  7814. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7815. } u1;
  7816. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7817. union {
  7818. A_UINT32 /* word 3 */
  7819. rssi2_pri20: 8,
  7820. rssi2_ext20: 8,
  7821. rssi2_ext40: 8,
  7822. rssi2_ext80: 8;
  7823. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7824. } u2;
  7825. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7826. union {
  7827. A_UINT32 /* word 4 */
  7828. rssi3_pri20: 8,
  7829. rssi3_ext20: 8,
  7830. rssi3_ext40: 8,
  7831. rssi3_ext80: 8;
  7832. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7833. } u3;
  7834. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7835. A_UINT32 tsf32; /* word 5 */
  7836. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7837. A_UINT32 timestamp_microsec; /* word 6 */
  7838. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7839. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7840. A_UINT32 /* word 7 */
  7841. vht_sig_a1: 24,
  7842. preamble_type: 8;
  7843. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7844. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7845. A_UINT32 /* word 8 */
  7846. vht_sig_a2: 24,
  7847. /* sa_ant_matrix
  7848. * For cases where a single rx chain has options to be connected to
  7849. * different rx antennas, show which rx antennas were in use during
  7850. * receipt of a given PPDU.
  7851. * This sa_ant_matrix provides a bitmask of the antennas used while
  7852. * receiving this frame.
  7853. */
  7854. sa_ant_matrix: 8;
  7855. } POSTPACK;
  7856. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7857. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7858. PREPACK struct htt_rx_ind_hdr_suffix_t
  7859. {
  7860. A_UINT32 /* word 0 */
  7861. fw_rx_desc_bytes: 16,
  7862. reserved0: 16;
  7863. } POSTPACK;
  7864. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7865. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7866. PREPACK struct htt_rx_ind_hdr_t
  7867. {
  7868. struct htt_rx_ind_hdr_prefix_t prefix;
  7869. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7870. struct htt_rx_ind_hdr_suffix_t suffix;
  7871. } POSTPACK;
  7872. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7873. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7874. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7875. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7876. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7877. /*
  7878. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7879. * the offset into the HTT rx indication message at which the
  7880. * FW rx PPDU descriptor resides
  7881. */
  7882. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7883. /*
  7884. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7885. * the offset into the HTT rx indication message at which the
  7886. * header suffix (FW rx MSDU byte count) resides
  7887. */
  7888. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7889. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7890. /*
  7891. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7892. * the offset into the HTT rx indication message at which the per-MSDU
  7893. * information starts
  7894. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7895. * per-MSDU information portion of the message. The per-MSDU info itself
  7896. * starts at byte 12.
  7897. */
  7898. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7899. /**
  7900. * @brief target -> host rx indication message definition
  7901. *
  7902. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7903. *
  7904. * @details
  7905. * The following field definitions describe the format of the rx indication
  7906. * message sent from the target to the host.
  7907. * The message consists of three major sections:
  7908. * 1. a fixed-length header
  7909. * 2. a variable-length list of firmware rx MSDU descriptors
  7910. * 3. one or more 4-octet MPDU range information elements
  7911. * The fixed length header itself has two sub-sections
  7912. * 1. the message meta-information, including identification of the
  7913. * sender and type of the received data, and a 4-octet flush/release IE
  7914. * 2. the firmware rx PPDU descriptor
  7915. *
  7916. * The format of the message is depicted below.
  7917. * in this depiction, the following abbreviations are used for information
  7918. * elements within the message:
  7919. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7920. * elements associated with the PPDU start are valid.
  7921. * Specifically, the following fields are valid only if SV is set:
  7922. * RSSI (all variants), L, legacy rate, preamble type, service,
  7923. * VHT-SIG-A
  7924. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7925. * elements associated with the PPDU end are valid.
  7926. * Specifically, the following fields are valid only if EV is set:
  7927. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7928. * - L - Legacy rate selector - if legacy rates are used, this flag
  7929. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7930. * (L == 0) PHY.
  7931. * - P - PHY error flag - boolean indication of whether the rx frame had
  7932. * a PHY error
  7933. *
  7934. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7935. * |----------------+-------------------+---------------------+---------------|
  7936. * | peer ID | |RV|FV| ext TID | msg type |
  7937. * |--------------------------------------------------------------------------|
  7938. * | num | release | release | flush | flush |
  7939. * | MPDU | end | start | end | start |
  7940. * | ranges | seq num | seq num | seq num | seq num |
  7941. * |==========================================================================|
  7942. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7943. * |V|V| | rate | | | timestamp | RSSI |
  7944. * |--------------------------------------------------------------------------|
  7945. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7946. * |--------------------------------------------------------------------------|
  7947. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7948. * |--------------------------------------------------------------------------|
  7949. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7950. * |--------------------------------------------------------------------------|
  7951. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7952. * |--------------------------------------------------------------------------|
  7953. * | TSF LSBs |
  7954. * |--------------------------------------------------------------------------|
  7955. * | microsec timestamp |
  7956. * |--------------------------------------------------------------------------|
  7957. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7958. * |--------------------------------------------------------------------------|
  7959. * | service | HT-SIG / VHT-SIG-A2 |
  7960. * |==========================================================================|
  7961. * | reserved | FW rx desc bytes |
  7962. * |--------------------------------------------------------------------------|
  7963. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7964. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7965. * |--------------------------------------------------------------------------|
  7966. * : : :
  7967. * |--------------------------------------------------------------------------|
  7968. * | alignment | MSDU Rx |
  7969. * | padding | desc Bn |
  7970. * |--------------------------------------------------------------------------|
  7971. * | reserved | MPDU range status | MPDU count |
  7972. * |--------------------------------------------------------------------------|
  7973. * : reserved : MPDU range status : MPDU count :
  7974. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7975. *
  7976. * Header fields:
  7977. * - MSG_TYPE
  7978. * Bits 7:0
  7979. * Purpose: identifies this as an rx indication message
  7980. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7981. * - EXT_TID
  7982. * Bits 12:8
  7983. * Purpose: identify the traffic ID of the rx data, including
  7984. * special "extended" TID values for multicast, broadcast, and
  7985. * non-QoS data frames
  7986. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7987. * - FLUSH_VALID (FV)
  7988. * Bit 13
  7989. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7990. * is valid
  7991. * Value:
  7992. * 1 -> flush IE is valid and needs to be processed
  7993. * 0 -> flush IE is not valid and should be ignored
  7994. * - REL_VALID (RV)
  7995. * Bit 13
  7996. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7997. * is valid
  7998. * Value:
  7999. * 1 -> release IE is valid and needs to be processed
  8000. * 0 -> release IE is not valid and should be ignored
  8001. * - PEER_ID
  8002. * Bits 31:16
  8003. * Purpose: Identify, by ID, which peer sent the rx data
  8004. * Value: ID of the peer who sent the rx data
  8005. * - FLUSH_SEQ_NUM_START
  8006. * Bits 5:0
  8007. * Purpose: Indicate the start of a series of MPDUs to flush
  8008. * Not all MPDUs within this series are necessarily valid - the host
  8009. * must check each sequence number within this range to see if the
  8010. * corresponding MPDU is actually present.
  8011. * This field is only valid if the FV bit is set.
  8012. * Value:
  8013. * The sequence number for the first MPDUs to check to flush.
  8014. * The sequence number is masked by 0x3f.
  8015. * - FLUSH_SEQ_NUM_END
  8016. * Bits 11:6
  8017. * Purpose: Indicate the end of a series of MPDUs to flush
  8018. * Value:
  8019. * The sequence number one larger than the sequence number of the
  8020. * last MPDU to check to flush.
  8021. * The sequence number is masked by 0x3f.
  8022. * Not all MPDUs within this series are necessarily valid - the host
  8023. * must check each sequence number within this range to see if the
  8024. * corresponding MPDU is actually present.
  8025. * This field is only valid if the FV bit is set.
  8026. * - REL_SEQ_NUM_START
  8027. * Bits 17:12
  8028. * Purpose: Indicate the start of a series of MPDUs to release.
  8029. * All MPDUs within this series are present and valid - the host
  8030. * need not check each sequence number within this range to see if
  8031. * the corresponding MPDU is actually present.
  8032. * This field is only valid if the RV bit is set.
  8033. * Value:
  8034. * The sequence number for the first MPDUs to check to release.
  8035. * The sequence number is masked by 0x3f.
  8036. * - REL_SEQ_NUM_END
  8037. * Bits 23:18
  8038. * Purpose: Indicate the end of a series of MPDUs to release.
  8039. * Value:
  8040. * The sequence number one larger than the sequence number of the
  8041. * last MPDU to check to release.
  8042. * The sequence number is masked by 0x3f.
  8043. * All MPDUs within this series are present and valid - the host
  8044. * need not check each sequence number within this range to see if
  8045. * the corresponding MPDU is actually present.
  8046. * This field is only valid if the RV bit is set.
  8047. * - NUM_MPDU_RANGES
  8048. * Bits 31:24
  8049. * Purpose: Indicate how many ranges of MPDUs are present.
  8050. * Each MPDU range consists of a series of contiguous MPDUs within the
  8051. * rx frame sequence which all have the same MPDU status.
  8052. * Value: 1-63 (typically a small number, like 1-3)
  8053. *
  8054. * Rx PPDU descriptor fields:
  8055. * - RSSI_CMB
  8056. * Bits 7:0
  8057. * Purpose: Combined RSSI from all active rx chains, across the active
  8058. * bandwidth.
  8059. * Value: RSSI dB units w.r.t. noise floor
  8060. * - TIMESTAMP_SUBMICROSEC
  8061. * Bits 15:8
  8062. * Purpose: high-resolution timestamp
  8063. * Value:
  8064. * Sub-microsecond time of PPDU reception.
  8065. * This timestamp ranges from [0,MAC clock MHz).
  8066. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8067. * to form a high-resolution, large range rx timestamp.
  8068. * - PHY_ERR_CODE
  8069. * Bits 23:16
  8070. * Purpose:
  8071. * If the rx frame processing resulted in a PHY error, indicate what
  8072. * type of rx PHY error occurred.
  8073. * Value:
  8074. * This field is valid if the "P" (PHY_ERR) flag is set.
  8075. * TBD: document/specify the values for this field
  8076. * - PHY_ERR
  8077. * Bit 24
  8078. * Purpose: indicate whether the rx PPDU had a PHY error
  8079. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8080. * - LEGACY_RATE
  8081. * Bits 28:25
  8082. * Purpose:
  8083. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8084. * specify which rate was used.
  8085. * Value:
  8086. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8087. * flag.
  8088. * If LEGACY_RATE_SEL is 0:
  8089. * 0x8: OFDM 48 Mbps
  8090. * 0x9: OFDM 24 Mbps
  8091. * 0xA: OFDM 12 Mbps
  8092. * 0xB: OFDM 6 Mbps
  8093. * 0xC: OFDM 54 Mbps
  8094. * 0xD: OFDM 36 Mbps
  8095. * 0xE: OFDM 18 Mbps
  8096. * 0xF: OFDM 9 Mbps
  8097. * If LEGACY_RATE_SEL is 1:
  8098. * 0x8: CCK 11 Mbps long preamble
  8099. * 0x9: CCK 5.5 Mbps long preamble
  8100. * 0xA: CCK 2 Mbps long preamble
  8101. * 0xB: CCK 1 Mbps long preamble
  8102. * 0xC: CCK 11 Mbps short preamble
  8103. * 0xD: CCK 5.5 Mbps short preamble
  8104. * 0xE: CCK 2 Mbps short preamble
  8105. * - LEGACY_RATE_SEL
  8106. * Bit 29
  8107. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8108. * Value:
  8109. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8110. * used a legacy rate.
  8111. * 0 -> OFDM, 1 -> CCK
  8112. * - END_VALID
  8113. * Bit 30
  8114. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8115. * the start of the PPDU are valid. Specifically, the following
  8116. * fields are only valid if END_VALID is set:
  8117. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8118. * TIMESTAMP_SUBMICROSEC
  8119. * Value:
  8120. * 0 -> rx PPDU desc end fields are not valid
  8121. * 1 -> rx PPDU desc end fields are valid
  8122. * - START_VALID
  8123. * Bit 31
  8124. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8125. * the end of the PPDU are valid. Specifically, the following
  8126. * fields are only valid if START_VALID is set:
  8127. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8128. * VHT-SIG-A
  8129. * Value:
  8130. * 0 -> rx PPDU desc start fields are not valid
  8131. * 1 -> rx PPDU desc start fields are valid
  8132. * - RSSI0_PRI20
  8133. * Bits 7:0
  8134. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8135. * Value: RSSI dB units w.r.t. noise floor
  8136. *
  8137. * - RSSI0_EXT20
  8138. * Bits 7:0
  8139. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8140. * (if the rx bandwidth was >= 40 MHz)
  8141. * Value: RSSI dB units w.r.t. noise floor
  8142. * - RSSI0_EXT40
  8143. * Bits 7:0
  8144. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8145. * (if the rx bandwidth was >= 80 MHz)
  8146. * Value: RSSI dB units w.r.t. noise floor
  8147. * - RSSI0_EXT80
  8148. * Bits 7:0
  8149. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8150. * (if the rx bandwidth was >= 160 MHz)
  8151. * Value: RSSI dB units w.r.t. noise floor
  8152. *
  8153. * - RSSI1_PRI20
  8154. * Bits 7:0
  8155. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8156. * Value: RSSI dB units w.r.t. noise floor
  8157. * - RSSI1_EXT20
  8158. * Bits 7:0
  8159. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8160. * (if the rx bandwidth was >= 40 MHz)
  8161. * Value: RSSI dB units w.r.t. noise floor
  8162. * - RSSI1_EXT40
  8163. * Bits 7:0
  8164. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8165. * (if the rx bandwidth was >= 80 MHz)
  8166. * Value: RSSI dB units w.r.t. noise floor
  8167. * - RSSI1_EXT80
  8168. * Bits 7:0
  8169. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8170. * (if the rx bandwidth was >= 160 MHz)
  8171. * Value: RSSI dB units w.r.t. noise floor
  8172. *
  8173. * - RSSI2_PRI20
  8174. * Bits 7:0
  8175. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8176. * Value: RSSI dB units w.r.t. noise floor
  8177. * - RSSI2_EXT20
  8178. * Bits 7:0
  8179. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8180. * (if the rx bandwidth was >= 40 MHz)
  8181. * Value: RSSI dB units w.r.t. noise floor
  8182. * - RSSI2_EXT40
  8183. * Bits 7:0
  8184. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8185. * (if the rx bandwidth was >= 80 MHz)
  8186. * Value: RSSI dB units w.r.t. noise floor
  8187. * - RSSI2_EXT80
  8188. * Bits 7:0
  8189. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8190. * (if the rx bandwidth was >= 160 MHz)
  8191. * Value: RSSI dB units w.r.t. noise floor
  8192. *
  8193. * - RSSI3_PRI20
  8194. * Bits 7:0
  8195. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8196. * Value: RSSI dB units w.r.t. noise floor
  8197. * - RSSI3_EXT20
  8198. * Bits 7:0
  8199. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8200. * (if the rx bandwidth was >= 40 MHz)
  8201. * Value: RSSI dB units w.r.t. noise floor
  8202. * - RSSI3_EXT40
  8203. * Bits 7:0
  8204. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8205. * (if the rx bandwidth was >= 80 MHz)
  8206. * Value: RSSI dB units w.r.t. noise floor
  8207. * - RSSI3_EXT80
  8208. * Bits 7:0
  8209. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8210. * (if the rx bandwidth was >= 160 MHz)
  8211. * Value: RSSI dB units w.r.t. noise floor
  8212. *
  8213. * - TSF32
  8214. * Bits 31:0
  8215. * Purpose: specify the time the rx PPDU was received, in TSF units
  8216. * Value: 32 LSBs of the TSF
  8217. * - TIMESTAMP_MICROSEC
  8218. * Bits 31:0
  8219. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8220. * Value: PPDU rx time, in microseconds
  8221. * - VHT_SIG_A1
  8222. * Bits 23:0
  8223. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8224. * from the rx PPDU
  8225. * Value:
  8226. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8227. * VHT-SIG-A1 data.
  8228. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8229. * first 24 bits of the HT-SIG data.
  8230. * Otherwise, this field is invalid.
  8231. * Refer to the the 802.11 protocol for the definition of the
  8232. * HT-SIG and VHT-SIG-A1 fields
  8233. * - VHT_SIG_A2
  8234. * Bits 23:0
  8235. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8236. * from the rx PPDU
  8237. * Value:
  8238. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8239. * VHT-SIG-A2 data.
  8240. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8241. * last 24 bits of the HT-SIG data.
  8242. * Otherwise, this field is invalid.
  8243. * Refer to the the 802.11 protocol for the definition of the
  8244. * HT-SIG and VHT-SIG-A2 fields
  8245. * - PREAMBLE_TYPE
  8246. * Bits 31:24
  8247. * Purpose: indicate the PHY format of the received burst
  8248. * Value:
  8249. * 0x4: Legacy (OFDM/CCK)
  8250. * 0x8: HT
  8251. * 0x9: HT with TxBF
  8252. * 0xC: VHT
  8253. * 0xD: VHT with TxBF
  8254. * - SERVICE
  8255. * Bits 31:24
  8256. * Purpose: TBD
  8257. * Value: TBD
  8258. *
  8259. * Rx MSDU descriptor fields:
  8260. * - FW_RX_DESC_BYTES
  8261. * Bits 15:0
  8262. * Purpose: Indicate how many bytes in the Rx indication are used for
  8263. * FW Rx descriptors
  8264. *
  8265. * Payload fields:
  8266. * - MPDU_COUNT
  8267. * Bits 7:0
  8268. * Purpose: Indicate how many sequential MPDUs share the same status.
  8269. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8270. * - MPDU_STATUS
  8271. * Bits 15:8
  8272. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8273. * received successfully.
  8274. * Value:
  8275. * 0x1: success
  8276. * 0x2: FCS error
  8277. * 0x3: duplicate error
  8278. * 0x4: replay error
  8279. * 0x5: invalid peer
  8280. */
  8281. /* header fields */
  8282. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8283. #define HTT_RX_IND_EXT_TID_S 8
  8284. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8285. #define HTT_RX_IND_FLUSH_VALID_S 13
  8286. #define HTT_RX_IND_REL_VALID_M 0x4000
  8287. #define HTT_RX_IND_REL_VALID_S 14
  8288. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8289. #define HTT_RX_IND_PEER_ID_S 16
  8290. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8291. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8292. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8293. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8294. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8295. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8296. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8297. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8298. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8299. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8300. /* rx PPDU descriptor fields */
  8301. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8302. #define HTT_RX_IND_RSSI_CMB_S 0
  8303. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8304. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8305. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8306. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8307. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8308. #define HTT_RX_IND_PHY_ERR_S 24
  8309. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8310. #define HTT_RX_IND_LEGACY_RATE_S 25
  8311. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8312. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8313. #define HTT_RX_IND_END_VALID_M 0x40000000
  8314. #define HTT_RX_IND_END_VALID_S 30
  8315. #define HTT_RX_IND_START_VALID_M 0x80000000
  8316. #define HTT_RX_IND_START_VALID_S 31
  8317. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8318. #define HTT_RX_IND_RSSI_PRI20_S 0
  8319. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8320. #define HTT_RX_IND_RSSI_EXT20_S 8
  8321. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8322. #define HTT_RX_IND_RSSI_EXT40_S 16
  8323. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8324. #define HTT_RX_IND_RSSI_EXT80_S 24
  8325. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8326. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8327. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8328. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8329. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8330. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8331. #define HTT_RX_IND_SERVICE_M 0xff000000
  8332. #define HTT_RX_IND_SERVICE_S 24
  8333. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8334. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8335. /* rx MSDU descriptor fields */
  8336. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8337. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8338. /* payload fields */
  8339. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8340. #define HTT_RX_IND_MPDU_COUNT_S 0
  8341. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8342. #define HTT_RX_IND_MPDU_STATUS_S 8
  8343. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8344. do { \
  8345. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8346. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8347. } while (0)
  8348. #define HTT_RX_IND_EXT_TID_GET(word) \
  8349. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8350. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8353. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8354. } while (0)
  8355. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8356. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8357. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8360. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8361. } while (0)
  8362. #define HTT_RX_IND_REL_VALID_GET(word) \
  8363. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8364. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8367. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8368. } while (0)
  8369. #define HTT_RX_IND_PEER_ID_GET(word) \
  8370. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8371. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8374. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8375. } while (0)
  8376. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8377. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8378. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8379. do { \
  8380. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8381. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8382. } while (0)
  8383. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8384. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8385. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8386. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8387. do { \
  8388. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8389. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8390. } while (0)
  8391. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8392. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8393. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8394. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8395. do { \
  8396. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8397. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8398. } while (0)
  8399. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8400. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8401. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8402. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8403. do { \
  8404. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8405. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8406. } while (0)
  8407. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8408. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8409. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8410. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8413. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8414. } while (0)
  8415. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8416. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8417. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8418. /* FW rx PPDU descriptor fields */
  8419. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8420. do { \
  8421. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8422. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8423. } while (0)
  8424. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8425. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8426. HTT_RX_IND_RSSI_CMB_S)
  8427. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8428. do { \
  8429. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8430. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8431. } while (0)
  8432. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8433. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8434. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8435. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8436. do { \
  8437. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8438. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8439. } while (0)
  8440. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8441. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8442. HTT_RX_IND_PHY_ERR_CODE_S)
  8443. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8446. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8447. } while (0)
  8448. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8449. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8450. HTT_RX_IND_PHY_ERR_S)
  8451. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8454. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8455. } while (0)
  8456. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8457. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8458. HTT_RX_IND_LEGACY_RATE_S)
  8459. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8462. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8463. } while (0)
  8464. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8465. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8466. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8467. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8470. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8471. } while (0)
  8472. #define HTT_RX_IND_END_VALID_GET(word) \
  8473. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8474. HTT_RX_IND_END_VALID_S)
  8475. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8476. do { \
  8477. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8478. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8479. } while (0)
  8480. #define HTT_RX_IND_START_VALID_GET(word) \
  8481. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8482. HTT_RX_IND_START_VALID_S)
  8483. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8484. do { \
  8485. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8486. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8487. } while (0)
  8488. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8489. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8490. HTT_RX_IND_RSSI_PRI20_S)
  8491. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8492. do { \
  8493. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8494. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8495. } while (0)
  8496. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8497. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8498. HTT_RX_IND_RSSI_EXT20_S)
  8499. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8500. do { \
  8501. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8502. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8503. } while (0)
  8504. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8505. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8506. HTT_RX_IND_RSSI_EXT40_S)
  8507. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8508. do { \
  8509. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8510. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8511. } while (0)
  8512. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8513. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8514. HTT_RX_IND_RSSI_EXT80_S)
  8515. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8516. do { \
  8517. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8518. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8519. } while (0)
  8520. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8521. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8522. HTT_RX_IND_VHT_SIG_A1_S)
  8523. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8526. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8527. } while (0)
  8528. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8529. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8530. HTT_RX_IND_VHT_SIG_A2_S)
  8531. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8534. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8535. } while (0)
  8536. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8537. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8538. HTT_RX_IND_PREAMBLE_TYPE_S)
  8539. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8540. do { \
  8541. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8542. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8543. } while (0)
  8544. #define HTT_RX_IND_SERVICE_GET(word) \
  8545. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8546. HTT_RX_IND_SERVICE_S)
  8547. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8550. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8551. } while (0)
  8552. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8553. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8554. HTT_RX_IND_SA_ANT_MATRIX_S)
  8555. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8556. do { \
  8557. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8558. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8559. } while (0)
  8560. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8561. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8562. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8563. do { \
  8564. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8565. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8566. } while (0)
  8567. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8568. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8569. #define HTT_RX_IND_HL_BYTES \
  8570. (HTT_RX_IND_HDR_BYTES + \
  8571. 4 /* single FW rx MSDU descriptor */ + \
  8572. 4 /* single MPDU range information element */)
  8573. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8574. /* Could we use one macro entry? */
  8575. #define HTT_WORD_SET(word, field, value) \
  8576. do { \
  8577. HTT_CHECK_SET_VAL(field, value); \
  8578. (word) |= ((value) << field ## _S); \
  8579. } while (0)
  8580. #define HTT_WORD_GET(word, field) \
  8581. (((word) & field ## _M) >> field ## _S)
  8582. PREPACK struct hl_htt_rx_ind_base {
  8583. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8584. } POSTPACK;
  8585. /*
  8586. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8587. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8588. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8589. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8590. * htt_rx_ind_hl_rx_desc_t.
  8591. */
  8592. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8593. struct htt_rx_ind_hl_rx_desc_t {
  8594. A_UINT8 ver;
  8595. A_UINT8 len;
  8596. struct {
  8597. A_UINT8
  8598. first_msdu: 1,
  8599. last_msdu: 1,
  8600. c3_failed: 1,
  8601. c4_failed: 1,
  8602. ipv6: 1,
  8603. tcp: 1,
  8604. udp: 1,
  8605. reserved: 1;
  8606. } flags;
  8607. /* NOTE: no reserved space - don't append any new fields here */
  8608. };
  8609. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8610. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8611. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8612. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8613. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8614. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8615. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8616. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8617. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8618. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8619. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8620. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8621. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8622. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8623. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8624. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8625. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8626. /* This structure is used in HL, the basic descriptor information
  8627. * used by host. the structure is translated by FW from HW desc
  8628. * or generated by FW. But in HL monitor mode, the host would use
  8629. * the same structure with LL.
  8630. */
  8631. PREPACK struct hl_htt_rx_desc_base {
  8632. A_UINT32
  8633. seq_num:12,
  8634. encrypted:1,
  8635. chan_info_present:1,
  8636. resv0:2,
  8637. mcast_bcast:1,
  8638. fragment:1,
  8639. key_id_oct:8,
  8640. resv1:6;
  8641. A_UINT32
  8642. pn_31_0;
  8643. union {
  8644. struct {
  8645. A_UINT16 pn_47_32;
  8646. A_UINT16 pn_63_48;
  8647. } pn16;
  8648. A_UINT32 pn_63_32;
  8649. } u0;
  8650. A_UINT32
  8651. pn_95_64;
  8652. A_UINT32
  8653. pn_127_96;
  8654. } POSTPACK;
  8655. /*
  8656. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8657. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8658. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8659. * Please see htt_chan_change_t for description of the fields.
  8660. */
  8661. PREPACK struct htt_chan_info_t
  8662. {
  8663. A_UINT32 primary_chan_center_freq_mhz: 16,
  8664. contig_chan1_center_freq_mhz: 16;
  8665. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8666. phy_mode: 8,
  8667. reserved: 8;
  8668. } POSTPACK;
  8669. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8670. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8671. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8672. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8673. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8674. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8675. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8676. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8677. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8678. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8679. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8680. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8681. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8682. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8683. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8684. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8685. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8686. /* Channel information */
  8687. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8688. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8689. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8690. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8691. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8692. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8693. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8694. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8695. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8698. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8699. } while (0)
  8700. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8701. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8702. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8705. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8706. } while (0)
  8707. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8708. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8709. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8710. do { \
  8711. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8712. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8713. } while (0)
  8714. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8715. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8716. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8717. do { \
  8718. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8719. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8720. } while (0)
  8721. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8722. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8723. /*
  8724. * @brief target -> host message definition for FW offloaded pkts
  8725. *
  8726. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8727. *
  8728. * @details
  8729. * The following field definitions describe the format of the firmware
  8730. * offload deliver message sent from the target to the host.
  8731. *
  8732. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8733. *
  8734. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8735. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8736. * | reserved_1 | msg type |
  8737. * |--------------------------------------------------------------------------|
  8738. * | phy_timestamp_l32 |
  8739. * |--------------------------------------------------------------------------|
  8740. * | WORD2 (see below) |
  8741. * |--------------------------------------------------------------------------|
  8742. * | seqno | framectrl |
  8743. * |--------------------------------------------------------------------------|
  8744. * | reserved_3 | vdev_id | tid_num|
  8745. * |--------------------------------------------------------------------------|
  8746. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8747. * |--------------------------------------------------------------------------|
  8748. *
  8749. * where:
  8750. * STAT = status
  8751. * F = format (802.3 vs. 802.11)
  8752. *
  8753. * definition for word 2
  8754. *
  8755. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8756. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8757. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8758. * |--------------------------------------------------------------------------|
  8759. *
  8760. * where:
  8761. * PR = preamble
  8762. * BF = beamformed
  8763. */
  8764. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8765. {
  8766. A_UINT32 /* word 0 */
  8767. msg_type:8, /* [ 7: 0] */
  8768. reserved_1:24; /* [31: 8] */
  8769. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8770. A_UINT32 /* word 2 */
  8771. /* preamble:
  8772. * 0-OFDM,
  8773. * 1-CCk,
  8774. * 2-HT,
  8775. * 3-VHT
  8776. */
  8777. preamble: 2, /* [1:0] */
  8778. /* mcs:
  8779. * In case of HT preamble interpret
  8780. * MCS along with NSS.
  8781. * Valid values for HT are 0 to 7.
  8782. * HT mcs 0 with NSS 2 is mcs 8.
  8783. * Valid values for VHT are 0 to 9.
  8784. */
  8785. mcs: 4, /* [5:2] */
  8786. /* rate:
  8787. * This is applicable only for
  8788. * CCK and OFDM preamble type
  8789. * rate 0: OFDM 48 Mbps,
  8790. * 1: OFDM 24 Mbps,
  8791. * 2: OFDM 12 Mbps
  8792. * 3: OFDM 6 Mbps
  8793. * 4: OFDM 54 Mbps
  8794. * 5: OFDM 36 Mbps
  8795. * 6: OFDM 18 Mbps
  8796. * 7: OFDM 9 Mbps
  8797. * rate 0: CCK 11 Mbps Long
  8798. * 1: CCK 5.5 Mbps Long
  8799. * 2: CCK 2 Mbps Long
  8800. * 3: CCK 1 Mbps Long
  8801. * 4: CCK 11 Mbps Short
  8802. * 5: CCK 5.5 Mbps Short
  8803. * 6: CCK 2 Mbps Short
  8804. */
  8805. rate : 3, /* [ 8: 6] */
  8806. rssi : 8, /* [16: 9] units=dBm */
  8807. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8808. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8809. stbc : 1, /* [22] */
  8810. sgi : 1, /* [23] */
  8811. ldpc : 1, /* [24] */
  8812. beamformed: 1, /* [25] */
  8813. reserved_2: 6; /* [31:26] */
  8814. A_UINT32 /* word 3 */
  8815. framectrl:16, /* [15: 0] */
  8816. seqno:16; /* [31:16] */
  8817. A_UINT32 /* word 4 */
  8818. tid_num:5, /* [ 4: 0] actual TID number */
  8819. vdev_id:8, /* [12: 5] */
  8820. reserved_3:19; /* [31:13] */
  8821. A_UINT32 /* word 5 */
  8822. /* status:
  8823. * 0: tx_ok
  8824. * 1: retry
  8825. * 2: drop
  8826. * 3: filtered
  8827. * 4: abort
  8828. * 5: tid delete
  8829. * 6: sw abort
  8830. * 7: dropped by peer migration
  8831. */
  8832. status:3, /* [2:0] */
  8833. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8834. tx_mpdu_bytes:16, /* [19:4] */
  8835. /* Indicates retry count of offloaded/local generated Data tx frames */
  8836. tx_retry_cnt:6, /* [25:20] */
  8837. reserved_4:6; /* [31:26] */
  8838. } POSTPACK;
  8839. /* FW offload deliver ind message header fields */
  8840. /* DWORD one */
  8841. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8842. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8843. /* DWORD two */
  8844. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8845. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8846. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8847. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8848. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8849. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8850. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8851. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8852. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8853. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8854. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8855. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8856. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8857. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8858. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8859. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8860. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8861. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8862. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8863. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8864. /* DWORD three*/
  8865. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8866. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8867. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8868. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8869. /* DWORD four */
  8870. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8871. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8872. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8873. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8874. /* DWORD five */
  8875. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8876. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8877. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8878. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8879. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8880. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8881. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8882. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8883. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8886. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8887. } while (0)
  8888. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8889. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8890. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8891. do { \
  8892. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8893. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8894. } while (0)
  8895. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8896. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8897. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8898. do { \
  8899. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8900. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8901. } while (0)
  8902. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8903. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8904. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8907. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8908. } while (0)
  8909. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8910. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8911. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8912. do { \
  8913. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8914. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8915. } while (0)
  8916. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8917. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8918. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8919. do { \
  8920. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8921. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8922. } while (0)
  8923. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8924. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8925. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8926. do { \
  8927. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8928. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8929. } while (0)
  8930. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8931. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8932. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8933. do { \
  8934. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8935. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8936. } while (0)
  8937. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8938. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8939. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8940. do { \
  8941. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8942. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8943. } while (0)
  8944. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8945. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8946. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8947. do { \
  8948. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8949. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8950. } while (0)
  8951. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8952. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8953. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8954. do { \
  8955. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8956. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8957. } while (0)
  8958. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8959. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8960. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8961. do { \
  8962. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8963. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8964. } while (0)
  8965. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8966. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8967. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8968. do { \
  8969. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8970. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8971. } while (0)
  8972. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8973. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8974. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8977. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8978. } while (0)
  8979. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8980. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8981. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8984. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8985. } while (0)
  8986. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8987. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8988. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8991. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8992. } while (0)
  8993. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8994. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8995. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8998. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8999. } while (0)
  9000. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9001. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9002. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9005. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9006. } while (0)
  9007. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9008. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9009. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9010. do { \
  9011. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9012. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9013. } while (0)
  9014. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9015. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9016. /*
  9017. * @brief target -> host rx reorder flush message definition
  9018. *
  9019. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9020. *
  9021. * @details
  9022. * The following field definitions describe the format of the rx flush
  9023. * message sent from the target to the host.
  9024. * The message consists of a 4-octet header, followed by one or more
  9025. * 4-octet payload information elements.
  9026. *
  9027. * |31 24|23 8|7 0|
  9028. * |--------------------------------------------------------------|
  9029. * | TID | peer ID | msg type |
  9030. * |--------------------------------------------------------------|
  9031. * | seq num end | seq num start | MPDU status | reserved |
  9032. * |--------------------------------------------------------------|
  9033. * First DWORD:
  9034. * - MSG_TYPE
  9035. * Bits 7:0
  9036. * Purpose: identifies this as an rx flush message
  9037. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9038. * - PEER_ID
  9039. * Bits 23:8 (only bits 18:8 actually used)
  9040. * Purpose: identify which peer's rx data is being flushed
  9041. * Value: (rx) peer ID
  9042. * - TID
  9043. * Bits 31:24 (only bits 27:24 actually used)
  9044. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9045. * Value: traffic identifier
  9046. * Second DWORD:
  9047. * - MPDU_STATUS
  9048. * Bits 15:8
  9049. * Purpose:
  9050. * Indicate whether the flushed MPDUs should be discarded or processed.
  9051. * Value:
  9052. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9053. * stages of rx processing
  9054. * other: discard the MPDUs
  9055. * It is anticipated that flush messages will always have
  9056. * MPDU status == 1, but the status flag is included for
  9057. * flexibility.
  9058. * - SEQ_NUM_START
  9059. * Bits 23:16
  9060. * Purpose:
  9061. * Indicate the start of a series of consecutive MPDUs being flushed.
  9062. * Not all MPDUs within this range are necessarily valid - the host
  9063. * must check each sequence number within this range to see if the
  9064. * corresponding MPDU is actually present.
  9065. * Value:
  9066. * The sequence number for the first MPDU in the sequence.
  9067. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9068. * - SEQ_NUM_END
  9069. * Bits 30:24
  9070. * Purpose:
  9071. * Indicate the end of a series of consecutive MPDUs being flushed.
  9072. * Value:
  9073. * The sequence number one larger than the sequence number of the
  9074. * last MPDU being flushed.
  9075. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9076. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9077. * are to be released for further rx processing.
  9078. * Not all MPDUs within this range are necessarily valid - the host
  9079. * must check each sequence number within this range to see if the
  9080. * corresponding MPDU is actually present.
  9081. */
  9082. /* first DWORD */
  9083. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9084. #define HTT_RX_FLUSH_PEER_ID_S 8
  9085. #define HTT_RX_FLUSH_TID_M 0xff000000
  9086. #define HTT_RX_FLUSH_TID_S 24
  9087. /* second DWORD */
  9088. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9089. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9090. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9091. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9092. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9093. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9094. #define HTT_RX_FLUSH_BYTES 8
  9095. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9096. do { \
  9097. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9098. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9099. } while (0)
  9100. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9101. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9102. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9103. do { \
  9104. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9105. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9106. } while (0)
  9107. #define HTT_RX_FLUSH_TID_GET(word) \
  9108. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9109. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9110. do { \
  9111. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9112. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9113. } while (0)
  9114. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9115. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9116. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9117. do { \
  9118. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9119. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9120. } while (0)
  9121. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9122. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9123. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9124. do { \
  9125. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9126. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9127. } while (0)
  9128. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9129. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9130. /*
  9131. * @brief target -> host rx pn check indication message
  9132. *
  9133. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9134. *
  9135. * @details
  9136. * The following field definitions describe the format of the Rx PN check
  9137. * indication message sent from the target to the host.
  9138. * The message consists of a 4-octet header, followed by the start and
  9139. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9140. * IE is one octet containing the sequence number that failed the PN
  9141. * check.
  9142. *
  9143. * |31 24|23 8|7 0|
  9144. * |--------------------------------------------------------------|
  9145. * | TID | peer ID | msg type |
  9146. * |--------------------------------------------------------------|
  9147. * | Reserved | PN IE count | seq num end | seq num start|
  9148. * |--------------------------------------------------------------|
  9149. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9150. * |--------------------------------------------------------------|
  9151. * First DWORD:
  9152. * - MSG_TYPE
  9153. * Bits 7:0
  9154. * Purpose: Identifies this as an rx pn check indication message
  9155. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9156. * - PEER_ID
  9157. * Bits 23:8 (only bits 18:8 actually used)
  9158. * Purpose: identify which peer
  9159. * Value: (rx) peer ID
  9160. * - TID
  9161. * Bits 31:24 (only bits 27:24 actually used)
  9162. * Purpose: identify traffic identifier
  9163. * Value: traffic identifier
  9164. * Second DWORD:
  9165. * - SEQ_NUM_START
  9166. * Bits 7:0
  9167. * Purpose:
  9168. * Indicates the starting sequence number of the MPDU in this
  9169. * series of MPDUs that went though PN check.
  9170. * Value:
  9171. * The sequence number for the first MPDU in the sequence.
  9172. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9173. * - SEQ_NUM_END
  9174. * Bits 15:8
  9175. * Purpose:
  9176. * Indicates the ending sequence number of the MPDU in this
  9177. * series of MPDUs that went though PN check.
  9178. * Value:
  9179. * The sequence number one larger then the sequence number of the last
  9180. * MPDU being flushed.
  9181. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9182. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9183. * for invalid PN numbers and are ready to be released for further processing.
  9184. * Not all MPDUs within this range are necessarily valid - the host
  9185. * must check each sequence number within this range to see if the
  9186. * corresponding MPDU is actually present.
  9187. * - PN_IE_COUNT
  9188. * Bits 23:16
  9189. * Purpose:
  9190. * Used to determine the variable number of PN information elements in this
  9191. * message
  9192. *
  9193. * PN information elements:
  9194. * - PN_IE_x-
  9195. * Purpose:
  9196. * Each PN information element contains the sequence number of the MPDU that
  9197. * has failed the target PN check.
  9198. * Value:
  9199. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9200. * that failed the PN check.
  9201. */
  9202. /* first DWORD */
  9203. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9204. #define HTT_RX_PN_IND_PEER_ID_S 8
  9205. #define HTT_RX_PN_IND_TID_M 0xff000000
  9206. #define HTT_RX_PN_IND_TID_S 24
  9207. /* second DWORD */
  9208. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9209. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9210. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9211. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9212. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9213. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9214. #define HTT_RX_PN_IND_BYTES 8
  9215. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9218. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9219. } while (0)
  9220. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9221. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9222. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9223. do { \
  9224. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9225. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9226. } while (0)
  9227. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9228. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9229. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9230. do { \
  9231. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9232. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9233. } while (0)
  9234. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9235. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9236. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9239. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9240. } while (0)
  9241. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9242. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9243. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9244. do { \
  9245. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9246. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9247. } while (0)
  9248. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9249. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9250. /*
  9251. * @brief target -> host rx offload deliver message for LL system
  9252. *
  9253. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9254. *
  9255. * @details
  9256. * In a low latency system this message is sent whenever the offload
  9257. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9258. * The DMA of the actual packets into host memory is done before sending out
  9259. * this message. This message indicates only how many MSDUs to reap. The
  9260. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9261. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9262. * DMA'd by the MAC directly into host memory these packets do not contain
  9263. * the MAC descriptors in the header portion of the packet. Instead they contain
  9264. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9265. * message, the packets are delivered directly to the NW stack without going
  9266. * through the regular reorder buffering and PN checking path since it has
  9267. * already been done in target.
  9268. *
  9269. * |31 24|23 16|15 8|7 0|
  9270. * |-----------------------------------------------------------------------|
  9271. * | Total MSDU count | reserved | msg type |
  9272. * |-----------------------------------------------------------------------|
  9273. *
  9274. * @brief target -> host rx offload deliver message for HL system
  9275. *
  9276. * @details
  9277. * In a high latency system this message is sent whenever the offload manager
  9278. * flushes out the packets it has coalesced in its coalescing buffer. The
  9279. * actual packets are also carried along with this message. When the host
  9280. * receives this message, it is expected to deliver these packets to the NW
  9281. * stack directly instead of routing them through the reorder buffering and
  9282. * PN checking path since it has already been done in target.
  9283. *
  9284. * |31 24|23 16|15 8|7 0|
  9285. * |-----------------------------------------------------------------------|
  9286. * | Total MSDU count | reserved | msg type |
  9287. * |-----------------------------------------------------------------------|
  9288. * | peer ID | MSDU length |
  9289. * |-----------------------------------------------------------------------|
  9290. * | MSDU payload | FW Desc | tid | vdev ID |
  9291. * |-----------------------------------------------------------------------|
  9292. * | MSDU payload contd. |
  9293. * |-----------------------------------------------------------------------|
  9294. * | peer ID | MSDU length |
  9295. * |-----------------------------------------------------------------------|
  9296. * | MSDU payload | FW Desc | tid | vdev ID |
  9297. * |-----------------------------------------------------------------------|
  9298. * | MSDU payload contd. |
  9299. * |-----------------------------------------------------------------------|
  9300. *
  9301. */
  9302. /* first DWORD */
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9306. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9307. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9308. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9309. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9310. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9311. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9312. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9313. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9314. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9315. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9317. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9318. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9319. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9322. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9323. } while (0)
  9324. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9325. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9326. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9329. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9330. } while (0)
  9331. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9332. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9333. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9334. do { \
  9335. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9336. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9337. } while (0)
  9338. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9339. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9340. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9341. do { \
  9342. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9343. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9344. } while (0)
  9345. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9346. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9347. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9348. do { \
  9349. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9350. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9351. } while (0)
  9352. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9353. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9354. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9355. do { \
  9356. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9357. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9358. } while (0)
  9359. /**
  9360. * @brief target -> host rx peer map/unmap message definition
  9361. *
  9362. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9363. *
  9364. * @details
  9365. * The following diagram shows the format of the rx peer map message sent
  9366. * from the target to the host. This layout assumes the target operates
  9367. * as little-endian.
  9368. *
  9369. * This message always contains a SW peer ID. The main purpose of the
  9370. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9371. * with, so that the host can use that peer ID to determine which peer
  9372. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9373. * other purposes, such as identifying during tx completions which peer
  9374. * the tx frames in question were transmitted to.
  9375. *
  9376. * In certain generations of chips, the peer map message also contains
  9377. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9378. * to identify which peer the frame needs to be forwarded to (i.e. the
  9379. * peer assocated with the Destination MAC Address within the packet),
  9380. * and particularly which vdev needs to transmit the frame (for cases
  9381. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9382. * meaning as AST_INDEX_0.
  9383. * This DA-based peer ID that is provided for certain rx frames
  9384. * (the rx frames that need to be re-transmitted as tx frames)
  9385. * is the ID that the HW uses for referring to the peer in question,
  9386. * rather than the peer ID that the SW+FW use to refer to the peer.
  9387. *
  9388. *
  9389. * |31 24|23 16|15 8|7 0|
  9390. * |-----------------------------------------------------------------------|
  9391. * | SW peer ID | VDEV ID | msg type |
  9392. * |-----------------------------------------------------------------------|
  9393. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9394. * |-----------------------------------------------------------------------|
  9395. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9396. * |-----------------------------------------------------------------------|
  9397. *
  9398. *
  9399. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9400. *
  9401. * The following diagram shows the format of the rx peer unmap message sent
  9402. * from the target to the host.
  9403. *
  9404. * |31 24|23 16|15 8|7 0|
  9405. * |-----------------------------------------------------------------------|
  9406. * | SW peer ID | VDEV ID | msg type |
  9407. * |-----------------------------------------------------------------------|
  9408. *
  9409. * The following field definitions describe the format of the rx peer map
  9410. * and peer unmap messages sent from the target to the host.
  9411. * - MSG_TYPE
  9412. * Bits 7:0
  9413. * Purpose: identifies this as an rx peer map or peer unmap message
  9414. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9415. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9416. * - VDEV_ID
  9417. * Bits 15:8
  9418. * Purpose: Indicates which virtual device the peer is associated
  9419. * with.
  9420. * Value: vdev ID (used in the host to look up the vdev object)
  9421. * - PEER_ID (a.k.a. SW_PEER_ID)
  9422. * Bits 31:16
  9423. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9424. * freeing (unmap)
  9425. * Value: (rx) peer ID
  9426. * - MAC_ADDR_L32 (peer map only)
  9427. * Bits 31:0
  9428. * Purpose: Identifies which peer node the peer ID is for.
  9429. * Value: lower 4 bytes of peer node's MAC address
  9430. * - MAC_ADDR_U16 (peer map only)
  9431. * Bits 15:0
  9432. * Purpose: Identifies which peer node the peer ID is for.
  9433. * Value: upper 2 bytes of peer node's MAC address
  9434. * - HW_PEER_ID
  9435. * Bits 31:16
  9436. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9437. * address, so for rx frames marked for rx --> tx forwarding, the
  9438. * host can determine from the HW peer ID provided as meta-data with
  9439. * the rx frame which peer the frame is supposed to be forwarded to.
  9440. * Value: ID used by the MAC HW to identify the peer
  9441. */
  9442. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9443. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9444. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9445. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9446. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9447. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9448. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9449. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9450. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9451. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9452. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9453. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9454. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9455. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9458. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9459. } while (0)
  9460. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9461. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9462. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9463. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9466. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9467. } while (0)
  9468. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9469. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9470. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9471. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9472. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9473. do { \
  9474. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9475. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9476. } while (0)
  9477. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9478. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9479. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9480. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9481. #define HTT_RX_PEER_MAP_BYTES 12
  9482. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9483. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9484. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9485. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9486. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9487. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9488. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9489. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9490. #define HTT_RX_PEER_UNMAP_BYTES 4
  9491. /**
  9492. * @brief target -> host rx peer map V2 message definition
  9493. *
  9494. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9495. *
  9496. * @details
  9497. * The following diagram shows the format of the rx peer map v2 message sent
  9498. * from the target to the host. This layout assumes the target operates
  9499. * as little-endian.
  9500. *
  9501. * This message always contains a SW peer ID. The main purpose of the
  9502. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9503. * with, so that the host can use that peer ID to determine which peer
  9504. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9505. * other purposes, such as identifying during tx completions which peer
  9506. * the tx frames in question were transmitted to.
  9507. *
  9508. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9509. * is used during rx --> tx frame forwarding to identify which peer the
  9510. * frame needs to be forwarded to (i.e. the peer assocated with the
  9511. * Destination MAC Address within the packet), and particularly which vdev
  9512. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9513. * This DA-based peer ID that is provided for certain rx frames
  9514. * (the rx frames that need to be re-transmitted as tx frames)
  9515. * is the ID that the HW uses for referring to the peer in question,
  9516. * rather than the peer ID that the SW+FW use to refer to the peer.
  9517. *
  9518. * The HW peer id here is the same meaning as AST_INDEX_0.
  9519. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9520. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9521. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9522. * AST is valid.
  9523. *
  9524. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9525. * |-------------------------------------------------------------------------|
  9526. * | SW peer ID | VDEV ID | msg type |
  9527. * |-------------------------------------------------------------------------|
  9528. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9529. * |-------------------------------------------------------------------------|
  9530. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9531. * |-------------------------------------------------------------------------|
  9532. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9533. * |-------------------------------------------------------------------------|
  9534. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9535. * |-------------------------------------------------------------------------|
  9536. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9537. * |-------------------------------------------------------------------------|
  9538. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9539. * |-------------------------------------------------------------------------|
  9540. * | Reserved_2 |
  9541. * |-------------------------------------------------------------------------|
  9542. * Where:
  9543. * NH = Next Hop
  9544. * ASTVM = AST valid mask
  9545. * OA = on-chip AST valid bit
  9546. * ASTFM = AST flow mask
  9547. *
  9548. * The following field definitions describe the format of the rx peer map v2
  9549. * messages sent from the target to the host.
  9550. * - MSG_TYPE
  9551. * Bits 7:0
  9552. * Purpose: identifies this as an rx peer map v2 message
  9553. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9554. * - VDEV_ID
  9555. * Bits 15:8
  9556. * Purpose: Indicates which virtual device the peer is associated with.
  9557. * Value: vdev ID (used in the host to look up the vdev object)
  9558. * - SW_PEER_ID
  9559. * Bits 31:16
  9560. * Purpose: The peer ID (index) that WAL is allocating
  9561. * Value: (rx) peer ID
  9562. * - MAC_ADDR_L32
  9563. * Bits 31:0
  9564. * Purpose: Identifies which peer node the peer ID is for.
  9565. * Value: lower 4 bytes of peer node's MAC address
  9566. * - MAC_ADDR_U16
  9567. * Bits 15:0
  9568. * Purpose: Identifies which peer node the peer ID is for.
  9569. * Value: upper 2 bytes of peer node's MAC address
  9570. * - HW_PEER_ID / AST_INDEX_0
  9571. * Bits 31:16
  9572. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9573. * address, so for rx frames marked for rx --> tx forwarding, the
  9574. * host can determine from the HW peer ID provided as meta-data with
  9575. * the rx frame which peer the frame is supposed to be forwarded to.
  9576. * Value: ID used by the MAC HW to identify the peer
  9577. * - AST_HASH_VALUE
  9578. * Bits 15:0
  9579. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9580. * override feature.
  9581. * - NEXT_HOP
  9582. * Bit 16
  9583. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9584. * (Wireless Distribution System).
  9585. * - AST_VALID_MASK
  9586. * Bits 19:17
  9587. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9588. * - ONCHIP_AST_VALID_FLAG
  9589. * Bit 20
  9590. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9591. * is valid.
  9592. * - AST_INDEX_1
  9593. * Bits 15:0
  9594. * Purpose: indicate the second AST index for this peer
  9595. * - AST_0_FLOW_MASK
  9596. * Bits 19:16
  9597. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9598. * - AST_1_FLOW_MASK
  9599. * Bits 23:20
  9600. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9601. * - AST_2_FLOW_MASK
  9602. * Bits 27:24
  9603. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9604. * - AST_3_FLOW_MASK
  9605. * Bits 31:28
  9606. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9607. * - AST_INDEX_2
  9608. * Bits 15:0
  9609. * Purpose: indicate the third AST index for this peer
  9610. * - TID_VALID_HI_PRI
  9611. * Bits 23:16
  9612. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9613. * - TID_VALID_LOW_PRI
  9614. * Bits 31:24
  9615. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9616. * - AST_INDEX_3
  9617. * Bits 15:0
  9618. * Purpose: indicate the fourth AST index for this peer
  9619. * - ONCHIP_AST_IDX / RESERVED
  9620. * Bits 31:16
  9621. * Purpose: This field is valid only when split AST feature is enabled.
  9622. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9623. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9624. * address, this ast_idx is used for LMAC modules for RXPCU.
  9625. * Value: ID used by the LMAC HW to identify the peer
  9626. */
  9627. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9628. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9629. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9630. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9631. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9632. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9633. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9634. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9635. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9636. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9637. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9638. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9639. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9640. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9641. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9642. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9643. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9644. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9645. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9646. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9647. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9648. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9649. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9650. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9651. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9652. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9653. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9654. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9655. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9656. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9657. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9658. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9659. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9660. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9661. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9662. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9663. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9664. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9665. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9666. do { \
  9667. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9668. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9669. } while (0)
  9670. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9671. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9672. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9673. do { \
  9674. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9675. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9676. } while (0)
  9677. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9678. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9679. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9680. do { \
  9681. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9682. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9683. } while (0)
  9684. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9685. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9686. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9687. do { \
  9688. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9689. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9690. } while (0)
  9691. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9692. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9693. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9694. do { \
  9695. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9696. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9697. } while (0)
  9698. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9699. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9700. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9701. do { \
  9702. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9703. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9704. } while (0)
  9705. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9706. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9707. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9708. do { \
  9709. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9710. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9711. } while (0)
  9712. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9713. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9714. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9715. do { \
  9716. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9717. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9718. } while (0)
  9719. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9720. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9721. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9722. do { \
  9723. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9724. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9725. } while (0)
  9726. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9727. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9728. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9729. do { \
  9730. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9731. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9732. } while (0)
  9733. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9734. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9735. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9736. do { \
  9737. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9738. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9739. } while (0)
  9740. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9741. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9742. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9743. do { \
  9744. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9745. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9746. } while (0)
  9747. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9748. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9749. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9752. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9753. } while (0)
  9754. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9755. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9756. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9757. do { \
  9758. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9759. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9760. } while (0)
  9761. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9762. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9763. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9764. do { \
  9765. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9766. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9767. } while (0)
  9768. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9769. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9770. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9771. do { \
  9772. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9773. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9774. } while (0)
  9775. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9776. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9777. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9778. do { \
  9779. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9780. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9781. } while (0)
  9782. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9783. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9784. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9785. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9786. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9787. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9788. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9789. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9790. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9791. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9792. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9793. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9794. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9795. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9796. /**
  9797. * @brief target -> host rx peer map V3 message definition
  9798. *
  9799. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9800. *
  9801. * @details
  9802. * The following diagram shows the format of the rx peer map v3 message sent
  9803. * from the target to the host.
  9804. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9805. * This layout assumes the target operates as little-endian.
  9806. *
  9807. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9808. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9809. * | SW peer ID | VDEV ID | msg type |
  9810. * |-----------------+--------------------+-----------------+-----------------|
  9811. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9812. * |-----------------+--------------------+-----------------+-----------------|
  9813. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9814. * |-----------------+--------+-----------+-----------------+-----------------|
  9815. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9816. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9817. * | (8bits) | | (4bits) | |
  9818. * |-----------------+--------+--+--+--+--------------------------------------|
  9819. * | RESERVED |E |O | | |
  9820. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9821. * | |V |V | | |
  9822. * |-----------------+--------------------+-----------------------------------|
  9823. * | HTT_MSDU_IDX_ | RESERVED | |
  9824. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9825. * | (8bits) | | |
  9826. * |-----------------+--------------------+-----------------------------------|
  9827. * | Reserved_2 |
  9828. * |--------------------------------------------------------------------------|
  9829. * | Reserved_3 |
  9830. * |--------------------------------------------------------------------------|
  9831. *
  9832. * Where:
  9833. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9834. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9835. * NH = Next Hop
  9836. * The following field definitions describe the format of the rx peer map v3
  9837. * messages sent from the target to the host.
  9838. * - MSG_TYPE
  9839. * Bits 7:0
  9840. * Purpose: identifies this as a peer map v3 message
  9841. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9842. * - VDEV_ID
  9843. * Bits 15:8
  9844. * Purpose: Indicates which virtual device the peer is associated with.
  9845. * - SW_PEER_ID
  9846. * Bits 31:16
  9847. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9848. * - MAC_ADDR_L32
  9849. * Bits 31:0
  9850. * Purpose: Identifies which peer node the peer ID is for.
  9851. * Value: lower 4 bytes of peer node's MAC address
  9852. * - MAC_ADDR_U16
  9853. * Bits 15:0
  9854. * Purpose: Identifies which peer node the peer ID is for.
  9855. * Value: upper 2 bytes of peer node's MAC address
  9856. * - MULTICAST_SW_PEER_ID
  9857. * Bits 31:16
  9858. * Purpose: The multicast peer ID (index)
  9859. * Value: set to HTT_INVALID_PEER if not valid
  9860. * - HW_PEER_ID / AST_INDEX
  9861. * Bits 15:0
  9862. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9863. * address, so for rx frames marked for rx --> tx forwarding, the
  9864. * host can determine from the HW peer ID provided as meta-data with
  9865. * the rx frame which peer the frame is supposed to be forwarded to.
  9866. * - CACHE_SET_NUM
  9867. * Bits 19:16
  9868. * Purpose: Cache Set Number for AST_INDEX
  9869. * Cache set number that should be used to cache the index based
  9870. * search results, for address and flow search.
  9871. * This value should be equal to LSB 4 bits of the hash value
  9872. * of match data, in case of search index points to an entry which
  9873. * may be used in content based search also. The value can be
  9874. * anything when the entry pointed by search index will not be
  9875. * used for content based search.
  9876. * - HTT_MSDU_IDX_VALID_MASK
  9877. * Bits 31:24
  9878. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9879. * - ONCHIP_AST_IDX / RESERVED
  9880. * Bits 15:0
  9881. * Purpose: This field is valid only when split AST feature is enabled.
  9882. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9883. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9884. * address, this ast_idx is used for LMAC modules for RXPCU.
  9885. * - NEXT_HOP
  9886. * Bits 16
  9887. * Purpose: Flag indicates next_hop AST entry used for WDS
  9888. * (Wireless Distribution System).
  9889. * - ONCHIP_AST_VALID
  9890. * Bits 17
  9891. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9892. * - EXT_AST_VALID
  9893. * Bits 18
  9894. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9895. * - EXT_AST_INDEX
  9896. * Bits 15:0
  9897. * Purpose: This field describes Extended AST index
  9898. * Valid if EXT_AST_VALID flag set
  9899. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9900. * Bits 31:24
  9901. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9902. */
  9903. /* dword 0 */
  9904. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9905. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9906. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9907. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9908. /* dword 1 */
  9909. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9910. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9911. /* dword 2 */
  9912. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9913. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9914. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9915. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9916. /* dword 3 */
  9917. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9918. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9919. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9920. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9921. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9922. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9923. /* dword 4 */
  9924. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9925. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9926. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9927. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9928. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9929. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9930. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9931. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9932. /* dword 5 */
  9933. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9934. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9935. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9936. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9937. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9940. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9941. } while (0)
  9942. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9943. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9944. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9945. do { \
  9946. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9947. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9948. } while (0)
  9949. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9950. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9951. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9952. do { \
  9953. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9954. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9955. } while (0)
  9956. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9957. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9958. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9959. do { \
  9960. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9961. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9962. } while (0)
  9963. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9964. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9965. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9966. do { \
  9967. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9968. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9969. } while (0)
  9970. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9971. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9972. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9973. do { \
  9974. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9975. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9976. } while (0)
  9977. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9978. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9979. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9980. do { \
  9981. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9982. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9983. } while (0)
  9984. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9985. (((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)
  9986. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9989. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9990. } while (0)
  9991. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9992. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9993. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9994. do { \
  9995. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9996. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9997. } while (0)
  9998. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9999. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10000. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10003. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10004. } while (0)
  10005. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10006. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10007. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10008. do { \
  10009. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10010. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10011. } while (0)
  10012. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10013. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10014. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10017. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10018. } while (0)
  10019. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10020. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10021. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10024. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10025. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10026. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10027. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10028. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10029. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10030. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10031. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10032. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10033. /**
  10034. * @brief target -> host rx peer unmap V2 message definition
  10035. *
  10036. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10037. *
  10038. * The following diagram shows the format of the rx peer unmap message sent
  10039. * from the target to the host.
  10040. *
  10041. * |31 24|23 16|15 8|7 0|
  10042. * |-----------------------------------------------------------------------|
  10043. * | SW peer ID | VDEV ID | msg type |
  10044. * |-----------------------------------------------------------------------|
  10045. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10046. * |-----------------------------------------------------------------------|
  10047. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10048. * |-----------------------------------------------------------------------|
  10049. * | Peer Delete Duration |
  10050. * |-----------------------------------------------------------------------|
  10051. * | Reserved_0 | WDS Free Count |
  10052. * |-----------------------------------------------------------------------|
  10053. * | Reserved_1 |
  10054. * |-----------------------------------------------------------------------|
  10055. * | Reserved_2 |
  10056. * |-----------------------------------------------------------------------|
  10057. *
  10058. *
  10059. * The following field definitions describe the format of the rx peer unmap
  10060. * messages sent from the target to the host.
  10061. * - MSG_TYPE
  10062. * Bits 7:0
  10063. * Purpose: identifies this as an rx peer unmap v2 message
  10064. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10065. * - VDEV_ID
  10066. * Bits 15:8
  10067. * Purpose: Indicates which virtual device the peer is associated
  10068. * with.
  10069. * Value: vdev ID (used in the host to look up the vdev object)
  10070. * - SW_PEER_ID
  10071. * Bits 31:16
  10072. * Purpose: The peer ID (index) that WAL is freeing
  10073. * Value: (rx) peer ID
  10074. * - MAC_ADDR_L32
  10075. * Bits 31:0
  10076. * Purpose: Identifies which peer node the peer ID is for.
  10077. * Value: lower 4 bytes of peer node's MAC address
  10078. * - MAC_ADDR_U16
  10079. * Bits 15:0
  10080. * Purpose: Identifies which peer node the peer ID is for.
  10081. * Value: upper 2 bytes of peer node's MAC address
  10082. * - NEXT_HOP
  10083. * Bits 16
  10084. * Purpose: Bit indicates next_hop AST entry used for WDS
  10085. * (Wireless Distribution System).
  10086. * - PEER_DELETE_DURATION
  10087. * Bits 31:0
  10088. * Purpose: Time taken to delete peer, in msec,
  10089. * Used for monitoring / debugging PEER delete response delay
  10090. * - PEER_WDS_FREE_COUNT
  10091. * Bits 15:0
  10092. * Purpose: Count of WDS entries deleted associated to peer deleted
  10093. */
  10094. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10095. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10096. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10097. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10098. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10099. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10100. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10101. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10102. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10103. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10104. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10105. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10106. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10107. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10108. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10109. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10110. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10111. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10112. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10113. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10114. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10115. do { \
  10116. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10117. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10118. } while (0)
  10119. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10120. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10121. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10122. do { \
  10123. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10124. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10125. } while (0)
  10126. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10127. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10128. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10129. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10130. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10131. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10132. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10133. /**
  10134. * @brief target -> host rx peer mlo map message definition
  10135. *
  10136. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10137. *
  10138. * @details
  10139. * The following diagram shows the format of the rx mlo peer map message sent
  10140. * from the target to the host. This layout assumes the target operates
  10141. * as little-endian.
  10142. *
  10143. * MCC:
  10144. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10145. *
  10146. * WIN:
  10147. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10148. * It will be sent on the Assoc Link.
  10149. *
  10150. * This message always contains a MLO peer ID. The main purpose of the
  10151. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10152. * with, so that the host can use that MLO peer ID to determine which peer
  10153. * transmitted the rx frame.
  10154. *
  10155. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10156. * |-------------------------------------------------------------------------|
  10157. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10158. * |-------------------------------------------------------------------------|
  10159. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10160. * |-------------------------------------------------------------------------|
  10161. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10162. * |-------------------------------------------------------------------------|
  10163. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10164. * |-------------------------------------------------------------------------|
  10165. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10166. * |-------------------------------------------------------------------------|
  10167. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10168. * |-------------------------------------------------------------------------|
  10169. * |RSVD |
  10170. * |-------------------------------------------------------------------------|
  10171. * |RSVD |
  10172. * |-------------------------------------------------------------------------|
  10173. * | htt_tlv_hdr_t |
  10174. * |-------------------------------------------------------------------------|
  10175. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10176. * |-------------------------------------------------------------------------|
  10177. * | htt_tlv_hdr_t |
  10178. * |-------------------------------------------------------------------------|
  10179. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10180. * |-------------------------------------------------------------------------|
  10181. * | htt_tlv_hdr_t |
  10182. * |-------------------------------------------------------------------------|
  10183. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10184. * |-------------------------------------------------------------------------|
  10185. *
  10186. * Where:
  10187. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10188. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10189. * V (valid) - 1 Bit Bit17
  10190. * CHIPID - 3 Bits
  10191. * TIDMASK - 8 Bits
  10192. * CACHE_SET_NUM - 8 Bits
  10193. *
  10194. * The following field definitions describe the format of the rx MLO peer map
  10195. * messages sent from the target to the host.
  10196. * - MSG_TYPE
  10197. * Bits 7:0
  10198. * Purpose: identifies this as an rx mlo peer map message
  10199. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10200. *
  10201. * - MLO_PEER_ID
  10202. * Bits 23:8
  10203. * Purpose: The MLO peer ID (index).
  10204. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10205. * Value: MLO peer ID
  10206. *
  10207. * - NUMLINK
  10208. * Bits: 26:24 (3Bits)
  10209. * Purpose: Indicate the max number of logical links supported per client.
  10210. * Value: number of logical links
  10211. *
  10212. * - PRC
  10213. * Bits: 29:27 (3Bits)
  10214. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10215. * if there is migration of the primary chip.
  10216. * Value: Primary REO CHIPID
  10217. *
  10218. * - MAC_ADDR_L32
  10219. * Bits 31:0
  10220. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10221. * Value: lower 4 bytes of peer node's MAC address
  10222. *
  10223. * - MAC_ADDR_U16
  10224. * Bits 15:0
  10225. * Purpose: Identifies which peer node the peer ID is for.
  10226. * Value: upper 2 bytes of peer node's MAC address
  10227. *
  10228. * - PRIMARY_TCL_AST_IDX
  10229. * Bits 15:0
  10230. * Purpose: Primary TCL AST index for this peer.
  10231. *
  10232. * - V
  10233. * 1 Bit Position 16
  10234. * Purpose: If the ast idx is valid.
  10235. *
  10236. * - CHIPID
  10237. * Bits 19:17
  10238. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10239. *
  10240. * - TIDMASK
  10241. * Bits 27:20
  10242. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10243. *
  10244. * - CACHE_SET_NUM
  10245. * Bits 31:28
  10246. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10247. * Cache set number that should be used to cache the index based
  10248. * search results, for address and flow search.
  10249. * This value should be equal to LSB four bits of the hash value
  10250. * of match data, in case of search index points to an entry which
  10251. * may be used in content based search also. The value can be
  10252. * anything when the entry pointed by search index will not be
  10253. * used for content based search.
  10254. *
  10255. * - htt_tlv_hdr_t
  10256. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10257. *
  10258. * Bits 11:0
  10259. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10260. *
  10261. * Bits 23:12
  10262. * Purpose: Length, Length of the value that follows the header
  10263. *
  10264. * Bits 31:28
  10265. * Purpose: Reserved.
  10266. *
  10267. *
  10268. * - SW_PEER_ID
  10269. * Bits 15:0
  10270. * Purpose: The peer ID (index) that WAL is allocating
  10271. * Value: (rx) peer ID
  10272. *
  10273. * - VDEV_ID
  10274. * Bits 23:16
  10275. * Purpose: Indicates which virtual device the peer is associated with.
  10276. * Value: vdev ID (used in the host to look up the vdev object)
  10277. *
  10278. * - CHIPID
  10279. * Bits 26:24
  10280. * Purpose: Indicates which Chip id the peer is associated with.
  10281. * Value: chip ID (Provided by Host as part of QMI exchange)
  10282. */
  10283. typedef enum {
  10284. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10285. } MLO_PEER_MAP_TLV_TAG_ID;
  10286. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10287. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10288. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10289. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10290. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10291. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10292. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10293. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10294. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10295. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10296. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10297. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10298. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10299. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10300. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10301. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10302. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10303. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10304. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10305. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10306. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10307. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10308. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10309. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10310. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10311. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10312. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10313. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10314. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10315. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10316. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10317. do { \
  10318. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10319. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10320. } while (0)
  10321. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10322. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10323. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10326. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10327. } while (0)
  10328. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10329. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10330. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10331. do { \
  10332. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10333. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10334. } while (0)
  10335. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10336. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10337. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10338. do { \
  10339. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10340. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10341. } while (0)
  10342. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10343. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10344. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10345. do { \
  10346. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10347. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10348. } while (0)
  10349. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10350. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10351. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10352. do { \
  10353. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10354. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10355. } while (0)
  10356. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10357. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10358. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10361. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10362. } while (0)
  10363. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10364. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10365. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10366. do { \
  10367. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10368. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10369. } while (0)
  10370. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10371. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10372. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10373. do { \
  10374. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10375. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10376. } while (0)
  10377. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10378. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10379. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10382. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10383. } while (0)
  10384. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10385. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10386. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10389. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10390. } while (0)
  10391. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10392. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10393. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10394. do { \
  10395. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10396. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10397. } while (0)
  10398. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10399. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10400. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10401. do { \
  10402. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10403. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10404. } while (0)
  10405. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10406. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10407. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10408. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10409. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10410. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10411. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10412. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10413. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10414. *
  10415. * The following diagram shows the format of the rx mlo peer unmap message sent
  10416. * from the target to the host.
  10417. *
  10418. * |31 24|23 16|15 8|7 0|
  10419. * |-----------------------------------------------------------------------|
  10420. * | RSVD_24_31 | MLO peer ID | msg type |
  10421. * |-----------------------------------------------------------------------|
  10422. */
  10423. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10424. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10425. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10426. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10427. /**
  10428. * @brief target -> host message specifying security parameters
  10429. *
  10430. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10431. *
  10432. * @details
  10433. * The following diagram shows the format of the security specification
  10434. * message sent from the target to the host.
  10435. * This security specification message tells the host whether a PN check is
  10436. * necessary on rx data frames, and if so, how large the PN counter is.
  10437. * This message also tells the host about the security processing to apply
  10438. * to defragmented rx frames - specifically, whether a Message Integrity
  10439. * Check is required, and the Michael key to use.
  10440. *
  10441. * |31 24|23 16|15|14 8|7 0|
  10442. * |-----------------------------------------------------------------------|
  10443. * | peer ID | U| security type | msg type |
  10444. * |-----------------------------------------------------------------------|
  10445. * | Michael Key K0 |
  10446. * |-----------------------------------------------------------------------|
  10447. * | Michael Key K1 |
  10448. * |-----------------------------------------------------------------------|
  10449. * | WAPI RSC Low0 |
  10450. * |-----------------------------------------------------------------------|
  10451. * | WAPI RSC Low1 |
  10452. * |-----------------------------------------------------------------------|
  10453. * | WAPI RSC Hi0 |
  10454. * |-----------------------------------------------------------------------|
  10455. * | WAPI RSC Hi1 |
  10456. * |-----------------------------------------------------------------------|
  10457. *
  10458. * The following field definitions describe the format of the security
  10459. * indication message sent from the target to the host.
  10460. * - MSG_TYPE
  10461. * Bits 7:0
  10462. * Purpose: identifies this as a security specification message
  10463. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10464. * - SEC_TYPE
  10465. * Bits 14:8
  10466. * Purpose: specifies which type of security applies to the peer
  10467. * Value: htt_sec_type enum value
  10468. * - UNICAST
  10469. * Bit 15
  10470. * Purpose: whether this security is applied to unicast or multicast data
  10471. * Value: 1 -> unicast, 0 -> multicast
  10472. * - PEER_ID
  10473. * Bits 31:16
  10474. * Purpose: The ID number for the peer the security specification is for
  10475. * Value: peer ID
  10476. * - MICHAEL_KEY_K0
  10477. * Bits 31:0
  10478. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10479. * Value: Michael Key K0 (if security type is TKIP)
  10480. * - MICHAEL_KEY_K1
  10481. * Bits 31:0
  10482. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10483. * Value: Michael Key K1 (if security type is TKIP)
  10484. * - WAPI_RSC_LOW0
  10485. * Bits 31:0
  10486. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10487. * Value: WAPI RSC Low0 (if security type is WAPI)
  10488. * - WAPI_RSC_LOW1
  10489. * Bits 31:0
  10490. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10491. * Value: WAPI RSC Low1 (if security type is WAPI)
  10492. * - WAPI_RSC_HI0
  10493. * Bits 31:0
  10494. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10495. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10496. * - WAPI_RSC_HI1
  10497. * Bits 31:0
  10498. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10499. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10500. */
  10501. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10502. #define HTT_SEC_IND_SEC_TYPE_S 8
  10503. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10504. #define HTT_SEC_IND_UNICAST_S 15
  10505. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10506. #define HTT_SEC_IND_PEER_ID_S 16
  10507. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10508. do { \
  10509. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10510. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10511. } while (0)
  10512. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10513. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10514. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10515. do { \
  10516. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10517. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10518. } while (0)
  10519. #define HTT_SEC_IND_UNICAST_GET(word) \
  10520. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10521. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10522. do { \
  10523. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10524. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10525. } while (0)
  10526. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10527. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10528. #define HTT_SEC_IND_BYTES 28
  10529. /**
  10530. * @brief target -> host rx ADDBA / DELBA message definitions
  10531. *
  10532. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10533. *
  10534. * @details
  10535. * The following diagram shows the format of the rx ADDBA message sent
  10536. * from the target to the host:
  10537. *
  10538. * |31 20|19 16|15 8|7 0|
  10539. * |---------------------------------------------------------------------|
  10540. * | peer ID | TID | window size | msg type |
  10541. * |---------------------------------------------------------------------|
  10542. *
  10543. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10544. *
  10545. * The following diagram shows the format of the rx DELBA message sent
  10546. * from the target to the host:
  10547. *
  10548. * |31 20|19 16|15 10|9 8|7 0|
  10549. * |---------------------------------------------------------------------|
  10550. * | peer ID | TID | window size | IR| msg type |
  10551. * |---------------------------------------------------------------------|
  10552. *
  10553. * The following field definitions describe the format of the rx ADDBA
  10554. * and DELBA messages sent from the target to the host.
  10555. * - MSG_TYPE
  10556. * Bits 7:0
  10557. * Purpose: identifies this as an rx ADDBA or DELBA message
  10558. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10559. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10560. * - IR (initiator / recipient)
  10561. * Bits 9:8 (DELBA only)
  10562. * Purpose: specify whether the DELBA handshake was initiated by the
  10563. * local STA/AP, or by the peer STA/AP
  10564. * Value:
  10565. * 0 - unspecified
  10566. * 1 - initiator (a.k.a. originator)
  10567. * 2 - recipient (a.k.a. responder)
  10568. * 3 - unused / reserved
  10569. * - WIN_SIZE
  10570. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10571. * Purpose: Specifies the length of the block ack window (max = 64).
  10572. * Value:
  10573. * block ack window length specified by the received ADDBA/DELBA
  10574. * management message.
  10575. * - TID
  10576. * Bits 19:16
  10577. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10578. * Value:
  10579. * TID specified by the received ADDBA or DELBA management message.
  10580. * - PEER_ID
  10581. * Bits 31:20
  10582. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10583. * Value:
  10584. * ID (hash value) used by the host for fast, direct lookup of
  10585. * host SW peer info, including rx reorder states.
  10586. */
  10587. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10588. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10589. #define HTT_RX_ADDBA_TID_M 0xf0000
  10590. #define HTT_RX_ADDBA_TID_S 16
  10591. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10592. #define HTT_RX_ADDBA_PEER_ID_S 20
  10593. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10596. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10597. } while (0)
  10598. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10599. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10600. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10603. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10604. } while (0)
  10605. #define HTT_RX_ADDBA_TID_GET(word) \
  10606. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10607. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10608. do { \
  10609. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10610. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10611. } while (0)
  10612. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10613. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10614. #define HTT_RX_ADDBA_BYTES 4
  10615. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10616. #define HTT_RX_DELBA_INITIATOR_S 8
  10617. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10618. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10619. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10620. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10621. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10622. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10623. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10624. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10625. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10626. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10627. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10628. do { \
  10629. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10630. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10631. } while (0)
  10632. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10633. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10634. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10635. do { \
  10636. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10637. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10638. } while (0)
  10639. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10640. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10641. #define HTT_RX_DELBA_BYTES 4
  10642. /**
  10643. * @brief tx queue group information element definition
  10644. *
  10645. * @details
  10646. * The following diagram shows the format of the tx queue group
  10647. * information element, which can be included in target --> host
  10648. * messages to specify the number of tx "credits" (tx descriptors
  10649. * for LL, or tx buffers for HL) available to a particular group
  10650. * of host-side tx queues, and which host-side tx queues belong to
  10651. * the group.
  10652. *
  10653. * |31|30 24|23 16|15|14|13 0|
  10654. * |------------------------------------------------------------------------|
  10655. * | X| reserved | tx queue grp ID | A| S| credit count |
  10656. * |------------------------------------------------------------------------|
  10657. * | vdev ID mask | AC mask |
  10658. * |------------------------------------------------------------------------|
  10659. *
  10660. * The following definitions describe the fields within the tx queue group
  10661. * information element:
  10662. * - credit_count
  10663. * Bits 13:1
  10664. * Purpose: specify how many tx credits are available to the tx queue group
  10665. * Value: An absolute or relative, positive or negative credit value
  10666. * The 'A' bit specifies whether the value is absolute or relative.
  10667. * The 'S' bit specifies whether the value is positive or negative.
  10668. * A negative value can only be relative, not absolute.
  10669. * An absolute value replaces any prior credit value the host has for
  10670. * the tx queue group in question.
  10671. * A relative value is added to the prior credit value the host has for
  10672. * the tx queue group in question.
  10673. * - sign
  10674. * Bit 14
  10675. * Purpose: specify whether the credit count is positive or negative
  10676. * Value: 0 -> positive, 1 -> negative
  10677. * - absolute
  10678. * Bit 15
  10679. * Purpose: specify whether the credit count is absolute or relative
  10680. * Value: 0 -> relative, 1 -> absolute
  10681. * - txq_group_id
  10682. * Bits 23:16
  10683. * Purpose: indicate which tx queue group's credit and/or membership are
  10684. * being specified
  10685. * Value: 0 to max_tx_queue_groups-1
  10686. * - reserved
  10687. * Bits 30:16
  10688. * Value: 0x0
  10689. * - eXtension
  10690. * Bit 31
  10691. * Purpose: specify whether another tx queue group info element follows
  10692. * Value: 0 -> no more tx queue group information elements
  10693. * 1 -> another tx queue group information element immediately follows
  10694. * - ac_mask
  10695. * Bits 15:0
  10696. * Purpose: specify which Access Categories belong to the tx queue group
  10697. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10698. * the tx queue group.
  10699. * The AC bit-mask values are obtained by left-shifting by the
  10700. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10701. * - vdev_id_mask
  10702. * Bits 31:16
  10703. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10704. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10705. * belong to the tx queue group.
  10706. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10707. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10708. */
  10709. PREPACK struct htt_txq_group {
  10710. A_UINT32
  10711. credit_count: 14,
  10712. sign: 1,
  10713. absolute: 1,
  10714. tx_queue_group_id: 8,
  10715. reserved0: 7,
  10716. extension: 1;
  10717. A_UINT32
  10718. ac_mask: 16,
  10719. vdev_id_mask: 16;
  10720. } POSTPACK;
  10721. /* first word */
  10722. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10723. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10724. #define HTT_TXQ_GROUP_SIGN_S 14
  10725. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10726. #define HTT_TXQ_GROUP_ABS_S 15
  10727. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10728. #define HTT_TXQ_GROUP_ID_S 16
  10729. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10730. #define HTT_TXQ_GROUP_EXT_S 31
  10731. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10732. /* second word */
  10733. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10734. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10735. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10736. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10737. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10738. do { \
  10739. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10740. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10741. } while (0)
  10742. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10743. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10744. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10745. do { \
  10746. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10747. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10748. } while (0)
  10749. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10750. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10751. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10752. do { \
  10753. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10754. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10755. } while (0)
  10756. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10757. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10758. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10759. do { \
  10760. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10761. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10762. } while (0)
  10763. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10764. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10765. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10766. do { \
  10767. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10768. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10769. } while (0)
  10770. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10771. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10772. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10773. do { \
  10774. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10775. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10776. } while (0)
  10777. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10778. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10779. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10780. do { \
  10781. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10782. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10783. } while (0)
  10784. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10785. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10786. /**
  10787. * @brief target -> host TX completion indication message definition
  10788. *
  10789. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10790. *
  10791. * @details
  10792. * The following diagram shows the format of the TX completion indication sent
  10793. * from the target to the host
  10794. *
  10795. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10796. * |-------------------------------------------------------------------|
  10797. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10798. * |-------------------------------------------------------------------|
  10799. * payload:| MSDU1 ID | MSDU0 ID |
  10800. * |-------------------------------------------------------------------|
  10801. * : MSDU3 ID | MSDU2 ID :
  10802. * |-------------------------------------------------------------------|
  10803. * | struct htt_tx_compl_ind_append_retries |
  10804. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10805. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10806. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10807. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10808. * |-------------------------------------------------------------------|
  10809. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10810. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10811. * | MSDU0 tx_tsf64_low |
  10812. * |-------------------------------------------------------------------|
  10813. * | MSDU0 tx_tsf64_high |
  10814. * |-------------------------------------------------------------------|
  10815. * | MSDU1 tx_tsf64_low |
  10816. * |-------------------------------------------------------------------|
  10817. * | MSDU1 tx_tsf64_high |
  10818. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10819. * | phy_timestamp |
  10820. * |-------------------------------------------------------------------|
  10821. * | rate specs (see below) |
  10822. * |-------------------------------------------------------------------|
  10823. * | seqctrl | framectrl |
  10824. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10825. * Where:
  10826. * A0 = append (a.k.a. append0)
  10827. * A1 = append1
  10828. * TP = MSDU tx power presence
  10829. * A2 = append2
  10830. * A3 = append3
  10831. * A4 = append4
  10832. *
  10833. * The following field definitions describe the format of the TX completion
  10834. * indication sent from the target to the host
  10835. * Header fields:
  10836. * - msg_type
  10837. * Bits 7:0
  10838. * Purpose: identifies this as HTT TX completion indication
  10839. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10840. * - status
  10841. * Bits 10:8
  10842. * Purpose: the TX completion status of payload fragmentations descriptors
  10843. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10844. * - tid
  10845. * Bits 14:11
  10846. * Purpose: the tid associated with those fragmentation descriptors. It is
  10847. * valid or not, depending on the tid_invalid bit.
  10848. * Value: 0 to 15
  10849. * - tid_invalid
  10850. * Bits 15:15
  10851. * Purpose: this bit indicates whether the tid field is valid or not
  10852. * Value: 0 indicates valid; 1 indicates invalid
  10853. * - num
  10854. * Bits 23:16
  10855. * Purpose: the number of payload in this indication
  10856. * Value: 1 to 255
  10857. * - append (a.k.a. append0)
  10858. * Bits 24:24
  10859. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10860. * the number of tx retries for one MSDU at the end of this message
  10861. * Value: 0 indicates no appending; 1 indicates appending
  10862. * - append1
  10863. * Bits 25:25
  10864. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10865. * contains the timestamp info for each TX msdu id in payload.
  10866. * The order of the timestamps matches the order of the MSDU IDs.
  10867. * Note that a big-endian host needs to account for the reordering
  10868. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10869. * conversion) when determining which tx timestamp corresponds to
  10870. * which MSDU ID.
  10871. * Value: 0 indicates no appending; 1 indicates appending
  10872. * - msdu_tx_power_presence
  10873. * Bits 26:26
  10874. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10875. * for each MSDU referenced by the TX_COMPL_IND message.
  10876. * The tx power is reported in 0.5 dBm units.
  10877. * The order of the per-MSDU tx power reports matches the order
  10878. * of the MSDU IDs.
  10879. * Note that a big-endian host needs to account for the reordering
  10880. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10881. * conversion) when determining which Tx Power corresponds to
  10882. * which MSDU ID.
  10883. * Value: 0 indicates MSDU tx power reports are not appended,
  10884. * 1 indicates MSDU tx power reports are appended
  10885. * - append2
  10886. * Bits 27:27
  10887. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10888. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10889. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10890. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10891. * for each MSDU, for convenience.
  10892. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10893. * this append2 bit is set).
  10894. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10895. * dB above the noise floor.
  10896. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10897. * 1 indicates MSDU ACK RSSI values are appended.
  10898. * - append3
  10899. * Bits 28:28
  10900. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10901. * contains the tx tsf info based on wlan global TSF for
  10902. * each TX msdu id in payload.
  10903. * The order of the tx tsf matches the order of the MSDU IDs.
  10904. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10905. * values to indicate the the lower 32 bits and higher 32 bits of
  10906. * the tx tsf.
  10907. * The tx_tsf64 here represents the time MSDU was acked and the
  10908. * tx_tsf64 has microseconds units.
  10909. * Value: 0 indicates no appending; 1 indicates appending
  10910. * - append4
  10911. * Bits 29:29
  10912. * Purpose: Indicate whether data frame control fields and fields required
  10913. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10914. * message. The order of the this message matches the order of
  10915. * the MSDU IDs.
  10916. * Value: 0 indicates frame control fields and fields required for
  10917. * radio tap header values are not appended,
  10918. * 1 indicates frame control fields and fields required for
  10919. * radio tap header values are appended.
  10920. * Payload fields:
  10921. * - hmsdu_id
  10922. * Bits 15:0
  10923. * Purpose: this ID is used to track the Tx buffer in host
  10924. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10925. */
  10926. PREPACK struct htt_tx_data_hdr_information {
  10927. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10928. A_UINT32 /* word 1 */
  10929. /* preamble:
  10930. * 0-OFDM,
  10931. * 1-CCk,
  10932. * 2-HT,
  10933. * 3-VHT
  10934. */
  10935. preamble: 2, /* [1:0] */
  10936. /* mcs:
  10937. * In case of HT preamble interpret
  10938. * MCS along with NSS.
  10939. * Valid values for HT are 0 to 7.
  10940. * HT mcs 0 with NSS 2 is mcs 8.
  10941. * Valid values for VHT are 0 to 9.
  10942. */
  10943. mcs: 4, /* [5:2] */
  10944. /* rate:
  10945. * This is applicable only for
  10946. * CCK and OFDM preamble type
  10947. * rate 0: OFDM 48 Mbps,
  10948. * 1: OFDM 24 Mbps,
  10949. * 2: OFDM 12 Mbps
  10950. * 3: OFDM 6 Mbps
  10951. * 4: OFDM 54 Mbps
  10952. * 5: OFDM 36 Mbps
  10953. * 6: OFDM 18 Mbps
  10954. * 7: OFDM 9 Mbps
  10955. * rate 0: CCK 11 Mbps Long
  10956. * 1: CCK 5.5 Mbps Long
  10957. * 2: CCK 2 Mbps Long
  10958. * 3: CCK 1 Mbps Long
  10959. * 4: CCK 11 Mbps Short
  10960. * 5: CCK 5.5 Mbps Short
  10961. * 6: CCK 2 Mbps Short
  10962. */
  10963. rate : 3, /* [ 8: 6] */
  10964. rssi : 8, /* [16: 9] units=dBm */
  10965. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10966. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10967. stbc : 1, /* [22] */
  10968. sgi : 1, /* [23] */
  10969. ldpc : 1, /* [24] */
  10970. beamformed: 1, /* [25] */
  10971. /* tx_retry_cnt:
  10972. * Indicates retry count of data tx frames provided by the host.
  10973. */
  10974. tx_retry_cnt: 6; /* [31:26] */
  10975. A_UINT32 /* word 2 */
  10976. framectrl:16, /* [15: 0] */
  10977. seqno:16; /* [31:16] */
  10978. } POSTPACK;
  10979. #define HTT_TX_COMPL_IND_STATUS_S 8
  10980. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10981. #define HTT_TX_COMPL_IND_TID_S 11
  10982. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10983. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10984. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10985. #define HTT_TX_COMPL_IND_NUM_S 16
  10986. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10987. #define HTT_TX_COMPL_IND_APPEND_S 24
  10988. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10989. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10990. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10991. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10992. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10993. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10994. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10995. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10996. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10997. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10998. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10999. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11000. do { \
  11001. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11002. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11003. } while (0)
  11004. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11005. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11006. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11009. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11010. } while (0)
  11011. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11012. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11013. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11014. do { \
  11015. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11016. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11017. } while (0)
  11018. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11019. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11020. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11021. do { \
  11022. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11023. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11024. } while (0)
  11025. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11026. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11027. HTT_TX_COMPL_IND_TID_INV_S)
  11028. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11029. do { \
  11030. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11031. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11032. } while (0)
  11033. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11034. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11035. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11036. do { \
  11037. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11038. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11039. } while (0)
  11040. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11041. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11042. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11045. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11046. } while (0)
  11047. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11048. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11049. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11050. do { \
  11051. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11052. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11053. } while (0)
  11054. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11055. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11056. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11057. do { \
  11058. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11059. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11060. } while (0)
  11061. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11062. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11063. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11064. do { \
  11065. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11066. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11067. } while (0)
  11068. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11069. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11070. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11071. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11072. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11073. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11074. #define HTT_TX_COMPL_IND_STAT_OK 0
  11075. /* DISCARD:
  11076. * current meaning:
  11077. * MSDUs were queued for transmission but filtered by HW or SW
  11078. * without any over the air attempts
  11079. * legacy meaning (HL Rome):
  11080. * MSDUs were discarded by the target FW without any over the air
  11081. * attempts due to lack of space
  11082. */
  11083. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11084. /* NO_ACK:
  11085. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11086. */
  11087. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11088. /* POSTPONE:
  11089. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11090. * be downloaded again later (in the appropriate order), when they are
  11091. * deliverable.
  11092. */
  11093. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11094. /*
  11095. * The PEER_DEL tx completion status is used for HL cases
  11096. * where the peer the frame is for has been deleted.
  11097. * The host has already discarded its copy of the frame, but
  11098. * it still needs the tx completion to restore its credit.
  11099. */
  11100. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11101. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11102. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11103. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11104. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11105. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11106. PREPACK struct htt_tx_compl_ind_base {
  11107. A_UINT32 hdr;
  11108. A_UINT16 payload[1/*or more*/];
  11109. } POSTPACK;
  11110. PREPACK struct htt_tx_compl_ind_append_retries {
  11111. A_UINT16 msdu_id;
  11112. A_UINT8 tx_retries;
  11113. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11114. 0: this is the last append_retries struct */
  11115. } POSTPACK;
  11116. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11117. A_UINT32 timestamp[1/*or more*/];
  11118. } POSTPACK;
  11119. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11120. A_UINT32 tx_tsf64_low;
  11121. A_UINT32 tx_tsf64_high;
  11122. } POSTPACK;
  11123. /* htt_tx_data_hdr_information payload extension fields: */
  11124. /* DWORD zero */
  11125. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11126. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11127. /* DWORD one */
  11128. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11129. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11130. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11131. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11132. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11133. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11134. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11135. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11136. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11137. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11138. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11139. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11140. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11141. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11142. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11143. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11144. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11145. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11146. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11147. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11148. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11149. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11150. /* DWORD two */
  11151. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11152. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11153. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11154. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11155. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11156. do { \
  11157. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11158. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11159. } while (0)
  11160. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11161. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11162. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11165. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11166. } while (0)
  11167. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11168. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11169. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11172. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11173. } while (0)
  11174. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11175. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11176. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11179. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11180. } while (0)
  11181. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11182. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11183. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11186. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11187. } while (0)
  11188. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11189. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11190. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11191. do { \
  11192. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11193. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11194. } while (0)
  11195. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11196. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11197. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11200. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11201. } while (0)
  11202. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11203. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11204. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11205. do { \
  11206. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11207. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11208. } while (0)
  11209. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11210. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11211. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11214. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11215. } while (0)
  11216. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11217. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11218. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11219. do { \
  11220. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11221. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11222. } while (0)
  11223. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11224. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11225. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11226. do { \
  11227. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11228. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11229. } while (0)
  11230. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11231. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11232. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11233. do { \
  11234. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11235. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11236. } while (0)
  11237. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11238. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11239. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11240. do { \
  11241. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11242. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11243. } while (0)
  11244. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11245. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11246. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11247. do { \
  11248. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11249. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11250. } while (0)
  11251. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11252. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11253. /**
  11254. * @brief target -> host rate-control update indication message
  11255. *
  11256. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11257. *
  11258. * @details
  11259. * The following diagram shows the format of the RC Update message
  11260. * sent from the target to the host, while processing the tx-completion
  11261. * of a transmitted PPDU.
  11262. *
  11263. * |31 24|23 16|15 8|7 0|
  11264. * |-------------------------------------------------------------|
  11265. * | peer ID | vdev ID | msg_type |
  11266. * |-------------------------------------------------------------|
  11267. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11268. * |-------------------------------------------------------------|
  11269. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11270. * |-------------------------------------------------------------|
  11271. * | : |
  11272. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11273. * | : |
  11274. * |-------------------------------------------------------------|
  11275. * | : |
  11276. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11277. * | : |
  11278. * |-------------------------------------------------------------|
  11279. * : :
  11280. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11281. *
  11282. */
  11283. typedef struct {
  11284. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11285. A_UINT32 rate_code_flags;
  11286. A_UINT32 flags; /* Encodes information such as excessive
  11287. retransmission, aggregate, some info
  11288. from .11 frame control,
  11289. STBC, LDPC, (SGI and Tx Chain Mask
  11290. are encoded in ptx_rc->flags field),
  11291. AMPDU truncation (BT/time based etc.),
  11292. RTS/CTS attempt */
  11293. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11294. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11295. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11296. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11297. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11298. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11299. } HTT_RC_TX_DONE_PARAMS;
  11300. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11301. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11302. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11303. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11304. #define HTT_RC_UPDATE_VDEVID_S 8
  11305. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11306. #define HTT_RC_UPDATE_PEERID_S 16
  11307. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11308. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11309. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11310. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11311. do { \
  11312. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11313. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11314. } while (0)
  11315. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11316. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11317. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11318. do { \
  11319. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11320. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11321. } while (0)
  11322. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11323. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11324. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11325. do { \
  11326. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11327. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11328. } while (0)
  11329. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11330. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11331. /**
  11332. * @brief target -> host rx fragment indication message definition
  11333. *
  11334. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11335. *
  11336. * @details
  11337. * The following field definitions describe the format of the rx fragment
  11338. * indication message sent from the target to the host.
  11339. * The rx fragment indication message shares the format of the
  11340. * rx indication message, but not all fields from the rx indication message
  11341. * are relevant to the rx fragment indication message.
  11342. *
  11343. *
  11344. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11345. * |-----------+-------------------+---------------------+-------------|
  11346. * | peer ID | |FV| ext TID | msg type |
  11347. * |-------------------------------------------------------------------|
  11348. * | | flush | flush |
  11349. * | | end | start |
  11350. * | | seq num | seq num |
  11351. * |-------------------------------------------------------------------|
  11352. * | reserved | FW rx desc bytes |
  11353. * |-------------------------------------------------------------------|
  11354. * | | FW MSDU Rx |
  11355. * | | desc B0 |
  11356. * |-------------------------------------------------------------------|
  11357. * Header fields:
  11358. * - MSG_TYPE
  11359. * Bits 7:0
  11360. * Purpose: identifies this as an rx fragment indication message
  11361. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11362. * - EXT_TID
  11363. * Bits 12:8
  11364. * Purpose: identify the traffic ID of the rx data, including
  11365. * special "extended" TID values for multicast, broadcast, and
  11366. * non-QoS data frames
  11367. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11368. * - FLUSH_VALID (FV)
  11369. * Bit 13
  11370. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11371. * is valid
  11372. * Value:
  11373. * 1 -> flush IE is valid and needs to be processed
  11374. * 0 -> flush IE is not valid and should be ignored
  11375. * - PEER_ID
  11376. * Bits 31:16
  11377. * Purpose: Identify, by ID, which peer sent the rx data
  11378. * Value: ID of the peer who sent the rx data
  11379. * - FLUSH_SEQ_NUM_START
  11380. * Bits 5:0
  11381. * Purpose: Indicate the start of a series of MPDUs to flush
  11382. * Not all MPDUs within this series are necessarily valid - the host
  11383. * must check each sequence number within this range to see if the
  11384. * corresponding MPDU is actually present.
  11385. * This field is only valid if the FV bit is set.
  11386. * Value:
  11387. * The sequence number for the first MPDUs to check to flush.
  11388. * The sequence number is masked by 0x3f.
  11389. * - FLUSH_SEQ_NUM_END
  11390. * Bits 11:6
  11391. * Purpose: Indicate the end of a series of MPDUs to flush
  11392. * Value:
  11393. * The sequence number one larger than the sequence number of the
  11394. * last MPDU to check to flush.
  11395. * The sequence number is masked by 0x3f.
  11396. * Not all MPDUs within this series are necessarily valid - the host
  11397. * must check each sequence number within this range to see if the
  11398. * corresponding MPDU is actually present.
  11399. * This field is only valid if the FV bit is set.
  11400. * Rx descriptor fields:
  11401. * - FW_RX_DESC_BYTES
  11402. * Bits 15:0
  11403. * Purpose: Indicate how many bytes in the Rx indication are used for
  11404. * FW Rx descriptors
  11405. * Value: 1
  11406. */
  11407. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11408. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11409. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11410. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11411. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11412. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11413. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11414. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11415. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11416. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11417. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11418. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11419. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11420. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11421. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11422. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11423. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11424. #define HTT_RX_FRAG_IND_BYTES \
  11425. (4 /* msg hdr */ + \
  11426. 4 /* flush spec */ + \
  11427. 4 /* (unused) FW rx desc bytes spec */ + \
  11428. 4 /* FW rx desc */)
  11429. /**
  11430. * @brief target -> host test message definition
  11431. *
  11432. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11433. *
  11434. * @details
  11435. * The following field definitions describe the format of the test
  11436. * message sent from the target to the host.
  11437. * The message consists of a 4-octet header, followed by a variable
  11438. * number of 32-bit integer values, followed by a variable number
  11439. * of 8-bit character values.
  11440. *
  11441. * |31 16|15 8|7 0|
  11442. * |-----------------------------------------------------------|
  11443. * | num chars | num ints | msg type |
  11444. * |-----------------------------------------------------------|
  11445. * | int 0 |
  11446. * |-----------------------------------------------------------|
  11447. * | int 1 |
  11448. * |-----------------------------------------------------------|
  11449. * | ... |
  11450. * |-----------------------------------------------------------|
  11451. * | char 3 | char 2 | char 1 | char 0 |
  11452. * |-----------------------------------------------------------|
  11453. * | | | ... | char 4 |
  11454. * |-----------------------------------------------------------|
  11455. * - MSG_TYPE
  11456. * Bits 7:0
  11457. * Purpose: identifies this as a test message
  11458. * Value: HTT_MSG_TYPE_TEST
  11459. * - NUM_INTS
  11460. * Bits 15:8
  11461. * Purpose: indicate how many 32-bit integers follow the message header
  11462. * - NUM_CHARS
  11463. * Bits 31:16
  11464. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11465. */
  11466. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11467. #define HTT_RX_TEST_NUM_INTS_S 8
  11468. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11469. #define HTT_RX_TEST_NUM_CHARS_S 16
  11470. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11471. do { \
  11472. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11473. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11474. } while (0)
  11475. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11476. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11477. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11478. do { \
  11479. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11480. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11481. } while (0)
  11482. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11483. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11484. /**
  11485. * @brief target -> host packet log message
  11486. *
  11487. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11488. *
  11489. * @details
  11490. * The following field definitions describe the format of the packet log
  11491. * message sent from the target to the host.
  11492. * The message consists of a 4-octet header,followed by a variable number
  11493. * of 32-bit character values.
  11494. *
  11495. * |31 16|15 12|11 10|9 8|7 0|
  11496. * |------------------------------------------------------------------|
  11497. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11498. * |------------------------------------------------------------------|
  11499. * | payload |
  11500. * |------------------------------------------------------------------|
  11501. * - MSG_TYPE
  11502. * Bits 7:0
  11503. * Purpose: identifies this as a pktlog message
  11504. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11505. * - mac_id
  11506. * Bits 9:8
  11507. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11508. * Value: 0-3
  11509. * - pdev_id
  11510. * Bits 11:10
  11511. * Purpose: pdev_id
  11512. * Value: 0-3
  11513. * 0 (for rings at SOC level),
  11514. * 1/2/3 PDEV -> 0/1/2
  11515. * - payload_size
  11516. * Bits 31:16
  11517. * Purpose: explicitly specify the payload size
  11518. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11519. */
  11520. PREPACK struct htt_pktlog_msg {
  11521. A_UINT32 header;
  11522. A_UINT32 payload[1/* or more */];
  11523. } POSTPACK;
  11524. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11525. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11526. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11527. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11528. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11529. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11530. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11531. do { \
  11532. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11533. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11534. } while (0)
  11535. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11536. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11537. HTT_T2H_PKTLOG_MAC_ID_S)
  11538. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11539. do { \
  11540. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11541. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11542. } while (0)
  11543. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11544. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11545. HTT_T2H_PKTLOG_PDEV_ID_S)
  11546. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11547. do { \
  11548. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11549. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11550. } while (0)
  11551. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11552. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11553. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11554. /*
  11555. * Rx reorder statistics
  11556. * NB: all the fields must be defined in 4 octets size.
  11557. */
  11558. struct rx_reorder_stats {
  11559. /* Non QoS MPDUs received */
  11560. A_UINT32 deliver_non_qos;
  11561. /* MPDUs received in-order */
  11562. A_UINT32 deliver_in_order;
  11563. /* Flush due to reorder timer expired */
  11564. A_UINT32 deliver_flush_timeout;
  11565. /* Flush due to move out of window */
  11566. A_UINT32 deliver_flush_oow;
  11567. /* Flush due to DELBA */
  11568. A_UINT32 deliver_flush_delba;
  11569. /* MPDUs dropped due to FCS error */
  11570. A_UINT32 fcs_error;
  11571. /* MPDUs dropped due to monitor mode non-data packet */
  11572. A_UINT32 mgmt_ctrl;
  11573. /* Unicast-data MPDUs dropped due to invalid peer */
  11574. A_UINT32 invalid_peer;
  11575. /* MPDUs dropped due to duplication (non aggregation) */
  11576. A_UINT32 dup_non_aggr;
  11577. /* MPDUs dropped due to processed before */
  11578. A_UINT32 dup_past;
  11579. /* MPDUs dropped due to duplicate in reorder queue */
  11580. A_UINT32 dup_in_reorder;
  11581. /* Reorder timeout happened */
  11582. A_UINT32 reorder_timeout;
  11583. /* invalid bar ssn */
  11584. A_UINT32 invalid_bar_ssn;
  11585. /* reorder reset due to bar ssn */
  11586. A_UINT32 ssn_reset;
  11587. /* Flush due to delete peer */
  11588. A_UINT32 deliver_flush_delpeer;
  11589. /* Flush due to offload*/
  11590. A_UINT32 deliver_flush_offload;
  11591. /* Flush due to out of buffer*/
  11592. A_UINT32 deliver_flush_oob;
  11593. /* MPDUs dropped due to PN check fail */
  11594. A_UINT32 pn_fail;
  11595. /* MPDUs dropped due to unable to allocate memory */
  11596. A_UINT32 store_fail;
  11597. /* Number of times the tid pool alloc succeeded */
  11598. A_UINT32 tid_pool_alloc_succ;
  11599. /* Number of times the MPDU pool alloc succeeded */
  11600. A_UINT32 mpdu_pool_alloc_succ;
  11601. /* Number of times the MSDU pool alloc succeeded */
  11602. A_UINT32 msdu_pool_alloc_succ;
  11603. /* Number of times the tid pool alloc failed */
  11604. A_UINT32 tid_pool_alloc_fail;
  11605. /* Number of times the MPDU pool alloc failed */
  11606. A_UINT32 mpdu_pool_alloc_fail;
  11607. /* Number of times the MSDU pool alloc failed */
  11608. A_UINT32 msdu_pool_alloc_fail;
  11609. /* Number of times the tid pool freed */
  11610. A_UINT32 tid_pool_free;
  11611. /* Number of times the MPDU pool freed */
  11612. A_UINT32 mpdu_pool_free;
  11613. /* Number of times the MSDU pool freed */
  11614. A_UINT32 msdu_pool_free;
  11615. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11616. A_UINT32 msdu_queued;
  11617. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11618. A_UINT32 msdu_recycled;
  11619. /* Number of MPDUs with invalid peer but A2 found in AST */
  11620. A_UINT32 invalid_peer_a2_in_ast;
  11621. /* Number of MPDUs with invalid peer but A3 found in AST */
  11622. A_UINT32 invalid_peer_a3_in_ast;
  11623. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11624. A_UINT32 invalid_peer_bmc_mpdus;
  11625. /* Number of MSDUs with err attention word */
  11626. A_UINT32 rxdesc_err_att;
  11627. /* Number of MSDUs with flag of peer_idx_invalid */
  11628. A_UINT32 rxdesc_err_peer_idx_inv;
  11629. /* Number of MSDUs with flag of peer_idx_timeout */
  11630. A_UINT32 rxdesc_err_peer_idx_to;
  11631. /* Number of MSDUs with flag of overflow */
  11632. A_UINT32 rxdesc_err_ov;
  11633. /* Number of MSDUs with flag of msdu_length_err */
  11634. A_UINT32 rxdesc_err_msdu_len;
  11635. /* Number of MSDUs with flag of mpdu_length_err */
  11636. A_UINT32 rxdesc_err_mpdu_len;
  11637. /* Number of MSDUs with flag of tkip_mic_err */
  11638. A_UINT32 rxdesc_err_tkip_mic;
  11639. /* Number of MSDUs with flag of decrypt_err */
  11640. A_UINT32 rxdesc_err_decrypt;
  11641. /* Number of MSDUs with flag of fcs_err */
  11642. A_UINT32 rxdesc_err_fcs;
  11643. /* Number of Unicast (bc_mc bit is not set in attention word)
  11644. * frames with invalid peer handler
  11645. */
  11646. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11647. /* Number of unicast frame directly (direct bit is set in attention word)
  11648. * to DUT with invalid peer handler
  11649. */
  11650. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11651. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11652. * frames with invalid peer handler
  11653. */
  11654. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11655. /* Number of MSDUs dropped due to no first MSDU flag */
  11656. A_UINT32 rxdesc_no_1st_msdu;
  11657. /* Number of MSDUs droped due to ring overflow */
  11658. A_UINT32 msdu_drop_ring_ov;
  11659. /* Number of MSDUs dropped due to FC mismatch */
  11660. A_UINT32 msdu_drop_fc_mismatch;
  11661. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11662. A_UINT32 msdu_drop_mgmt_remote_ring;
  11663. /* Number of MSDUs dropped due to errors not reported in attention word */
  11664. A_UINT32 msdu_drop_misc;
  11665. /* Number of MSDUs go to offload before reorder */
  11666. A_UINT32 offload_msdu_wal;
  11667. /* Number of data frame dropped by offload after reorder */
  11668. A_UINT32 offload_msdu_reorder;
  11669. /* Number of MPDUs with sequence number in the past and within the BA window */
  11670. A_UINT32 dup_past_within_window;
  11671. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11672. A_UINT32 dup_past_outside_window;
  11673. /* Number of MSDUs with decrypt/MIC error */
  11674. A_UINT32 rxdesc_err_decrypt_mic;
  11675. /* Number of data MSDUs received on both local and remote rings */
  11676. A_UINT32 data_msdus_on_both_rings;
  11677. /* MPDUs never filled */
  11678. A_UINT32 holes_not_filled;
  11679. };
  11680. /*
  11681. * Rx Remote buffer statistics
  11682. * NB: all the fields must be defined in 4 octets size.
  11683. */
  11684. struct rx_remote_buffer_mgmt_stats {
  11685. /* Total number of MSDUs reaped for Rx processing */
  11686. A_UINT32 remote_reaped;
  11687. /* MSDUs recycled within firmware */
  11688. A_UINT32 remote_recycled;
  11689. /* MSDUs stored by Data Rx */
  11690. A_UINT32 data_rx_msdus_stored;
  11691. /* Number of HTT indications from WAL Rx MSDU */
  11692. A_UINT32 wal_rx_ind;
  11693. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11694. A_UINT32 wal_rx_ind_unconsumed;
  11695. /* Number of HTT indications from Data Rx MSDU */
  11696. A_UINT32 data_rx_ind;
  11697. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11698. A_UINT32 data_rx_ind_unconsumed;
  11699. /* Number of HTT indications from ATHBUF */
  11700. A_UINT32 athbuf_rx_ind;
  11701. /* Number of remote buffers requested for refill */
  11702. A_UINT32 refill_buf_req;
  11703. /* Number of remote buffers filled by the host */
  11704. A_UINT32 refill_buf_rsp;
  11705. /* Number of times MAC hw_index = f/w write_index */
  11706. A_INT32 mac_no_bufs;
  11707. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11708. A_INT32 fw_indices_equal;
  11709. /* Number of times f/w finds no buffers to post */
  11710. A_INT32 host_no_bufs;
  11711. };
  11712. /*
  11713. * TXBF MU/SU packets and NDPA statistics
  11714. * NB: all the fields must be defined in 4 octets size.
  11715. */
  11716. struct rx_txbf_musu_ndpa_pkts_stats {
  11717. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11718. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11719. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11720. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11721. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11722. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11723. };
  11724. /*
  11725. * htt_dbg_stats_status -
  11726. * present - The requested stats have been delivered in full.
  11727. * This indicates that either the stats information was contained
  11728. * in its entirety within this message, or else this message
  11729. * completes the delivery of the requested stats info that was
  11730. * partially delivered through earlier STATS_CONF messages.
  11731. * partial - The requested stats have been delivered in part.
  11732. * One or more subsequent STATS_CONF messages with the same
  11733. * cookie value will be sent to deliver the remainder of the
  11734. * information.
  11735. * error - The requested stats could not be delivered, for example due
  11736. * to a shortage of memory to construct a message holding the
  11737. * requested stats.
  11738. * invalid - The requested stat type is either not recognized, or the
  11739. * target is configured to not gather the stats type in question.
  11740. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11741. * series_done - This special value indicates that no further stats info
  11742. * elements are present within a series of stats info elems
  11743. * (within a stats upload confirmation message).
  11744. */
  11745. enum htt_dbg_stats_status {
  11746. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11747. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11748. HTT_DBG_STATS_STATUS_ERROR = 2,
  11749. HTT_DBG_STATS_STATUS_INVALID = 3,
  11750. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11751. };
  11752. /**
  11753. * @brief target -> host statistics upload
  11754. *
  11755. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11756. *
  11757. * @details
  11758. * The following field definitions describe the format of the HTT target
  11759. * to host stats upload confirmation message.
  11760. * The message contains a cookie echoed from the HTT host->target stats
  11761. * upload request, which identifies which request the confirmation is
  11762. * for, and a series of tag-length-value stats information elements.
  11763. * The tag-length header for each stats info element also includes a
  11764. * status field, to indicate whether the request for the stat type in
  11765. * question was fully met, partially met, unable to be met, or invalid
  11766. * (if the stat type in question is disabled in the target).
  11767. * A special value of all 1's in this status field is used to indicate
  11768. * the end of the series of stats info elements.
  11769. *
  11770. *
  11771. * |31 16|15 8|7 5|4 0|
  11772. * |------------------------------------------------------------|
  11773. * | reserved | msg type |
  11774. * |------------------------------------------------------------|
  11775. * | cookie LSBs |
  11776. * |------------------------------------------------------------|
  11777. * | cookie MSBs |
  11778. * |------------------------------------------------------------|
  11779. * | stats entry length | reserved | S |stat type|
  11780. * |------------------------------------------------------------|
  11781. * | |
  11782. * | type-specific stats info |
  11783. * | |
  11784. * |------------------------------------------------------------|
  11785. * | stats entry length | reserved | S |stat type|
  11786. * |------------------------------------------------------------|
  11787. * | |
  11788. * | type-specific stats info |
  11789. * | |
  11790. * |------------------------------------------------------------|
  11791. * | n/a | reserved | 111 | n/a |
  11792. * |------------------------------------------------------------|
  11793. * Header fields:
  11794. * - MSG_TYPE
  11795. * Bits 7:0
  11796. * Purpose: identifies this is a statistics upload confirmation message
  11797. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11798. * - COOKIE_LSBS
  11799. * Bits 31:0
  11800. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11801. * message with its preceding host->target stats request message.
  11802. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11803. * - COOKIE_MSBS
  11804. * Bits 31:0
  11805. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11806. * message with its preceding host->target stats request message.
  11807. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11808. *
  11809. * Stats Information Element tag-length header fields:
  11810. * - STAT_TYPE
  11811. * Bits 4:0
  11812. * Purpose: identifies the type of statistics info held in the
  11813. * following information element
  11814. * Value: htt_dbg_stats_type
  11815. * - STATUS
  11816. * Bits 7:5
  11817. * Purpose: indicate whether the requested stats are present
  11818. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11819. * the completion of the stats entry series
  11820. * - LENGTH
  11821. * Bits 31:16
  11822. * Purpose: indicate the stats information size
  11823. * Value: This field specifies the number of bytes of stats information
  11824. * that follows the element tag-length header.
  11825. * It is expected but not required that this length is a multiple of
  11826. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11827. * subsequent stats entry header will begin on a 4-byte aligned
  11828. * boundary.
  11829. */
  11830. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11831. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11832. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11833. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11834. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11835. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11836. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11837. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11838. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11839. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11840. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11841. do { \
  11842. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11843. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11844. } while (0)
  11845. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11846. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11847. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11848. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11851. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11852. } while (0)
  11853. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11854. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11855. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11856. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11857. do { \
  11858. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11859. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11860. } while (0)
  11861. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11862. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11863. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11864. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11865. #define HTT_MAX_AGGR 64
  11866. #define HTT_HL_MAX_AGGR 18
  11867. /**
  11868. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11869. *
  11870. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11871. *
  11872. * @details
  11873. * The following field definitions describe the format of the HTT host
  11874. * to target frag_desc/msdu_ext bank configuration message.
  11875. * The message contains the based address and the min and max id of the
  11876. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11877. * MSDU_EXT/FRAG_DESC.
  11878. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11879. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11880. * the hardware does the mapping/translation.
  11881. *
  11882. * Total banks that can be configured is configured to 16.
  11883. *
  11884. * This should be called before any TX has be initiated by the HTT
  11885. *
  11886. * |31 16|15 8|7 5|4 0|
  11887. * |------------------------------------------------------------|
  11888. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11889. * |------------------------------------------------------------|
  11890. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11891. #if HTT_PADDR64
  11892. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11893. #endif
  11894. * |------------------------------------------------------------|
  11895. * | ... |
  11896. * |------------------------------------------------------------|
  11897. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11898. #if HTT_PADDR64
  11899. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11900. #endif
  11901. * |------------------------------------------------------------|
  11902. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11903. * |------------------------------------------------------------|
  11904. * | ... |
  11905. * |------------------------------------------------------------|
  11906. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11907. * |------------------------------------------------------------|
  11908. * Header fields:
  11909. * - MSG_TYPE
  11910. * Bits 7:0
  11911. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11912. * for systems with 64-bit format for bus addresses:
  11913. * - BANKx_BASE_ADDRESS_LO
  11914. * Bits 31:0
  11915. * Purpose: Provide a mechanism to specify the base address of the
  11916. * MSDU_EXT bank physical/bus address.
  11917. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11918. * - BANKx_BASE_ADDRESS_HI
  11919. * Bits 31:0
  11920. * Purpose: Provide a mechanism to specify the base address of the
  11921. * MSDU_EXT bank physical/bus address.
  11922. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11923. * for systems with 32-bit format for bus addresses:
  11924. * - BANKx_BASE_ADDRESS
  11925. * Bits 31:0
  11926. * Purpose: Provide a mechanism to specify the base address of the
  11927. * MSDU_EXT bank physical/bus address.
  11928. * Value: MSDU_EXT bank physical / bus address
  11929. * - BANKx_MIN_ID
  11930. * Bits 15:0
  11931. * Purpose: Provide a mechanism to specify the min index that needs to
  11932. * mapped.
  11933. * - BANKx_MAX_ID
  11934. * Bits 31:16
  11935. * Purpose: Provide a mechanism to specify the max index that needs to
  11936. * mapped.
  11937. *
  11938. */
  11939. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11940. * safe value.
  11941. * @note MAX supported banks is 16.
  11942. */
  11943. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11944. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11945. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11946. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11947. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11948. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11949. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11950. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11951. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11952. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11953. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11954. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11955. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11956. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11957. do { \
  11958. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11959. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11960. } while (0)
  11961. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11962. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11963. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11964. do { \
  11965. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11966. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11967. } while (0)
  11968. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11969. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11970. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11971. do { \
  11972. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11973. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11974. } while (0)
  11975. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11976. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11977. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11978. do { \
  11979. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11980. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11981. } while (0)
  11982. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11983. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11984. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11985. do { \
  11986. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11987. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11988. } while (0)
  11989. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11990. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11991. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11992. do { \
  11993. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11994. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11995. } while (0)
  11996. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11997. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11998. /*
  11999. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12000. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12001. * addresses are stored in a XXX-bit field.
  12002. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12003. * htt_tx_frag_desc64_bank_cfg_t structs.
  12004. */
  12005. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12006. _paddr_bits_, \
  12007. _paddr__bank_base_address_) \
  12008. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12009. /** word 0 \
  12010. * msg_type: 8, \
  12011. * pdev_id: 2, \
  12012. * swap: 1, \
  12013. * reserved0: 5, \
  12014. * num_banks: 8, \
  12015. * desc_size: 8; \
  12016. */ \
  12017. A_UINT32 word0; \
  12018. /* \
  12019. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12020. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12021. * the second A_UINT32). \
  12022. */ \
  12023. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12024. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12025. } POSTPACK
  12026. /* define htt_tx_frag_desc32_bank_cfg_t */
  12027. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12028. /* define htt_tx_frag_desc64_bank_cfg_t */
  12029. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12030. /*
  12031. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12032. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12033. */
  12034. #if HTT_PADDR64
  12035. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12036. #else
  12037. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12038. #endif
  12039. /**
  12040. * @brief target -> host HTT TX Credit total count update message definition
  12041. *
  12042. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12043. *
  12044. *|31 16|15|14 9| 8 |7 0 |
  12045. *|---------------------+--+----------+-------+----------|
  12046. *|cur htt credit delta | Q| reserved | sign | msg type |
  12047. *|------------------------------------------------------|
  12048. *
  12049. * Header fields:
  12050. * - MSG_TYPE
  12051. * Bits 7:0
  12052. * Purpose: identifies this as a htt tx credit delta update message
  12053. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12054. * - SIGN
  12055. * Bits 8
  12056. * identifies whether credit delta is positive or negative
  12057. * Value:
  12058. * - 0x0: credit delta is positive, rebalance in some buffers
  12059. * - 0x1: credit delta is negative, rebalance out some buffers
  12060. * - reserved
  12061. * Bits 14:9
  12062. * Value: 0x0
  12063. * - TXQ_GRP
  12064. * Bit 15
  12065. * Purpose: indicates whether any tx queue group information elements
  12066. * are appended to the tx credit update message
  12067. * Value: 0 -> no tx queue group information element is present
  12068. * 1 -> a tx queue group information element immediately follows
  12069. * - DELTA_COUNT
  12070. * Bits 31:16
  12071. * Purpose: Specify current htt credit delta absolute count
  12072. */
  12073. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12074. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12075. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12076. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12077. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12078. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12079. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12082. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12083. } while (0)
  12084. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12085. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12086. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12087. do { \
  12088. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12089. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12090. } while (0)
  12091. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12092. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12093. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12094. do { \
  12095. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12096. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12097. } while (0)
  12098. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12099. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12100. #define HTT_TX_CREDIT_MSG_BYTES 4
  12101. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12102. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12103. /**
  12104. * @brief HTT WDI_IPA Operation Response Message
  12105. *
  12106. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12107. *
  12108. * @details
  12109. * HTT WDI_IPA Operation Response message is sent by target
  12110. * to host confirming suspend or resume operation.
  12111. * |31 24|23 16|15 8|7 0|
  12112. * |----------------+----------------+----------------+----------------|
  12113. * | op_code | Rsvd | msg_type |
  12114. * |-------------------------------------------------------------------|
  12115. * | Rsvd | Response len |
  12116. * |-------------------------------------------------------------------|
  12117. * | |
  12118. * | Response-type specific info |
  12119. * | |
  12120. * | |
  12121. * |-------------------------------------------------------------------|
  12122. * Header fields:
  12123. * - MSG_TYPE
  12124. * Bits 7:0
  12125. * Purpose: Identifies this as WDI_IPA Operation Response message
  12126. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12127. * - OP_CODE
  12128. * Bits 31:16
  12129. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12130. * value: = enum htt_wdi_ipa_op_code
  12131. * - RSP_LEN
  12132. * Bits 16:0
  12133. * Purpose: length for the response-type specific info
  12134. * value: = length in bytes for response-type specific info
  12135. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12136. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12137. */
  12138. PREPACK struct htt_wdi_ipa_op_response_t
  12139. {
  12140. /* DWORD 0: flags and meta-data */
  12141. A_UINT32
  12142. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12143. reserved1: 8,
  12144. op_code: 16;
  12145. A_UINT32
  12146. rsp_len: 16,
  12147. reserved2: 16;
  12148. } POSTPACK;
  12149. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12150. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12151. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12152. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12153. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12154. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12155. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12156. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12157. do { \
  12158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12159. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12160. } while (0)
  12161. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12162. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12163. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12164. do { \
  12165. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12166. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12167. } while (0)
  12168. enum htt_phy_mode {
  12169. htt_phy_mode_11a = 0,
  12170. htt_phy_mode_11g = 1,
  12171. htt_phy_mode_11b = 2,
  12172. htt_phy_mode_11g_only = 3,
  12173. htt_phy_mode_11na_ht20 = 4,
  12174. htt_phy_mode_11ng_ht20 = 5,
  12175. htt_phy_mode_11na_ht40 = 6,
  12176. htt_phy_mode_11ng_ht40 = 7,
  12177. htt_phy_mode_11ac_vht20 = 8,
  12178. htt_phy_mode_11ac_vht40 = 9,
  12179. htt_phy_mode_11ac_vht80 = 10,
  12180. htt_phy_mode_11ac_vht20_2g = 11,
  12181. htt_phy_mode_11ac_vht40_2g = 12,
  12182. htt_phy_mode_11ac_vht80_2g = 13,
  12183. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12184. htt_phy_mode_11ac_vht160 = 15,
  12185. htt_phy_mode_max,
  12186. };
  12187. /**
  12188. * @brief target -> host HTT channel change indication
  12189. *
  12190. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12191. *
  12192. * @details
  12193. * Specify when a channel change occurs.
  12194. * This allows the host to precisely determine which rx frames arrived
  12195. * on the old channel and which rx frames arrived on the new channel.
  12196. *
  12197. *|31 |7 0 |
  12198. *|-------------------------------------------+----------|
  12199. *| reserved | msg type |
  12200. *|------------------------------------------------------|
  12201. *| primary_chan_center_freq_mhz |
  12202. *|------------------------------------------------------|
  12203. *| contiguous_chan1_center_freq_mhz |
  12204. *|------------------------------------------------------|
  12205. *| contiguous_chan2_center_freq_mhz |
  12206. *|------------------------------------------------------|
  12207. *| phy_mode |
  12208. *|------------------------------------------------------|
  12209. *
  12210. * Header fields:
  12211. * - MSG_TYPE
  12212. * Bits 7:0
  12213. * Purpose: identifies this as a htt channel change indication message
  12214. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12215. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12216. * Bits 31:0
  12217. * Purpose: identify the (center of the) new 20 MHz primary channel
  12218. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12219. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12220. * Bits 31:0
  12221. * Purpose: identify the (center of the) contiguous frequency range
  12222. * comprising the new channel.
  12223. * For example, if the new channel is a 80 MHz channel extending
  12224. * 60 MHz beyond the primary channel, this field would be 30 larger
  12225. * than the primary channel center frequency field.
  12226. * Value: center frequency of the contiguous frequency range comprising
  12227. * the full channel in MHz units
  12228. * (80+80 channels also use the CONTIG_CHAN2 field)
  12229. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12230. * Bits 31:0
  12231. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12232. * within a VHT 80+80 channel.
  12233. * This field is only relevant for VHT 80+80 channels.
  12234. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12235. * channel (arbitrary value for cases besides VHT 80+80)
  12236. * - PHY_MODE
  12237. * Bits 31:0
  12238. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12239. * and band
  12240. * Value: htt_phy_mode enum value
  12241. */
  12242. PREPACK struct htt_chan_change_t
  12243. {
  12244. /* DWORD 0: flags and meta-data */
  12245. A_UINT32
  12246. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12247. reserved1: 24;
  12248. A_UINT32 primary_chan_center_freq_mhz;
  12249. A_UINT32 contig_chan1_center_freq_mhz;
  12250. A_UINT32 contig_chan2_center_freq_mhz;
  12251. A_UINT32 phy_mode;
  12252. } POSTPACK;
  12253. /*
  12254. * Due to historical / backwards-compatibility reasons, maintain the
  12255. * below htt_chan_change_msg struct definition, which needs to be
  12256. * consistent with the above htt_chan_change_t struct definition
  12257. * (aside from the htt_chan_change_t definition including the msg_type
  12258. * dword within the message, and the htt_chan_change_msg only containing
  12259. * the payload of the message that follows the msg_type dword).
  12260. */
  12261. PREPACK struct htt_chan_change_msg {
  12262. A_UINT32 chan_mhz; /* frequency in mhz */
  12263. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12264. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12265. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12266. } POSTPACK;
  12267. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12268. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12269. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12270. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12271. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12272. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12273. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12274. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12275. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12276. do { \
  12277. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12278. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12279. } while (0)
  12280. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12281. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12282. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12283. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12284. do { \
  12285. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12286. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12287. } while (0)
  12288. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12289. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12290. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12291. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12292. do { \
  12293. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12294. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12295. } while (0)
  12296. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12297. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12298. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12299. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12300. do { \
  12301. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12302. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12303. } while (0)
  12304. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12305. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12306. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12307. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12308. /**
  12309. * @brief rx offload packet error message
  12310. *
  12311. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12312. *
  12313. * @details
  12314. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12315. * of target payload like mic err.
  12316. *
  12317. * |31 24|23 16|15 8|7 0|
  12318. * |----------------+----------------+----------------+----------------|
  12319. * | tid | vdev_id | msg_sub_type | msg_type |
  12320. * |-------------------------------------------------------------------|
  12321. * : (sub-type dependent content) :
  12322. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12323. * Header fields:
  12324. * - msg_type
  12325. * Bits 7:0
  12326. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12327. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12328. * - msg_sub_type
  12329. * Bits 15:8
  12330. * Purpose: Identifies which type of rx error is reported by this message
  12331. * value: htt_rx_ofld_pkt_err_type
  12332. * - vdev_id
  12333. * Bits 23:16
  12334. * Purpose: Identifies which vdev received the erroneous rx frame
  12335. * value:
  12336. * - tid
  12337. * Bits 31:24
  12338. * Purpose: Identifies the traffic type of the rx frame
  12339. * value:
  12340. *
  12341. * - The payload fields used if the sub-type == MIC error are shown below.
  12342. * Note - MIC err is per MSDU, while PN is per MPDU.
  12343. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12344. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12345. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12346. * instead of sending separate HTT messages for each wrong MSDU within
  12347. * the MPDU.
  12348. *
  12349. * |31 24|23 16|15 8|7 0|
  12350. * |----------------+----------------+----------------+----------------|
  12351. * | Rsvd | key_id | peer_id |
  12352. * |-------------------------------------------------------------------|
  12353. * | receiver MAC addr 31:0 |
  12354. * |-------------------------------------------------------------------|
  12355. * | Rsvd | receiver MAC addr 47:32 |
  12356. * |-------------------------------------------------------------------|
  12357. * | transmitter MAC addr 31:0 |
  12358. * |-------------------------------------------------------------------|
  12359. * | Rsvd | transmitter MAC addr 47:32 |
  12360. * |-------------------------------------------------------------------|
  12361. * | PN 31:0 |
  12362. * |-------------------------------------------------------------------|
  12363. * | Rsvd | PN 47:32 |
  12364. * |-------------------------------------------------------------------|
  12365. * - peer_id
  12366. * Bits 15:0
  12367. * Purpose: identifies which peer is frame is from
  12368. * value:
  12369. * - key_id
  12370. * Bits 23:16
  12371. * Purpose: identifies key_id of rx frame
  12372. * value:
  12373. * - RA_31_0 (receiver MAC addr 31:0)
  12374. * Bits 31:0
  12375. * Purpose: identifies by MAC address which vdev received the frame
  12376. * value: MAC address lower 4 bytes
  12377. * - RA_47_32 (receiver MAC addr 47:32)
  12378. * Bits 15:0
  12379. * Purpose: identifies by MAC address which vdev received the frame
  12380. * value: MAC address upper 2 bytes
  12381. * - TA_31_0 (transmitter MAC addr 31:0)
  12382. * Bits 31:0
  12383. * Purpose: identifies by MAC address which peer transmitted the frame
  12384. * value: MAC address lower 4 bytes
  12385. * - TA_47_32 (transmitter MAC addr 47:32)
  12386. * Bits 15:0
  12387. * Purpose: identifies by MAC address which peer transmitted the frame
  12388. * value: MAC address upper 2 bytes
  12389. * - PN_31_0
  12390. * Bits 31:0
  12391. * Purpose: Identifies pn of rx frame
  12392. * value: PN lower 4 bytes
  12393. * - PN_47_32
  12394. * Bits 15:0
  12395. * Purpose: Identifies pn of rx frame
  12396. * value:
  12397. * TKIP or CCMP: PN upper 2 bytes
  12398. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12399. */
  12400. enum htt_rx_ofld_pkt_err_type {
  12401. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12402. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12403. };
  12404. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12405. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12406. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12407. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12408. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12409. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12410. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12411. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12412. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12413. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12414. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12415. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12416. do { \
  12417. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12418. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12419. } while (0)
  12420. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12421. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12422. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12423. do { \
  12424. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12425. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12426. } while (0)
  12427. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12428. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12429. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12430. do { \
  12431. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12432. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12433. } while (0)
  12434. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12443. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12444. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12445. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12446. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12448. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12449. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12450. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12451. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12452. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12453. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12454. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12455. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12458. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12459. } while (0)
  12460. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12461. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12462. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12464. do { \
  12465. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12466. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12467. } while (0)
  12468. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12469. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12470. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12474. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12475. } while (0)
  12476. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12477. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12478. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12479. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12480. do { \
  12481. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12482. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12483. } while (0)
  12484. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12485. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12486. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12488. do { \
  12489. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12490. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12491. } while (0)
  12492. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12493. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12494. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12496. do { \
  12497. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12498. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12499. } while (0)
  12500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12501. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12502. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12504. do { \
  12505. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12506. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12507. } while (0)
  12508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12509. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12510. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12512. do { \
  12513. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12514. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12515. } while (0)
  12516. /**
  12517. * @brief target -> host peer rate report message
  12518. *
  12519. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12520. *
  12521. * @details
  12522. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12523. * justified rate of all the peers.
  12524. *
  12525. * |31 24|23 16|15 8|7 0|
  12526. * |----------------+----------------+----------------+----------------|
  12527. * | peer_count | | msg_type |
  12528. * |-------------------------------------------------------------------|
  12529. * : Payload (variant number of peer rate report) :
  12530. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12531. * Header fields:
  12532. * - msg_type
  12533. * Bits 7:0
  12534. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12535. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12536. * - reserved
  12537. * Bits 15:8
  12538. * Purpose:
  12539. * value:
  12540. * - peer_count
  12541. * Bits 31:16
  12542. * Purpose: Specify how many peer rate report elements are present in the payload.
  12543. * value:
  12544. *
  12545. * Payload:
  12546. * There are variant number of peer rate report follow the first 32 bits.
  12547. * The peer rate report is defined as follows.
  12548. *
  12549. * |31 20|19 16|15 0|
  12550. * |-----------------------+---------+---------------------------------|-
  12551. * | reserved | phy | peer_id | \
  12552. * |-------------------------------------------------------------------| -> report #0
  12553. * | rate | /
  12554. * |-----------------------+---------+---------------------------------|-
  12555. * | reserved | phy | peer_id | \
  12556. * |-------------------------------------------------------------------| -> report #1
  12557. * | rate | /
  12558. * |-----------------------+---------+---------------------------------|-
  12559. * | reserved | phy | peer_id | \
  12560. * |-------------------------------------------------------------------| -> report #2
  12561. * | rate | /
  12562. * |-------------------------------------------------------------------|-
  12563. * : :
  12564. * : :
  12565. * : :
  12566. * :-------------------------------------------------------------------:
  12567. *
  12568. * - peer_id
  12569. * Bits 15:0
  12570. * Purpose: identify the peer
  12571. * value:
  12572. * - phy
  12573. * Bits 19:16
  12574. * Purpose: identify which phy is in use
  12575. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12576. * Please see enum htt_peer_report_phy_type for detail.
  12577. * - reserved
  12578. * Bits 31:20
  12579. * Purpose:
  12580. * value:
  12581. * - rate
  12582. * Bits 31:0
  12583. * Purpose: represent the justified rate of the peer specified by peer_id
  12584. * value:
  12585. */
  12586. enum htt_peer_rate_report_phy_type {
  12587. HTT_PEER_RATE_REPORT_11B = 0,
  12588. HTT_PEER_RATE_REPORT_11A_G,
  12589. HTT_PEER_RATE_REPORT_11N,
  12590. HTT_PEER_RATE_REPORT_11AC,
  12591. };
  12592. #define HTT_PEER_RATE_REPORT_SIZE 8
  12593. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12594. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12595. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12596. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12597. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12598. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12599. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12600. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12601. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12602. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12603. do { \
  12604. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12605. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12606. } while (0)
  12607. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12608. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12609. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12610. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12611. do { \
  12612. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12613. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12614. } while (0)
  12615. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12616. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12617. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12618. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12619. do { \
  12620. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12621. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12622. } while (0)
  12623. /**
  12624. * @brief target -> host flow pool map message
  12625. *
  12626. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12627. *
  12628. * @details
  12629. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12630. * a flow of descriptors.
  12631. *
  12632. * This message is in TLV format and indicates the parameters to be setup a
  12633. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12634. * receive descriptors from a specified pool.
  12635. *
  12636. * The message would appear as follows:
  12637. *
  12638. * |31 24|23 16|15 8|7 0|
  12639. * |----------------+----------------+----------------+----------------|
  12640. * header | reserved | num_flows | msg_type |
  12641. * |-------------------------------------------------------------------|
  12642. * | |
  12643. * : payload :
  12644. * | |
  12645. * |-------------------------------------------------------------------|
  12646. *
  12647. * The header field is one DWORD long and is interpreted as follows:
  12648. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12649. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12650. * this message
  12651. * b'16-31 - reserved: These bits are reserved for future use
  12652. *
  12653. * Payload:
  12654. * The payload would contain multiple objects of the following structure. Each
  12655. * object represents a flow.
  12656. *
  12657. * |31 24|23 16|15 8|7 0|
  12658. * |----------------+----------------+----------------+----------------|
  12659. * header | reserved | num_flows | msg_type |
  12660. * |-------------------------------------------------------------------|
  12661. * payload0| flow_type |
  12662. * |-------------------------------------------------------------------|
  12663. * | flow_id |
  12664. * |-------------------------------------------------------------------|
  12665. * | reserved0 | flow_pool_id |
  12666. * |-------------------------------------------------------------------|
  12667. * | reserved1 | flow_pool_size |
  12668. * |-------------------------------------------------------------------|
  12669. * | reserved2 |
  12670. * |-------------------------------------------------------------------|
  12671. * payload1| flow_type |
  12672. * |-------------------------------------------------------------------|
  12673. * | flow_id |
  12674. * |-------------------------------------------------------------------|
  12675. * | reserved0 | flow_pool_id |
  12676. * |-------------------------------------------------------------------|
  12677. * | reserved1 | flow_pool_size |
  12678. * |-------------------------------------------------------------------|
  12679. * | reserved2 |
  12680. * |-------------------------------------------------------------------|
  12681. * | . |
  12682. * | . |
  12683. * | . |
  12684. * |-------------------------------------------------------------------|
  12685. *
  12686. * Each payload is 5 DWORDS long and is interpreted as follows:
  12687. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12688. * this flow is associated. It can be VDEV, peer,
  12689. * or tid (AC). Based on enum htt_flow_type.
  12690. *
  12691. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12692. * object. For flow_type vdev it is set to the
  12693. * vdevid, for peer it is peerid and for tid, it is
  12694. * tid_num.
  12695. *
  12696. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12697. * in the host for this flow
  12698. * b'16:31 - reserved0: This field in reserved for the future. In case
  12699. * we have a hierarchical implementation (HCM) of
  12700. * pools, it can be used to indicate the ID of the
  12701. * parent-pool.
  12702. *
  12703. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12704. * Descriptors for this flow will be
  12705. * allocated from this pool in the host.
  12706. * b'16:31 - reserved1: This field in reserved for the future. In case
  12707. * we have a hierarchical implementation of pools,
  12708. * it can be used to indicate the max number of
  12709. * descriptors in the pool. The b'0:15 can be used
  12710. * to indicate min number of descriptors in the
  12711. * HCM scheme.
  12712. *
  12713. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12714. * we have a hierarchical implementation of pools,
  12715. * b'0:15 can be used to indicate the
  12716. * priority-based borrowing (PBB) threshold of
  12717. * the flow's pool. The b'16:31 are still left
  12718. * reserved.
  12719. */
  12720. enum htt_flow_type {
  12721. FLOW_TYPE_VDEV = 0,
  12722. /* Insert new flow types above this line */
  12723. };
  12724. PREPACK struct htt_flow_pool_map_payload_t {
  12725. A_UINT32 flow_type;
  12726. A_UINT32 flow_id;
  12727. A_UINT32 flow_pool_id:16,
  12728. reserved0:16;
  12729. A_UINT32 flow_pool_size:16,
  12730. reserved1:16;
  12731. A_UINT32 reserved2;
  12732. } POSTPACK;
  12733. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12734. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12735. (sizeof(struct htt_flow_pool_map_payload_t))
  12736. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12737. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12738. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12739. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12740. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12741. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12742. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12743. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12744. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12745. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12746. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12747. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12748. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12749. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12750. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12751. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12752. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12753. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12754. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12755. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12756. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12757. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12758. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12759. do { \
  12760. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12761. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12762. } while (0)
  12763. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12764. do { \
  12765. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12766. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12767. } while (0)
  12768. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12769. do { \
  12770. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12771. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12772. } while (0)
  12773. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12774. do { \
  12775. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12776. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12777. } while (0)
  12778. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12779. do { \
  12780. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12781. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12782. } while (0)
  12783. /**
  12784. * @brief target -> host flow pool unmap message
  12785. *
  12786. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12787. *
  12788. * @details
  12789. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12790. * down a flow of descriptors.
  12791. * This message indicates that for the flow (whose ID is provided) is wanting
  12792. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12793. * pool of descriptors from where descriptors are being allocated for this
  12794. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12795. * be unmapped by the host.
  12796. *
  12797. * The message would appear as follows:
  12798. *
  12799. * |31 24|23 16|15 8|7 0|
  12800. * |----------------+----------------+----------------+----------------|
  12801. * | reserved0 | msg_type |
  12802. * |-------------------------------------------------------------------|
  12803. * | flow_type |
  12804. * |-------------------------------------------------------------------|
  12805. * | flow_id |
  12806. * |-------------------------------------------------------------------|
  12807. * | reserved1 | flow_pool_id |
  12808. * |-------------------------------------------------------------------|
  12809. *
  12810. * The message is interpreted as follows:
  12811. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12812. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12813. * b'8:31 - reserved0: Reserved for future use
  12814. *
  12815. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12816. * this flow is associated. It can be VDEV, peer,
  12817. * or tid (AC). Based on enum htt_flow_type.
  12818. *
  12819. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12820. * object. For flow_type vdev it is set to the
  12821. * vdevid, for peer it is peerid and for tid, it is
  12822. * tid_num.
  12823. *
  12824. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12825. * used in the host for this flow
  12826. * b'16:31 - reserved0: This field in reserved for the future.
  12827. *
  12828. */
  12829. PREPACK struct htt_flow_pool_unmap_t {
  12830. A_UINT32 msg_type:8,
  12831. reserved0:24;
  12832. A_UINT32 flow_type;
  12833. A_UINT32 flow_id;
  12834. A_UINT32 flow_pool_id:16,
  12835. reserved1:16;
  12836. } POSTPACK;
  12837. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12838. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12839. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12840. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12841. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12842. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12843. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12844. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12845. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12846. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12847. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12848. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12849. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12850. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12851. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12852. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12853. do { \
  12854. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12855. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12856. } while (0)
  12857. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12858. do { \
  12859. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12860. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12861. } while (0)
  12862. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12863. do { \
  12864. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12865. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12866. } while (0)
  12867. /**
  12868. * @brief target -> host SRING setup done message
  12869. *
  12870. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12871. *
  12872. * @details
  12873. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12874. * SRNG ring setup is done
  12875. *
  12876. * This message indicates whether the last setup operation is successful.
  12877. * It will be sent to host when host set respose_required bit in
  12878. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12879. * The message would appear as follows:
  12880. *
  12881. * |31 24|23 16|15 8|7 0|
  12882. * |--------------- +----------------+----------------+----------------|
  12883. * | setup_status | ring_id | pdev_id | msg_type |
  12884. * |-------------------------------------------------------------------|
  12885. *
  12886. * The message is interpreted as follows:
  12887. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12888. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12889. * b'8:15 - pdev_id:
  12890. * 0 (for rings at SOC/UMAC level),
  12891. * 1/2/3 mac id (for rings at LMAC level)
  12892. * b'16:23 - ring_id: Identify the ring which is set up
  12893. * More details can be got from enum htt_srng_ring_id
  12894. * b'24:31 - setup_status: Indicate status of setup operation
  12895. * Refer to htt_ring_setup_status
  12896. */
  12897. PREPACK struct htt_sring_setup_done_t {
  12898. A_UINT32 msg_type: 8,
  12899. pdev_id: 8,
  12900. ring_id: 8,
  12901. setup_status: 8;
  12902. } POSTPACK;
  12903. enum htt_ring_setup_status {
  12904. htt_ring_setup_status_ok = 0,
  12905. htt_ring_setup_status_error,
  12906. };
  12907. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12908. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12909. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12910. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12911. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12912. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12913. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12914. do { \
  12915. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12916. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12917. } while (0)
  12918. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12919. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12920. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12921. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12922. HTT_SRING_SETUP_DONE_RING_ID_S)
  12923. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12924. do { \
  12925. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12926. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12927. } while (0)
  12928. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12929. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12930. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12931. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12932. HTT_SRING_SETUP_DONE_STATUS_S)
  12933. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12934. do { \
  12935. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12936. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12937. } while (0)
  12938. /**
  12939. * @brief target -> flow map flow info
  12940. *
  12941. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12942. *
  12943. * @details
  12944. * HTT TX map flow entry with tqm flow pointer
  12945. * Sent from firmware to host to add tqm flow pointer in corresponding
  12946. * flow search entry. Flow metadata is replayed back to host as part of this
  12947. * struct to enable host to find the specific flow search entry
  12948. *
  12949. * The message would appear as follows:
  12950. *
  12951. * |31 28|27 18|17 14|13 8|7 0|
  12952. * |-------+------------------------------------------+----------------|
  12953. * | rsvd0 | fse_hsh_idx | msg_type |
  12954. * |-------------------------------------------------------------------|
  12955. * | rsvd1 | tid | peer_id |
  12956. * |-------------------------------------------------------------------|
  12957. * | tqm_flow_pntr_lo |
  12958. * |-------------------------------------------------------------------|
  12959. * | tqm_flow_pntr_hi |
  12960. * |-------------------------------------------------------------------|
  12961. * | fse_meta_data |
  12962. * |-------------------------------------------------------------------|
  12963. *
  12964. * The message is interpreted as follows:
  12965. *
  12966. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12967. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12968. *
  12969. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12970. * for this flow entry
  12971. *
  12972. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12973. *
  12974. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12975. *
  12976. * dword1 - b'14:17 - tid
  12977. *
  12978. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12979. *
  12980. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12981. *
  12982. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12983. *
  12984. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12985. * given by host
  12986. */
  12987. PREPACK struct htt_tx_map_flow_info {
  12988. A_UINT32
  12989. msg_type: 8,
  12990. fse_hsh_idx: 20,
  12991. rsvd0: 4;
  12992. A_UINT32
  12993. peer_id: 14,
  12994. tid: 4,
  12995. rsvd1: 14;
  12996. A_UINT32 tqm_flow_pntr_lo;
  12997. A_UINT32 tqm_flow_pntr_hi;
  12998. struct htt_tx_flow_metadata fse_meta_data;
  12999. } POSTPACK;
  13000. /* DWORD 0 */
  13001. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13002. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13003. /* DWORD 1 */
  13004. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13005. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13006. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13007. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13008. /* DWORD 0 */
  13009. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13010. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13011. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13012. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13013. do { \
  13014. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13015. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13016. } while (0)
  13017. /* DWORD 1 */
  13018. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13019. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13020. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13021. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13022. do { \
  13023. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13024. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13025. } while (0)
  13026. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13027. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13028. HTT_TX_MAP_FLOW_INFO_TID_S)
  13029. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13030. do { \
  13031. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13032. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13033. } while (0)
  13034. /*
  13035. * htt_dbg_ext_stats_status -
  13036. * present - The requested stats have been delivered in full.
  13037. * This indicates that either the stats information was contained
  13038. * in its entirety within this message, or else this message
  13039. * completes the delivery of the requested stats info that was
  13040. * partially delivered through earlier STATS_CONF messages.
  13041. * partial - The requested stats have been delivered in part.
  13042. * One or more subsequent STATS_CONF messages with the same
  13043. * cookie value will be sent to deliver the remainder of the
  13044. * information.
  13045. * error - The requested stats could not be delivered, for example due
  13046. * to a shortage of memory to construct a message holding the
  13047. * requested stats.
  13048. * invalid - The requested stat type is either not recognized, or the
  13049. * target is configured to not gather the stats type in question.
  13050. */
  13051. enum htt_dbg_ext_stats_status {
  13052. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13053. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13054. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13055. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13056. };
  13057. /**
  13058. * @brief target -> host ppdu stats upload
  13059. *
  13060. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13061. *
  13062. * @details
  13063. * The following field definitions describe the format of the HTT target
  13064. * to host ppdu stats indication message.
  13065. *
  13066. *
  13067. * |31 16|15 12|11 10|9 8|7 0 |
  13068. * |----------------------------------------------------------------------|
  13069. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13070. * |----------------------------------------------------------------------|
  13071. * | ppdu_id |
  13072. * |----------------------------------------------------------------------|
  13073. * | Timestamp in us |
  13074. * |----------------------------------------------------------------------|
  13075. * | reserved |
  13076. * |----------------------------------------------------------------------|
  13077. * | type-specific stats info |
  13078. * | (see htt_ppdu_stats.h) |
  13079. * |----------------------------------------------------------------------|
  13080. * Header fields:
  13081. * - MSG_TYPE
  13082. * Bits 7:0
  13083. * Purpose: Identifies this is a PPDU STATS indication
  13084. * message.
  13085. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13086. * - mac_id
  13087. * Bits 9:8
  13088. * Purpose: mac_id of this ppdu_id
  13089. * Value: 0-3
  13090. * - pdev_id
  13091. * Bits 11:10
  13092. * Purpose: pdev_id of this ppdu_id
  13093. * Value: 0-3
  13094. * 0 (for rings at SOC level),
  13095. * 1/2/3 PDEV -> 0/1/2
  13096. * - payload_size
  13097. * Bits 31:16
  13098. * Purpose: total tlv size
  13099. * Value: payload_size in bytes
  13100. */
  13101. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13102. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13103. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13104. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13105. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13106. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13107. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13108. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13109. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13110. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13111. do { \
  13112. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13113. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13114. } while (0)
  13115. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13116. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13117. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13118. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13119. do { \
  13120. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13121. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13122. } while (0)
  13123. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13124. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13125. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13126. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13127. do { \
  13128. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13129. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13130. } while (0)
  13131. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13132. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13133. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13134. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13135. do { \
  13136. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13137. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13138. } while (0)
  13139. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13140. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13141. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13142. /* htt_t2h_ppdu_stats_ind_hdr_t
  13143. * This struct contains the fields within the header of the
  13144. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13145. * stats info.
  13146. * This struct assumes little-endian layout, and thus is only
  13147. * suitable for use within processors known to be little-endian
  13148. * (such as the target).
  13149. * In contrast, the above macros provide endian-portable methods
  13150. * to get and set the bitfields within this PPDU_STATS_IND header.
  13151. */
  13152. typedef struct {
  13153. A_UINT32 msg_type: 8, /* bits 7:0 */
  13154. mac_id: 2, /* bits 9:8 */
  13155. pdev_id: 2, /* bits 11:10 */
  13156. reserved1: 4, /* bits 15:12 */
  13157. payload_size: 16; /* bits 31:16 */
  13158. A_UINT32 ppdu_id;
  13159. A_UINT32 timestamp_us;
  13160. A_UINT32 reserved2;
  13161. } htt_t2h_ppdu_stats_ind_hdr_t;
  13162. /**
  13163. * @brief target -> host extended statistics upload
  13164. *
  13165. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13166. *
  13167. * @details
  13168. * The following field definitions describe the format of the HTT target
  13169. * to host stats upload confirmation message.
  13170. * The message contains a cookie echoed from the HTT host->target stats
  13171. * upload request, which identifies which request the confirmation is
  13172. * for, and a single stats can span over multiple HTT stats indication
  13173. * due to the HTT message size limitation so every HTT ext stats indication
  13174. * will have tag-length-value stats information elements.
  13175. * The tag-length header for each HTT stats IND message also includes a
  13176. * status field, to indicate whether the request for the stat type in
  13177. * question was fully met, partially met, unable to be met, or invalid
  13178. * (if the stat type in question is disabled in the target).
  13179. * A Done bit 1's indicate the end of the of stats info elements.
  13180. *
  13181. *
  13182. * |31 16|15 12|11|10 8|7 5|4 0|
  13183. * |--------------------------------------------------------------|
  13184. * | reserved | msg type |
  13185. * |--------------------------------------------------------------|
  13186. * | cookie LSBs |
  13187. * |--------------------------------------------------------------|
  13188. * | cookie MSBs |
  13189. * |--------------------------------------------------------------|
  13190. * | stats entry length | rsvd | D| S | stat type |
  13191. * |--------------------------------------------------------------|
  13192. * | type-specific stats info |
  13193. * | (see htt_stats.h) |
  13194. * |--------------------------------------------------------------|
  13195. * Header fields:
  13196. * - MSG_TYPE
  13197. * Bits 7:0
  13198. * Purpose: Identifies this is a extended statistics upload confirmation
  13199. * message.
  13200. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13201. * - COOKIE_LSBS
  13202. * Bits 31:0
  13203. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13204. * message with its preceding host->target stats request message.
  13205. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13206. * - COOKIE_MSBS
  13207. * Bits 31:0
  13208. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13209. * message with its preceding host->target stats request message.
  13210. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13211. *
  13212. * Stats Information Element tag-length header fields:
  13213. * - STAT_TYPE
  13214. * Bits 7:0
  13215. * Purpose: identifies the type of statistics info held in the
  13216. * following information element
  13217. * Value: htt_dbg_ext_stats_type
  13218. * - STATUS
  13219. * Bits 10:8
  13220. * Purpose: indicate whether the requested stats are present
  13221. * Value: htt_dbg_ext_stats_status
  13222. * - DONE
  13223. * Bits 11
  13224. * Purpose:
  13225. * Indicates the completion of the stats entry, this will be the last
  13226. * stats conf HTT segment for the requested stats type.
  13227. * Value:
  13228. * 0 -> the stats retrieval is ongoing
  13229. * 1 -> the stats retrieval is complete
  13230. * - LENGTH
  13231. * Bits 31:16
  13232. * Purpose: indicate the stats information size
  13233. * Value: This field specifies the number of bytes of stats information
  13234. * that follows the element tag-length header.
  13235. * It is expected but not required that this length is a multiple of
  13236. * 4 bytes.
  13237. */
  13238. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13239. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13240. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13241. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13242. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13243. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13244. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13245. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13246. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13247. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13248. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13249. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13250. do { \
  13251. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13252. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13253. } while (0)
  13254. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13255. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13256. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13257. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13260. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13261. } while (0)
  13262. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13263. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13264. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13265. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13266. do { \
  13267. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13268. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13269. } while (0)
  13270. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13271. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13272. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13273. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13274. do { \
  13275. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13276. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13277. } while (0)
  13278. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13279. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13280. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13281. typedef enum {
  13282. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13283. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13284. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13285. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13286. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13287. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13288. /* Reserved from 128 - 255 for target internal use.*/
  13289. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13290. } HTT_PEER_TYPE;
  13291. /** macro to convert MAC address from char array to HTT word format */
  13292. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13293. (phtt_mac_addr)->mac_addr31to0 = \
  13294. (((c_macaddr)[0] << 0) | \
  13295. ((c_macaddr)[1] << 8) | \
  13296. ((c_macaddr)[2] << 16) | \
  13297. ((c_macaddr)[3] << 24)); \
  13298. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13299. } while (0)
  13300. /**
  13301. * @brief target -> host monitor mac header indication message
  13302. *
  13303. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13304. *
  13305. * @details
  13306. * The following diagram shows the format of the monitor mac header message
  13307. * sent from the target to the host.
  13308. * This message is primarily sent when promiscuous rx mode is enabled.
  13309. * One message is sent per rx PPDU.
  13310. *
  13311. * |31 24|23 16|15 8|7 0|
  13312. * |-------------------------------------------------------------|
  13313. * | peer_id | reserved0 | msg_type |
  13314. * |-------------------------------------------------------------|
  13315. * | reserved1 | num_mpdu |
  13316. * |-------------------------------------------------------------|
  13317. * | struct hw_rx_desc |
  13318. * | (see wal_rx_desc.h) |
  13319. * |-------------------------------------------------------------|
  13320. * | struct ieee80211_frame_addr4 |
  13321. * | (see ieee80211_defs.h) |
  13322. * |-------------------------------------------------------------|
  13323. * | struct ieee80211_frame_addr4 |
  13324. * | (see ieee80211_defs.h) |
  13325. * |-------------------------------------------------------------|
  13326. * | ...... |
  13327. * |-------------------------------------------------------------|
  13328. *
  13329. * Header fields:
  13330. * - msg_type
  13331. * Bits 7:0
  13332. * Purpose: Identifies this is a monitor mac header indication message.
  13333. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13334. * - peer_id
  13335. * Bits 31:16
  13336. * Purpose: Software peer id given by host during association,
  13337. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13338. * for rx PPDUs received from unassociated peers.
  13339. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13340. * - num_mpdu
  13341. * Bits 15:0
  13342. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13343. * delivered within the message.
  13344. * Value: 1 to 32
  13345. * num_mpdu is limited to a maximum value of 32, due to buffer
  13346. * size limits. For PPDUs with more than 32 MPDUs, only the
  13347. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13348. * the PPDU will be provided.
  13349. */
  13350. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13351. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13352. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13353. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13354. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13355. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13356. do { \
  13357. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13358. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13359. } while (0)
  13360. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13361. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13362. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13363. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13364. do { \
  13365. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13366. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13367. } while (0)
  13368. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13369. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13370. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13371. /**
  13372. * @brief target -> host flow pool resize Message
  13373. *
  13374. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13375. *
  13376. * @details
  13377. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13378. * the flow pool associated with the specified ID is resized
  13379. *
  13380. * The message would appear as follows:
  13381. *
  13382. * |31 16|15 8|7 0|
  13383. * |---------------------------------+----------------+----------------|
  13384. * | reserved0 | Msg type |
  13385. * |-------------------------------------------------------------------|
  13386. * | flow pool new size | flow pool ID |
  13387. * |-------------------------------------------------------------------|
  13388. *
  13389. * The message is interpreted as follows:
  13390. * b'0:7 - msg_type: This will be set to 0x21
  13391. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13392. *
  13393. * b'0:15 - flow pool ID: Existing flow pool ID
  13394. *
  13395. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13396. *
  13397. */
  13398. PREPACK struct htt_flow_pool_resize_t {
  13399. A_UINT32 msg_type:8,
  13400. reserved0:24;
  13401. A_UINT32 flow_pool_id:16,
  13402. flow_pool_new_size:16;
  13403. } POSTPACK;
  13404. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13405. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13406. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13407. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13408. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13409. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13410. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13411. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13412. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13413. do { \
  13414. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13415. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13416. } while (0)
  13417. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13418. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13419. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13420. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13421. do { \
  13422. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13423. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13424. } while (0)
  13425. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13426. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13427. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13428. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13429. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13430. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13431. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13432. /*
  13433. * The read and write indices point to the data within the host buffer.
  13434. * Because the first 4 bytes of the host buffer is used for the read index and
  13435. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13436. * The read index and write index are the byte offsets from the base of the
  13437. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13438. * Refer the ASCII text picture below.
  13439. */
  13440. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13441. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13442. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13443. /*
  13444. ***************************************************************************
  13445. *
  13446. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13447. *
  13448. ***************************************************************************
  13449. *
  13450. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13451. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13452. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13453. * written into the Host memory region mentioned below.
  13454. *
  13455. * Read index is updated by the Host. At any point of time, the read index will
  13456. * indicate the index that will next be read by the Host. The read index is
  13457. * in units of bytes offset from the base of the meta-data buffer.
  13458. *
  13459. * Write index is updated by the FW. At any point of time, the write index will
  13460. * indicate from where the FW can start writing any new data. The write index is
  13461. * in units of bytes offset from the base of the meta-data buffer.
  13462. *
  13463. * If the Host is not fast enough in reading the CFR data, any new capture data
  13464. * would be dropped if there is no space left to write the new captures.
  13465. *
  13466. * The last 4 bytes of the memory region will have the magic pattern
  13467. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13468. * not overrun the host buffer.
  13469. *
  13470. * ,--------------------. read and write indices store the
  13471. * | | byte offset from the base of the
  13472. * | ,--------+--------. meta-data buffer to the next
  13473. * | | | | location within the data buffer
  13474. * | | v v that will be read / written
  13475. * ************************************************************************
  13476. * * Read * Write * * Magic *
  13477. * * index * index * CFR data1 ...... CFR data N * pattern *
  13478. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13479. * ************************************************************************
  13480. * |<---------- data buffer ---------->|
  13481. *
  13482. * |<----------------- meta-data buffer allocated in Host ----------------|
  13483. *
  13484. * Note:
  13485. * - Considering the 4 bytes needed to store the Read index (R) and the
  13486. * Write index (W), the initial value is as follows:
  13487. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13488. * - Buffer empty condition:
  13489. * R = W
  13490. *
  13491. * Regarding CFR data format:
  13492. * --------------------------
  13493. *
  13494. * Each CFR tone is stored in HW as 16-bits with the following format:
  13495. * {bits[15:12], bits[11:6], bits[5:0]} =
  13496. * {unsigned exponent (4 bits),
  13497. * signed mantissa_real (6 bits),
  13498. * signed mantissa_imag (6 bits)}
  13499. *
  13500. * CFR_real = mantissa_real * 2^(exponent-5)
  13501. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13502. *
  13503. *
  13504. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13505. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13506. *
  13507. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13508. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13509. * .
  13510. * .
  13511. * .
  13512. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13513. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13514. */
  13515. /* Bandwidth of peer CFR captures */
  13516. typedef enum {
  13517. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13518. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13519. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13520. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13521. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13522. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13523. } HTT_PEER_CFR_CAPTURE_BW;
  13524. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13525. * was captured
  13526. */
  13527. typedef enum {
  13528. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13529. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13530. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13531. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13532. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13533. } HTT_PEER_CFR_CAPTURE_MODE;
  13534. typedef enum {
  13535. /* This message type is currently used for the below purpose:
  13536. *
  13537. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13538. * wmi_peer_cfr_capture_cmd.
  13539. * If payload_present bit is set to 0 then the associated memory region
  13540. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13541. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13542. * message; the CFR dump will be present at the end of the message,
  13543. * after the chan_phy_mode.
  13544. */
  13545. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13546. /* Always keep this last */
  13547. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13548. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13549. /**
  13550. * @brief target -> host CFR dump completion indication message definition
  13551. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13552. *
  13553. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13554. *
  13555. * @details
  13556. * The following diagram shows the format of the Channel Frequency Response
  13557. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13558. * the channel capture of a peer is copied by Firmware into the Host memory
  13559. *
  13560. * **************************************************************************
  13561. *
  13562. * Message format when the CFR capture message type is
  13563. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13564. *
  13565. * **************************************************************************
  13566. *
  13567. * |31 16|15 |8|7 0|
  13568. * |----------------------------------------------------------------|
  13569. * header: | reserved |P| msg_type |
  13570. * word 0 | | | |
  13571. * |----------------------------------------------------------------|
  13572. * payload: | cfr_capture_msg_type |
  13573. * word 1 | |
  13574. * |----------------------------------------------------------------|
  13575. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13576. * word 2 | | | | | | | | |
  13577. * |----------------------------------------------------------------|
  13578. * | mac_addr31to0 |
  13579. * word 3 | |
  13580. * |----------------------------------------------------------------|
  13581. * | unused / reserved | mac_addr47to32 |
  13582. * word 4 | | |
  13583. * |----------------------------------------------------------------|
  13584. * | index |
  13585. * word 5 | |
  13586. * |----------------------------------------------------------------|
  13587. * | length |
  13588. * word 6 | |
  13589. * |----------------------------------------------------------------|
  13590. * | timestamp |
  13591. * word 7 | |
  13592. * |----------------------------------------------------------------|
  13593. * | counter |
  13594. * word 8 | |
  13595. * |----------------------------------------------------------------|
  13596. * | chan_mhz |
  13597. * word 9 | |
  13598. * |----------------------------------------------------------------|
  13599. * | band_center_freq1 |
  13600. * word 10 | |
  13601. * |----------------------------------------------------------------|
  13602. * | band_center_freq2 |
  13603. * word 11 | |
  13604. * |----------------------------------------------------------------|
  13605. * | chan_phy_mode |
  13606. * word 12 | |
  13607. * |----------------------------------------------------------------|
  13608. * where,
  13609. * P - payload present bit (payload_present explained below)
  13610. * req_id - memory request id (mem_req_id explained below)
  13611. * S - status field (status explained below)
  13612. * capbw - capture bandwidth (capture_bw explained below)
  13613. * mode - mode of capture (mode explained below)
  13614. * sts - space time streams (sts_count explained below)
  13615. * chbw - channel bandwidth (channel_bw explained below)
  13616. * captype - capture type (cap_type explained below)
  13617. *
  13618. * The following field definitions describe the format of the CFR dump
  13619. * completion indication sent from the target to the host
  13620. *
  13621. * Header fields:
  13622. *
  13623. * Word 0
  13624. * - msg_type
  13625. * Bits 7:0
  13626. * Purpose: Identifies this as CFR TX completion indication
  13627. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13628. * - payload_present
  13629. * Bit 8
  13630. * Purpose: Identifies how CFR data is sent to host
  13631. * Value: 0 - If CFR Payload is written to host memory
  13632. * 1 - If CFR Payload is sent as part of HTT message
  13633. * (This is the requirement for SDIO/USB where it is
  13634. * not possible to write CFR data to host memory)
  13635. * - reserved
  13636. * Bits 31:9
  13637. * Purpose: Reserved
  13638. * Value: 0
  13639. *
  13640. * Payload fields:
  13641. *
  13642. * Word 1
  13643. * - cfr_capture_msg_type
  13644. * Bits 31:0
  13645. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13646. * to specify the format used for the remainder of the message
  13647. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13648. * (currently only MSG_TYPE_1 is defined)
  13649. *
  13650. * Word 2
  13651. * - mem_req_id
  13652. * Bits 6:0
  13653. * Purpose: Contain the mem request id of the region where the CFR capture
  13654. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13655. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13656. this value is invalid)
  13657. * - status
  13658. * Bit 7
  13659. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13660. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13661. * - capture_bw
  13662. * Bits 10:8
  13663. * Purpose: Carry the bandwidth of the CFR capture
  13664. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13665. * - mode
  13666. * Bits 13:11
  13667. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13668. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13669. * - sts_count
  13670. * Bits 16:14
  13671. * Purpose: Carry the number of space time streams
  13672. * Value: Number of space time streams
  13673. * - channel_bw
  13674. * Bits 19:17
  13675. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13676. * measurement
  13677. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13678. * - cap_type
  13679. * Bits 23:20
  13680. * Purpose: Carry the type of the capture
  13681. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13682. * - vdev_id
  13683. * Bits 31:24
  13684. * Purpose: Carry the virtual device id
  13685. * Value: vdev ID
  13686. *
  13687. * Word 3
  13688. * - mac_addr31to0
  13689. * Bits 31:0
  13690. * Purpose: Contain the bits 31:0 of the peer MAC address
  13691. * Value: Bits 31:0 of the peer MAC address
  13692. *
  13693. * Word 4
  13694. * - mac_addr47to32
  13695. * Bits 15:0
  13696. * Purpose: Contain the bits 47:32 of the peer MAC address
  13697. * Value: Bits 47:32 of the peer MAC address
  13698. *
  13699. * Word 5
  13700. * - index
  13701. * Bits 31:0
  13702. * Purpose: Contain the index at which this CFR dump was written in the Host
  13703. * allocated memory. This index is the number of bytes from the base address.
  13704. * Value: Index position
  13705. *
  13706. * Word 6
  13707. * - length
  13708. * Bits 31:0
  13709. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13710. * Value: Length of the CFR capture of the peer
  13711. *
  13712. * Word 7
  13713. * - timestamp
  13714. * Bits 31:0
  13715. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13716. * clock used for this timestamp is private to the target and not visible to
  13717. * the host i.e., Host can interpret only the relative timestamp deltas from
  13718. * one message to the next, but can't interpret the absolute timestamp from a
  13719. * single message.
  13720. * Value: Timestamp in microseconds
  13721. *
  13722. * Word 8
  13723. * - counter
  13724. * Bits 31:0
  13725. * Purpose: Carry the count of the current CFR capture from FW. This is
  13726. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13727. * in host memory)
  13728. * Value: Count of the current CFR capture
  13729. *
  13730. * Word 9
  13731. * - chan_mhz
  13732. * Bits 31:0
  13733. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13734. * Value: Primary 20 channel frequency
  13735. *
  13736. * Word 10
  13737. * - band_center_freq1
  13738. * Bits 31:0
  13739. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13740. * Value: Center frequency 1 in MHz
  13741. *
  13742. * Word 11
  13743. * - band_center_freq2
  13744. * Bits 31:0
  13745. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13746. * the VDEV
  13747. * 80plus80 mode
  13748. * Value: Center frequency 2 in MHz
  13749. *
  13750. * Word 12
  13751. * - chan_phy_mode
  13752. * Bits 31:0
  13753. * Purpose: Carry the phy mode of the channel, of the VDEV
  13754. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13755. */
  13756. PREPACK struct htt_cfr_dump_ind_type_1 {
  13757. A_UINT32 mem_req_id:7,
  13758. status:1,
  13759. capture_bw:3,
  13760. mode:3,
  13761. sts_count:3,
  13762. channel_bw:3,
  13763. cap_type:4,
  13764. vdev_id:8;
  13765. htt_mac_addr addr;
  13766. A_UINT32 index;
  13767. A_UINT32 length;
  13768. A_UINT32 timestamp;
  13769. A_UINT32 counter;
  13770. struct htt_chan_change_msg chan;
  13771. } POSTPACK;
  13772. PREPACK struct htt_cfr_dump_compl_ind {
  13773. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13774. union {
  13775. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13776. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13777. /* If there is a need to change the memory layout and its associated
  13778. * HTT indication format, a new CFR capture message type can be
  13779. * introduced and added into this union.
  13780. */
  13781. };
  13782. } POSTPACK;
  13783. /*
  13784. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13785. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13786. */
  13787. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13788. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13789. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13790. do { \
  13791. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13792. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13793. } while(0)
  13794. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13795. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13796. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13797. /*
  13798. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13799. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13800. */
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13804. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13805. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13806. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13808. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13809. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13810. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13811. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13812. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13813. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13814. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13815. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13816. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13817. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13818. do { \
  13819. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13820. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13821. } while (0)
  13822. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13823. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13824. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13825. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13826. do { \
  13827. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13828. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13829. } while (0)
  13830. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13831. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13832. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13833. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13834. do { \
  13835. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13836. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13837. } while (0)
  13838. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13839. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13840. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13841. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13842. do { \
  13843. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13844. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13845. } while (0)
  13846. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13847. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13848. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13849. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13850. do { \
  13851. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13852. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13853. } while (0)
  13854. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13855. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13856. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13857. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13858. do { \
  13859. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13860. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13861. } while (0)
  13862. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13863. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13864. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13865. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13866. do { \
  13867. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13868. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13869. } while (0)
  13870. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13871. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13872. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13873. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13874. do { \
  13875. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13876. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13877. } while (0)
  13878. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13879. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13880. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13881. /**
  13882. * @brief target -> host peer (PPDU) stats message
  13883. *
  13884. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13885. *
  13886. * @details
  13887. * This message is generated by FW when FW is sending stats to host
  13888. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13889. * This message is sent autonomously by the target rather than upon request
  13890. * by the host.
  13891. * The following field definitions describe the format of the HTT target
  13892. * to host peer stats indication message.
  13893. *
  13894. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13895. * or more PPDU stats records.
  13896. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13897. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13898. * then the message would start with the
  13899. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13900. * below.
  13901. *
  13902. * |31 16|15|14|13 11|10 9|8|7 0|
  13903. * |-------------------------------------------------------------|
  13904. * | reserved |MSG_TYPE |
  13905. * |-------------------------------------------------------------|
  13906. * rec 0 | TLV header |
  13907. * rec 0 |-------------------------------------------------------------|
  13908. * rec 0 | ppdu successful bytes |
  13909. * rec 0 |-------------------------------------------------------------|
  13910. * rec 0 | ppdu retry bytes |
  13911. * rec 0 |-------------------------------------------------------------|
  13912. * rec 0 | ppdu failed bytes |
  13913. * rec 0 |-------------------------------------------------------------|
  13914. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13915. * rec 0 |-------------------------------------------------------------|
  13916. * rec 0 | retried MSDUs | successful MSDUs |
  13917. * rec 0 |-------------------------------------------------------------|
  13918. * rec 0 | TX duration | failed MSDUs |
  13919. * rec 0 |-------------------------------------------------------------|
  13920. * ...
  13921. * |-------------------------------------------------------------|
  13922. * rec N | TLV header |
  13923. * rec N |-------------------------------------------------------------|
  13924. * rec N | ppdu successful bytes |
  13925. * rec N |-------------------------------------------------------------|
  13926. * rec N | ppdu retry bytes |
  13927. * rec N |-------------------------------------------------------------|
  13928. * rec N | ppdu failed bytes |
  13929. * rec N |-------------------------------------------------------------|
  13930. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13931. * rec N |-------------------------------------------------------------|
  13932. * rec N | retried MSDUs | successful MSDUs |
  13933. * rec N |-------------------------------------------------------------|
  13934. * rec N | TX duration | failed MSDUs |
  13935. * rec N |-------------------------------------------------------------|
  13936. *
  13937. * where:
  13938. * A = is A-MPDU flag
  13939. * BA = block-ack failure flags
  13940. * BW = bandwidth spec
  13941. * SG = SGI enabled spec
  13942. * S = skipped rate ctrl
  13943. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13944. *
  13945. * Header
  13946. * ------
  13947. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13948. * dword0 - b'8:31 - reserved : Reserved for future use
  13949. *
  13950. * payload include below peer_stats information
  13951. * --------------------------------------------
  13952. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13953. * @tx_success_bytes : total successful bytes in the PPDU.
  13954. * @tx_retry_bytes : total retried bytes in the PPDU.
  13955. * @tx_failed_bytes : total failed bytes in the PPDU.
  13956. * @tx_ratecode : rate code used for the PPDU.
  13957. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13958. * @ba_ack_failed : BA/ACK failed for this PPDU
  13959. * b00 -> BA received
  13960. * b01 -> BA failed once
  13961. * b10 -> BA failed twice, when HW retry is enabled.
  13962. * @bw : BW
  13963. * b00 -> 20 MHz
  13964. * b01 -> 40 MHz
  13965. * b10 -> 80 MHz
  13966. * b11 -> 160 MHz (or 80+80)
  13967. * @sg : SGI enabled
  13968. * @s : skipped ratectrl
  13969. * @peer_id : peer id
  13970. * @tx_success_msdus : successful MSDUs
  13971. * @tx_retry_msdus : retried MSDUs
  13972. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13973. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13974. */
  13975. /**
  13976. * @brief target -> host backpressure event
  13977. *
  13978. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13979. *
  13980. * @details
  13981. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13982. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13983. * This message will only be sent if the backpressure condition has existed
  13984. * continuously for an initial period (100 ms).
  13985. * Repeat messages with updated information will be sent after each
  13986. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13987. * This message indicates the ring id along with current head and tail index
  13988. * locations (i.e. write and read indices).
  13989. * The backpressure time indicates the time in ms for which continous
  13990. * backpressure has been observed in the ring.
  13991. *
  13992. * The message format is as follows:
  13993. *
  13994. * |31 24|23 16|15 8|7 0|
  13995. * |----------------+----------------+----------------+----------------|
  13996. * | ring_id | ring_type | pdev_id | msg_type |
  13997. * |-------------------------------------------------------------------|
  13998. * | tail_idx | head_idx |
  13999. * |-------------------------------------------------------------------|
  14000. * | backpressure_time_ms |
  14001. * |-------------------------------------------------------------------|
  14002. *
  14003. * The message is interpreted as follows:
  14004. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14005. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14006. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14007. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14008. the msg is for LMAC ring.
  14009. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14010. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14011. * htt_backpressure_lmac_ring_id. This represents
  14012. * the ring id for which continous backpressure is seen
  14013. *
  14014. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14015. * the ring indicated by the ring_id
  14016. *
  14017. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14018. * the ring indicated by the ring id
  14019. *
  14020. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14021. * backpressure has been seen in the ring
  14022. * indicated by the ring_id.
  14023. * Units = milliseconds
  14024. */
  14025. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14026. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14027. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14028. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14029. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14030. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14031. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14032. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14033. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14034. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14035. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14036. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14037. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14038. do { \
  14039. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14040. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14041. } while (0)
  14042. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14043. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14044. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14045. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14046. do { \
  14047. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14048. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14049. } while (0)
  14050. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14051. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14052. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14053. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14054. do { \
  14055. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14056. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14057. } while (0)
  14058. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14059. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14060. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14061. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14062. do { \
  14063. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14064. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14065. } while (0)
  14066. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14067. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14068. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14069. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14070. do { \
  14071. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14072. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14073. } while (0)
  14074. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14075. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14076. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14077. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14078. do { \
  14079. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14080. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14081. } while (0)
  14082. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14083. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14084. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14085. enum htt_backpressure_ring_type {
  14086. HTT_SW_RING_TYPE_UMAC,
  14087. HTT_SW_RING_TYPE_LMAC,
  14088. HTT_SW_RING_TYPE_MAX,
  14089. };
  14090. /* Ring id for which the message is sent to host */
  14091. enum htt_backpressure_umac_ringid {
  14092. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14093. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14094. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14095. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14096. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14097. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14098. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14099. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14100. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14101. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14102. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14103. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14104. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14105. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14106. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14107. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14108. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14109. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14110. HTT_SW_UMAC_RING_IDX_MAX,
  14111. };
  14112. enum htt_backpressure_lmac_ringid {
  14113. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14114. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14115. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14116. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14117. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14118. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14119. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14120. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14121. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14122. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14123. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14124. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14125. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14126. HTT_SW_LMAC_RING_IDX_MAX,
  14127. };
  14128. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14129. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14130. pdev_id: 8,
  14131. ring_type: 8, /* htt_backpressure_ring_type */
  14132. /*
  14133. * ring_id holds an enum value from either
  14134. * htt_backpressure_umac_ringid or
  14135. * htt_backpressure_lmac_ringid, based on
  14136. * the ring_type setting.
  14137. */
  14138. ring_id: 8;
  14139. A_UINT16 head_idx;
  14140. A_UINT16 tail_idx;
  14141. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14142. } POSTPACK;
  14143. /*
  14144. * Defines two 32 bit words that can be used by the target to indicate a per
  14145. * user RU allocation and rate information.
  14146. *
  14147. * This information is currently provided in the "sw_response_reference_ptr"
  14148. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14149. * "rx_ppdu_end_user_stats" TLV.
  14150. *
  14151. * VALID:
  14152. * The consumer of these words must explicitly check the valid bit,
  14153. * and only attempt interpretation of any of the remaining fields if
  14154. * the valid bit is set to 1.
  14155. *
  14156. * VERSION:
  14157. * The consumer of these words must also explicitly check the version bit,
  14158. * and only use the V0 definition if the VERSION field is set to 0.
  14159. *
  14160. * Version 1 is currently undefined, with the exception of the VALID and
  14161. * VERSION fields.
  14162. *
  14163. * Version 0:
  14164. *
  14165. * The fields below are duplicated per BW.
  14166. *
  14167. * The consumer must determine which BW field to use, based on the UL OFDMA
  14168. * PPDU BW indicated by HW.
  14169. *
  14170. * RU_START: RU26 start index for the user.
  14171. * Note that this is always using the RU26 index, regardless
  14172. * of the actual RU assigned to the user
  14173. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14174. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14175. *
  14176. * For example, 20MHz (the value in the top row is RU_START)
  14177. *
  14178. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14179. * RU Size 1 (52): | | | | | |
  14180. * RU Size 2 (106): | | | |
  14181. * RU Size 3 (242): | |
  14182. *
  14183. * RU_SIZE: Indicates the RU size, as defined by enum
  14184. * htt_ul_ofdma_user_info_ru_size.
  14185. *
  14186. * LDPC: LDPC enabled (if 0, BCC is used)
  14187. *
  14188. * DCM: DCM enabled
  14189. *
  14190. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14191. * |---------------------------------+--------------------------------|
  14192. * |Ver|Valid| FW internal |
  14193. * |---------------------------------+--------------------------------|
  14194. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14195. * |---------------------------------+--------------------------------|
  14196. */
  14197. enum htt_ul_ofdma_user_info_ru_size {
  14198. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14199. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14200. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14201. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14202. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14203. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14204. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14205. };
  14206. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14207. struct htt_ul_ofdma_user_info_v0 {
  14208. A_UINT32 word0;
  14209. A_UINT32 word1;
  14210. };
  14211. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14212. A_UINT32 w0_fw_rsvd:30; \
  14213. A_UINT32 w0_valid:1; \
  14214. A_UINT32 w0_version:1;
  14215. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14216. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14217. };
  14218. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14219. A_UINT32 w1_nss:3; \
  14220. A_UINT32 w1_mcs:4; \
  14221. A_UINT32 w1_ldpc:1; \
  14222. A_UINT32 w1_dcm:1; \
  14223. A_UINT32 w1_ru_start:7; \
  14224. A_UINT32 w1_ru_size:3; \
  14225. A_UINT32 w1_trig_type:4; \
  14226. A_UINT32 w1_unused:9;
  14227. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14228. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14229. };
  14230. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14231. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14232. union {
  14233. A_UINT32 word0;
  14234. struct {
  14235. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14236. };
  14237. };
  14238. union {
  14239. A_UINT32 word1;
  14240. struct {
  14241. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14242. };
  14243. };
  14244. } POSTPACK;
  14245. enum HTT_UL_OFDMA_TRIG_TYPE {
  14246. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14247. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14248. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14249. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14250. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14251. };
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14265. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14266. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14267. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14268. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14269. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14270. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14271. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14272. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14273. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14274. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14275. /*--- word 0 ---*/
  14276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14277. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14278. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14279. do { \
  14280. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14281. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14282. } while (0)
  14283. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14284. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14285. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14288. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14289. } while (0)
  14290. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14291. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14292. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14293. do { \
  14294. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14295. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14296. } while (0)
  14297. /*--- word 1 ---*/
  14298. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14299. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14300. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14301. do { \
  14302. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14303. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14304. } while (0)
  14305. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14306. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14307. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14308. do { \
  14309. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14310. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14311. } while (0)
  14312. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14313. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14314. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14315. do { \
  14316. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14317. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14318. } while (0)
  14319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14320. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14322. do { \
  14323. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14324. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14325. } while (0)
  14326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14327. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14328. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14329. do { \
  14330. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14331. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14332. } while (0)
  14333. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14334. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14335. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14336. do { \
  14337. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14338. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14339. } while (0)
  14340. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14341. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14342. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14343. do { \
  14344. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14345. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14346. } while (0)
  14347. /**
  14348. * @brief target -> host channel calibration data message
  14349. *
  14350. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14351. *
  14352. * @brief host -> target channel calibration data message
  14353. *
  14354. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14355. *
  14356. * @details
  14357. * The following field definitions describe the format of the channel
  14358. * calibration data message sent from the target to the host when
  14359. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14360. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14361. * The message is defined as htt_chan_caldata_msg followed by a variable
  14362. * number of 32-bit character values.
  14363. *
  14364. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14365. * |------------------------------------------------------------------|
  14366. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14367. * |------------------------------------------------------------------|
  14368. * | payload size | mhz |
  14369. * |------------------------------------------------------------------|
  14370. * | center frequency 2 | center frequency 1 |
  14371. * |------------------------------------------------------------------|
  14372. * | check sum |
  14373. * |------------------------------------------------------------------|
  14374. * | payload |
  14375. * |------------------------------------------------------------------|
  14376. * message info field:
  14377. * - MSG_TYPE
  14378. * Bits 7:0
  14379. * Purpose: identifies this as a channel calibration data message
  14380. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14381. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14382. * - SUB_TYPE
  14383. * Bits 11:8
  14384. * Purpose: T2H: indicates whether target is providing chan cal data
  14385. * to the host to store, or requesting that the host
  14386. * download previously-stored data.
  14387. * H2T: indicates whether the host is providing the requested
  14388. * channel cal data, or if it is rejecting the data
  14389. * request because it does not have the requested data.
  14390. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14391. * - CHKSUM_VALID
  14392. * Bit 12
  14393. * Purpose: indicates if the checksum field is valid
  14394. * value:
  14395. * - FRAG
  14396. * Bit 19:16
  14397. * Purpose: indicates the fragment index for message
  14398. * value: 0 for first fragment, 1 for second fragment, ...
  14399. * - APPEND
  14400. * Bit 20
  14401. * Purpose: indicates if this is the last fragment
  14402. * value: 0 = final fragment, 1 = more fragments will be appended
  14403. *
  14404. * channel and payload size field
  14405. * - MHZ
  14406. * Bits 15:0
  14407. * Purpose: indicates the channel primary frequency
  14408. * Value:
  14409. * - PAYLOAD_SIZE
  14410. * Bits 31:16
  14411. * Purpose: indicates the bytes of calibration data in payload
  14412. * Value:
  14413. *
  14414. * center frequency field
  14415. * - CENTER FREQUENCY 1
  14416. * Bits 15:0
  14417. * Purpose: indicates the channel center frequency
  14418. * Value: channel center frequency, in MHz units
  14419. * - CENTER FREQUENCY 2
  14420. * Bits 31:16
  14421. * Purpose: indicates the secondary channel center frequency,
  14422. * only for 11acvht 80plus80 mode
  14423. * Value: secondary channel center frequeny, in MHz units, if applicable
  14424. *
  14425. * checksum field
  14426. * - CHECK_SUM
  14427. * Bits 31:0
  14428. * Purpose: check the payload data, it is just for this fragment.
  14429. * This is intended for the target to check that the channel
  14430. * calibration data returned by the host is the unmodified data
  14431. * that was previously provided to the host by the target.
  14432. * value: checksum of fragment payload
  14433. */
  14434. PREPACK struct htt_chan_caldata_msg {
  14435. /* DWORD 0: message info */
  14436. A_UINT32
  14437. msg_type: 8,
  14438. sub_type: 4 ,
  14439. chksum_valid: 1, /** 1:valid, 0:invalid */
  14440. reserved1: 3,
  14441. frag_idx: 4, /** fragment index for calibration data */
  14442. appending: 1, /** 0: no fragment appending,
  14443. * 1: extra fragment appending */
  14444. reserved2: 11;
  14445. /* DWORD 1: channel and payload size */
  14446. A_UINT32
  14447. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14448. payload_size: 16; /** unit: bytes */
  14449. /* DWORD 2: center frequency */
  14450. A_UINT32
  14451. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14452. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14453. * valid only for 11acvht 80plus80 mode */
  14454. /* DWORD 3: check sum */
  14455. A_UINT32 chksum;
  14456. /* variable length for calibration data */
  14457. A_UINT32 payload[1/* or more */];
  14458. } POSTPACK;
  14459. /* T2H SUBTYPE */
  14460. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14461. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14462. /* H2T SUBTYPE */
  14463. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14464. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14465. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14466. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14467. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14468. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14469. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14470. do { \
  14471. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14472. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14473. } while (0)
  14474. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14475. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14476. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14477. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14478. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14479. do { \
  14480. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14481. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14482. } while (0)
  14483. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14484. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14485. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14486. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14487. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14488. do { \
  14489. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14490. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14491. } while (0)
  14492. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14493. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14494. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14495. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14496. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14497. do { \
  14498. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14499. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14500. } while (0)
  14501. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14502. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14503. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14504. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14505. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14506. do { \
  14507. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14508. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14509. } while (0)
  14510. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14511. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14512. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14513. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14514. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14515. do { \
  14516. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14517. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14518. } while (0)
  14519. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14520. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14521. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14522. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14523. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14524. do { \
  14525. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14526. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14527. } while (0)
  14528. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14529. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14530. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14531. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14532. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14533. do { \
  14534. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14535. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14536. } while (0)
  14537. /**
  14538. * @brief target -> host FSE CMEM based send
  14539. *
  14540. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14541. *
  14542. * @details
  14543. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14544. * FSE placement in CMEM is enabled.
  14545. *
  14546. * This message sends the non-secure CMEM base address.
  14547. * It will be sent to host in response to message
  14548. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14549. * The message would appear as follows:
  14550. *
  14551. * |31 24|23 16|15 8|7 0|
  14552. * |----------------+----------------+----------------+----------------|
  14553. * | reserved | num_entries | msg_type |
  14554. * |----------------+----------------+----------------+----------------|
  14555. * | base_address_lo |
  14556. * |----------------+----------------+----------------+----------------|
  14557. * | base_address_hi |
  14558. * |-------------------------------------------------------------------|
  14559. *
  14560. * The message is interpreted as follows:
  14561. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14562. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14563. * b'8:15 - number_entries: Indicated the number of entries
  14564. * programmed.
  14565. * b'16:31 - reserved.
  14566. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14567. * CMEM base address
  14568. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14569. * CMEM base address
  14570. */
  14571. PREPACK struct htt_cmem_base_send_t {
  14572. A_UINT32 msg_type: 8,
  14573. num_entries: 8,
  14574. reserved: 16;
  14575. A_UINT32 base_address_lo;
  14576. A_UINT32 base_address_hi;
  14577. } POSTPACK;
  14578. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14579. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14580. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14581. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14582. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14583. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14584. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14585. do { \
  14586. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14587. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14588. } while (0)
  14589. /**
  14590. * @brief - HTT PPDU ID format
  14591. *
  14592. * @details
  14593. * The following field definitions describe the format of the PPDU ID.
  14594. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14595. *
  14596. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14597. * +--------------------------------------------------------------------------
  14598. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14599. * +--------------------------------------------------------------------------
  14600. *
  14601. * sch id :Schedule command id
  14602. * Bits [11 : 0] : monotonically increasing counter to track the
  14603. * PPDU posted to a specific transmit queue.
  14604. *
  14605. * hwq_id: Hardware Queue ID.
  14606. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14607. *
  14608. * mac_id: MAC ID
  14609. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14610. *
  14611. * seq_idx: Sequence index.
  14612. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14613. * a particular TXOP.
  14614. *
  14615. * tqm_cmd: HWSCH/TQM flag.
  14616. * Bit [23] : Always set to 0.
  14617. *
  14618. * seq_cmd_type: Sequence command type.
  14619. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14620. * Refer to enum HTT_STATS_FTYPE for values.
  14621. */
  14622. PREPACK struct htt_ppdu_id {
  14623. A_UINT32
  14624. sch_id: 12,
  14625. hwq_id: 5,
  14626. mac_id: 2,
  14627. seq_idx: 2,
  14628. reserved1: 2,
  14629. tqm_cmd: 1,
  14630. seq_cmd_type: 6,
  14631. reserved2: 2;
  14632. } POSTPACK;
  14633. #define HTT_PPDU_ID_SCH_ID_S 0
  14634. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14635. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14636. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14637. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14638. do { \
  14639. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14640. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14641. } while (0)
  14642. #define HTT_PPDU_ID_HWQ_ID_S 12
  14643. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14644. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14645. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14646. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14647. do { \
  14648. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14649. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14650. } while (0)
  14651. #define HTT_PPDU_ID_MAC_ID_S 17
  14652. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14653. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14654. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14655. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14656. do { \
  14657. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14658. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14659. } while (0)
  14660. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14661. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14662. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14663. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14664. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14665. do { \
  14666. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14667. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14668. } while (0)
  14669. #define HTT_PPDU_ID_TQM_CMD_S 23
  14670. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14671. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14672. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14673. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14674. do { \
  14675. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14676. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14677. } while (0)
  14678. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14679. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14680. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14681. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14682. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14683. do { \
  14684. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14685. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14686. } while (0)
  14687. /**
  14688. * @brief target -> RX PEER METADATA V0 format
  14689. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14690. * message from target, and will confirm to the target which peer metadata
  14691. * version to use in the wmi_init message.
  14692. *
  14693. * The following diagram shows the format of the RX PEER METADATA.
  14694. *
  14695. * |31 24|23 16|15 8|7 0|
  14696. * |-----------------------------------------------------------------------|
  14697. * | Reserved | VDEV ID | PEER ID |
  14698. * |-----------------------------------------------------------------------|
  14699. */
  14700. PREPACK struct htt_rx_peer_metadata_v0 {
  14701. A_UINT32
  14702. peer_id: 16,
  14703. vdev_id: 8,
  14704. reserved1: 8;
  14705. } POSTPACK;
  14706. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14707. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14708. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14709. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14710. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14713. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14714. } while (0)
  14715. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14716. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14717. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14718. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14719. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14720. do { \
  14721. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14722. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14723. } while (0)
  14724. /**
  14725. * @brief target -> RX PEER METADATA V1 format
  14726. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14727. * message from target, and will confirm to the target which peer metadata
  14728. * version to use in the wmi_init message.
  14729. *
  14730. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14731. *
  14732. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14733. * |-----------------------------------------------------------------------|
  14734. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14735. * |-----------------------------------------------------------------------|
  14736. */
  14737. PREPACK struct htt_rx_peer_metadata_v1 {
  14738. A_UINT32
  14739. peer_id: 13,
  14740. ml_peer_valid: 1,
  14741. reserved1: 2,
  14742. vdev_id: 8,
  14743. lmac_id: 2,
  14744. chip_id: 3,
  14745. reserved2: 3;
  14746. } POSTPACK;
  14747. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14748. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14749. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14750. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14751. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14752. do { \
  14753. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14754. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14755. } while (0)
  14756. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14757. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14758. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14759. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14760. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14761. do { \
  14762. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14763. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14764. } while (0)
  14765. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14766. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14767. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14768. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14769. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14770. do { \
  14771. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14772. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14773. } while (0)
  14774. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14775. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14776. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14777. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14778. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14779. do { \
  14780. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14781. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14782. } while (0)
  14783. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14784. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14785. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14786. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14787. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14788. do { \
  14789. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14790. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14791. } while (0)
  14792. /*
  14793. * In some systems, the host SW wants to specify priorities between
  14794. * different MSDU / flow queues within the same peer-TID.
  14795. * The below enums are used for the host to identify to the target
  14796. * which MSDU queue's priority it wants to adjust.
  14797. */
  14798. /*
  14799. * The MSDUQ index describe index of TCL HW, where each index is
  14800. * used for queuing particular types of MSDUs.
  14801. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14802. */
  14803. enum HTT_MSDUQ_INDEX {
  14804. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14805. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14806. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14807. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14808. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14809. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14810. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14811. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14812. HTT_MSDUQ_MAX_INDEX,
  14813. };
  14814. /* MSDU qtype definition */
  14815. enum HTT_MSDU_QTYPE {
  14816. /*
  14817. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14818. * relative priority. Instead, the relative priority of CRIT_0 versus
  14819. * CRIT_1 is controlled by the FW, through the configuration parameters
  14820. * it applies to the queues.
  14821. */
  14822. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14823. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14824. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14825. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14826. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14827. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14828. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14829. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14830. /* New MSDU_QTYPE should be added above this line */
  14831. /*
  14832. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14833. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14834. * any host/target message definitions. The QTYPE_MAX value can
  14835. * only be used internally within the host or within the target.
  14836. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14837. * it must regard the unexpected value as a default qtype value,
  14838. * or ignore it.
  14839. */
  14840. HTT_MSDU_QTYPE_MAX,
  14841. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14842. };
  14843. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14844. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14845. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14846. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14847. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14848. };
  14849. /**
  14850. * @brief target -> host mlo timestamp offset indication
  14851. *
  14852. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14853. *
  14854. * @details
  14855. * The following field definitions describe the format of the HTT target
  14856. * to host mlo timestamp offset indication message.
  14857. *
  14858. *
  14859. * |31 16|15 12|11 10|9 8|7 0 |
  14860. * |----------------------------------------------------------------------|
  14861. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14862. * |----------------------------------------------------------------------|
  14863. * | Sync time stamp lo in us |
  14864. * |----------------------------------------------------------------------|
  14865. * | Sync time stamp hi in us |
  14866. * |----------------------------------------------------------------------|
  14867. * | mlo time stamp offset lo in us |
  14868. * |----------------------------------------------------------------------|
  14869. * | mlo time stamp offset hi in us |
  14870. * |----------------------------------------------------------------------|
  14871. * | mlo time stamp offset clocks in clock ticks |
  14872. * |----------------------------------------------------------------------|
  14873. * |31 26|25 16|15 0 |
  14874. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14875. * | | compensation in clks | |
  14876. * |----------------------------------------------------------------------|
  14877. * |31 22|21 0 |
  14878. * | rsvd 3 | mlo time stamp comp timer period |
  14879. * |----------------------------------------------------------------------|
  14880. * The message is interpreted as follows:
  14881. *
  14882. * dword0 - b'0:7 - msg_type: This will be set to
  14883. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14884. * value: 0x28
  14885. *
  14886. * dword0 - b'9:8 - pdev_id
  14887. *
  14888. * dword0 - b'11:10 - chip_id
  14889. *
  14890. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14891. *
  14892. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14893. *
  14894. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14895. * which last sync interrupt was received
  14896. *
  14897. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14898. * which last sync interrupt was received
  14899. *
  14900. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14901. *
  14902. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14903. *
  14904. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14905. *
  14906. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14907. *
  14908. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14909. * for sub us resolution
  14910. *
  14911. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14912. *
  14913. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14914. * is applied, in us
  14915. *
  14916. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14917. */
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14919. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14922. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14923. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14924. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14925. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14926. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14927. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14928. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14929. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14930. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14931. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14932. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14933. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14934. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14935. do { \
  14936. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14937. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14938. } while (0)
  14939. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14940. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14941. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14942. do { \
  14943. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14944. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14945. } while (0)
  14946. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14947. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14949. do { \
  14950. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14951. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14952. } while (0)
  14953. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14954. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14955. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14957. do { \
  14958. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14959. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14960. } while (0)
  14961. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14962. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14963. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14964. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14965. do { \
  14966. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14967. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14968. } while (0)
  14969. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14970. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14971. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14972. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14973. do { \
  14974. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14975. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14976. } while (0)
  14977. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14978. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14979. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14980. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14981. do { \
  14982. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14983. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14984. } while (0)
  14985. typedef struct {
  14986. A_UINT32 msg_type: 8, /* bits 7:0 */
  14987. pdev_id: 2, /* bits 9:8 */
  14988. chip_id: 2, /* bits 11:10 */
  14989. reserved1: 4, /* bits 15:12 */
  14990. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14991. A_UINT32 sync_timestamp_lo_us;
  14992. A_UINT32 sync_timestamp_hi_us;
  14993. A_UINT32 mlo_timestamp_offset_lo_us;
  14994. A_UINT32 mlo_timestamp_offset_hi_us;
  14995. A_UINT32 mlo_timestamp_offset_clks;
  14996. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14997. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14998. reserved2: 6; /* bits 31:26 */
  14999. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15000. reserved3: 10; /* bits 31:22 */
  15001. } htt_t2h_mlo_offset_ind_t;
  15002. /*
  15003. * @brief target -> host VDEV TX RX STATS
  15004. *
  15005. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15006. *
  15007. * @details
  15008. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15009. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15010. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15011. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15012. * periodically by target even in the absence of any further HTT request
  15013. * messages from host.
  15014. *
  15015. * The message is formatted as follows:
  15016. *
  15017. * |31 16|15 8|7 0|
  15018. * |---------------------------------+----------------+----------------|
  15019. * | payload_size | pdev_id | msg_type |
  15020. * |---------------------------------+----------------+----------------|
  15021. * | reserved0 |
  15022. * |-------------------------------------------------------------------|
  15023. * | reserved1 |
  15024. * |-------------------------------------------------------------------|
  15025. * | reserved2 |
  15026. * |-------------------------------------------------------------------|
  15027. * | |
  15028. * | VDEV specific Tx Rx stats info |
  15029. * | |
  15030. * |-------------------------------------------------------------------|
  15031. *
  15032. * The message is interpreted as follows:
  15033. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15034. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15035. * b'8:15 - pdev_id
  15036. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15037. * message header fields (msg_type through reserved2)
  15038. * dword1 - b'0:31 - reserved0.
  15039. * dword2 - b'0:31 - reserved1.
  15040. * dword3 - b'0:31 - reserved2.
  15041. */
  15042. typedef struct {
  15043. A_UINT32 msg_type: 8,
  15044. pdev_id: 8,
  15045. payload_size: 16;
  15046. A_UINT32 reserved0;
  15047. A_UINT32 reserved1;
  15048. A_UINT32 reserved2;
  15049. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15050. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15051. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15052. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15053. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15054. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15055. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15056. do { \
  15057. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15058. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15059. } while (0)
  15060. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15061. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15062. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15063. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15064. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15065. do { \
  15066. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15067. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15068. } while (0)
  15069. /* SOC related stats */
  15070. typedef struct {
  15071. htt_tlv_hdr_t tlv_hdr;
  15072. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15073. * This can be due to either the peer is deleted or deletion is ongoing
  15074. * */
  15075. A_UINT32 inv_peers_msdu_drop_count_lo;
  15076. A_UINT32 inv_peers_msdu_drop_count_hi;
  15077. } htt_t2h_soc_txrx_stats_common_tlv;
  15078. /* VDEV HW Tx/Rx stats */
  15079. typedef struct {
  15080. htt_tlv_hdr_t tlv_hdr;
  15081. A_UINT32 vdev_id;
  15082. /* Rx msdu byte cnt */
  15083. A_UINT32 rx_msdu_byte_cnt_lo;
  15084. A_UINT32 rx_msdu_byte_cnt_hi;
  15085. /* Rx msdu cnt */
  15086. A_UINT32 rx_msdu_cnt_lo;
  15087. A_UINT32 rx_msdu_cnt_hi;
  15088. /* tx msdu byte cnt */
  15089. A_UINT32 tx_msdu_byte_cnt_lo;
  15090. A_UINT32 tx_msdu_byte_cnt_hi;
  15091. /* tx msdu cnt */
  15092. A_UINT32 tx_msdu_cnt_lo;
  15093. A_UINT32 tx_msdu_cnt_hi;
  15094. /* tx excessive retry discarded msdu cnt*/
  15095. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15096. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15097. /* TX congestion ctrl msdu drop cnt */
  15098. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15099. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15100. /* discarded tx msdus cnt coz of time to live expiry */
  15101. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15102. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15103. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15104. #endif