htt.h 720 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868
  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. */
  214. #define HTT_CURRENT_VERSION_MAJOR 3
  215. #define HTT_CURRENT_VERSION_MINOR 94
  216. #define HTT_NUM_TX_FRAG_DESC 1024
  217. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  218. #define HTT_CHECK_SET_VAL(field, val) \
  219. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  220. /* macros to assist in sign-extending fields from HTT messages */
  221. #define HTT_SIGN_BIT_MASK(field) \
  222. ((field ## _M + (1 << field ## _S)) >> 1)
  223. #define HTT_SIGN_BIT(_val, field) \
  224. (_val & HTT_SIGN_BIT_MASK(field))
  225. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  226. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  227. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  228. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  229. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  230. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  231. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  232. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  233. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  234. /*
  235. * TEMPORARY:
  236. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  237. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  238. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  239. * updated.
  240. */
  241. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  242. /*
  243. * TEMPORARY:
  244. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  245. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  246. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  247. * updated.
  248. */
  249. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  250. /*
  251. * htt_dbg_stats_type -
  252. * bit positions for each stats type within a stats type bitmask
  253. * The bitmask contains 24 bits.
  254. */
  255. enum htt_dbg_stats_type {
  256. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  257. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  258. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  259. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  260. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  261. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  262. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  263. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  264. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  265. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  266. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  267. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  268. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  269. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  270. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  271. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  272. /* bits 16-23 currently reserved */
  273. /* keep this last */
  274. HTT_DBG_NUM_STATS
  275. };
  276. /*=== HTT option selection TLVs ===
  277. * Certain HTT messages have alternatives or options.
  278. * For such cases, the host and target need to agree on which option to use.
  279. * Option specification TLVs can be appended to the VERSION_REQ and
  280. * VERSION_CONF messages to select options other than the default.
  281. * These TLVs are entirely optional - if they are not provided, there is a
  282. * well-defined default for each option. If they are provided, they can be
  283. * provided in any order. Each TLV can be present or absent independent of
  284. * the presence / absence of other TLVs.
  285. *
  286. * The HTT option selection TLVs use the following format:
  287. * |31 16|15 8|7 0|
  288. * |---------------------------------+----------------+----------------|
  289. * | value (payload) | length | tag |
  290. * |-------------------------------------------------------------------|
  291. * The value portion need not be only 2 bytes; it can be extended by any
  292. * integer number of 4-byte units. The total length of the TLV, including
  293. * the tag and length fields, must be a multiple of 4 bytes. The length
  294. * field specifies the total TLV size in 4-byte units. Thus, the typical
  295. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  296. * field, would store 0x1 in its length field, to show that the TLV occupies
  297. * a single 4-byte unit.
  298. */
  299. /*--- TLV header format - applies to all HTT option TLVs ---*/
  300. enum HTT_OPTION_TLV_TAGS {
  301. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  302. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  303. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  304. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  305. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  306. };
  307. PREPACK struct htt_option_tlv_header_t {
  308. A_UINT8 tag;
  309. A_UINT8 length;
  310. } POSTPACK;
  311. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  312. #define HTT_OPTION_TLV_TAG_S 0
  313. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  314. #define HTT_OPTION_TLV_LENGTH_S 8
  315. /*
  316. * value0 - 16 bit value field stored in word0
  317. * The TLV's value field may be longer than 2 bytes, in which case
  318. * the remainder of the value is stored in word1, word2, etc.
  319. */
  320. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  321. #define HTT_OPTION_TLV_VALUE0_S 16
  322. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  323. do { \
  324. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  325. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  326. } while (0)
  327. #define HTT_OPTION_TLV_TAG_GET(word) \
  328. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  329. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  330. do { \
  331. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  332. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  333. } while (0)
  334. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  335. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  336. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  337. do { \
  338. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  339. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  340. } while (0)
  341. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  342. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  343. /*--- format of specific HTT option TLVs ---*/
  344. /*
  345. * HTT option TLV for specifying LL bus address size
  346. * Some chips require bus addresses used by the target to access buffers
  347. * within the host's memory to be 32 bits; others require bus addresses
  348. * used by the target to access buffers within the host's memory to be
  349. * 64 bits.
  350. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  351. * a suffix to the VERSION_CONF message to specify which bus address format
  352. * the target requires.
  353. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  354. * default to providing bus addresses to the target in 32-bit format.
  355. */
  356. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  357. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  359. };
  360. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  361. struct htt_option_tlv_header_t hdr;
  362. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  363. } POSTPACK;
  364. /*
  365. * HTT option TLV for specifying whether HL systems should indicate
  366. * over-the-air tx completion for individual frames, or should instead
  367. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  368. * requests an OTA tx completion for a particular tx frame.
  369. * This option does not apply to LL systems, where the TX_COMPL_IND
  370. * is mandatory.
  371. * This option is primarily intended for HL systems in which the tx frame
  372. * downloads over the host --> target bus are as slow as or slower than
  373. * the transmissions over the WLAN PHY. For cases where the bus is faster
  374. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  375. * and consquently will send one TX_COMPL_IND message that covers several
  376. * tx frames. For cases where the WLAN PHY is faster than the bus,
  377. * the target will end up transmitting very short A-MPDUs, and consequently
  378. * sending many TX_COMPL_IND messages, which each cover a very small number
  379. * of tx frames.
  380. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  381. * a suffix to the VERSION_REQ message to request whether the host desires to
  382. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  383. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  384. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  385. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  386. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  387. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  388. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  389. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  390. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  391. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  392. * TLV.
  393. */
  394. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  395. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  396. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  397. };
  398. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  399. struct htt_option_tlv_header_t hdr;
  400. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  401. } POSTPACK;
  402. /*
  403. * HTT option TLV for specifying how many tx queue groups the target
  404. * may establish.
  405. * This TLV specifies the maximum value the target may send in the
  406. * txq_group_id field of any TXQ_GROUP information elements sent by
  407. * the target to the host. This allows the host to pre-allocate an
  408. * appropriate number of tx queue group structs.
  409. *
  410. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  411. * a suffix to the VERSION_REQ message to specify whether the host supports
  412. * tx queue groups at all, and if so if there is any limit on the number of
  413. * tx queue groups that the host supports.
  414. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  415. * a suffix to the VERSION_CONF message. If the host has specified in the
  416. * VER_REQ message a limit on the number of tx queue groups the host can
  417. * supprt, the target shall limit its specification of the maximum tx groups
  418. * to be no larger than this host-specified limit.
  419. *
  420. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  421. * shall preallocate 4 tx queue group structs, and the target shall not
  422. * specify a txq_group_id larger than 3.
  423. */
  424. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  425. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  426. /*
  427. * values 1 through N specify the max number of tx queue groups
  428. * the sender supports
  429. */
  430. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  431. };
  432. /* TEMPORARY backwards-compatibility alias for a typo fix -
  433. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  434. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  435. * to support the old name (with the typo) until all references to the
  436. * old name are replaced with the new name.
  437. */
  438. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  439. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  440. struct htt_option_tlv_header_t hdr;
  441. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  442. } POSTPACK;
  443. /*
  444. * HTT option TLV for specifying whether the target supports an extended
  445. * version of the HTT tx descriptor. If the target provides this TLV
  446. * and specifies in the TLV that the target supports an extended version
  447. * of the HTT tx descriptor, the target must check the "extension" bit in
  448. * the HTT tx descriptor, and if the extension bit is set, to expect a
  449. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  450. * descriptor. Furthermore, the target must provide room for the HTT
  451. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  452. * This option is intended for systems where the host needs to explicitly
  453. * control the transmission parameters such as tx power for individual
  454. * tx frames.
  455. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  456. * as a suffix to the VERSION_CONF message to explicitly specify whether
  457. * the target supports the HTT tx MSDU extension descriptor.
  458. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  459. * by the host as lack of target support for the HTT tx MSDU extension
  460. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  461. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  462. * the HTT tx MSDU extension descriptor.
  463. * The host is not required to provide the HTT tx MSDU extension descriptor
  464. * just because the target supports it; the target must check the
  465. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  466. * extension descriptor is present.
  467. */
  468. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  469. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  471. };
  472. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  473. struct htt_option_tlv_header_t hdr;
  474. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  475. } POSTPACK;
  476. typedef struct {
  477. union {
  478. /* BIT [11 : 0] :- tag
  479. * BIT [23 : 12] :- length
  480. * BIT [31 : 24] :- reserved
  481. */
  482. A_UINT32 tag__length;
  483. /*
  484. * The following struct is not endian-portable.
  485. * It is suitable for use within the target, which is known to be
  486. * little-endian.
  487. * The host should use the above endian-portable macros to access
  488. * the tag and length bitfields in an endian-neutral manner.
  489. */
  490. struct {
  491. A_UINT32 tag : 12, /* BIT [11 : 0] */
  492. length : 12, /* BIT [23 : 12] */
  493. reserved : 8; /* BIT [31 : 24] */
  494. };
  495. };
  496. } htt_tlv_hdr_t;
  497. typedef enum {
  498. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  499. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  500. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  501. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  502. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  503. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  504. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  505. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  506. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  507. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  509. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  510. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  511. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  512. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  513. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  514. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  515. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  516. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  517. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  519. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  520. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  521. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  522. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  523. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  524. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  525. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  526. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  527. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  528. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  529. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  530. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  531. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  532. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  533. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  534. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  535. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  536. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  537. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  538. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  539. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  540. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  541. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  542. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  543. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  544. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  545. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  546. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  549. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  550. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  552. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  553. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  554. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  555. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  556. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  557. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  558. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  559. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  560. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  561. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  562. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  563. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  564. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  565. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  566. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  567. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  568. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  569. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  570. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  571. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  572. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  573. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  574. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  575. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  576. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  577. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  578. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  579. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  580. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  581. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  582. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  583. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  584. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  585. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  586. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  587. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  588. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  589. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  590. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  591. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  592. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  593. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  594. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  596. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  597. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  598. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  599. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  600. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  601. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  602. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  603. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  606. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  607. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  608. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  609. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  610. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  611. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  612. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  615. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  616. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  617. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  618. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  619. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  620. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  621. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  622. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  623. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  624. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  625. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  626. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  627. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  628. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  629. HTT_STATS_MAX_TAG,
  630. } htt_tlv_tag_t;
  631. #define HTT_STATS_TLV_TAG_M 0x00000fff
  632. #define HTT_STATS_TLV_TAG_S 0
  633. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  634. #define HTT_STATS_TLV_LENGTH_S 12
  635. #define HTT_STATS_TLV_TAG_GET(_var) \
  636. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  637. HTT_STATS_TLV_TAG_S)
  638. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  639. do { \
  640. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  641. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  642. } while (0)
  643. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  644. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  645. HTT_STATS_TLV_LENGTH_S)
  646. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  647. do { \
  648. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  649. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  650. } while (0)
  651. /*=== host -> target messages ===============================================*/
  652. enum htt_h2t_msg_type {
  653. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  654. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  655. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  656. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  657. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  658. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  659. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  660. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  661. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  662. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  663. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  664. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  665. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  666. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  667. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  668. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  669. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  670. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  671. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  672. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  673. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  674. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  675. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  676. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  677. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  678. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  679. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  680. /* keep this last */
  681. HTT_H2T_NUM_MSGS
  682. };
  683. /*
  684. * HTT host to target message type -
  685. * stored in bits 7:0 of the first word of the message
  686. */
  687. #define HTT_H2T_MSG_TYPE_M 0xff
  688. #define HTT_H2T_MSG_TYPE_S 0
  689. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  690. do { \
  691. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  692. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  693. } while (0)
  694. #define HTT_H2T_MSG_TYPE_GET(word) \
  695. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  696. /**
  697. * @brief host -> target version number request message definition
  698. *
  699. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  700. *
  701. *
  702. * |31 24|23 16|15 8|7 0|
  703. * |----------------+----------------+----------------+----------------|
  704. * | reserved | msg type |
  705. * |-------------------------------------------------------------------|
  706. * : option request TLV (optional) |
  707. * :...................................................................:
  708. *
  709. * The VER_REQ message may consist of a single 4-byte word, or may be
  710. * extended with TLVs that specify which HTT options the host is requesting
  711. * from the target.
  712. * The following option TLVs may be appended to the VER_REQ message:
  713. * - HL_SUPPRESS_TX_COMPL_IND
  714. * - HL_MAX_TX_QUEUE_GROUPS
  715. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  716. * may be appended to the VER_REQ message (but only one TLV of each type).
  717. *
  718. * Header fields:
  719. * - MSG_TYPE
  720. * Bits 7:0
  721. * Purpose: identifies this as a version number request message
  722. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  723. */
  724. #define HTT_VER_REQ_BYTES 4
  725. /* TBDXXX: figure out a reasonable number */
  726. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  727. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  728. /**
  729. * @brief HTT tx MSDU descriptor
  730. *
  731. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  732. *
  733. * @details
  734. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  735. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  736. * the target firmware needs for the FW's tx processing, particularly
  737. * for creating the HW msdu descriptor.
  738. * The same HTT tx descriptor is used for HL and LL systems, though
  739. * a few fields within the tx descriptor are used only by LL or
  740. * only by HL.
  741. * The HTT tx descriptor is defined in two manners: by a struct with
  742. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  743. * definitions.
  744. * The target should use the struct def, for simplicitly and clarity,
  745. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  746. * neutral. Specifically, the host shall use the get/set macros built
  747. * around the mask + shift defs.
  748. */
  749. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  750. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  751. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  752. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  753. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  754. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  755. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  756. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  757. #define HTT_TX_VDEV_ID_WORD 0
  758. #define HTT_TX_VDEV_ID_MASK 0x3f
  759. #define HTT_TX_VDEV_ID_SHIFT 16
  760. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  761. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  762. #define HTT_TX_MSDU_LEN_DWORD 1
  763. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  764. /*
  765. * HTT_VAR_PADDR macros
  766. * Allow physical / bus addresses to be either a single 32-bit value,
  767. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  768. */
  769. #define HTT_VAR_PADDR32(var_name) \
  770. A_UINT32 var_name
  771. #define HTT_VAR_PADDR64_LE(var_name) \
  772. struct { \
  773. /* little-endian: lo precedes hi */ \
  774. A_UINT32 lo; \
  775. A_UINT32 hi; \
  776. } var_name
  777. /*
  778. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  779. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  780. * addresses are stored in a XXX-bit field.
  781. * This macro is used to define both htt_tx_msdu_desc32_t and
  782. * htt_tx_msdu_desc64_t structs.
  783. */
  784. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  785. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  786. { \
  787. /* DWORD 0: flags and meta-data */ \
  788. A_UINT32 \
  789. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  790. \
  791. /* pkt_subtype - \
  792. * Detailed specification of the tx frame contents, extending the \
  793. * general specification provided by pkt_type. \
  794. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  795. * pkt_type | pkt_subtype \
  796. * ============================================================== \
  797. * 802.3 | bit 0:3 - Reserved \
  798. * | bit 4: 0x0 - Copy-Engine Classification Results \
  799. * | not appended to the HTT message \
  800. * | 0x1 - Copy-Engine Classification Results \
  801. * | appended to the HTT message in the \
  802. * | format: \
  803. * | [HTT tx desc, frame header, \
  804. * | CE classification results] \
  805. * | The CE classification results begin \
  806. * | at the next 4-byte boundary after \
  807. * | the frame header. \
  808. * ------------+------------------------------------------------- \
  809. * Eth2 | bit 0:3 - Reserved \
  810. * | bit 4: 0x0 - Copy-Engine Classification Results \
  811. * | not appended to the HTT message \
  812. * | 0x1 - Copy-Engine Classification Results \
  813. * | appended to the HTT message. \
  814. * | See the above specification of the \
  815. * | CE classification results location. \
  816. * ------------+------------------------------------------------- \
  817. * native WiFi | bit 0:3 - Reserved \
  818. * | bit 4: 0x0 - Copy-Engine Classification Results \
  819. * | not appended to the HTT message \
  820. * | 0x1 - Copy-Engine Classification Results \
  821. * | appended to the HTT message. \
  822. * | See the above specification of the \
  823. * | CE classification results location. \
  824. * ------------+------------------------------------------------- \
  825. * mgmt | 0x0 - 802.11 MAC header absent \
  826. * | 0x1 - 802.11 MAC header present \
  827. * ------------+------------------------------------------------- \
  828. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  829. * | 0x1 - 802.11 MAC header present \
  830. * | bit 1: 0x0 - allow aggregation \
  831. * | 0x1 - don't allow aggregation \
  832. * | bit 2: 0x0 - perform encryption \
  833. * | 0x1 - don't perform encryption \
  834. * | bit 3: 0x0 - perform tx classification / queuing \
  835. * | 0x1 - don't perform tx classification; \
  836. * | insert the frame into the "misc" \
  837. * | tx queue \
  838. * | bit 4: 0x0 - Copy-Engine Classification Results \
  839. * | not appended to the HTT message \
  840. * | 0x1 - Copy-Engine Classification Results \
  841. * | appended to the HTT message. \
  842. * | See the above specification of the \
  843. * | CE classification results location. \
  844. */ \
  845. pkt_subtype: 5, \
  846. \
  847. /* pkt_type - \
  848. * General specification of the tx frame contents. \
  849. * The htt_pkt_type enum should be used to specify and check the \
  850. * value of this field. \
  851. */ \
  852. pkt_type: 3, \
  853. \
  854. /* vdev_id - \
  855. * ID for the vdev that is sending this tx frame. \
  856. * For certain non-standard packet types, e.g. pkt_type == raw \
  857. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  858. * This field is used primarily for determining where to queue \
  859. * broadcast and multicast frames. \
  860. */ \
  861. vdev_id: 6, \
  862. /* ext_tid - \
  863. * The extended traffic ID. \
  864. * If the TID is unknown, the extended TID is set to \
  865. * HTT_TX_EXT_TID_INVALID. \
  866. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  867. * value of the QoS TID. \
  868. * If the tx frame is non-QoS data, then the extended TID is set to \
  869. * HTT_TX_EXT_TID_NON_QOS. \
  870. * If the tx frame is multicast or broadcast, then the extended TID \
  871. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  872. */ \
  873. ext_tid: 5, \
  874. \
  875. /* postponed - \
  876. * This flag indicates whether the tx frame has been downloaded to \
  877. * the target before but discarded by the target, and now is being \
  878. * downloaded again; or if this is a new frame that is being \
  879. * downloaded for the first time. \
  880. * This flag allows the target to determine the correct order for \
  881. * transmitting new vs. old frames. \
  882. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  883. * This flag only applies to HL systems, since in LL systems, \
  884. * the tx flow control is handled entirely within the target. \
  885. */ \
  886. postponed: 1, \
  887. \
  888. /* extension - \
  889. * This flag indicates whether a HTT tx MSDU extension descriptor \
  890. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  891. * \
  892. * 0x0 - no extension MSDU descriptor is present \
  893. * 0x1 - an extension MSDU descriptor immediately follows the \
  894. * regular MSDU descriptor \
  895. */ \
  896. extension: 1, \
  897. \
  898. /* cksum_offload - \
  899. * This flag indicates whether checksum offload is enabled or not \
  900. * for this frame. Target FW use this flag to turn on HW checksumming \
  901. * 0x0 - No checksum offload \
  902. * 0x1 - L3 header checksum only \
  903. * 0x2 - L4 checksum only \
  904. * 0x3 - L3 header checksum + L4 checksum \
  905. */ \
  906. cksum_offload: 2, \
  907. \
  908. /* tx_comp_req - \
  909. * This flag indicates whether Tx Completion \
  910. * from fw is required or not. \
  911. * This flag is only relevant if tx completion is not \
  912. * universally enabled. \
  913. * For all LL systems, tx completion is mandatory, \
  914. * so this flag will be irrelevant. \
  915. * For HL systems tx completion is optional, but HL systems in which \
  916. * the bus throughput exceeds the WLAN throughput will \
  917. * probably want to always use tx completion, and thus \
  918. * would not check this flag. \
  919. * This flag is required when tx completions are not used universally, \
  920. * but are still required for certain tx frames for which \
  921. * an OTA delivery acknowledgment is needed by the host. \
  922. * In practice, this would be for HL systems in which the \
  923. * bus throughput is less than the WLAN throughput. \
  924. * \
  925. * 0x0 - Tx Completion Indication from Fw not required \
  926. * 0x1 - Tx Completion Indication from Fw is required \
  927. */ \
  928. tx_compl_req: 1; \
  929. \
  930. \
  931. /* DWORD 1: MSDU length and ID */ \
  932. A_UINT32 \
  933. len: 16, /* MSDU length, in bytes */ \
  934. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  935. * and this id is used to calculate fragmentation \
  936. * descriptor pointer inside the target based on \
  937. * the base address, configured inside the target. \
  938. */ \
  939. \
  940. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  941. /* frags_desc_ptr - \
  942. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  943. * where the tx frame's fragments reside in memory. \
  944. * This field only applies to LL systems, since in HL systems the \
  945. * (degenerate single-fragment) fragmentation descriptor is created \
  946. * within the target. \
  947. */ \
  948. _paddr__frags_desc_ptr_; \
  949. \
  950. /* DWORD 3 (or 4): peerid, chanfreq */ \
  951. /* \
  952. * Peer ID : Target can use this value to know which peer-id packet \
  953. * destined to. \
  954. * It's intended to be specified by host in case of NAWDS. \
  955. */ \
  956. A_UINT16 peerid; \
  957. \
  958. /* \
  959. * Channel frequency: This identifies the desired channel \
  960. * frequency (in mhz) for tx frames. This is used by FW to help \
  961. * determine when it is safe to transmit or drop frames for \
  962. * off-channel operation. \
  963. * The default value of zero indicates to FW that the corresponding \
  964. * VDEV's home channel (if there is one) is the desired channel \
  965. * frequency. \
  966. */ \
  967. A_UINT16 chanfreq; \
  968. \
  969. /* Reason reserved is commented is increasing the htt structure size \
  970. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  971. * A_UINT32 reserved_dword3_bits0_31; \
  972. */ \
  973. } POSTPACK
  974. /* define a htt_tx_msdu_desc32_t type */
  975. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  976. /* define a htt_tx_msdu_desc64_t type */
  977. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  978. /*
  979. * Make htt_tx_msdu_desc_t be an alias for either
  980. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  981. */
  982. #if HTT_PADDR64
  983. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  984. #else
  985. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  986. #endif
  987. /* decriptor information for Management frame*/
  988. /*
  989. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  990. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  991. */
  992. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  993. extern A_UINT32 mgmt_hdr_len;
  994. PREPACK struct htt_mgmt_tx_desc_t {
  995. A_UINT32 msg_type;
  996. #if HTT_PADDR64
  997. A_UINT64 frag_paddr; /* DMAble address of the data */
  998. #else
  999. A_UINT32 frag_paddr; /* DMAble address of the data */
  1000. #endif
  1001. A_UINT32 desc_id; /* returned to host during completion
  1002. * to free the meory*/
  1003. A_UINT32 len; /* Fragment length */
  1004. A_UINT32 vdev_id; /* virtual device ID*/
  1005. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1006. } POSTPACK;
  1007. PREPACK struct htt_mgmt_tx_compl_ind {
  1008. A_UINT32 desc_id;
  1009. A_UINT32 status;
  1010. } POSTPACK;
  1011. /*
  1012. * This SDU header size comes from the summation of the following:
  1013. * 1. Max of:
  1014. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1015. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1016. * b. 802.11 header, for raw frames: 36 bytes
  1017. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1018. * QoS header, HT header)
  1019. * c. 802.3 header, for ethernet frames: 14 bytes
  1020. * (destination address, source address, ethertype / length)
  1021. * 2. Max of:
  1022. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1023. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1024. * 3. 802.1Q VLAN header: 4 bytes
  1025. * 4. LLC/SNAP header: 8 bytes
  1026. */
  1027. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1028. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1029. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1030. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1031. A_COMPILE_TIME_ASSERT(
  1032. htt_encap_hdr_size_max_check_nwifi,
  1033. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1034. A_COMPILE_TIME_ASSERT(
  1035. htt_encap_hdr_size_max_check_enet,
  1036. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1037. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1038. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1039. #define HTT_TX_HDR_SIZE_802_1Q 4
  1040. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1041. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1042. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1043. HTT_TX_HDR_SIZE_802_1Q + \
  1044. HTT_TX_HDR_SIZE_LLC_SNAP)
  1045. #define HTT_HL_TX_FRM_HDR_LEN \
  1046. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1047. #define HTT_LL_TX_FRM_HDR_LEN \
  1048. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1049. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1050. /* dword 0 */
  1051. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1052. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1053. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1054. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1055. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1056. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1057. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1058. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1059. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1060. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1061. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1062. #define HTT_TX_DESC_PKT_TYPE_S 13
  1063. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1064. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1065. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1066. #define HTT_TX_DESC_VDEV_ID_S 16
  1067. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1068. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1069. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1070. #define HTT_TX_DESC_EXT_TID_S 22
  1071. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1072. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1073. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1074. #define HTT_TX_DESC_POSTPONED_S 27
  1075. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1076. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1077. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1078. #define HTT_TX_DESC_EXTENSION_S 28
  1079. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1080. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1081. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1082. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1083. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1084. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1085. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1086. #define HTT_TX_DESC_TX_COMP_S 31
  1087. /* dword 1 */
  1088. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1089. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1090. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1091. #define HTT_TX_DESC_FRM_LEN_S 0
  1092. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1093. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1094. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1095. #define HTT_TX_DESC_FRM_ID_S 16
  1096. /* dword 2 */
  1097. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1098. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1099. /* for systems using 64-bit format for bus addresses */
  1100. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1101. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1102. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1103. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1104. /* for systems using 32-bit format for bus addresses */
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1106. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1107. /* dword 3 */
  1108. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1109. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1110. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1111. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1112. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1113. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1114. #if HTT_PADDR64
  1115. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1116. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1117. #else
  1118. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1119. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1120. #endif
  1121. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1122. #define HTT_TX_DESC_PEER_ID_S 0
  1123. /*
  1124. * TEMPORARY:
  1125. * The original definitions for the PEER_ID fields contained typos
  1126. * (with _DESC_PADDR appended to this PEER_ID field name).
  1127. * Retain deprecated original names for PEER_ID fields until all code that
  1128. * refers to them has been updated.
  1129. */
  1130. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1131. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1132. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1133. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1134. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1135. HTT_TX_DESC_PEER_ID_M
  1136. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1137. HTT_TX_DESC_PEER_ID_S
  1138. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1139. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1140. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1141. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1142. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1143. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1144. #if HTT_PADDR64
  1145. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1146. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1147. #else
  1148. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1149. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1150. #endif
  1151. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1152. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1153. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1154. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1155. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1156. do { \
  1157. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1158. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1159. } while (0)
  1160. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1161. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1162. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1163. do { \
  1164. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1165. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1166. } while (0)
  1167. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1168. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1169. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1170. do { \
  1171. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1172. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1173. } while (0)
  1174. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1175. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1176. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1177. do { \
  1178. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1179. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1180. } while (0)
  1181. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1182. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1183. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1184. do { \
  1185. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1186. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1187. } while (0)
  1188. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1189. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1190. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1191. do { \
  1192. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1193. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1194. } while (0)
  1195. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1196. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1197. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1198. do { \
  1199. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1200. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1201. } while (0)
  1202. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1203. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1204. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1205. do { \
  1206. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1207. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1208. } while (0)
  1209. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1210. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1211. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1212. do { \
  1213. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1214. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1215. } while (0)
  1216. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1217. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1218. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1219. do { \
  1220. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1221. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1222. } while (0)
  1223. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1224. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1225. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1226. do { \
  1227. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1228. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1229. } while (0)
  1230. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1231. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1232. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1233. do { \
  1234. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1235. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1236. } while (0)
  1237. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1238. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1239. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1240. do { \
  1241. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1242. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1243. } while (0)
  1244. /* enums used in the HTT tx MSDU extension descriptor */
  1245. enum {
  1246. htt_tx_guard_interval_regular = 0,
  1247. htt_tx_guard_interval_short = 1,
  1248. };
  1249. enum {
  1250. htt_tx_preamble_type_ofdm = 0,
  1251. htt_tx_preamble_type_cck = 1,
  1252. htt_tx_preamble_type_ht = 2,
  1253. htt_tx_preamble_type_vht = 3,
  1254. };
  1255. enum {
  1256. htt_tx_bandwidth_5MHz = 0,
  1257. htt_tx_bandwidth_10MHz = 1,
  1258. htt_tx_bandwidth_20MHz = 2,
  1259. htt_tx_bandwidth_40MHz = 3,
  1260. htt_tx_bandwidth_80MHz = 4,
  1261. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1262. };
  1263. /**
  1264. * @brief HTT tx MSDU extension descriptor
  1265. * @details
  1266. * If the target supports HTT tx MSDU extension descriptors, the host has
  1267. * the option of appending the following struct following the regular
  1268. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1269. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1270. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1271. * tx specs for each frame.
  1272. */
  1273. PREPACK struct htt_tx_msdu_desc_ext_t {
  1274. /* DWORD 0: flags */
  1275. A_UINT32
  1276. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1277. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1278. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1279. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1280. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1281. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1282. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1283. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1284. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1285. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1286. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1287. /* DWORD 1: tx power, tx rate, tx BW */
  1288. A_UINT32
  1289. /* pwr -
  1290. * Specify what power the tx frame needs to be transmitted at.
  1291. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1292. * The value needs to be appropriately sign-extended when extracting
  1293. * the value from the message and storing it in a variable that is
  1294. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1295. * automatically handles this sign-extension.)
  1296. * If the transmission uses multiple tx chains, this power spec is
  1297. * the total transmit power, assuming incoherent combination of
  1298. * per-chain power to produce the total power.
  1299. */
  1300. pwr: 8,
  1301. /* mcs_mask -
  1302. * Specify the allowable values for MCS index (modulation and coding)
  1303. * to use for transmitting the frame.
  1304. *
  1305. * For HT / VHT preamble types, this mask directly corresponds to
  1306. * the HT or VHT MCS indices that are allowed. For each bit N set
  1307. * within the mask, MCS index N is allowed for transmitting the frame.
  1308. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1309. * rates versus OFDM rates, so the host has the option of specifying
  1310. * that the target must transmit the frame with CCK or OFDM rates
  1311. * (not HT or VHT), but leaving the decision to the target whether
  1312. * to use CCK or OFDM.
  1313. *
  1314. * For CCK and OFDM, the bits within this mask are interpreted as
  1315. * follows:
  1316. * bit 0 -> CCK 1 Mbps rate is allowed
  1317. * bit 1 -> CCK 2 Mbps rate is allowed
  1318. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1319. * bit 3 -> CCK 11 Mbps rate is allowed
  1320. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1321. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1322. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1323. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1324. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1325. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1326. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1327. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1328. *
  1329. * The MCS index specification needs to be compatible with the
  1330. * bandwidth mask specification. For example, a MCS index == 9
  1331. * specification is inconsistent with a preamble type == VHT,
  1332. * Nss == 1, and channel bandwidth == 20 MHz.
  1333. *
  1334. * Furthermore, the host has only a limited ability to specify to
  1335. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1336. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1337. */
  1338. mcs_mask: 12,
  1339. /* nss_mask -
  1340. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1341. * Each bit in this mask corresponds to a Nss value:
  1342. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1343. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1344. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1345. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1346. * The values in the Nss mask must be suitable for the recipient, e.g.
  1347. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1348. * recipient which only supports 2x2 MIMO.
  1349. */
  1350. nss_mask: 4,
  1351. /* guard_interval -
  1352. * Specify a htt_tx_guard_interval enum value to indicate whether
  1353. * the transmission should use a regular guard interval or a
  1354. * short guard interval.
  1355. */
  1356. guard_interval: 1,
  1357. /* preamble_type_mask -
  1358. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1359. * may choose from for transmitting this frame.
  1360. * The bits in this mask correspond to the values in the
  1361. * htt_tx_preamble_type enum. For example, to allow the target
  1362. * to transmit the frame as either CCK or OFDM, this field would
  1363. * be set to
  1364. * (1 << htt_tx_preamble_type_ofdm) |
  1365. * (1 << htt_tx_preamble_type_cck)
  1366. */
  1367. preamble_type_mask: 4,
  1368. reserved1_31_29: 3; /* unused, set to 0x0 */
  1369. /* DWORD 2: tx chain mask, tx retries */
  1370. A_UINT32
  1371. /* chain_mask - specify which chains to transmit from */
  1372. chain_mask: 4,
  1373. /* retry_limit -
  1374. * Specify the maximum number of transmissions, including the
  1375. * initial transmission, to attempt before giving up if no ack
  1376. * is received.
  1377. * If the tx rate is specified, then all retries shall use the
  1378. * same rate as the initial transmission.
  1379. * If no tx rate is specified, the target can choose whether to
  1380. * retain the original rate during the retransmissions, or to
  1381. * fall back to a more robust rate.
  1382. */
  1383. retry_limit: 4,
  1384. /* bandwidth_mask -
  1385. * Specify what channel widths may be used for the transmission.
  1386. * A value of zero indicates "don't care" - the target may choose
  1387. * the transmission bandwidth.
  1388. * The bits within this mask correspond to the htt_tx_bandwidth
  1389. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1390. * The bandwidth_mask must be consistent with the preamble_type_mask
  1391. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1392. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1393. */
  1394. bandwidth_mask: 6,
  1395. reserved2_31_14: 18; /* unused, set to 0x0 */
  1396. /* DWORD 3: tx expiry time (TSF) LSBs */
  1397. A_UINT32 expire_tsf_lo;
  1398. /* DWORD 4: tx expiry time (TSF) MSBs */
  1399. A_UINT32 expire_tsf_hi;
  1400. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1401. } POSTPACK;
  1402. /* DWORD 0 */
  1403. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1404. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1405. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1406. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1407. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1408. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1409. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1423. /* DWORD 1 */
  1424. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1425. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1426. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1427. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1428. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1429. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1430. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1431. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1432. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1433. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1434. /* DWORD 2 */
  1435. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1436. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1437. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1438. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1439. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1440. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1441. /* DWORD 0 */
  1442. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1443. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1444. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1445. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1446. do { \
  1447. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1448. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1449. } while (0)
  1450. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1451. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1452. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1454. do { \
  1455. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1456. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1457. } while (0)
  1458. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1459. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1460. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1462. do { \
  1463. HTT_CHECK_SET_VAL( \
  1464. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1465. ((_var) |= ((_val) \
  1466. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1467. } while (0)
  1468. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1469. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1470. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1472. do { \
  1473. HTT_CHECK_SET_VAL( \
  1474. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1475. ((_var) |= ((_val) \
  1476. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1477. } while (0)
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1479. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1480. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1482. do { \
  1483. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1484. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1485. } while (0)
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1487. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1488. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1490. do { \
  1491. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1492. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1493. } while (0)
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1495. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1496. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1498. do { \
  1499. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1500. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1501. } while (0)
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1503. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1504. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1506. do { \
  1507. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1508. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1509. } while (0)
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1511. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1512. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1514. do { \
  1515. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1516. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1517. } while (0)
  1518. /* DWORD 1 */
  1519. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1520. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1521. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1522. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1523. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1524. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1525. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1526. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1527. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1528. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1529. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1530. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1531. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1532. do { \
  1533. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1534. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1535. } while (0)
  1536. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1537. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1538. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1539. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1540. do { \
  1541. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1542. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1543. } while (0)
  1544. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1545. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1546. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1547. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1548. do { \
  1549. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1550. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1559. } while (0)
  1560. /* DWORD 2 */
  1561. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1563. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1564. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1567. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1584. } while (0)
  1585. typedef enum {
  1586. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1587. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1588. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1589. } htt_11ax_ltf_subtype_t;
  1590. typedef enum {
  1591. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1592. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1593. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1594. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1595. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1596. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1597. } htt_tx_ext2_preamble_type_t;
  1598. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1599. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1600. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1610. /**
  1611. * @brief HTT tx MSDU extension descriptor v2
  1612. * @details
  1613. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1614. * is received as tcl_exit_base->host_meta_info in firmware.
  1615. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1616. * are already part of tcl_exit_base.
  1617. */
  1618. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1619. /* DWORD 0: flags */
  1620. A_UINT32
  1621. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1622. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1623. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1624. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1625. valid_retries : 1, /* if set, tx retries spec is valid */
  1626. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1627. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1628. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1629. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1630. valid_key_flags : 1, /* if set, key flags is valid */
  1631. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1632. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1633. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1634. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1635. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1636. 1 = ENCRYPT,
  1637. 2 ~ 3 - Reserved */
  1638. /* retry_limit -
  1639. * Specify the maximum number of transmissions, including the
  1640. * initial transmission, to attempt before giving up if no ack
  1641. * is received.
  1642. * If the tx rate is specified, then all retries shall use the
  1643. * same rate as the initial transmission.
  1644. * If no tx rate is specified, the target can choose whether to
  1645. * retain the original rate during the retransmissions, or to
  1646. * fall back to a more robust rate.
  1647. */
  1648. retry_limit : 4,
  1649. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1650. * Valid only for 11ax preamble types HE_SU
  1651. * and HE_EXT_SU
  1652. */
  1653. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1654. * Valid only for 11ax preamble types HE_SU
  1655. * and HE_EXT_SU
  1656. */
  1657. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1658. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1659. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1660. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1661. */
  1662. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1663. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1664. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1665. * Use cases:
  1666. * Any time firmware uses TQM-BYPASS for Data
  1667. * TID, firmware expect host to set this bit.
  1668. */
  1669. /* DWORD 1: tx power, tx rate */
  1670. A_UINT32
  1671. power : 8, /* unit of the power field is 0.5 dbm
  1672. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1673. * signed value ranging from -64dbm to 63.5 dbm
  1674. */
  1675. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1676. * Setting more than one MCS isn't currently
  1677. * supported by the target (but is supported
  1678. * in the interface in case in the future
  1679. * the target supports specifications of
  1680. * a limited set of MCS values.
  1681. */
  1682. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1683. * Setting more than one Nss isn't currently
  1684. * supported by the target (but is supported
  1685. * in the interface in case in the future
  1686. * the target supports specifications of
  1687. * a limited set of Nss values.
  1688. */
  1689. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1690. update_peer_cache : 1; /* When set these custom values will be
  1691. * used for all packets, until the next
  1692. * update via this ext header.
  1693. * This is to make sure not all packets
  1694. * need to include this header.
  1695. */
  1696. /* DWORD 2: tx chain mask, tx retries */
  1697. A_UINT32
  1698. /* chain_mask - specify which chains to transmit from */
  1699. chain_mask : 8,
  1700. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1701. * TODO: Update Enum values for key_flags
  1702. */
  1703. /*
  1704. * Channel frequency: This identifies the desired channel
  1705. * frequency (in MHz) for tx frames. This is used by FW to help
  1706. * determine when it is safe to transmit or drop frames for
  1707. * off-channel operation.
  1708. * The default value of zero indicates to FW that the corresponding
  1709. * VDEV's home channel (if there is one) is the desired channel
  1710. * frequency.
  1711. */
  1712. chanfreq : 16;
  1713. /* DWORD 3: tx expiry time (TSF) LSBs */
  1714. A_UINT32 expire_tsf_lo;
  1715. /* DWORD 4: tx expiry time (TSF) MSBs */
  1716. A_UINT32 expire_tsf_hi;
  1717. /* DWORD 5: flags to control routing / processing of the MSDU */
  1718. A_UINT32
  1719. /* learning_frame
  1720. * When this flag is set, this frame will be dropped by FW
  1721. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1722. */
  1723. learning_frame : 1,
  1724. /* send_as_standalone
  1725. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1726. * i.e. with no A-MSDU or A-MPDU aggregation.
  1727. * The scope is extended to other use-cases.
  1728. */
  1729. send_as_standalone : 1,
  1730. /* is_host_opaque_valid
  1731. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1732. * with valid information.
  1733. */
  1734. is_host_opaque_valid : 1,
  1735. rsvd0 : 29;
  1736. /* DWORD 6 : Host opaque cookie for special frames */
  1737. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1738. rsvd1 : 16;
  1739. /*
  1740. * This structure can be expanded further up to 40 bytes
  1741. * by adding further DWORDs as needed.
  1742. */
  1743. } POSTPACK;
  1744. /* DWORD 0 */
  1745. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1746. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1747. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1749. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1750. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1771. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1772. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1773. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1774. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1775. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1776. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1777. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1778. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1779. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1780. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1781. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1782. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1783. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1784. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1785. /* DWORD 1 */
  1786. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1787. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1788. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1789. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1790. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1791. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1792. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1793. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1794. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1795. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1796. /* DWORD 2 */
  1797. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1798. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1799. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1800. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1801. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1802. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1803. /* DWORD 5 */
  1804. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1805. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1806. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1807. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1808. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1809. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1810. /* DWORD 6 */
  1811. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1812. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1813. /* DWORD 0 */
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1815. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1816. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1818. do { \
  1819. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1820. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1821. } while (0)
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1829. } while (0)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL( \
  1844. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1845. ((_var) |= ((_val) \
  1846. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1847. } while (0)
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1849. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1850. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1854. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1855. } while (0)
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1857. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1858. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1860. do { \
  1861. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1862. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1863. } while (0)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1865. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1866. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1868. do { \
  1869. HTT_CHECK_SET_VAL( \
  1870. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1871. ((_var) |= ((_val) \
  1872. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1873. } while (0)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1875. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1876. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1878. do { \
  1879. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1880. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1881. } while (0)
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1889. } while (0)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1891. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1892. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1897. } while (0)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1899. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1900. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1905. } while (0)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1907. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1908. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1912. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1913. } while (0)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1915. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1916. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1920. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1921. } while (0)
  1922. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1944. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1945. } while (0)
  1946. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1947. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1948. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1949. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1952. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1953. } while (0)
  1954. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1955. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1956. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1957. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1977. } while (0)
  1978. /* DWORD 1 */
  1979. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1980. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1981. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1982. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1983. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1984. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1985. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1986. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1987. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1988. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2014. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2015. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2019. } while (0)
  2020. /* DWORD 2 */
  2021. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2044. } while (0)
  2045. /* DWORD 5 */
  2046. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2047. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2048. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2049. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2050. do { \
  2051. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2052. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2053. } while (0)
  2054. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2061. } while (0)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2069. } while (0)
  2070. /* DWORD 6 */
  2071. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2078. } while (0)
  2079. typedef enum {
  2080. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2081. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2082. } htt_tcl_metadata_type;
  2083. /**
  2084. * @brief HTT TCL command number format
  2085. * @details
  2086. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2087. * available to firmware as tcl_exit_base->tcl_status_number.
  2088. * For regular / multicast packets host will send vdev and mac id and for
  2089. * NAWDS packets, host will send peer id.
  2090. * A_UINT32 is used to avoid endianness conversion problems.
  2091. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2092. */
  2093. typedef struct {
  2094. A_UINT32
  2095. type: 1, /* vdev_id based or peer_id based */
  2096. rsvd: 31;
  2097. } htt_tx_tcl_vdev_or_peer_t;
  2098. typedef struct {
  2099. A_UINT32
  2100. type: 1, /* vdev_id based or peer_id based */
  2101. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2102. vdev_id: 8,
  2103. pdev_id: 2,
  2104. host_inspected:1,
  2105. rsvd: 19;
  2106. } htt_tx_tcl_vdev_metadata;
  2107. typedef struct {
  2108. A_UINT32
  2109. type: 1, /* vdev_id based or peer_id based */
  2110. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2111. peer_id: 14,
  2112. rsvd: 16;
  2113. } htt_tx_tcl_peer_metadata;
  2114. PREPACK struct htt_tx_tcl_metadata {
  2115. union {
  2116. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2117. htt_tx_tcl_vdev_metadata vdev_meta;
  2118. htt_tx_tcl_peer_metadata peer_meta;
  2119. };
  2120. } POSTPACK;
  2121. /* DWORD 0 */
  2122. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2123. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2124. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2125. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2126. /* VDEV metadata */
  2127. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2128. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2129. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2130. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2131. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2132. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2133. /* PEER metadata */
  2134. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2135. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2136. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2137. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2138. HTT_TX_TCL_METADATA_TYPE_S)
  2139. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2140. do { \
  2141. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2142. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2143. } while (0)
  2144. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2145. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2146. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2147. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2151. } while (0)
  2152. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2153. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2154. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2155. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2159. } while (0)
  2160. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2161. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2162. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2163. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2167. } while (0)
  2168. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2169. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2170. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2171. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2175. } while (0)
  2176. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2177. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2178. HTT_TX_TCL_METADATA_PEER_ID_S)
  2179. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2183. } while (0)
  2184. typedef enum {
  2185. HTT_TX_FW2WBM_TX_STATUS_OK,
  2186. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2187. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2188. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2189. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2190. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2191. HTT_TX_FW2WBM_TX_STATUS_MAX
  2192. } htt_tx_fw2wbm_tx_status_t;
  2193. typedef enum {
  2194. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2195. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2196. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2197. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2198. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2199. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2200. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2201. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2202. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2203. } htt_tx_fw2wbm_reinject_reason_t;
  2204. /**
  2205. * @brief HTT TX WBM Completion from firmware to host
  2206. * @details
  2207. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2208. * DWORD 3 and 4 for software based completions (Exception frames and
  2209. * TQM bypass frames)
  2210. * For software based completions, wbm_release_ring->release_source_module will
  2211. * be set to release_source_fw
  2212. */
  2213. PREPACK struct htt_tx_wbm_completion {
  2214. A_UINT32
  2215. sch_cmd_id: 24,
  2216. exception_frame: 1, /* If set, this packet was queued via exception path */
  2217. rsvd0_31_25: 7;
  2218. A_UINT32
  2219. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2220. * reception of an ACK or BA, this field indicates
  2221. * the RSSI of the received ACK or BA frame.
  2222. * When the frame is removed as result of a direct
  2223. * remove command from the SW, this field is set
  2224. * to 0x0 (which is never a valid value when real
  2225. * RSSI is available).
  2226. * Units: dB w.r.t noise floor
  2227. */
  2228. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2229. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2230. rsvd1_31_16: 16;
  2231. } POSTPACK;
  2232. /* DWORD 0 */
  2233. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2234. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2235. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2236. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2237. /* DWORD 1 */
  2238. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2239. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2240. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2241. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2242. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2243. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2244. /* DWORD 0 */
  2245. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2246. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2247. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2248. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2252. } while (0)
  2253. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2254. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2255. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2256. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2260. } while (0)
  2261. /* DWORD 1 */
  2262. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2264. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2265. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2269. } while (0)
  2270. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2272. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2273. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2277. } while (0)
  2278. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2279. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2280. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2281. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2285. } while (0)
  2286. /**
  2287. * @brief HTT TX WBM Completion from firmware to host
  2288. * @details
  2289. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2290. * (WBM) offload HW.
  2291. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2292. * For software based completions, release_source_module will
  2293. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2294. * struct wbm_release_ring and then switch to this after looking at
  2295. * release_source_module.
  2296. */
  2297. PREPACK struct htt_tx_wbm_completion_v2 {
  2298. A_UINT32
  2299. used_by_hw0; /* Refer to struct wbm_release_ring */
  2300. A_UINT32
  2301. used_by_hw1; /* Refer to struct wbm_release_ring */
  2302. A_UINT32
  2303. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2304. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2305. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2306. exception_frame: 1,
  2307. rsvd0: 12, /* For future use */
  2308. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2309. rsvd1: 1; /* For future use */
  2310. A_UINT32
  2311. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2312. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2313. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2314. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2315. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2316. */
  2317. A_UINT32
  2318. data1: 32;
  2319. A_UINT32
  2320. data2: 32;
  2321. A_UINT32
  2322. used_by_hw3; /* Refer to struct wbm_release_ring */
  2323. } POSTPACK;
  2324. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2325. /* DWORD 3 */
  2326. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2327. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2328. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2329. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2330. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2331. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2332. /* DWORD 3 */
  2333. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2334. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2335. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2336. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2337. do { \
  2338. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2339. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2340. } while (0)
  2341. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2342. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2343. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2344. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2345. do { \
  2346. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2347. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2348. } while (0)
  2349. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2350. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2351. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2352. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2355. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2356. } while (0)
  2357. /**
  2358. * @brief HTT TX WBM transmit status from firmware to host
  2359. * @details
  2360. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2361. * (WBM) offload HW.
  2362. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2363. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2364. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2365. */
  2366. PREPACK struct htt_tx_wbm_transmit_status {
  2367. A_UINT32
  2368. sch_cmd_id: 24,
  2369. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2370. * reception of an ACK or BA, this field indicates
  2371. * the RSSI of the received ACK or BA frame.
  2372. * When the frame is removed as result of a direct
  2373. * remove command from the SW, this field is set
  2374. * to 0x0 (which is never a valid value when real
  2375. * RSSI is available).
  2376. * Units: dB w.r.t noise floor
  2377. */
  2378. A_UINT32
  2379. sw_peer_id: 16,
  2380. tid_num: 5,
  2381. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2382. * and tid_num fields contain valid data.
  2383. * If this "valid" flag is not set, the
  2384. * sw_peer_id and tid_num fields must be ignored.
  2385. */
  2386. mcast: 1,
  2387. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2388. * contains valid data.
  2389. */
  2390. reserved0: 8;
  2391. A_UINT32
  2392. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2393. * packets in the wbm completion path
  2394. */
  2395. } POSTPACK;
  2396. /* DWORD 4 */
  2397. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2398. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2399. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2400. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2401. /* DWORD 5 */
  2402. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2403. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2404. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2405. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2406. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2407. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2408. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2409. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2410. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2411. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2412. /* DWORD 4 */
  2413. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2414. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2415. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2416. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2420. } while (0)
  2421. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2422. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2423. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2424. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2427. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2428. } while (0)
  2429. /* DWORD 5 */
  2430. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2431. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2432. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2433. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2437. } while (0)
  2438. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2439. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2440. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2441. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2445. } while (0)
  2446. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2447. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2448. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2449. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2453. } while (0)
  2454. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2455. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2456. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2457. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2460. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2461. } while (0)
  2462. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2463. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2464. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2465. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2466. do { \
  2467. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2468. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2469. } while (0)
  2470. /**
  2471. * @brief HTT TX WBM reinject status from firmware to host
  2472. * @details
  2473. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2474. * (WBM) offload HW.
  2475. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2476. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2477. */
  2478. PREPACK struct htt_tx_wbm_reinject_status {
  2479. A_UINT32
  2480. reserved0: 32;
  2481. A_UINT32
  2482. reserved1: 32;
  2483. A_UINT32
  2484. reserved2: 32;
  2485. } POSTPACK;
  2486. /**
  2487. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2488. * @details
  2489. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2490. * (WBM) offload HW.
  2491. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2492. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2493. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2494. * STA side.
  2495. */
  2496. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2497. A_UINT32
  2498. mec_sa_addr_31_0;
  2499. A_UINT32
  2500. mec_sa_addr_47_32: 16,
  2501. sa_ast_index: 16;
  2502. A_UINT32
  2503. vdev_id: 8,
  2504. reserved0: 24;
  2505. } POSTPACK;
  2506. /* DWORD 4 - mec_sa_addr_31_0 */
  2507. /* DWORD 5 */
  2508. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2509. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2510. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2511. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2512. /* DWORD 6 */
  2513. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2514. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2515. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2516. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2517. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2518. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2519. do { \
  2520. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2521. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2522. } while (0)
  2523. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2524. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2525. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2526. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2529. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2530. } while (0)
  2531. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2532. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2533. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2534. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2537. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2538. } while (0)
  2539. typedef enum {
  2540. TX_FLOW_PRIORITY_BE,
  2541. TX_FLOW_PRIORITY_HIGH,
  2542. TX_FLOW_PRIORITY_LOW,
  2543. } htt_tx_flow_priority_t;
  2544. typedef enum {
  2545. TX_FLOW_LATENCY_SENSITIVE,
  2546. TX_FLOW_LATENCY_INSENSITIVE,
  2547. } htt_tx_flow_latency_t;
  2548. typedef enum {
  2549. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2550. TX_FLOW_INTERACTIVE_TRAFFIC,
  2551. TX_FLOW_PERIODIC_TRAFFIC,
  2552. TX_FLOW_BURSTY_TRAFFIC,
  2553. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2554. } htt_tx_flow_traffic_pattern_t;
  2555. /**
  2556. * @brief HTT TX Flow search metadata format
  2557. * @details
  2558. * Host will set this metadata in flow table's flow search entry along with
  2559. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2560. * firmware and TQM ring if the flow search entry wins.
  2561. * This metadata is available to firmware in that first MSDU's
  2562. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2563. * to one of the available flows for specific tid and returns the tqm flow
  2564. * pointer as part of htt_tx_map_flow_info message.
  2565. */
  2566. PREPACK struct htt_tx_flow_metadata {
  2567. A_UINT32
  2568. rsvd0_1_0: 2,
  2569. tid: 4,
  2570. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2571. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2572. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2573. * Else choose final tid based on latency, priority.
  2574. */
  2575. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2576. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2577. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2578. } POSTPACK;
  2579. /* DWORD 0 */
  2580. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2581. #define HTT_TX_FLOW_METADATA_TID_S 2
  2582. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2583. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2584. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2585. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2586. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2587. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2588. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2589. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2590. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2591. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2592. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2593. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2594. /* DWORD 0 */
  2595. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2596. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2597. HTT_TX_FLOW_METADATA_TID_S)
  2598. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2599. do { \
  2600. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2601. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2602. } while (0)
  2603. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2604. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2605. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2606. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2607. do { \
  2608. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2609. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2610. } while (0)
  2611. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2612. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2613. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2614. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2615. do { \
  2616. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2617. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2618. } while (0)
  2619. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2620. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2621. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2622. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2623. do { \
  2624. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2625. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2626. } while (0)
  2627. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2628. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2629. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2630. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2631. do { \
  2632. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2633. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2634. } while (0)
  2635. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2636. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2637. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2638. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2639. do { \
  2640. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2641. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2642. } while (0)
  2643. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2644. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2645. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2646. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2647. do { \
  2648. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2649. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2650. } while (0)
  2651. /**
  2652. * @brief host -> target ADD WDS Entry
  2653. *
  2654. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2655. *
  2656. * @brief host -> target DELETE WDS Entry
  2657. *
  2658. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2659. *
  2660. * @details
  2661. * HTT wds entry from source port learning
  2662. * Host will learn wds entries from rx and send this message to firmware
  2663. * to enable firmware to configure/delete AST entries for wds clients.
  2664. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2665. * and when SA's entry is deleted, firmware removes this AST entry
  2666. *
  2667. * The message would appear as follows:
  2668. *
  2669. * |31 30|29 |17 16|15 8|7 0|
  2670. * |----------------+----------------+----------------+----------------|
  2671. * | rsvd0 |PDVID| vdev_id | msg_type |
  2672. * |-------------------------------------------------------------------|
  2673. * | sa_addr_31_0 |
  2674. * |-------------------------------------------------------------------|
  2675. * | | ta_peer_id | sa_addr_47_32 |
  2676. * |-------------------------------------------------------------------|
  2677. * Where PDVID = pdev_id
  2678. *
  2679. * The message is interpreted as follows:
  2680. *
  2681. * dword0 - b'0:7 - msg_type: This will be set to
  2682. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2683. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2684. *
  2685. * dword0 - b'8:15 - vdev_id
  2686. *
  2687. * dword0 - b'16:17 - pdev_id
  2688. *
  2689. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2690. *
  2691. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2692. *
  2693. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2694. *
  2695. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2696. */
  2697. PREPACK struct htt_wds_entry {
  2698. A_UINT32
  2699. msg_type: 8,
  2700. vdev_id: 8,
  2701. pdev_id: 2,
  2702. rsvd0: 14;
  2703. A_UINT32 sa_addr_31_0;
  2704. A_UINT32
  2705. sa_addr_47_32: 16,
  2706. ta_peer_id: 14,
  2707. rsvd2: 2;
  2708. } POSTPACK;
  2709. /* DWORD 0 */
  2710. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2711. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2712. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2713. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2714. /* DWORD 2 */
  2715. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2716. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2717. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2718. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2719. /* DWORD 0 */
  2720. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2721. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2722. HTT_WDS_ENTRY_VDEV_ID_S)
  2723. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2724. do { \
  2725. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2726. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2727. } while (0)
  2728. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2729. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2730. HTT_WDS_ENTRY_PDEV_ID_S)
  2731. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2732. do { \
  2733. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2734. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2735. } while (0)
  2736. /* DWORD 2 */
  2737. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2738. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2739. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2740. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2743. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2744. } while (0)
  2745. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2746. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2747. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2748. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2749. do { \
  2750. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2751. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2752. } while (0)
  2753. /**
  2754. * @brief MAC DMA rx ring setup specification
  2755. *
  2756. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2757. *
  2758. * @details
  2759. * To allow for dynamic rx ring reconfiguration and to avoid race
  2760. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2761. * it uses. Instead, it sends this message to the target, indicating how
  2762. * the rx ring used by the host should be set up and maintained.
  2763. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2764. * specifications.
  2765. *
  2766. * |31 16|15 8|7 0|
  2767. * |---------------------------------------------------------------|
  2768. * header: | reserved | num rings | msg type |
  2769. * |---------------------------------------------------------------|
  2770. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2771. #if HTT_PADDR64
  2772. * | FW_IDX shadow register physical address (bits 63:32) |
  2773. #endif
  2774. * |---------------------------------------------------------------|
  2775. * | rx ring base physical address (bits 31:0) |
  2776. #if HTT_PADDR64
  2777. * | rx ring base physical address (bits 63:32) |
  2778. #endif
  2779. * |---------------------------------------------------------------|
  2780. * | rx ring buffer size | rx ring length |
  2781. * |---------------------------------------------------------------|
  2782. * | FW_IDX initial value | enabled flags |
  2783. * |---------------------------------------------------------------|
  2784. * | MSDU payload offset | 802.11 header offset |
  2785. * |---------------------------------------------------------------|
  2786. * | PPDU end offset | PPDU start offset |
  2787. * |---------------------------------------------------------------|
  2788. * | MPDU end offset | MPDU start offset |
  2789. * |---------------------------------------------------------------|
  2790. * | MSDU end offset | MSDU start offset |
  2791. * |---------------------------------------------------------------|
  2792. * | frag info offset | rx attention offset |
  2793. * |---------------------------------------------------------------|
  2794. * payload 2, if present, has the same format as payload 1
  2795. * Header fields:
  2796. * - MSG_TYPE
  2797. * Bits 7:0
  2798. * Purpose: identifies this as an rx ring configuration message
  2799. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2800. * - NUM_RINGS
  2801. * Bits 15:8
  2802. * Purpose: indicates whether the host is setting up one rx ring or two
  2803. * Value: 1 or 2
  2804. * Payload:
  2805. * for systems using 64-bit format for bus addresses:
  2806. * - IDX_SHADOW_REG_PADDR_LO
  2807. * Bits 31:0
  2808. * Value: lower 4 bytes of physical address of the host's
  2809. * FW_IDX shadow register
  2810. * - IDX_SHADOW_REG_PADDR_HI
  2811. * Bits 31:0
  2812. * Value: upper 4 bytes of physical address of the host's
  2813. * FW_IDX shadow register
  2814. * - RING_BASE_PADDR_LO
  2815. * Bits 31:0
  2816. * Value: lower 4 bytes of physical address of the host's rx ring
  2817. * - RING_BASE_PADDR_HI
  2818. * Bits 31:0
  2819. * Value: uppper 4 bytes of physical address of the host's rx ring
  2820. * for systems using 32-bit format for bus addresses:
  2821. * - IDX_SHADOW_REG_PADDR
  2822. * Bits 31:0
  2823. * Value: physical address of the host's FW_IDX shadow register
  2824. * - RING_BASE_PADDR
  2825. * Bits 31:0
  2826. * Value: physical address of the host's rx ring
  2827. * - RING_LEN
  2828. * Bits 15:0
  2829. * Value: number of elements in the rx ring
  2830. * - RING_BUF_SZ
  2831. * Bits 31:16
  2832. * Value: size of the buffers referenced by the rx ring, in byte units
  2833. * - ENABLED_FLAGS
  2834. * Bits 15:0
  2835. * Value: 1-bit flags to show whether different rx fields are enabled
  2836. * bit 0: 802.11 header enabled (1) or disabled (0)
  2837. * bit 1: MSDU payload enabled (1) or disabled (0)
  2838. * bit 2: PPDU start enabled (1) or disabled (0)
  2839. * bit 3: PPDU end enabled (1) or disabled (0)
  2840. * bit 4: MPDU start enabled (1) or disabled (0)
  2841. * bit 5: MPDU end enabled (1) or disabled (0)
  2842. * bit 6: MSDU start enabled (1) or disabled (0)
  2843. * bit 7: MSDU end enabled (1) or disabled (0)
  2844. * bit 8: rx attention enabled (1) or disabled (0)
  2845. * bit 9: frag info enabled (1) or disabled (0)
  2846. * bit 10: unicast rx enabled (1) or disabled (0)
  2847. * bit 11: multicast rx enabled (1) or disabled (0)
  2848. * bit 12: ctrl rx enabled (1) or disabled (0)
  2849. * bit 13: mgmt rx enabled (1) or disabled (0)
  2850. * bit 14: null rx enabled (1) or disabled (0)
  2851. * bit 15: phy data rx enabled (1) or disabled (0)
  2852. * - IDX_INIT_VAL
  2853. * Bits 31:16
  2854. * Purpose: Specify the initial value for the FW_IDX.
  2855. * Value: the number of buffers initially present in the host's rx ring
  2856. * - OFFSET_802_11_HDR
  2857. * Bits 15:0
  2858. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2859. * - OFFSET_MSDU_PAYLOAD
  2860. * Bits 31:16
  2861. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2862. * - OFFSET_PPDU_START
  2863. * Bits 15:0
  2864. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2865. * - OFFSET_PPDU_END
  2866. * Bits 31:16
  2867. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2868. * - OFFSET_MPDU_START
  2869. * Bits 15:0
  2870. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2871. * - OFFSET_MPDU_END
  2872. * Bits 31:16
  2873. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2874. * - OFFSET_MSDU_START
  2875. * Bits 15:0
  2876. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2877. * - OFFSET_MSDU_END
  2878. * Bits 31:16
  2879. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2880. * - OFFSET_RX_ATTN
  2881. * Bits 15:0
  2882. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2883. * - OFFSET_FRAG_INFO
  2884. * Bits 31:16
  2885. * Value: offset in QUAD-bytes of frag info table
  2886. */
  2887. /* header fields */
  2888. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2889. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2890. /* payload fields */
  2891. /* for systems using a 64-bit format for bus addresses */
  2892. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2893. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2894. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2895. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2896. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2897. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2898. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2899. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2900. /* for systems using a 32-bit format for bus addresses */
  2901. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2902. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2903. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2904. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2905. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2906. #define HTT_RX_RING_CFG_LEN_S 0
  2907. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2908. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2909. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2910. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2911. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2912. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2913. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2914. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2915. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2916. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2917. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2918. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2919. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2920. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2921. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2922. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2923. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2924. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2925. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2926. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2927. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2928. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2929. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2930. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2931. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2932. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2933. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2934. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2935. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2936. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2937. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2938. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2939. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2940. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2941. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2942. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2943. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2944. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2946. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2947. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2948. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2949. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2950. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2951. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2952. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2953. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2954. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2955. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2956. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2957. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2959. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2960. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2961. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2962. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2963. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2964. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2965. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2966. #if HTT_PADDR64
  2967. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2968. #else
  2969. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2970. #endif
  2971. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2972. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2973. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2974. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2975. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2978. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2979. } while (0)
  2980. /* degenerate case for 32-bit fields */
  2981. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2982. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2983. ((_var) = (_val))
  2984. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2985. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2986. ((_var) = (_val))
  2987. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2988. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2989. ((_var) = (_val))
  2990. /* degenerate case for 32-bit fields */
  2991. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2992. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2993. ((_var) = (_val))
  2994. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2995. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2996. ((_var) = (_val))
  2997. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2998. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2999. ((_var) = (_val))
  3000. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3001. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3002. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3003. do { \
  3004. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3005. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3006. } while (0)
  3007. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3008. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3009. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3012. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3013. } while (0)
  3014. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3015. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3016. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3017. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3020. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3021. } while (0)
  3022. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3023. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3024. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3025. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3028. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3029. } while (0)
  3030. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3031. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3032. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3033. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3036. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3037. } while (0)
  3038. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3039. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3040. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3041. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3044. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3045. } while (0)
  3046. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3047. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3048. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3049. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3050. do { \
  3051. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3052. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3053. } while (0)
  3054. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3055. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3056. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3057. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3060. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3061. } while (0)
  3062. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3063. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3064. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3065. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3066. do { \
  3067. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3068. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3069. } while (0)
  3070. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3071. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3072. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3073. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3074. do { \
  3075. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3076. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3077. } while (0)
  3078. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3079. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3080. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3081. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3082. do { \
  3083. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3084. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3085. } while (0)
  3086. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3087. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3088. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3089. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3090. do { \
  3091. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3092. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3093. } while (0)
  3094. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3095. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3096. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3097. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3098. do { \
  3099. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3100. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3101. } while (0)
  3102. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3103. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3104. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3105. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3106. do { \
  3107. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3108. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3109. } while (0)
  3110. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3111. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3112. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3113. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3114. do { \
  3115. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3116. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3117. } while (0)
  3118. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3119. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3120. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3121. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3122. do { \
  3123. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3124. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3125. } while (0)
  3126. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3127. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3128. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3129. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3130. do { \
  3131. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3132. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3133. } while (0)
  3134. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3135. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3136. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3137. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3138. do { \
  3139. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3140. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3141. } while (0)
  3142. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3143. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3144. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3145. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3146. do { \
  3147. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3148. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3149. } while (0)
  3150. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3151. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3152. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3153. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3154. do { \
  3155. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3156. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3157. } while (0)
  3158. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3159. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3160. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3161. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3162. do { \
  3163. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3164. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3165. } while (0)
  3166. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3167. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3168. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3169. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3170. do { \
  3171. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3172. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3173. } while (0)
  3174. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3175. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3176. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3177. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3178. do { \
  3179. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3180. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3181. } while (0)
  3182. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3183. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3184. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3185. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3186. do { \
  3187. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3188. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3189. } while (0)
  3190. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3191. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3192. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3193. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3194. do { \
  3195. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3196. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3197. } while (0)
  3198. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3199. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3200. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3201. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3202. do { \
  3203. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3204. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3205. } while (0)
  3206. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3207. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3208. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3209. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3210. do { \
  3211. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3212. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3213. } while (0)
  3214. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3215. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3216. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3217. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3218. do { \
  3219. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3220. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3221. } while (0)
  3222. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3223. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3224. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3225. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3226. do { \
  3227. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3228. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3229. } while (0)
  3230. /**
  3231. * @brief host -> target FW statistics retrieve
  3232. *
  3233. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3234. *
  3235. * @details
  3236. * The following field definitions describe the format of the HTT host
  3237. * to target FW stats retrieve message. The message specifies the type of
  3238. * stats host wants to retrieve.
  3239. *
  3240. * |31 24|23 16|15 8|7 0|
  3241. * |-----------------------------------------------------------|
  3242. * | stats types request bitmask | msg type |
  3243. * |-----------------------------------------------------------|
  3244. * | stats types reset bitmask | reserved |
  3245. * |-----------------------------------------------------------|
  3246. * | stats type | config value |
  3247. * |-----------------------------------------------------------|
  3248. * | cookie LSBs |
  3249. * |-----------------------------------------------------------|
  3250. * | cookie MSBs |
  3251. * |-----------------------------------------------------------|
  3252. * Header fields:
  3253. * - MSG_TYPE
  3254. * Bits 7:0
  3255. * Purpose: identifies this is a stats upload request message
  3256. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3257. * - UPLOAD_TYPES
  3258. * Bits 31:8
  3259. * Purpose: identifies which types of FW statistics to upload
  3260. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3261. * - RESET_TYPES
  3262. * Bits 31:8
  3263. * Purpose: identifies which types of FW statistics to reset
  3264. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3265. * - CFG_VAL
  3266. * Bits 23:0
  3267. * Purpose: give an opaque configuration value to the specified stats type
  3268. * Value: stats-type specific configuration value
  3269. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3270. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3271. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3272. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3273. * - CFG_STAT_TYPE
  3274. * Bits 31:24
  3275. * Purpose: specify which stats type (if any) the config value applies to
  3276. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3277. * a valid configuration specification
  3278. * - COOKIE_LSBS
  3279. * Bits 31:0
  3280. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3281. * message with its preceding host->target stats request message.
  3282. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3283. * - COOKIE_MSBS
  3284. * Bits 31:0
  3285. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3286. * message with its preceding host->target stats request message.
  3287. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3288. */
  3289. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3290. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3291. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3292. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3293. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3294. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3295. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3296. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3297. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3298. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3299. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3300. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3301. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3302. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3303. do { \
  3304. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3305. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3306. } while (0)
  3307. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3308. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3309. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3310. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3311. do { \
  3312. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3313. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3314. } while (0)
  3315. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3316. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3317. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3318. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3321. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3322. } while (0)
  3323. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3324. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3325. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3326. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3329. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3330. } while (0)
  3331. /**
  3332. * @brief host -> target HTT out-of-band sync request
  3333. *
  3334. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3335. *
  3336. * @details
  3337. * The HTT SYNC tells the target to suspend processing of subsequent
  3338. * HTT host-to-target messages until some other target agent locally
  3339. * informs the target HTT FW that the current sync counter is equal to
  3340. * or greater than (in a modulo sense) the sync counter specified in
  3341. * the SYNC message.
  3342. * This allows other host-target components to synchronize their operation
  3343. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3344. * security key has been downloaded to and activated by the target.
  3345. * In the absence of any explicit synchronization counter value
  3346. * specification, the target HTT FW will use zero as the default current
  3347. * sync value.
  3348. *
  3349. * |31 24|23 16|15 8|7 0|
  3350. * |-----------------------------------------------------------|
  3351. * | reserved | sync count | msg type |
  3352. * |-----------------------------------------------------------|
  3353. * Header fields:
  3354. * - MSG_TYPE
  3355. * Bits 7:0
  3356. * Purpose: identifies this as a sync message
  3357. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3358. * - SYNC_COUNT
  3359. * Bits 15:8
  3360. * Purpose: specifies what sync value the HTT FW will wait for from
  3361. * an out-of-band specification to resume its operation
  3362. * Value: in-band sync counter value to compare against the out-of-band
  3363. * counter spec.
  3364. * The HTT target FW will suspend its host->target message processing
  3365. * as long as
  3366. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3367. */
  3368. #define HTT_H2T_SYNC_MSG_SZ 4
  3369. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3370. #define HTT_H2T_SYNC_COUNT_S 8
  3371. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3372. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3373. HTT_H2T_SYNC_COUNT_S)
  3374. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3377. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3378. } while (0)
  3379. /**
  3380. * @brief host -> target HTT aggregation configuration
  3381. *
  3382. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3383. */
  3384. #define HTT_AGGR_CFG_MSG_SZ 4
  3385. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3386. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3387. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3388. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3389. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3390. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3391. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3392. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3395. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3396. } while (0)
  3397. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3398. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3399. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3400. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3403. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3404. } while (0)
  3405. /**
  3406. * @brief host -> target HTT configure max amsdu info per vdev
  3407. *
  3408. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3409. *
  3410. * @details
  3411. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3412. *
  3413. * |31 21|20 16|15 8|7 0|
  3414. * |-----------------------------------------------------------|
  3415. * | reserved | vdev id | max amsdu | msg type |
  3416. * |-----------------------------------------------------------|
  3417. * Header fields:
  3418. * - MSG_TYPE
  3419. * Bits 7:0
  3420. * Purpose: identifies this as a aggr cfg ex message
  3421. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3422. * - MAX_NUM_AMSDU_SUBFRM
  3423. * Bits 15:8
  3424. * Purpose: max MSDUs per A-MSDU
  3425. * - VDEV_ID
  3426. * Bits 20:16
  3427. * Purpose: ID of the vdev to which this limit is applied
  3428. */
  3429. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3430. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3431. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3432. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3433. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3434. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3435. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3436. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3437. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3440. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3441. } while (0)
  3442. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3443. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3444. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3445. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3448. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3449. } while (0)
  3450. /**
  3451. * @brief HTT WDI_IPA Config Message
  3452. *
  3453. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3454. *
  3455. * @details
  3456. * The HTT WDI_IPA config message is created/sent by host at driver
  3457. * init time. It contains information about data structures used on
  3458. * WDI_IPA TX and RX path.
  3459. * TX CE ring is used for pushing packet metadata from IPA uC
  3460. * to WLAN FW
  3461. * TX Completion ring is used for generating TX completions from
  3462. * WLAN FW to IPA uC
  3463. * RX Indication ring is used for indicating RX packets from FW
  3464. * to IPA uC
  3465. * RX Ring2 is used as either completion ring or as second
  3466. * indication ring. when Ring2 is used as completion ring, IPA uC
  3467. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3468. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3469. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3470. * indicated in RX Indication ring. Please see WDI_IPA specification
  3471. * for more details.
  3472. * |31 24|23 16|15 8|7 0|
  3473. * |----------------+----------------+----------------+----------------|
  3474. * | tx pkt pool size | Rsvd | msg_type |
  3475. * |-------------------------------------------------------------------|
  3476. * | tx comp ring base (bits 31:0) |
  3477. #if HTT_PADDR64
  3478. * | tx comp ring base (bits 63:32) |
  3479. #endif
  3480. * |-------------------------------------------------------------------|
  3481. * | tx comp ring size |
  3482. * |-------------------------------------------------------------------|
  3483. * | tx comp WR_IDX physical address (bits 31:0) |
  3484. #if HTT_PADDR64
  3485. * | tx comp WR_IDX physical address (bits 63:32) |
  3486. #endif
  3487. * |-------------------------------------------------------------------|
  3488. * | tx CE WR_IDX physical address (bits 31:0) |
  3489. #if HTT_PADDR64
  3490. * | tx CE WR_IDX physical address (bits 63:32) |
  3491. #endif
  3492. * |-------------------------------------------------------------------|
  3493. * | rx indication ring base (bits 31:0) |
  3494. #if HTT_PADDR64
  3495. * | rx indication ring base (bits 63:32) |
  3496. #endif
  3497. * |-------------------------------------------------------------------|
  3498. * | rx indication ring size |
  3499. * |-------------------------------------------------------------------|
  3500. * | rx ind RD_IDX physical address (bits 31:0) |
  3501. #if HTT_PADDR64
  3502. * | rx ind RD_IDX physical address (bits 63:32) |
  3503. #endif
  3504. * |-------------------------------------------------------------------|
  3505. * | rx ind WR_IDX physical address (bits 31:0) |
  3506. #if HTT_PADDR64
  3507. * | rx ind WR_IDX physical address (bits 63:32) |
  3508. #endif
  3509. * |-------------------------------------------------------------------|
  3510. * |-------------------------------------------------------------------|
  3511. * | rx ring2 base (bits 31:0) |
  3512. #if HTT_PADDR64
  3513. * | rx ring2 base (bits 63:32) |
  3514. #endif
  3515. * |-------------------------------------------------------------------|
  3516. * | rx ring2 size |
  3517. * |-------------------------------------------------------------------|
  3518. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3519. #if HTT_PADDR64
  3520. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3521. #endif
  3522. * |-------------------------------------------------------------------|
  3523. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3524. #if HTT_PADDR64
  3525. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3526. #endif
  3527. * |-------------------------------------------------------------------|
  3528. *
  3529. * Header fields:
  3530. * Header fields:
  3531. * - MSG_TYPE
  3532. * Bits 7:0
  3533. * Purpose: Identifies this as WDI_IPA config message
  3534. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3535. * - TX_PKT_POOL_SIZE
  3536. * Bits 15:0
  3537. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3538. * WDI_IPA TX path
  3539. * For systems using 32-bit format for bus addresses:
  3540. * - TX_COMP_RING_BASE_ADDR
  3541. * Bits 31:0
  3542. * Purpose: TX Completion Ring base address in DDR
  3543. * - TX_COMP_RING_SIZE
  3544. * Bits 31:0
  3545. * Purpose: TX Completion Ring size (must be power of 2)
  3546. * - TX_COMP_WR_IDX_ADDR
  3547. * Bits 31:0
  3548. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3549. * updates the Write Index for WDI_IPA TX completion ring
  3550. * - TX_CE_WR_IDX_ADDR
  3551. * Bits 31:0
  3552. * Purpose: DDR address where IPA uC
  3553. * updates the WR Index for TX CE ring
  3554. * (needed for fusion platforms)
  3555. * - RX_IND_RING_BASE_ADDR
  3556. * Bits 31:0
  3557. * Purpose: RX Indication Ring base address in DDR
  3558. * - RX_IND_RING_SIZE
  3559. * Bits 31:0
  3560. * Purpose: RX Indication Ring size
  3561. * - RX_IND_RD_IDX_ADDR
  3562. * Bits 31:0
  3563. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3564. * RX indication ring
  3565. * - RX_IND_WR_IDX_ADDR
  3566. * Bits 31:0
  3567. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3568. * updates the Write Index for WDI_IPA RX indication ring
  3569. * - RX_RING2_BASE_ADDR
  3570. * Bits 31:0
  3571. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3572. * - RX_RING2_SIZE
  3573. * Bits 31:0
  3574. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3575. * - RX_RING2_RD_IDX_ADDR
  3576. * Bits 31:0
  3577. * Purpose: If Second RX ring is Indication ring, DDR address where
  3578. * IPA uC updates the Read Index for Ring2.
  3579. * If Second RX ring is completion ring, this is NOT used
  3580. * - RX_RING2_WR_IDX_ADDR
  3581. * Bits 31:0
  3582. * Purpose: If Second RX ring is Indication ring, DDR address where
  3583. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3584. * If second RX ring is completion ring, DDR address where
  3585. * IPA uC updates the Write Index for Ring 2.
  3586. * For systems using 64-bit format for bus addresses:
  3587. * - TX_COMP_RING_BASE_ADDR_LO
  3588. * Bits 31:0
  3589. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3590. * - TX_COMP_RING_BASE_ADDR_HI
  3591. * Bits 31:0
  3592. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3593. * - TX_COMP_RING_SIZE
  3594. * Bits 31:0
  3595. * Purpose: TX Completion Ring size (must be power of 2)
  3596. * - TX_COMP_WR_IDX_ADDR_LO
  3597. * Bits 31:0
  3598. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3599. * Lower 4 bytes of DDR address where WIFI FW
  3600. * updates the Write Index for WDI_IPA TX completion ring
  3601. * - TX_COMP_WR_IDX_ADDR_HI
  3602. * Bits 31:0
  3603. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3604. * Higher 4 bytes of DDR address where WIFI FW
  3605. * updates the Write Index for WDI_IPA TX completion ring
  3606. * - TX_CE_WR_IDX_ADDR_LO
  3607. * Bits 31:0
  3608. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3609. * updates the WR Index for TX CE ring
  3610. * (needed for fusion platforms)
  3611. * - TX_CE_WR_IDX_ADDR_HI
  3612. * Bits 31:0
  3613. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3614. * updates the WR Index for TX CE ring
  3615. * (needed for fusion platforms)
  3616. * - RX_IND_RING_BASE_ADDR_LO
  3617. * Bits 31:0
  3618. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3619. * - RX_IND_RING_BASE_ADDR_HI
  3620. * Bits 31:0
  3621. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3622. * - RX_IND_RING_SIZE
  3623. * Bits 31:0
  3624. * Purpose: RX Indication Ring size
  3625. * - RX_IND_RD_IDX_ADDR_LO
  3626. * Bits 31:0
  3627. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3628. * for WDI_IPA RX indication ring
  3629. * - RX_IND_RD_IDX_ADDR_HI
  3630. * Bits 31:0
  3631. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3632. * for WDI_IPA RX indication ring
  3633. * - RX_IND_WR_IDX_ADDR_LO
  3634. * Bits 31:0
  3635. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3636. * Lower 4 bytes of DDR address where WIFI FW
  3637. * updates the Write Index for WDI_IPA RX indication ring
  3638. * - RX_IND_WR_IDX_ADDR_HI
  3639. * Bits 31:0
  3640. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3641. * Higher 4 bytes of DDR address where WIFI FW
  3642. * updates the Write Index for WDI_IPA RX indication ring
  3643. * - RX_RING2_BASE_ADDR_LO
  3644. * Bits 31:0
  3645. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3646. * - RX_RING2_BASE_ADDR_HI
  3647. * Bits 31:0
  3648. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3649. * - RX_RING2_SIZE
  3650. * Bits 31:0
  3651. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3652. * - RX_RING2_RD_IDX_ADDR_LO
  3653. * Bits 31:0
  3654. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3655. * DDR address where IPA uC updates the Read Index for Ring2.
  3656. * If Second RX ring is completion ring, this is NOT used
  3657. * - RX_RING2_RD_IDX_ADDR_HI
  3658. * Bits 31:0
  3659. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3660. * DDR address where IPA uC updates the Read Index for Ring2.
  3661. * If Second RX ring is completion ring, this is NOT used
  3662. * - RX_RING2_WR_IDX_ADDR_LO
  3663. * Bits 31:0
  3664. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3665. * DDR address where WIFI FW updates the Write Index
  3666. * for WDI_IPA RX ring2
  3667. * If second RX ring is completion ring, lower 4 bytes of
  3668. * DDR address where IPA uC updates the Write Index for Ring 2.
  3669. * - RX_RING2_WR_IDX_ADDR_HI
  3670. * Bits 31:0
  3671. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3672. * DDR address where WIFI FW updates the Write Index
  3673. * for WDI_IPA RX ring2
  3674. * If second RX ring is completion ring, higher 4 bytes of
  3675. * DDR address where IPA uC updates the Write Index for Ring 2.
  3676. */
  3677. #if HTT_PADDR64
  3678. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3679. #else
  3680. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3681. #endif
  3682. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3683. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3684. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3685. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3686. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3687. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3688. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3689. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3690. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3698. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3699. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3700. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3701. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3702. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3704. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3706. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3708. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3710. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3718. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3720. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3744. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3745. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3746. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3749. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3750. } while (0)
  3751. /* for systems using 32-bit format for bus addr */
  3752. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3753. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3754. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3757. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3758. } while (0)
  3759. /* for systems using 64-bit format for bus addr */
  3760. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3761. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3762. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3765. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3766. } while (0)
  3767. /* for systems using 64-bit format for bus addr */
  3768. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3769. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3770. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3773. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3774. } while (0)
  3775. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3776. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3777. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3778. do { \
  3779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3780. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3781. } while (0)
  3782. /* for systems using 32-bit format for bus addr */
  3783. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3784. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3785. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3788. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3789. } while (0)
  3790. /* for systems using 64-bit format for bus addr */
  3791. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3793. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3797. } while (0)
  3798. /* for systems using 64-bit format for bus addr */
  3799. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3800. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3801. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3804. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3805. } while (0)
  3806. /* for systems using 32-bit format for bus addr */
  3807. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3808. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3809. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3810. do { \
  3811. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3812. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3813. } while (0)
  3814. /* for systems using 64-bit format for bus addr */
  3815. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3816. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3817. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3818. do { \
  3819. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3820. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3821. } while (0)
  3822. /* for systems using 64-bit format for bus addr */
  3823. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3824. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3825. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3826. do { \
  3827. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3828. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3829. } while (0)
  3830. /* for systems using 32-bit format for bus addr */
  3831. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3832. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3833. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3834. do { \
  3835. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3836. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3837. } while (0)
  3838. /* for systems using 64-bit format for bus addr */
  3839. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3840. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3841. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3842. do { \
  3843. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3844. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3845. } while (0)
  3846. /* for systems using 64-bit format for bus addr */
  3847. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3848. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3849. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3850. do { \
  3851. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3852. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3853. } while (0)
  3854. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3855. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3856. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3857. do { \
  3858. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3859. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3860. } while (0)
  3861. /* for systems using 32-bit format for bus addr */
  3862. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3863. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3864. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3865. do { \
  3866. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3867. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3868. } while (0)
  3869. /* for systems using 64-bit format for bus addr */
  3870. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3871. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3872. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3873. do { \
  3874. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3875. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3876. } while (0)
  3877. /* for systems using 64-bit format for bus addr */
  3878. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3879. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3880. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3881. do { \
  3882. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3883. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3884. } while (0)
  3885. /* for systems using 32-bit format for bus addr */
  3886. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3887. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3888. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3889. do { \
  3890. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3891. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3892. } while (0)
  3893. /* for systems using 64-bit format for bus addr */
  3894. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3895. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3896. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3897. do { \
  3898. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3899. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3900. } while (0)
  3901. /* for systems using 64-bit format for bus addr */
  3902. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3903. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3904. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3905. do { \
  3906. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3907. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3908. } while (0)
  3909. /* for systems using 32-bit format for bus addr */
  3910. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3911. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3912. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3915. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3916. } while (0)
  3917. /* for systems using 64-bit format for bus addr */
  3918. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3919. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3920. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3921. do { \
  3922. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3923. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3924. } while (0)
  3925. /* for systems using 64-bit format for bus addr */
  3926. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3927. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3928. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3929. do { \
  3930. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3931. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3932. } while (0)
  3933. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3934. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3935. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3936. do { \
  3937. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3938. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3939. } while (0)
  3940. /* for systems using 32-bit format for bus addr */
  3941. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3942. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3943. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3944. do { \
  3945. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3946. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3947. } while (0)
  3948. /* for systems using 64-bit format for bus addr */
  3949. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3950. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3951. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3952. do { \
  3953. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3954. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3955. } while (0)
  3956. /* for systems using 64-bit format for bus addr */
  3957. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3958. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3960. do { \
  3961. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3962. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3963. } while (0)
  3964. /* for systems using 32-bit format for bus addr */
  3965. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3966. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3968. do { \
  3969. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3970. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3971. } while (0)
  3972. /* for systems using 64-bit format for bus addr */
  3973. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3974. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3975. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3976. do { \
  3977. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3978. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3979. } while (0)
  3980. /* for systems using 64-bit format for bus addr */
  3981. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3982. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3983. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3984. do { \
  3985. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3986. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3987. } while (0)
  3988. /*
  3989. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3990. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3991. * addresses are stored in a XXX-bit field.
  3992. * This macro is used to define both htt_wdi_ipa_config32_t and
  3993. * htt_wdi_ipa_config64_t structs.
  3994. */
  3995. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3996. _paddr__tx_comp_ring_base_addr_, \
  3997. _paddr__tx_comp_wr_idx_addr_, \
  3998. _paddr__tx_ce_wr_idx_addr_, \
  3999. _paddr__rx_ind_ring_base_addr_, \
  4000. _paddr__rx_ind_rd_idx_addr_, \
  4001. _paddr__rx_ind_wr_idx_addr_, \
  4002. _paddr__rx_ring2_base_addr_,\
  4003. _paddr__rx_ring2_rd_idx_addr_,\
  4004. _paddr__rx_ring2_wr_idx_addr_) \
  4005. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4006. { \
  4007. /* DWORD 0: flags and meta-data */ \
  4008. A_UINT32 \
  4009. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4010. reserved: 8, \
  4011. tx_pkt_pool_size: 16;\
  4012. /* DWORD 1 */\
  4013. _paddr__tx_comp_ring_base_addr_;\
  4014. /* DWORD 2 (or 3)*/\
  4015. A_UINT32 tx_comp_ring_size;\
  4016. /* DWORD 3 (or 4)*/\
  4017. _paddr__tx_comp_wr_idx_addr_;\
  4018. /* DWORD 4 (or 6)*/\
  4019. _paddr__tx_ce_wr_idx_addr_;\
  4020. /* DWORD 5 (or 8)*/\
  4021. _paddr__rx_ind_ring_base_addr_;\
  4022. /* DWORD 6 (or 10)*/\
  4023. A_UINT32 rx_ind_ring_size;\
  4024. /* DWORD 7 (or 11)*/\
  4025. _paddr__rx_ind_rd_idx_addr_;\
  4026. /* DWORD 8 (or 13)*/\
  4027. _paddr__rx_ind_wr_idx_addr_;\
  4028. /* DWORD 9 (or 15)*/\
  4029. _paddr__rx_ring2_base_addr_;\
  4030. /* DWORD 10 (or 17) */\
  4031. A_UINT32 rx_ring2_size;\
  4032. /* DWORD 11 (or 18) */\
  4033. _paddr__rx_ring2_rd_idx_addr_;\
  4034. /* DWORD 12 (or 20) */\
  4035. _paddr__rx_ring2_wr_idx_addr_;\
  4036. } POSTPACK
  4037. /* define a htt_wdi_ipa_config32_t type */
  4038. 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));
  4039. /* define a htt_wdi_ipa_config64_t type */
  4040. 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));
  4041. #if HTT_PADDR64
  4042. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4043. #else
  4044. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4045. #endif
  4046. enum htt_wdi_ipa_op_code {
  4047. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4048. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4049. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4050. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4051. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4052. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4053. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4054. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4055. /* keep this last */
  4056. HTT_WDI_IPA_OPCODE_MAX
  4057. };
  4058. /**
  4059. * @brief HTT WDI_IPA Operation Request Message
  4060. *
  4061. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4062. *
  4063. * @details
  4064. * HTT WDI_IPA Operation Request message is sent by host
  4065. * to either suspend or resume WDI_IPA TX or RX path.
  4066. * |31 24|23 16|15 8|7 0|
  4067. * |----------------+----------------+----------------+----------------|
  4068. * | op_code | Rsvd | msg_type |
  4069. * |-------------------------------------------------------------------|
  4070. *
  4071. * Header fields:
  4072. * - MSG_TYPE
  4073. * Bits 7:0
  4074. * Purpose: Identifies this as WDI_IPA Operation Request message
  4075. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4076. * - OP_CODE
  4077. * Bits 31:16
  4078. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4079. * value: = enum htt_wdi_ipa_op_code
  4080. */
  4081. PREPACK struct htt_wdi_ipa_op_request_t
  4082. {
  4083. /* DWORD 0: flags and meta-data */
  4084. A_UINT32
  4085. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4086. reserved: 8,
  4087. op_code: 16;
  4088. } POSTPACK;
  4089. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4090. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4091. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4092. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4093. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4094. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4097. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4098. } while (0)
  4099. /*
  4100. * @brief host -> target HTT_SRING_SETUP message
  4101. *
  4102. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4103. *
  4104. * @details
  4105. * After target is booted up, Host can send SRING setup message for
  4106. * each host facing LMAC SRING. Target setups up HW registers based
  4107. * on setup message and confirms back to Host if response_required is set.
  4108. * Host should wait for confirmation message before sending new SRING
  4109. * setup message
  4110. *
  4111. * The message would appear as follows:
  4112. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4113. * |--------------- +-----------------+-----------------+-----------------|
  4114. * | ring_type | ring_id | pdev_id | msg_type |
  4115. * |----------------------------------------------------------------------|
  4116. * | ring_base_addr_lo |
  4117. * |----------------------------------------------------------------------|
  4118. * | ring_base_addr_hi |
  4119. * |----------------------------------------------------------------------|
  4120. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4121. * |----------------------------------------------------------------------|
  4122. * | ring_head_offset32_remote_addr_lo |
  4123. * |----------------------------------------------------------------------|
  4124. * | ring_head_offset32_remote_addr_hi |
  4125. * |----------------------------------------------------------------------|
  4126. * | ring_tail_offset32_remote_addr_lo |
  4127. * |----------------------------------------------------------------------|
  4128. * | ring_tail_offset32_remote_addr_hi |
  4129. * |----------------------------------------------------------------------|
  4130. * | ring_msi_addr_lo |
  4131. * |----------------------------------------------------------------------|
  4132. * | ring_msi_addr_hi |
  4133. * |----------------------------------------------------------------------|
  4134. * | ring_msi_data |
  4135. * |----------------------------------------------------------------------|
  4136. * | intr_timer_th |IM| intr_batch_counter_th |
  4137. * |----------------------------------------------------------------------|
  4138. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4139. * |----------------------------------------------------------------------|
  4140. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4141. * |----------------------------------------------------------------------|
  4142. * Where
  4143. * IM = sw_intr_mode
  4144. * RR = response_required
  4145. * PTCF = prefetch_timer_cfg
  4146. * IP = IPA drop flag
  4147. *
  4148. * The message is interpreted as follows:
  4149. * dword0 - b'0:7 - msg_type: This will be set to
  4150. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4151. * b'8:15 - pdev_id:
  4152. * 0 (for rings at SOC/UMAC level),
  4153. * 1/2/3 mac id (for rings at LMAC level)
  4154. * b'16:23 - ring_id: identify which ring is to setup,
  4155. * more details can be got from enum htt_srng_ring_id
  4156. * b'24:31 - ring_type: identify type of host rings,
  4157. * more details can be got from enum htt_srng_ring_type
  4158. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4159. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4160. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4161. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4162. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4163. * SW_TO_HW_RING.
  4164. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4165. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4166. * Lower 32 bits of memory address of the remote variable
  4167. * storing the 4-byte word offset that identifies the head
  4168. * element within the ring.
  4169. * (The head offset variable has type A_UINT32.)
  4170. * Valid for HW_TO_SW and SW_TO_SW rings.
  4171. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4172. * Upper 32 bits of memory address of the remote variable
  4173. * storing the 4-byte word offset that identifies the head
  4174. * element within the ring.
  4175. * (The head offset variable has type A_UINT32.)
  4176. * Valid for HW_TO_SW and SW_TO_SW rings.
  4177. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4178. * Lower 32 bits of memory address of the remote variable
  4179. * storing the 4-byte word offset that identifies the tail
  4180. * element within the ring.
  4181. * (The tail offset variable has type A_UINT32.)
  4182. * Valid for HW_TO_SW and SW_TO_SW rings.
  4183. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4184. * Upper 32 bits of memory address of the remote variable
  4185. * storing the 4-byte word offset that identifies the tail
  4186. * element within the ring.
  4187. * (The tail offset variable has type A_UINT32.)
  4188. * Valid for HW_TO_SW and SW_TO_SW rings.
  4189. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4190. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4191. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4192. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4193. * dword10 - b'0:31 - ring_msi_data: MSI data
  4194. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4195. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4196. * dword11 - b'0:14 - intr_batch_counter_th:
  4197. * batch counter threshold is in units of 4-byte words.
  4198. * HW internally maintains and increments batch count.
  4199. * (see SRING spec for detail description).
  4200. * When batch count reaches threshold value, an interrupt
  4201. * is generated by HW.
  4202. * b'15 - sw_intr_mode:
  4203. * This configuration shall be static.
  4204. * Only programmed at power up.
  4205. * 0: generate pulse style sw interrupts
  4206. * 1: generate level style sw interrupts
  4207. * b'16:31 - intr_timer_th:
  4208. * The timer init value when timer is idle or is
  4209. * initialized to start downcounting.
  4210. * In 8us units (to cover a range of 0 to 524 ms)
  4211. * dword12 - b'0:15 - intr_low_threshold:
  4212. * Used only by Consumer ring to generate ring_sw_int_p.
  4213. * Ring entries low threshold water mark, that is used
  4214. * in combination with the interrupt timer as well as
  4215. * the the clearing of the level interrupt.
  4216. * b'16:18 - prefetch_timer_cfg:
  4217. * Used only by Consumer ring to set timer mode to
  4218. * support Application prefetch handling.
  4219. * The external tail offset/pointer will be updated
  4220. * at following intervals:
  4221. * 3'b000: (Prefetch feature disabled; used only for debug)
  4222. * 3'b001: 1 usec
  4223. * 3'b010: 4 usec
  4224. * 3'b011: 8 usec (default)
  4225. * 3'b100: 16 usec
  4226. * Others: Reserverd
  4227. * b'19 - response_required:
  4228. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4229. * b'20 - ipa_drop_flag:
  4230. Indicates that host will config ipa drop threshold percentage
  4231. * b'21:31 - reserved: reserved for future use
  4232. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4233. * b'8:15 - ipa drop high threshold percentage:
  4234. * b'16:31 - Reserved
  4235. */
  4236. PREPACK struct htt_sring_setup_t {
  4237. A_UINT32 msg_type: 8,
  4238. pdev_id: 8,
  4239. ring_id: 8,
  4240. ring_type: 8;
  4241. A_UINT32 ring_base_addr_lo;
  4242. A_UINT32 ring_base_addr_hi;
  4243. A_UINT32 ring_size: 16,
  4244. ring_entry_size: 8,
  4245. ring_misc_cfg_flag: 8;
  4246. A_UINT32 ring_head_offset32_remote_addr_lo;
  4247. A_UINT32 ring_head_offset32_remote_addr_hi;
  4248. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4249. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4250. A_UINT32 ring_msi_addr_lo;
  4251. A_UINT32 ring_msi_addr_hi;
  4252. A_UINT32 ring_msi_data;
  4253. A_UINT32 intr_batch_counter_th: 15,
  4254. sw_intr_mode: 1,
  4255. intr_timer_th: 16;
  4256. A_UINT32 intr_low_threshold: 16,
  4257. prefetch_timer_cfg: 3,
  4258. response_required: 1,
  4259. ipa_drop_flag: 1,
  4260. reserved1: 11;
  4261. A_UINT32 ipa_drop_low_threshold: 8,
  4262. ipa_drop_high_threshold: 8,
  4263. reserved: 16;
  4264. } POSTPACK;
  4265. enum htt_srng_ring_type {
  4266. HTT_HW_TO_SW_RING = 0,
  4267. HTT_SW_TO_HW_RING,
  4268. HTT_SW_TO_SW_RING,
  4269. /* Insert new ring types above this line */
  4270. };
  4271. enum htt_srng_ring_id {
  4272. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4273. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4274. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4275. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4276. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4277. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4278. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4279. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4280. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4281. /* Add Other SRING which can't be directly configured by host software above this line */
  4282. };
  4283. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4284. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4285. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4286. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4287. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4288. HTT_SRING_SETUP_PDEV_ID_S)
  4289. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4290. do { \
  4291. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4292. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4293. } while (0)
  4294. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4295. #define HTT_SRING_SETUP_RING_ID_S 16
  4296. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4297. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4298. HTT_SRING_SETUP_RING_ID_S)
  4299. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4302. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4303. } while (0)
  4304. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4305. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4306. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4307. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4308. HTT_SRING_SETUP_RING_TYPE_S)
  4309. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4312. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4313. } while (0)
  4314. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4315. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4316. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4317. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4318. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4319. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4322. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4323. } while (0)
  4324. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4325. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4326. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4327. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4328. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4329. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4332. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4333. } while (0)
  4334. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4335. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4336. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4337. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4338. HTT_SRING_SETUP_RING_SIZE_S)
  4339. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4342. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4343. } while (0)
  4344. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4345. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4346. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4347. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4348. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4349. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4350. do { \
  4351. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4352. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4353. } while (0)
  4354. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4355. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4356. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4357. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4358. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4359. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4360. do { \
  4361. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4362. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4363. } while (0)
  4364. /* This control bit is applicable to only Producer, which updates Ring ID field
  4365. * of each descriptor before pushing into the ring.
  4366. * 0: updates ring_id(default)
  4367. * 1: ring_id updating disabled */
  4368. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4369. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4370. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4371. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4372. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4373. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4376. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4377. } while (0)
  4378. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4379. * of each descriptor before pushing into the ring.
  4380. * 0: updates Loopcnt(default)
  4381. * 1: Loopcnt updating disabled */
  4382. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4383. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4384. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4385. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4386. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4387. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4388. do { \
  4389. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4390. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4391. } while (0)
  4392. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4393. * into security_id port of GXI/AXI. */
  4394. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4395. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4397. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4398. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4399. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4400. do { \
  4401. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4402. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4403. } while (0)
  4404. /* During MSI write operation, SRNG drives value of this register bit into
  4405. * swap bit of GXI/AXI. */
  4406. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4407. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4408. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4409. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4410. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4411. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4412. do { \
  4413. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4414. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4415. } while (0)
  4416. /* During Pointer write operation, SRNG drives value of this register bit into
  4417. * swap bit of GXI/AXI. */
  4418. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4419. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4420. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4421. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4422. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4423. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4424. do { \
  4425. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4426. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4427. } while (0)
  4428. /* During any data or TLV write operation, SRNG drives value of this register
  4429. * bit into swap bit of GXI/AXI. */
  4430. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4431. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4432. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4433. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4434. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4435. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4436. do { \
  4437. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4438. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4439. } while (0)
  4440. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4441. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4442. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4443. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4444. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4445. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4446. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4447. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4448. do { \
  4449. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4450. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4451. } while (0)
  4452. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4453. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4454. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4455. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4456. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4457. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4458. do { \
  4459. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4460. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4461. } while (0)
  4462. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4463. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4464. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4465. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4466. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4467. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4468. do { \
  4469. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4470. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4471. } while (0)
  4472. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4473. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4474. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4475. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4476. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4477. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4478. do { \
  4479. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4480. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4481. } while (0)
  4482. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4483. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4484. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4485. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4486. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4487. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4488. do { \
  4489. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4490. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4491. } while (0)
  4492. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4493. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4494. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4495. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4496. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4497. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4498. do { \
  4499. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4500. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4501. } while (0)
  4502. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4503. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4504. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4505. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4506. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4507. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4508. do { \
  4509. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4510. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4511. } while (0)
  4512. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4513. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4514. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4515. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4516. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4517. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4518. do { \
  4519. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4520. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4521. } while (0)
  4522. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4523. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4524. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4525. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4526. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4527. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4528. do { \
  4529. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4530. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4531. } while (0)
  4532. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4533. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4534. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4535. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4536. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4537. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4538. do { \
  4539. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4540. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4541. } while (0)
  4542. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4543. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4544. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4545. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4546. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4547. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4548. do { \
  4549. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4550. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4551. } while (0)
  4552. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4553. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4554. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4555. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4556. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4557. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4558. do { \
  4559. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4560. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4561. } while (0)
  4562. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4563. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4564. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4565. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4566. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4567. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4568. do { \
  4569. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4570. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4571. } while (0)
  4572. /**
  4573. * @brief host -> target RX ring selection config message
  4574. *
  4575. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4576. *
  4577. * @details
  4578. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4579. * configure RXDMA rings.
  4580. * The configuration is per ring based and includes both packet subtypes
  4581. * and PPDU/MPDU TLVs.
  4582. *
  4583. * The message would appear as follows:
  4584. *
  4585. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4586. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4587. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4588. * |-------------------------------------------------------------------|
  4589. * | rsvd2 | ring_buffer_size |
  4590. * |-------------------------------------------------------------------|
  4591. * | packet_type_enable_flags_0 |
  4592. * |-------------------------------------------------------------------|
  4593. * | packet_type_enable_flags_1 |
  4594. * |-------------------------------------------------------------------|
  4595. * | packet_type_enable_flags_2 |
  4596. * |-------------------------------------------------------------------|
  4597. * | packet_type_enable_flags_3 |
  4598. * |-------------------------------------------------------------------|
  4599. * | tlv_filter_in_flags |
  4600. * |-------------------------------------------------------------------|
  4601. * | rx_header_offset | rx_packet_offset |
  4602. * |-------------------------------------------------------------------|
  4603. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4604. * |-------------------------------------------------------------------|
  4605. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4606. * |-------------------------------------------------------------------|
  4607. * | rsvd3 | rx_attention_offset |
  4608. * |-------------------------------------------------------------------|
  4609. * | rsvd4 | mo| fp| rx_drop_threshold |
  4610. * | |ndp|ndp| |
  4611. * |-------------------------------------------------------------------|
  4612. * Where:
  4613. * PS = pkt_swap
  4614. * SS = status_swap
  4615. * OV = rx_offsets_valid
  4616. * DT = drop_thresh_valid
  4617. * The message is interpreted as follows:
  4618. * dword0 - b'0:7 - msg_type: This will be set to
  4619. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4620. * b'8:15 - pdev_id:
  4621. * 0 (for rings at SOC/UMAC level),
  4622. * 1/2/3 mac id (for rings at LMAC level)
  4623. * b'16:23 - ring_id : Identify the ring to configure.
  4624. * More details can be got from enum htt_srng_ring_id
  4625. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4626. * BUF_RING_CFG_0 defs within HW .h files,
  4627. * e.g. wmac_top_reg_seq_hwioreg.h
  4628. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4629. * BUF_RING_CFG_0 defs within HW .h files,
  4630. * e.g. wmac_top_reg_seq_hwioreg.h
  4631. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4632. * configuration fields are valid
  4633. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4634. * rx_drop_threshold field is valid
  4635. * b'28:31 - rsvd1: reserved for future use
  4636. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4637. * in byte units.
  4638. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4639. * - b'16:31 - rsvd2: Reserved for future use
  4640. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4641. * Enable MGMT packet from 0b0000 to 0b1001
  4642. * bits from low to high: FP, MD, MO - 3 bits
  4643. * FP: Filter_Pass
  4644. * MD: Monitor_Direct
  4645. * MO: Monitor_Other
  4646. * 10 mgmt subtypes * 3 bits -> 30 bits
  4647. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4648. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4649. * Enable MGMT packet from 0b1010 to 0b1111
  4650. * bits from low to high: FP, MD, MO - 3 bits
  4651. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4652. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4653. * Enable CTRL packet from 0b0000 to 0b1001
  4654. * bits from low to high: FP, MD, MO - 3 bits
  4655. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4656. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4657. * Enable CTRL packet from 0b1010 to 0b1111,
  4658. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4659. * bits from low to high: FP, MD, MO - 3 bits
  4660. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4661. * dword6 - b'0:31 - tlv_filter_in_flags:
  4662. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4663. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4664. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4665. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4666. * A value of 0 will be considered as ignore this config.
  4667. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4668. * e.g. wmac_top_reg_seq_hwioreg.h
  4669. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4670. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4671. * A value of 0 will be considered as ignore this config.
  4672. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4673. * e.g. wmac_top_reg_seq_hwioreg.h
  4674. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4675. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4676. * A value of 0 will be considered as ignore this config.
  4677. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4678. * e.g. wmac_top_reg_seq_hwioreg.h
  4679. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4680. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4681. * A value of 0 will be considered as ignore this config.
  4682. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4683. * e.g. wmac_top_reg_seq_hwioreg.h
  4684. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4685. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4686. * A value of 0 will be considered as ignore this config.
  4687. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4688. * e.g. wmac_top_reg_seq_hwioreg.h
  4689. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4690. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4691. * A value of 0 will be considered as ignore this config.
  4692. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4693. * e.g. wmac_top_reg_seq_hwioreg.h
  4694. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4695. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4696. * A value of 0 will be considered as ignore this config.
  4697. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4698. * e.g. wmac_top_reg_seq_hwioreg.h
  4699. * - b'16:31 - rsvd3 for future use
  4700. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4701. * to source rings. Consumer drops packets if the available
  4702. * words in the ring falls below the configured threshold
  4703. * value.
  4704. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4705. * by host. 1 -> subscribed
  4706. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4707. * by host. 1 -> subscribed
  4708. */
  4709. PREPACK struct htt_rx_ring_selection_cfg_t {
  4710. A_UINT32 msg_type: 8,
  4711. pdev_id: 8,
  4712. ring_id: 8,
  4713. status_swap: 1,
  4714. pkt_swap: 1,
  4715. rx_offsets_valid: 1,
  4716. drop_thresh_valid: 1,
  4717. rsvd1: 4;
  4718. A_UINT32 ring_buffer_size: 16,
  4719. rsvd2: 16;
  4720. A_UINT32 packet_type_enable_flags_0;
  4721. A_UINT32 packet_type_enable_flags_1;
  4722. A_UINT32 packet_type_enable_flags_2;
  4723. A_UINT32 packet_type_enable_flags_3;
  4724. A_UINT32 tlv_filter_in_flags;
  4725. A_UINT32 rx_packet_offset: 16,
  4726. rx_header_offset: 16;
  4727. A_UINT32 rx_mpdu_end_offset: 16,
  4728. rx_mpdu_start_offset: 16;
  4729. A_UINT32 rx_msdu_end_offset: 16,
  4730. rx_msdu_start_offset: 16;
  4731. A_UINT32 rx_attn_offset: 16,
  4732. rsvd3: 16;
  4733. A_UINT32 rx_drop_threshold: 10,
  4734. fp_ndp: 1,
  4735. mo_ndp: 1,
  4736. rsvd4: 20;
  4737. } POSTPACK;
  4738. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4739. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4740. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4741. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4742. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4743. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4744. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4745. do { \
  4746. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4747. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4748. } while (0)
  4749. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4750. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4751. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4752. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4753. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4754. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4755. do { \
  4756. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4757. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4758. } while (0)
  4759. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4760. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4761. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4762. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4763. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4764. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4765. do { \
  4766. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4767. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4768. } while (0)
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4772. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4773. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4775. do { \
  4776. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4777. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4778. } while (0)
  4779. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4780. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4781. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4782. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4783. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4784. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4787. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4788. } while (0)
  4789. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4790. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4791. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4792. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4793. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4794. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4795. do { \
  4796. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4797. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4798. } while (0)
  4799. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4800. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4801. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4802. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4803. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4804. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4805. do { \
  4806. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4807. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4808. } while (0)
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4812. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4813. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4815. do { \
  4816. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4817. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4818. } while (0)
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4822. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4823. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4825. do { \
  4826. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4827. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4828. } while (0)
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4832. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4833. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4837. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4838. } while (0)
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4842. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4843. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4847. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4848. } while (0)
  4849. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4850. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4851. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4852. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4853. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4854. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4855. do { \
  4856. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4857. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4858. } while (0)
  4859. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4860. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4861. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4862. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4863. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4864. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4865. do { \
  4866. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4867. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4868. } while (0)
  4869. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4870. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4871. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4872. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4873. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4874. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4877. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4878. } while (0)
  4879. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4880. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4881. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4882. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4883. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4884. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4885. do { \
  4886. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4887. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4888. } while (0)
  4889. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4890. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4891. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4892. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4893. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4894. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4895. do { \
  4896. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4897. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4898. } while (0)
  4899. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4900. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4901. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4902. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4903. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4904. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4905. do { \
  4906. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4907. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4908. } while (0)
  4909. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4910. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4911. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4912. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4913. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4914. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4917. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4918. } while (0)
  4919. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4920. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4921. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4922. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4923. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4924. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4927. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4928. } while (0)
  4929. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4930. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4931. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4932. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4933. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4934. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4937. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4938. } while (0)
  4939. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4940. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4941. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4942. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4943. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4944. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4945. do { \
  4946. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4947. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4948. } while (0)
  4949. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4950. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4951. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4952. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4953. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4954. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4957. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4958. } while (0)
  4959. /*
  4960. * Subtype based MGMT frames enable bits.
  4961. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4962. */
  4963. /* association request */
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4970. /* association response */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4977. /* Reassociation request */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4984. /* Reassociation response */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4991. /* Probe request */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4998. /* Probe response */
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5005. /* Timing Advertisement */
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5012. /* Reserved */
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5019. /* Beacon */
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5026. /* ATIM */
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5033. /* Disassociation */
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5040. /* Authentication */
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5047. /* Deauthentication */
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5054. /* Action */
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5061. /* Action No Ack */
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5068. /* Reserved */
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5075. /*
  5076. * Subtype based CTRL frames enable bits.
  5077. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5078. */
  5079. /* Reserved */
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5086. /* Reserved */
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5093. /* Reserved */
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5100. /* Reserved */
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5107. /* Reserved */
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5114. /* Reserved */
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5121. /* Reserved */
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5128. /* Control Wrapper */
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5135. /* Block Ack Request */
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5142. /* Block Ack*/
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5149. /* PS-POLL */
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5156. /* RTS */
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5163. /* CTS */
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5170. /* ACK */
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5177. /* CF-END */
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5184. /* CF-END + CF-ACK */
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5191. /* Multicast data */
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5198. /* Unicast data */
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5205. /* NULL data */
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(httsym, value); \
  5215. (word) |= (value) << httsym##_S; \
  5216. } while (0)
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5218. (((word) & httsym##_M) >> httsym##_S)
  5219. #define htt_rx_ring_pkt_enable_subtype_set( \
  5220. word, flag, mode, type, subtype, val) \
  5221. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5222. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5223. #define htt_rx_ring_pkt_enable_subtype_get( \
  5224. word, flag, mode, type, subtype) \
  5225. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5226. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5227. /* Definition to filter in TLVs */
  5228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5234. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5235. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5254. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5255. do { \
  5256. HTT_CHECK_SET_VAL(httsym, enable); \
  5257. (word) |= (enable) << httsym##_S; \
  5258. } while (0)
  5259. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5260. (((word) & httsym##_M) >> httsym##_S)
  5261. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5262. HTT_RX_RING_TLV_ENABLE_SET( \
  5263. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5264. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5265. HTT_RX_RING_TLV_ENABLE_GET( \
  5266. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5267. /**
  5268. * @brief host --> target Receive Flow Steering configuration message definition
  5269. *
  5270. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5271. *
  5272. * host --> target Receive Flow Steering configuration message definition.
  5273. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5274. * The reason for this is we want RFS to be configured and ready before MAC
  5275. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5276. *
  5277. * |31 24|23 16|15 9|8|7 0|
  5278. * |----------------+----------------+----------------+----------------|
  5279. * | reserved |E| msg type |
  5280. * |-------------------------------------------------------------------|
  5281. * Where E = RFS enable flag
  5282. *
  5283. * The RFS_CONFIG message consists of a single 4-byte word.
  5284. *
  5285. * Header fields:
  5286. * - MSG_TYPE
  5287. * Bits 7:0
  5288. * Purpose: identifies this as a RFS config msg
  5289. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5290. * - RFS_CONFIG
  5291. * Bit 8
  5292. * Purpose: Tells target whether to enable (1) or disable (0)
  5293. * flow steering feature when sending rx indication messages to host
  5294. */
  5295. #define HTT_H2T_RFS_CONFIG_M 0x100
  5296. #define HTT_H2T_RFS_CONFIG_S 8
  5297. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5298. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5299. HTT_H2T_RFS_CONFIG_S)
  5300. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5301. do { \
  5302. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5303. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5304. } while (0)
  5305. #define HTT_RFS_CFG_REQ_BYTES 4
  5306. /**
  5307. * @brief host -> target FW extended statistics retrieve
  5308. *
  5309. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5310. *
  5311. * @details
  5312. * The following field definitions describe the format of the HTT host
  5313. * to target FW extended stats retrieve message.
  5314. * The message specifies the type of stats the host wants to retrieve.
  5315. *
  5316. * |31 24|23 16|15 8|7 0|
  5317. * |-----------------------------------------------------------|
  5318. * | reserved | stats type | pdev_mask | msg type |
  5319. * |-----------------------------------------------------------|
  5320. * | config param [0] |
  5321. * |-----------------------------------------------------------|
  5322. * | config param [1] |
  5323. * |-----------------------------------------------------------|
  5324. * | config param [2] |
  5325. * |-----------------------------------------------------------|
  5326. * | config param [3] |
  5327. * |-----------------------------------------------------------|
  5328. * | reserved |
  5329. * |-----------------------------------------------------------|
  5330. * | cookie LSBs |
  5331. * |-----------------------------------------------------------|
  5332. * | cookie MSBs |
  5333. * |-----------------------------------------------------------|
  5334. * Header fields:
  5335. * - MSG_TYPE
  5336. * Bits 7:0
  5337. * Purpose: identifies this is a extended stats upload request message
  5338. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5339. * - PDEV_MASK
  5340. * Bits 8:15
  5341. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5342. * Value: This is a overloaded field, refer to usage and interpretation of
  5343. * PDEV in interface document.
  5344. * Bit 8 : Reserved for SOC stats
  5345. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5346. * Indicates MACID_MASK in DBS
  5347. * - STATS_TYPE
  5348. * Bits 23:16
  5349. * Purpose: identifies which FW statistics to upload
  5350. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5351. * - Reserved
  5352. * Bits 31:24
  5353. * - CONFIG_PARAM [0]
  5354. * Bits 31:0
  5355. * Purpose: give an opaque configuration value to the specified stats type
  5356. * Value: stats-type specific configuration value
  5357. * Refer to htt_stats.h for interpretation for each stats sub_type
  5358. * - CONFIG_PARAM [1]
  5359. * Bits 31:0
  5360. * Purpose: give an opaque configuration value to the specified stats type
  5361. * Value: stats-type specific configuration value
  5362. * Refer to htt_stats.h for interpretation for each stats sub_type
  5363. * - CONFIG_PARAM [2]
  5364. * Bits 31:0
  5365. * Purpose: give an opaque configuration value to the specified stats type
  5366. * Value: stats-type specific configuration value
  5367. * Refer to htt_stats.h for interpretation for each stats sub_type
  5368. * - CONFIG_PARAM [3]
  5369. * Bits 31:0
  5370. * Purpose: give an opaque configuration value to the specified stats type
  5371. * Value: stats-type specific configuration value
  5372. * Refer to htt_stats.h for interpretation for each stats sub_type
  5373. * - Reserved [31:0] for future use.
  5374. * - COOKIE_LSBS
  5375. * Bits 31:0
  5376. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5377. * message with its preceding host->target stats request message.
  5378. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5379. * - COOKIE_MSBS
  5380. * Bits 31:0
  5381. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5382. * message with its preceding host->target stats request message.
  5383. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5384. */
  5385. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5386. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5387. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5388. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5389. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5390. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5391. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5392. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5393. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5394. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5395. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5396. do { \
  5397. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5398. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5399. } while (0)
  5400. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5401. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5402. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5403. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5406. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5407. } while (0)
  5408. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5409. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5410. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5411. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5414. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5415. } while (0)
  5416. /**
  5417. * @brief host -> target FW PPDU_STATS request message
  5418. *
  5419. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5420. *
  5421. * @details
  5422. * The following field definitions describe the format of the HTT host
  5423. * to target FW for PPDU_STATS_CFG msg.
  5424. * The message allows the host to configure the PPDU_STATS_IND messages
  5425. * produced by the target.
  5426. *
  5427. * |31 24|23 16|15 8|7 0|
  5428. * |-----------------------------------------------------------|
  5429. * | REQ bit mask | pdev_mask | msg type |
  5430. * |-----------------------------------------------------------|
  5431. * Header fields:
  5432. * - MSG_TYPE
  5433. * Bits 7:0
  5434. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5435. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5436. * - PDEV_MASK
  5437. * Bits 8:15
  5438. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5439. * Value: This is a overloaded field, refer to usage and interpretation of
  5440. * PDEV in interface document.
  5441. * Bit 8 : Reserved for SOC stats
  5442. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5443. * Indicates MACID_MASK in DBS
  5444. * - REQ_TLV_BIT_MASK
  5445. * Bits 16:31
  5446. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5447. * needs to be included in the target's PPDU_STATS_IND messages.
  5448. * Value: refer htt_ppdu_stats_tlv_tag_t
  5449. *
  5450. */
  5451. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5452. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5453. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5454. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5455. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5456. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5457. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5458. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5459. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5462. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5463. } while (0)
  5464. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5465. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5466. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5467. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5468. do { \
  5469. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5470. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5471. } while (0)
  5472. /**
  5473. * @brief Host-->target HTT RX FSE setup message
  5474. *
  5475. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5476. *
  5477. * @details
  5478. * Through this message, the host will provide details of the flow tables
  5479. * in host DDR along with hash keys.
  5480. * This message can be sent per SOC or per PDEV, which is differentiated
  5481. * by pdev id values.
  5482. * The host will allocate flow search table and sends table size,
  5483. * physical DMA address of flow table, and hash keys to firmware to
  5484. * program into the RXOLE FSE HW block.
  5485. *
  5486. * The following field definitions describe the format of the RX FSE setup
  5487. * message sent from the host to target
  5488. *
  5489. * Header fields:
  5490. * dword0 - b'7:0 - msg_type: This will be set to
  5491. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5492. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5493. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5494. * pdev's LMAC ring.
  5495. * b'31:16 - reserved : Reserved for future use
  5496. * dword1 - b'19:0 - number of records: This field indicates the number of
  5497. * entries in the flow table. For example: 8k number of
  5498. * records is equivalent to
  5499. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5500. * b'27:20 - max search: This field specifies the skid length to FSE
  5501. * parser HW module whenever match is not found at the
  5502. * exact index pointed by hash.
  5503. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5504. * Refer htt_ip_da_sa_prefix below for more details.
  5505. * b'31:30 - reserved: Reserved for future use
  5506. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5507. * table allocated by host in DDR
  5508. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5509. * table allocated by host in DDR
  5510. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5511. * entry hashing
  5512. *
  5513. *
  5514. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5515. * |---------------------------------------------------------------|
  5516. * | reserved | pdev_id | MSG_TYPE |
  5517. * |---------------------------------------------------------------|
  5518. * |resvd|IPDSA| max_search | Number of records |
  5519. * |---------------------------------------------------------------|
  5520. * | base address lo |
  5521. * |---------------------------------------------------------------|
  5522. * | base address high |
  5523. * |---------------------------------------------------------------|
  5524. * | toeplitz key 31_0 |
  5525. * |---------------------------------------------------------------|
  5526. * | toeplitz key 63_32 |
  5527. * |---------------------------------------------------------------|
  5528. * | toeplitz key 95_64 |
  5529. * |---------------------------------------------------------------|
  5530. * | toeplitz key 127_96 |
  5531. * |---------------------------------------------------------------|
  5532. * | toeplitz key 159_128 |
  5533. * |---------------------------------------------------------------|
  5534. * | toeplitz key 191_160 |
  5535. * |---------------------------------------------------------------|
  5536. * | toeplitz key 223_192 |
  5537. * |---------------------------------------------------------------|
  5538. * | toeplitz key 255_224 |
  5539. * |---------------------------------------------------------------|
  5540. * | toeplitz key 287_256 |
  5541. * |---------------------------------------------------------------|
  5542. * | reserved | toeplitz key 314_288(26:0 bits) |
  5543. * |---------------------------------------------------------------|
  5544. * where:
  5545. * IPDSA = ip_da_sa
  5546. */
  5547. /**
  5548. * @brief: htt_ip_da_sa_prefix
  5549. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5550. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5551. * documentation per RFC3849
  5552. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5553. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5554. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5555. */
  5556. enum htt_ip_da_sa_prefix {
  5557. HTT_RX_IPV6_20010db8,
  5558. HTT_RX_IPV4_MAPPED_IPV6,
  5559. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5560. HTT_RX_IPV6_64FF9B,
  5561. };
  5562. /**
  5563. * @brief Host-->target HTT RX FISA configure and enable
  5564. *
  5565. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5566. *
  5567. * @details
  5568. * The host will send this command down to configure and enable the FISA
  5569. * operational params.
  5570. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5571. * register.
  5572. * Should configure both the MACs.
  5573. *
  5574. * dword0 - b'7:0 - msg_type:
  5575. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5576. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5577. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5578. * pdev's LMAC ring.
  5579. * b'31:16 - reserved : Reserved for future use
  5580. *
  5581. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5582. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5583. * packets. 1 flow search will be skipped
  5584. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5585. * tcp,udp packets
  5586. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5587. * calculation
  5588. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5589. * calculation
  5590. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5591. * calculation
  5592. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5593. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5594. * length
  5595. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5596. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5597. * length
  5598. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5599. * num jump
  5600. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5601. * num jump
  5602. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5603. * data type switch has happend for MPDU Sequence num jump
  5604. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5605. * for MPDU Sequence num jump
  5606. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5607. * for decrypt errors
  5608. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5609. * while aggregating a msdu
  5610. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5611. * The aggregation is done until (number of MSDUs aggregated
  5612. * < LIMIT + 1)
  5613. * b'31:18 - Reserved
  5614. *
  5615. * fisa_control_value - 32bit value FW can write to register
  5616. *
  5617. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5618. * Threshold value for FISA timeout (units are microseconds).
  5619. * When the global timestamp exceeds this threshold, FISA
  5620. * aggregation will be restarted.
  5621. * A value of 0 means timeout is disabled.
  5622. * Compare the threshold register with timestamp field in
  5623. * flow entry to generate timeout for the flow.
  5624. *
  5625. * |31 18 |17 16|15 8|7 0|
  5626. * |-------------------------------------------------------------|
  5627. * | reserved | pdev_mask | msg type |
  5628. * |-------------------------------------------------------------|
  5629. * | reserved | FISA_CTRL |
  5630. * |-------------------------------------------------------------|
  5631. * | FISA_TIMEOUT_THRESH |
  5632. * |-------------------------------------------------------------|
  5633. */
  5634. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5635. A_UINT32 msg_type:8,
  5636. pdev_id:8,
  5637. reserved0:16;
  5638. /**
  5639. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5640. * [17:0]
  5641. */
  5642. union {
  5643. /*
  5644. * fisa_control_bits structure is deprecated.
  5645. * Please use fisa_control_bits_v2 going forward.
  5646. */
  5647. struct {
  5648. A_UINT32 fisa_enable: 1,
  5649. ipsec_skip_search: 1,
  5650. nontcp_skip_search: 1,
  5651. add_ipv4_fixed_hdr_len: 1,
  5652. add_ipv6_fixed_hdr_len: 1,
  5653. add_tcp_fixed_hdr_len: 1,
  5654. add_udp_hdr_len: 1,
  5655. chksum_cum_ip_len_en: 1,
  5656. disable_tid_check: 1,
  5657. disable_ta_check: 1,
  5658. disable_qos_check: 1,
  5659. disable_raw_check: 1,
  5660. disable_decrypt_err_check: 1,
  5661. disable_msdu_drop_check: 1,
  5662. fisa_aggr_limit: 4,
  5663. reserved: 14;
  5664. } fisa_control_bits;
  5665. struct {
  5666. A_UINT32 fisa_enable: 1,
  5667. fisa_aggr_limit: 4,
  5668. reserved: 27;
  5669. } fisa_control_bits_v2;
  5670. A_UINT32 fisa_control_value;
  5671. } u_fisa_control;
  5672. /**
  5673. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5674. * timeout threshold for aggregation. Unit in usec.
  5675. * [31:0]
  5676. */
  5677. A_UINT32 fisa_timeout_threshold;
  5678. } POSTPACK;
  5679. /* DWord 0: pdev-ID */
  5680. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5681. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5682. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5683. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5684. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5685. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5686. do { \
  5687. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5688. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5689. } while (0)
  5690. /* Dword 1: fisa_control_value fisa config */
  5691. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5692. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5693. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5694. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5695. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5696. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5697. do { \
  5698. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5699. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5700. } while (0)
  5701. /* Dword 1: fisa_control_value ipsec_skip_search */
  5702. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5703. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5704. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5705. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5706. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5707. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5708. do { \
  5709. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5710. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5711. } while (0)
  5712. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5713. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5714. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5715. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5716. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5717. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5718. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5719. do { \
  5720. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5721. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5722. } while (0)
  5723. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5724. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5725. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5726. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5727. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5728. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5729. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5730. do { \
  5731. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5732. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5733. } while (0)
  5734. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5735. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5736. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5737. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5738. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5739. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5740. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5741. do { \
  5742. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5743. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5744. } while (0)
  5745. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5746. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5747. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5748. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5749. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5750. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5751. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5752. do { \
  5753. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5754. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5755. } while (0)
  5756. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5757. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5758. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5759. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5760. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5761. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5762. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5763. do { \
  5764. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5765. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5766. } while (0)
  5767. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5768. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5769. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5770. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5771. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5772. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5773. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5774. do { \
  5775. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5776. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5777. } while (0)
  5778. /* Dword 1: fisa_control_value disable_tid_check */
  5779. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5780. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5781. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5782. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5783. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5784. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5785. do { \
  5786. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5787. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5788. } while (0)
  5789. /* Dword 1: fisa_control_value disable_ta_check */
  5790. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5791. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5792. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5793. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5794. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5795. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5796. do { \
  5797. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5798. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5799. } while (0)
  5800. /* Dword 1: fisa_control_value disable_qos_check */
  5801. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5802. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5803. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5804. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5805. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5806. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5809. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5810. } while (0)
  5811. /* Dword 1: fisa_control_value disable_raw_check */
  5812. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5813. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5814. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5815. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5816. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5817. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5818. do { \
  5819. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5820. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5821. } while (0)
  5822. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5823. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5824. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5825. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5826. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5827. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5828. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5829. do { \
  5830. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5831. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5832. } while (0)
  5833. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5834. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5835. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5836. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5837. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5838. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5839. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5840. do { \
  5841. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5842. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5843. } while (0)
  5844. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5845. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5846. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5847. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5848. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5849. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5850. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5851. do { \
  5852. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5853. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5854. } while (0)
  5855. /* Dword 1: fisa_control_value fisa config */
  5856. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5857. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5858. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5859. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5860. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5861. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5862. do { \
  5863. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5864. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5865. } while (0)
  5866. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5867. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5868. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5869. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5870. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5871. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5872. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5873. do { \
  5874. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5875. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5876. } while (0)
  5877. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5878. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5879. pdev_id:8,
  5880. reserved0:16;
  5881. A_UINT32 num_records:20,
  5882. max_search:8,
  5883. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5884. reserved1:2;
  5885. A_UINT32 base_addr_lo;
  5886. A_UINT32 base_addr_hi;
  5887. A_UINT32 toeplitz31_0;
  5888. A_UINT32 toeplitz63_32;
  5889. A_UINT32 toeplitz95_64;
  5890. A_UINT32 toeplitz127_96;
  5891. A_UINT32 toeplitz159_128;
  5892. A_UINT32 toeplitz191_160;
  5893. A_UINT32 toeplitz223_192;
  5894. A_UINT32 toeplitz255_224;
  5895. A_UINT32 toeplitz287_256;
  5896. A_UINT32 toeplitz314_288:27,
  5897. reserved2:5;
  5898. } POSTPACK;
  5899. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5900. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5901. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5902. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5903. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5904. /* DWORD 0: Pdev ID */
  5905. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5906. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5907. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5908. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5909. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5910. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5911. do { \
  5912. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5913. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5914. } while (0)
  5915. /* DWORD 1:num of records */
  5916. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5917. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5918. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5919. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5920. HTT_RX_FSE_SETUP_NUM_REC_S)
  5921. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5922. do { \
  5923. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5924. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5925. } while (0)
  5926. /* DWORD 1:max_search */
  5927. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5928. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5929. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5930. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5931. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5932. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5933. do { \
  5934. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5935. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5936. } while (0)
  5937. /* DWORD 1:ip_da_sa prefix */
  5938. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5939. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5940. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5941. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5942. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5943. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5944. do { \
  5945. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5946. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5947. } while (0)
  5948. /* DWORD 2: Base Address LO */
  5949. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5950. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5951. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5952. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5953. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5954. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5955. do { \
  5956. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5957. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5958. } while (0)
  5959. /* DWORD 3: Base Address High */
  5960. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5961. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5962. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5963. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5964. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5965. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5966. do { \
  5967. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5968. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5969. } while (0)
  5970. /* DWORD 4-12: Hash Value */
  5971. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5972. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5973. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5974. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5975. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5976. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5979. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5980. } while (0)
  5981. /* DWORD 13: Hash Value 314:288 bits */
  5982. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5983. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5984. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5985. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5986. do { \
  5987. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5988. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5989. } while (0)
  5990. /**
  5991. * @brief Host-->target HTT RX FSE operation message
  5992. *
  5993. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5994. *
  5995. * @details
  5996. * The host will send this Flow Search Engine (FSE) operation message for
  5997. * every flow add/delete operation.
  5998. * The FSE operation includes FSE full cache invalidation or individual entry
  5999. * invalidation.
  6000. * This message can be sent per SOC or per PDEV which is differentiated
  6001. * by pdev id values.
  6002. *
  6003. * |31 16|15 8|7 1|0|
  6004. * |-------------------------------------------------------------|
  6005. * | reserved | pdev_id | MSG_TYPE |
  6006. * |-------------------------------------------------------------|
  6007. * | reserved | operation |I|
  6008. * |-------------------------------------------------------------|
  6009. * | ip_src_addr_31_0 |
  6010. * |-------------------------------------------------------------|
  6011. * | ip_src_addr_63_32 |
  6012. * |-------------------------------------------------------------|
  6013. * | ip_src_addr_95_64 |
  6014. * |-------------------------------------------------------------|
  6015. * | ip_src_addr_127_96 |
  6016. * |-------------------------------------------------------------|
  6017. * | ip_dst_addr_31_0 |
  6018. * |-------------------------------------------------------------|
  6019. * | ip_dst_addr_63_32 |
  6020. * |-------------------------------------------------------------|
  6021. * | ip_dst_addr_95_64 |
  6022. * |-------------------------------------------------------------|
  6023. * | ip_dst_addr_127_96 |
  6024. * |-------------------------------------------------------------|
  6025. * | l4_dst_port | l4_src_port |
  6026. * | (32-bit SPI incase of IPsec) |
  6027. * |-------------------------------------------------------------|
  6028. * | reserved | l4_proto |
  6029. * |-------------------------------------------------------------|
  6030. *
  6031. * where I is 1-bit ipsec_valid.
  6032. *
  6033. * The following field definitions describe the format of the RX FSE operation
  6034. * message sent from the host to target for every add/delete flow entry to flow
  6035. * table.
  6036. *
  6037. * Header fields:
  6038. * dword0 - b'7:0 - msg_type: This will be set to
  6039. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6040. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6041. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6042. * specified pdev's LMAC ring.
  6043. * b'31:16 - reserved : Reserved for future use
  6044. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6045. * (Internet Protocol Security).
  6046. * IPsec describes the framework for providing security at
  6047. * IP layer. IPsec is defined for both versions of IP:
  6048. * IPV4 and IPV6.
  6049. * Please refer to htt_rx_flow_proto enumeration below for
  6050. * more info.
  6051. * ipsec_valid = 1 for IPSEC packets
  6052. * ipsec_valid = 0 for IP Packets
  6053. * b'7:1 - operation: This indicates types of FSE operation.
  6054. * Refer to htt_rx_fse_operation enumeration:
  6055. * 0 - No Cache Invalidation required
  6056. * 1 - Cache invalidate only one entry given by IP
  6057. * src/dest address at DWORD[2:9]
  6058. * 2 - Complete FSE Cache Invalidation
  6059. * 3 - FSE Disable
  6060. * 4 - FSE Enable
  6061. * b'31:8 - reserved: Reserved for future use
  6062. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6063. * for per flow addition/deletion
  6064. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6065. * and the subsequent 3 A_UINT32 will be padding bytes.
  6066. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6067. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6068. * from 0 to 65535 but only 0 to 1023 are designated as
  6069. * well-known ports. Refer to [RFC1700] for more details.
  6070. * This field is valid only if
  6071. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6072. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6073. * range from 0 to 65535 but only 0 to 1023 are designated
  6074. * as well-known ports. Refer to [RFC1700] for more details.
  6075. * This field is valid only if
  6076. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6077. * - SPI (31:0): Security Parameters Index is an
  6078. * identification tag added to the header while using IPsec
  6079. * for tunneling the IP traffici.
  6080. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6081. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6082. * Assigned Internet Protocol Numbers.
  6083. * l4_proto numbers for standard protocol like UDP/TCP
  6084. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6085. * l4_proto = 17 for UDP etc.
  6086. * b'31:8 - reserved: Reserved for future use.
  6087. *
  6088. */
  6089. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6090. A_UINT32 msg_type:8,
  6091. pdev_id:8,
  6092. reserved0:16;
  6093. A_UINT32 ipsec_valid:1,
  6094. operation:7,
  6095. reserved1:24;
  6096. A_UINT32 ip_src_addr_31_0;
  6097. A_UINT32 ip_src_addr_63_32;
  6098. A_UINT32 ip_src_addr_95_64;
  6099. A_UINT32 ip_src_addr_127_96;
  6100. A_UINT32 ip_dest_addr_31_0;
  6101. A_UINT32 ip_dest_addr_63_32;
  6102. A_UINT32 ip_dest_addr_95_64;
  6103. A_UINT32 ip_dest_addr_127_96;
  6104. union {
  6105. A_UINT32 spi;
  6106. struct {
  6107. A_UINT32 l4_src_port:16,
  6108. l4_dest_port:16;
  6109. } ip;
  6110. } u;
  6111. A_UINT32 l4_proto:8,
  6112. reserved:24;
  6113. } POSTPACK;
  6114. /**
  6115. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6116. *
  6117. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6118. *
  6119. * @details
  6120. * The host will send this Full monitor mode register configuration message.
  6121. * This message can be sent per SOC or per PDEV which is differentiated
  6122. * by pdev id values.
  6123. *
  6124. * |31 16|15 11|10 8|7 3|2|1|0|
  6125. * |-------------------------------------------------------------|
  6126. * | reserved | pdev_id | MSG_TYPE |
  6127. * |-------------------------------------------------------------|
  6128. * | reserved |Release Ring |N|Z|E|
  6129. * |-------------------------------------------------------------|
  6130. *
  6131. * where E is 1-bit full monitor mode enable/disable.
  6132. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6133. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6134. *
  6135. * The following field definitions describe the format of the full monitor
  6136. * mode configuration message sent from the host to target for each pdev.
  6137. *
  6138. * Header fields:
  6139. * dword0 - b'7:0 - msg_type: This will be set to
  6140. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6141. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6142. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6143. * specified pdev's LMAC ring.
  6144. * b'31:16 - reserved : Reserved for future use.
  6145. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6146. * monitor mode rxdma register is to be enabled or disabled.
  6147. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6148. * additional descriptors at ppdu end for zero mpdus
  6149. * enabled or disabled.
  6150. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6151. * additional descriptors at ppdu end for non zero mpdus
  6152. * enabled or disabled.
  6153. * b'10:3 - release_ring: This indicates the destination ring
  6154. * selection for the descriptor at the end of PPDU
  6155. * 0 - REO ring select
  6156. * 1 - FW ring select
  6157. * 2 - SW ring select
  6158. * 3 - Release ring select
  6159. * Refer to htt_rx_full_mon_release_ring.
  6160. * b'31:11 - reserved for future use
  6161. */
  6162. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6163. A_UINT32 msg_type:8,
  6164. pdev_id:8,
  6165. reserved0:16;
  6166. A_UINT32 full_monitor_mode_enable:1,
  6167. addnl_descs_zero_mpdus_end:1,
  6168. addnl_descs_non_zero_mpdus_end:1,
  6169. release_ring:8,
  6170. reserved1:21;
  6171. } POSTPACK;
  6172. /**
  6173. * Enumeration for full monitor mode destination ring select
  6174. * 0 - REO destination ring select
  6175. * 1 - FW destination ring select
  6176. * 2 - SW destination ring select
  6177. * 3 - Release destination ring select
  6178. */
  6179. enum htt_rx_full_mon_release_ring {
  6180. HTT_RX_MON_RING_REO,
  6181. HTT_RX_MON_RING_FW,
  6182. HTT_RX_MON_RING_SW,
  6183. HTT_RX_MON_RING_RELEASE,
  6184. };
  6185. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6186. /* DWORD 0: Pdev ID */
  6187. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6188. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6189. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6190. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6191. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6192. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6193. do { \
  6194. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6195. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6196. } while (0)
  6197. /* DWORD 1:ENABLE */
  6198. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6199. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6200. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6201. do { \
  6202. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6203. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6204. } while (0)
  6205. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6206. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6207. /* DWORD 1:ZERO_MPDU */
  6208. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6209. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6210. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6211. do { \
  6212. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6213. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6214. } while (0)
  6215. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6216. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6217. /* DWORD 1:NON_ZERO_MPDU */
  6218. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6219. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6220. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6221. do { \
  6222. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6223. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6224. } while (0)
  6225. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6226. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6227. /* DWORD 1:RELEASE_RINGS */
  6228. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6229. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6230. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6233. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6234. } while (0)
  6235. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6236. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6237. /**
  6238. * Enumeration for IP Protocol or IPSEC Protocol
  6239. * IPsec describes the framework for providing security at IP layer.
  6240. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6241. */
  6242. enum htt_rx_flow_proto {
  6243. HTT_RX_FLOW_IP_PROTO,
  6244. HTT_RX_FLOW_IPSEC_PROTO,
  6245. };
  6246. /**
  6247. * Enumeration for FSE Cache Invalidation
  6248. * 0 - No Cache Invalidation required
  6249. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6250. * 2 - Complete FSE Cache Invalidation
  6251. * 3 - FSE Disable
  6252. * 4 - FSE Enable
  6253. */
  6254. enum htt_rx_fse_operation {
  6255. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6256. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6257. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6258. HTT_RX_FSE_DISABLE,
  6259. HTT_RX_FSE_ENABLE,
  6260. };
  6261. /* DWORD 0: Pdev ID */
  6262. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6263. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6264. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6265. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6266. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6267. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6268. do { \
  6269. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6270. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6271. } while (0)
  6272. /* DWORD 1:IP PROTO or IPSEC */
  6273. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6274. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6275. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6276. do { \
  6277. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6278. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6279. } while (0)
  6280. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6281. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6282. /* DWORD 1:FSE Operation */
  6283. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6284. #define HTT_RX_FSE_OPERATION_S 1
  6285. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6286. do { \
  6287. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6288. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6289. } while (0)
  6290. #define HTT_RX_FSE_OPERATION_GET(word) \
  6291. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6292. /* DWORD 2-9:IP Address */
  6293. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6294. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6295. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6296. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6297. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6298. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6299. do { \
  6300. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6301. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6302. } while (0)
  6303. /* DWORD 10:Source Port Number */
  6304. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6305. #define HTT_RX_FSE_SOURCEPORT_S 0
  6306. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6307. do { \
  6308. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6309. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6310. } while (0)
  6311. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6312. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6313. /* DWORD 11:Destination Port Number */
  6314. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6315. #define HTT_RX_FSE_DESTPORT_S 16
  6316. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6317. do { \
  6318. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6319. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6320. } while (0)
  6321. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6322. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6323. /* DWORD 10-11:SPI (In case of IPSEC) */
  6324. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6325. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6326. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6327. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6328. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6329. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6330. do { \
  6331. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6332. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6333. } while (0)
  6334. /* DWORD 12:L4 PROTO */
  6335. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6336. #define HTT_RX_FSE_L4_PROTO_S 0
  6337. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6340. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6341. } while (0)
  6342. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6343. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6344. /**
  6345. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6346. *
  6347. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6348. *
  6349. * |31 24|23 |15 8|7 2|1|0|
  6350. * |----------------+----------------+----------------+----------------|
  6351. * | reserved | pdev_id | msg_type |
  6352. * |---------------------------------+----------------+----------------|
  6353. * | reserved |E|F|
  6354. * |---------------------------------+----------------+----------------|
  6355. * Where E = Configure the target to provide the 3-tuple hash value in
  6356. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6357. * F = Configure the target to provide the 3-tuple hash value in
  6358. * flow_id_toeplitz field of rx_msdu_start tlv
  6359. *
  6360. * The following field definitions describe the format of the 3 tuple hash value
  6361. * message sent from the host to target as part of initialization sequence.
  6362. *
  6363. * Header fields:
  6364. * dword0 - b'7:0 - msg_type: This will be set to
  6365. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6366. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6367. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6368. * specified pdev's LMAC ring.
  6369. * b'31:16 - reserved : Reserved for future use
  6370. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6371. * b'1 - toeplitz_hash_2_or_4_field_enable
  6372. * b'31:2 - reserved : Reserved for future use
  6373. * ---------+------+----------------------------------------------------------
  6374. * bit1 | bit0 | Functionality
  6375. * ---------+------+----------------------------------------------------------
  6376. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6377. * | | in flow_id_toeplitz field
  6378. * ---------+------+----------------------------------------------------------
  6379. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6380. * | | in toeplitz_hash_2_or_4 field
  6381. * ---------+------+----------------------------------------------------------
  6382. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6383. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6384. * ---------+------+----------------------------------------------------------
  6385. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6386. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6387. * | | toeplitz_hash_2_or_4 field
  6388. *----------------------------------------------------------------------------
  6389. */
  6390. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6391. A_UINT32 msg_type :8,
  6392. pdev_id :8,
  6393. reserved0 :16;
  6394. A_UINT32 flow_id_toeplitz_field_enable :1,
  6395. toeplitz_hash_2_or_4_field_enable :1,
  6396. reserved1 :30;
  6397. } POSTPACK;
  6398. /* DWORD0 : pdev_id configuration Macros */
  6399. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6400. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6401. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6402. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6403. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6404. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6405. do { \
  6406. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6407. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6408. } while (0)
  6409. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6410. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6411. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6412. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6413. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6414. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6415. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6416. do { \
  6417. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6418. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6419. } while (0)
  6420. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6421. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6422. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6423. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6424. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6425. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6426. do { \
  6427. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6428. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6429. } while (0)
  6430. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6431. /**
  6432. * @brief host --> target Host PA Address Size
  6433. *
  6434. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6435. *
  6436. * @details
  6437. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6438. * provide the physical start address and size of each of the memory
  6439. * areas within host DDR that the target FW may need to access.
  6440. *
  6441. * For example, the host can use this message to allow the target FW
  6442. * to set up access to the host's pools of TQM link descriptors.
  6443. * The message would appear as follows:
  6444. *
  6445. * |31 24|23 16|15 8|7 0|
  6446. * |----------------+----------------+----------------+----------------|
  6447. * | reserved | num_entries | msg_type |
  6448. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6449. * | mem area 0 size |
  6450. * |----------------+----------------+----------------+----------------|
  6451. * | mem area 0 physical_address_lo |
  6452. * |----------------+----------------+----------------+----------------|
  6453. * | mem area 0 physical_address_hi |
  6454. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6455. * | mem area 1 size |
  6456. * |----------------+----------------+----------------+----------------|
  6457. * | mem area 1 physical_address_lo |
  6458. * |----------------+----------------+----------------+----------------|
  6459. * | mem area 1 physical_address_hi |
  6460. * |----------------+----------------+----------------+----------------|
  6461. * ...
  6462. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6463. * | mem area N size |
  6464. * |----------------+----------------+----------------+----------------|
  6465. * | mem area N physical_address_lo |
  6466. * |----------------+----------------+----------------+----------------|
  6467. * | mem area N physical_address_hi |
  6468. * |----------------+----------------+----------------+----------------|
  6469. *
  6470. * The message is interpreted as follows:
  6471. * dword0 - b'0:7 - msg_type: This will be set to
  6472. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6473. * b'8:15 - number_entries: Indicated the number of host memory
  6474. * areas specified within the remainder of the message
  6475. * b'16:31 - reserved.
  6476. * dword1 - b'0:31 - memory area 0 size in bytes
  6477. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6478. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6479. * and similar for memory area 1 through memory area N.
  6480. */
  6481. PREPACK struct htt_h2t_host_paddr_size {
  6482. A_UINT32 msg_type: 8,
  6483. num_entries: 8,
  6484. reserved: 16;
  6485. } POSTPACK;
  6486. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6487. A_UINT32 size;
  6488. A_UINT32 physical_address_lo;
  6489. A_UINT32 physical_address_hi;
  6490. } POSTPACK;
  6491. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6492. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6493. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6494. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6495. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6496. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6497. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6498. do { \
  6499. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6500. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6501. } while (0)
  6502. /**
  6503. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  6504. *
  6505. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  6506. *
  6507. * @details
  6508. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  6509. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  6510. *
  6511. * The message would appear as follows:
  6512. *
  6513. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  6514. * |---------------------------------+---+---+----------+-+-----------|
  6515. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  6516. * |---------------------+---+---+---+---+---+----------+-+-----------|
  6517. *
  6518. *
  6519. * The message is interpreted as follows:
  6520. * dword0 - b'0:7 - msg_type: This will be set to
  6521. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  6522. * b'8 - override bit to drive MSDUs to PPE ring
  6523. * b'9:13 - REO destination ring indication
  6524. * b'14 - Multi buffer msdu override enable bit
  6525. * b'15 - Intra BSS override
  6526. * b'16 - Decap raw override
  6527. * b'17 - Decap Native wifi override
  6528. * b'18 - IP frag override
  6529. * b'19:31 - reserved
  6530. */
  6531. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  6532. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  6533. override: 1,
  6534. reo_destination_indication: 5,
  6535. multi_buffer_msdu_override_en: 1,
  6536. intra_bss_override: 1,
  6537. decap_raw_override: 1,
  6538. decap_nwifi_override: 1,
  6539. ip_frag_override: 1,
  6540. reserved: 13;
  6541. } POSTPACK;
  6542. /* DWORD 0: Override */
  6543. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  6544. #define HTT_PPE_CFG_OVERRIDE_S 8
  6545. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  6546. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  6547. HTT_PPE_CFG_OVERRIDE_S)
  6548. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  6551. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  6552. } while (0)
  6553. /* DWORD 0: REO Destination Indication*/
  6554. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  6555. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  6556. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  6557. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  6558. HTT_PPE_CFG_REO_DEST_IND_S)
  6559. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  6560. do { \
  6561. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  6562. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  6563. } while (0)
  6564. /* DWORD 0: Multi buffer MSDU override */
  6565. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  6566. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  6567. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  6568. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  6569. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  6570. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  6573. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  6574. } while (0)
  6575. /* DWORD 0: Intra BSS override */
  6576. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  6577. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  6578. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  6579. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  6580. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  6581. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  6584. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  6585. } while (0)
  6586. /* DWORD 0: Decap RAW override */
  6587. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  6588. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  6589. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  6590. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  6591. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  6592. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  6593. do { \
  6594. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  6595. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  6596. } while (0)
  6597. /* DWORD 0: Decap NWIFI override */
  6598. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  6599. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  6600. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  6601. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  6602. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  6603. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  6604. do { \
  6605. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  6606. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  6607. } while (0)
  6608. /* DWORD 0: IP frag override */
  6609. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  6610. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  6611. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  6612. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  6613. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  6614. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  6615. do { \
  6616. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  6617. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  6618. } while (0)
  6619. /*
  6620. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  6621. *
  6622. * @details
  6623. * The following field definitions describe the format of the HTT host
  6624. * to target FW VDEV TX RX stats retrieve message.
  6625. * The message specifies the type of stats the host wants to retrieve.
  6626. *
  6627. * |31 27|26 25|24 17|16|15 8|7 0|
  6628. * |-----------------------------------------------------------|
  6629. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  6630. * |-----------------------------------------------------------|
  6631. * | vdev_id lower bitmask |
  6632. * |-----------------------------------------------------------|
  6633. * | vdev_id upper bitmask |
  6634. * |-----------------------------------------------------------|
  6635. * Header fields:
  6636. * Where:
  6637. * dword0 - b'7:0 - msg_type: This will be set to
  6638. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  6639. * b'15:8 - pdev id
  6640. * b'16(E) - Enable/Disable the vdev HW stats
  6641. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  6642. * b'25:26(R) - Reset stats bits
  6643. * 0: don't reset stats
  6644. * 1: reset stats once
  6645. * 2: reset stats at the start of each periodic interval
  6646. * b'27:31 - reserved for future use
  6647. * dword1 - b'0:31 - vdev_id lower bitmask
  6648. * dword2 - b'0:31 - vdev_id upper bitmask
  6649. */
  6650. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  6651. A_UINT32 msg_type :8,
  6652. pdev_id :8,
  6653. enable :1,
  6654. periodic_interval :8,
  6655. reset_stats_bits :2,
  6656. reserved0 :5;
  6657. A_UINT32 vdev_id_lower_bitmask;
  6658. A_UINT32 vdev_id_upper_bitmask;
  6659. } POSTPACK;
  6660. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  6661. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  6662. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  6663. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  6664. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  6665. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  6666. do { \
  6667. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  6668. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  6669. } while (0)
  6670. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  6671. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  6672. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  6673. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  6674. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  6675. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  6676. do { \
  6677. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  6678. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  6679. } while (0)
  6680. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  6681. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  6682. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  6683. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  6684. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  6685. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  6686. do { \
  6687. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  6688. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  6689. } while (0)
  6690. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  6691. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  6692. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  6693. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  6694. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  6695. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  6696. do { \
  6697. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  6698. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  6699. } while (0)
  6700. /*=== target -> host messages ===============================================*/
  6701. enum htt_t2h_msg_type {
  6702. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6703. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6704. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6705. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6706. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6707. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6708. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6709. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6710. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6711. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6712. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6713. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6714. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6715. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6716. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6717. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6718. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6719. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6720. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6721. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6722. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6723. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6724. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6725. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6726. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6727. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6728. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6729. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6730. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6731. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6732. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6733. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6734. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6735. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6736. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6737. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6738. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6739. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6740. /* TX_OFFLOAD_DELIVER_IND:
  6741. * Forward the target's locally-generated packets to the host,
  6742. * to provide to the monitor mode interface.
  6743. */
  6744. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6745. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6746. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6747. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6748. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  6749. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  6750. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  6751. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  6752. HTT_T2H_MSG_TYPE_TEST,
  6753. /* keep this last */
  6754. HTT_T2H_NUM_MSGS
  6755. };
  6756. /*
  6757. * HTT target to host message type -
  6758. * stored in bits 7:0 of the first word of the message
  6759. */
  6760. #define HTT_T2H_MSG_TYPE_M 0xff
  6761. #define HTT_T2H_MSG_TYPE_S 0
  6762. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6763. do { \
  6764. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6765. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6766. } while (0)
  6767. #define HTT_T2H_MSG_TYPE_GET(word) \
  6768. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6769. /**
  6770. * @brief target -> host version number confirmation message definition
  6771. *
  6772. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6773. *
  6774. * |31 24|23 16|15 8|7 0|
  6775. * |----------------+----------------+----------------+----------------|
  6776. * | reserved | major number | minor number | msg type |
  6777. * |-------------------------------------------------------------------|
  6778. * : option request TLV (optional) |
  6779. * :...................................................................:
  6780. *
  6781. * The VER_CONF message may consist of a single 4-byte word, or may be
  6782. * extended with TLVs that specify HTT options selected by the target.
  6783. * The following option TLVs may be appended to the VER_CONF message:
  6784. * - LL_BUS_ADDR_SIZE
  6785. * - HL_SUPPRESS_TX_COMPL_IND
  6786. * - MAX_TX_QUEUE_GROUPS
  6787. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6788. * may be appended to the VER_CONF message (but only one TLV of each type).
  6789. *
  6790. * Header fields:
  6791. * - MSG_TYPE
  6792. * Bits 7:0
  6793. * Purpose: identifies this as a version number confirmation message
  6794. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6795. * - VER_MINOR
  6796. * Bits 15:8
  6797. * Purpose: Specify the minor number of the HTT message library version
  6798. * in use by the target firmware.
  6799. * The minor number specifies the specific revision within a range
  6800. * of fundamentally compatible HTT message definition revisions.
  6801. * Compatible revisions involve adding new messages or perhaps
  6802. * adding new fields to existing messages, in a backwards-compatible
  6803. * manner.
  6804. * Incompatible revisions involve changing the message type values,
  6805. * or redefining existing messages.
  6806. * Value: minor number
  6807. * - VER_MAJOR
  6808. * Bits 15:8
  6809. * Purpose: Specify the major number of the HTT message library version
  6810. * in use by the target firmware.
  6811. * The major number specifies the family of minor revisions that are
  6812. * fundamentally compatible with each other, but not with prior or
  6813. * later families.
  6814. * Value: major number
  6815. */
  6816. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6817. #define HTT_VER_CONF_MINOR_S 8
  6818. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6819. #define HTT_VER_CONF_MAJOR_S 16
  6820. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6821. do { \
  6822. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6823. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6824. } while (0)
  6825. #define HTT_VER_CONF_MINOR_GET(word) \
  6826. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6827. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6828. do { \
  6829. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6830. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6831. } while (0)
  6832. #define HTT_VER_CONF_MAJOR_GET(word) \
  6833. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6834. #define HTT_VER_CONF_BYTES 4
  6835. /**
  6836. * @brief - target -> host HTT Rx In order indication message
  6837. *
  6838. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6839. *
  6840. * @details
  6841. *
  6842. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6843. * |----------------+-------------------+---------------------+---------------|
  6844. * | peer ID | P| F| O| ext TID | msg type |
  6845. * |--------------------------------------------------------------------------|
  6846. * | MSDU count | Reserved | vdev id |
  6847. * |--------------------------------------------------------------------------|
  6848. * | MSDU 0 bus address (bits 31:0) |
  6849. #if HTT_PADDR64
  6850. * | MSDU 0 bus address (bits 63:32) |
  6851. #endif
  6852. * |--------------------------------------------------------------------------|
  6853. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6854. * |--------------------------------------------------------------------------|
  6855. * | MSDU 1 bus address (bits 31:0) |
  6856. #if HTT_PADDR64
  6857. * | MSDU 1 bus address (bits 63:32) |
  6858. #endif
  6859. * |--------------------------------------------------------------------------|
  6860. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6861. * |--------------------------------------------------------------------------|
  6862. */
  6863. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6864. *
  6865. * @details
  6866. * bits
  6867. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6868. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6869. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6870. * | | frag | | | | fail |chksum fail|
  6871. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6872. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6873. */
  6874. struct htt_rx_in_ord_paddr_ind_hdr_t
  6875. {
  6876. A_UINT32 /* word 0 */
  6877. msg_type: 8,
  6878. ext_tid: 5,
  6879. offload: 1,
  6880. frag: 1,
  6881. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6882. peer_id: 16;
  6883. A_UINT32 /* word 1 */
  6884. vap_id: 8,
  6885. /* NOTE:
  6886. * This reserved_1 field is not truly reserved - certain targets use
  6887. * this field internally to store debug information, and do not zero
  6888. * out the contents of the field before uploading the message to the
  6889. * host. Thus, any host-target communication supported by this field
  6890. * is limited to using values that are never used by the debug
  6891. * information stored by certain targets in the reserved_1 field.
  6892. * In particular, the targets in question don't use the value 0x3
  6893. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6894. * so this previously-unused value within these bits is available to
  6895. * use as the host / target PKT_CAPTURE_MODE flag.
  6896. */
  6897. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6898. /* if pkt_capture_mode == 0x3, host should
  6899. * send rx frames to monitor mode interface
  6900. */
  6901. msdu_cnt: 16;
  6902. };
  6903. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6904. {
  6905. A_UINT32 dma_addr;
  6906. A_UINT32
  6907. length: 16,
  6908. fw_desc: 8,
  6909. msdu_info:8;
  6910. };
  6911. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6912. {
  6913. A_UINT32 dma_addr_lo;
  6914. A_UINT32 dma_addr_hi;
  6915. A_UINT32
  6916. length: 16,
  6917. fw_desc: 8,
  6918. msdu_info:8;
  6919. };
  6920. #if HTT_PADDR64
  6921. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6922. #else
  6923. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6924. #endif
  6925. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6926. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6927. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6928. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6929. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6930. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6931. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6932. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6933. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6934. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6935. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6936. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6937. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6938. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6939. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6940. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6941. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6942. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6943. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6944. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6945. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6946. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6947. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6948. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6949. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6950. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6951. /* for systems using 64-bit format for bus addresses */
  6952. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6953. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6954. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6955. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6956. /* for systems using 32-bit format for bus addresses */
  6957. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6958. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6959. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6960. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6961. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6962. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6963. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6964. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6965. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6966. do { \
  6967. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6968. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6969. } while (0)
  6970. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6971. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6972. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6973. do { \
  6974. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6975. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6976. } while (0)
  6977. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6978. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6979. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6980. do { \
  6981. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6982. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6983. } while (0)
  6984. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6985. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6986. /*
  6987. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6988. * deliver the rx frames to the monitor mode interface.
  6989. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6990. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6991. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6992. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6993. */
  6994. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6995. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6996. do { \
  6997. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6998. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6999. } while (0)
  7000. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7001. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7002. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7003. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7004. do { \
  7005. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7006. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7007. } while (0)
  7008. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7009. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7010. /* for systems using 64-bit format for bus addresses */
  7011. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7012. do { \
  7013. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7014. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7015. } while (0)
  7016. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7017. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7018. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7019. do { \
  7020. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7021. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7022. } while (0)
  7023. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7024. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7025. /* for systems using 32-bit format for bus addresses */
  7026. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7027. do { \
  7028. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7029. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7030. } while (0)
  7031. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7032. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7033. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7036. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7037. } while (0)
  7038. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7039. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7040. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7041. do { \
  7042. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7043. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7044. } while (0)
  7045. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7046. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7047. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7048. do { \
  7049. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7050. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7051. } while (0)
  7052. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7053. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7054. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7055. do { \
  7056. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7057. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7058. } while (0)
  7059. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7060. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7061. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7062. do { \
  7063. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7064. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7065. } while (0)
  7066. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7067. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7068. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7069. do { \
  7070. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7071. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7072. } while (0)
  7073. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7074. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7075. /* definitions used within target -> host rx indication message */
  7076. PREPACK struct htt_rx_ind_hdr_prefix_t
  7077. {
  7078. A_UINT32 /* word 0 */
  7079. msg_type: 8,
  7080. ext_tid: 5,
  7081. release_valid: 1,
  7082. flush_valid: 1,
  7083. reserved0: 1,
  7084. peer_id: 16;
  7085. A_UINT32 /* word 1 */
  7086. flush_start_seq_num: 6,
  7087. flush_end_seq_num: 6,
  7088. release_start_seq_num: 6,
  7089. release_end_seq_num: 6,
  7090. num_mpdu_ranges: 8;
  7091. } POSTPACK;
  7092. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7093. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7094. #define HTT_TGT_RSSI_INVALID 0x80
  7095. PREPACK struct htt_rx_ppdu_desc_t
  7096. {
  7097. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7098. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7099. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7100. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7101. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7102. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7103. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7104. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7105. A_UINT32 /* word 0 */
  7106. rssi_cmb: 8,
  7107. timestamp_submicrosec: 8,
  7108. phy_err_code: 8,
  7109. phy_err: 1,
  7110. legacy_rate: 4,
  7111. legacy_rate_sel: 1,
  7112. end_valid: 1,
  7113. start_valid: 1;
  7114. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7115. union {
  7116. A_UINT32 /* word 1 */
  7117. rssi0_pri20: 8,
  7118. rssi0_ext20: 8,
  7119. rssi0_ext40: 8,
  7120. rssi0_ext80: 8;
  7121. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7122. } u0;
  7123. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7124. union {
  7125. A_UINT32 /* word 2 */
  7126. rssi1_pri20: 8,
  7127. rssi1_ext20: 8,
  7128. rssi1_ext40: 8,
  7129. rssi1_ext80: 8;
  7130. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7131. } u1;
  7132. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7133. union {
  7134. A_UINT32 /* word 3 */
  7135. rssi2_pri20: 8,
  7136. rssi2_ext20: 8,
  7137. rssi2_ext40: 8,
  7138. rssi2_ext80: 8;
  7139. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7140. } u2;
  7141. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7142. union {
  7143. A_UINT32 /* word 4 */
  7144. rssi3_pri20: 8,
  7145. rssi3_ext20: 8,
  7146. rssi3_ext40: 8,
  7147. rssi3_ext80: 8;
  7148. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7149. } u3;
  7150. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7151. A_UINT32 tsf32; /* word 5 */
  7152. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7153. A_UINT32 timestamp_microsec; /* word 6 */
  7154. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7155. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7156. A_UINT32 /* word 7 */
  7157. vht_sig_a1: 24,
  7158. preamble_type: 8;
  7159. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7160. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7161. A_UINT32 /* word 8 */
  7162. vht_sig_a2: 24,
  7163. /* sa_ant_matrix
  7164. * For cases where a single rx chain has options to be connected to
  7165. * different rx antennas, show which rx antennas were in use during
  7166. * receipt of a given PPDU.
  7167. * This sa_ant_matrix provides a bitmask of the antennas used while
  7168. * receiving this frame.
  7169. */
  7170. sa_ant_matrix: 8;
  7171. } POSTPACK;
  7172. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7173. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7174. PREPACK struct htt_rx_ind_hdr_suffix_t
  7175. {
  7176. A_UINT32 /* word 0 */
  7177. fw_rx_desc_bytes: 16,
  7178. reserved0: 16;
  7179. } POSTPACK;
  7180. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7181. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7182. PREPACK struct htt_rx_ind_hdr_t
  7183. {
  7184. struct htt_rx_ind_hdr_prefix_t prefix;
  7185. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7186. struct htt_rx_ind_hdr_suffix_t suffix;
  7187. } POSTPACK;
  7188. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7189. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7190. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7191. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7192. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7193. /*
  7194. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7195. * the offset into the HTT rx indication message at which the
  7196. * FW rx PPDU descriptor resides
  7197. */
  7198. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7199. /*
  7200. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7201. * the offset into the HTT rx indication message at which the
  7202. * header suffix (FW rx MSDU byte count) resides
  7203. */
  7204. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7205. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7206. /*
  7207. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7208. * the offset into the HTT rx indication message at which the per-MSDU
  7209. * information starts
  7210. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7211. * per-MSDU information portion of the message. The per-MSDU info itself
  7212. * starts at byte 12.
  7213. */
  7214. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7215. /**
  7216. * @brief target -> host rx indication message definition
  7217. *
  7218. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7219. *
  7220. * @details
  7221. * The following field definitions describe the format of the rx indication
  7222. * message sent from the target to the host.
  7223. * The message consists of three major sections:
  7224. * 1. a fixed-length header
  7225. * 2. a variable-length list of firmware rx MSDU descriptors
  7226. * 3. one or more 4-octet MPDU range information elements
  7227. * The fixed length header itself has two sub-sections
  7228. * 1. the message meta-information, including identification of the
  7229. * sender and type of the received data, and a 4-octet flush/release IE
  7230. * 2. the firmware rx PPDU descriptor
  7231. *
  7232. * The format of the message is depicted below.
  7233. * in this depiction, the following abbreviations are used for information
  7234. * elements within the message:
  7235. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7236. * elements associated with the PPDU start are valid.
  7237. * Specifically, the following fields are valid only if SV is set:
  7238. * RSSI (all variants), L, legacy rate, preamble type, service,
  7239. * VHT-SIG-A
  7240. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7241. * elements associated with the PPDU end are valid.
  7242. * Specifically, the following fields are valid only if EV is set:
  7243. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7244. * - L - Legacy rate selector - if legacy rates are used, this flag
  7245. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7246. * (L == 0) PHY.
  7247. * - P - PHY error flag - boolean indication of whether the rx frame had
  7248. * a PHY error
  7249. *
  7250. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7251. * |----------------+-------------------+---------------------+---------------|
  7252. * | peer ID | |RV|FV| ext TID | msg type |
  7253. * |--------------------------------------------------------------------------|
  7254. * | num | release | release | flush | flush |
  7255. * | MPDU | end | start | end | start |
  7256. * | ranges | seq num | seq num | seq num | seq num |
  7257. * |==========================================================================|
  7258. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7259. * |V|V| | rate | | | timestamp | RSSI |
  7260. * |--------------------------------------------------------------------------|
  7261. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7262. * |--------------------------------------------------------------------------|
  7263. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7264. * |--------------------------------------------------------------------------|
  7265. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7266. * |--------------------------------------------------------------------------|
  7267. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7268. * |--------------------------------------------------------------------------|
  7269. * | TSF LSBs |
  7270. * |--------------------------------------------------------------------------|
  7271. * | microsec timestamp |
  7272. * |--------------------------------------------------------------------------|
  7273. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7274. * |--------------------------------------------------------------------------|
  7275. * | service | HT-SIG / VHT-SIG-A2 |
  7276. * |==========================================================================|
  7277. * | reserved | FW rx desc bytes |
  7278. * |--------------------------------------------------------------------------|
  7279. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7280. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7281. * |--------------------------------------------------------------------------|
  7282. * : : :
  7283. * |--------------------------------------------------------------------------|
  7284. * | alignment | MSDU Rx |
  7285. * | padding | desc Bn |
  7286. * |--------------------------------------------------------------------------|
  7287. * | reserved | MPDU range status | MPDU count |
  7288. * |--------------------------------------------------------------------------|
  7289. * : reserved : MPDU range status : MPDU count :
  7290. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7291. *
  7292. * Header fields:
  7293. * - MSG_TYPE
  7294. * Bits 7:0
  7295. * Purpose: identifies this as an rx indication message
  7296. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7297. * - EXT_TID
  7298. * Bits 12:8
  7299. * Purpose: identify the traffic ID of the rx data, including
  7300. * special "extended" TID values for multicast, broadcast, and
  7301. * non-QoS data frames
  7302. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7303. * - FLUSH_VALID (FV)
  7304. * Bit 13
  7305. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7306. * is valid
  7307. * Value:
  7308. * 1 -> flush IE is valid and needs to be processed
  7309. * 0 -> flush IE is not valid and should be ignored
  7310. * - REL_VALID (RV)
  7311. * Bit 13
  7312. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7313. * is valid
  7314. * Value:
  7315. * 1 -> release IE is valid and needs to be processed
  7316. * 0 -> release IE is not valid and should be ignored
  7317. * - PEER_ID
  7318. * Bits 31:16
  7319. * Purpose: Identify, by ID, which peer sent the rx data
  7320. * Value: ID of the peer who sent the rx data
  7321. * - FLUSH_SEQ_NUM_START
  7322. * Bits 5:0
  7323. * Purpose: Indicate the start of a series of MPDUs to flush
  7324. * Not all MPDUs within this series are necessarily valid - the host
  7325. * must check each sequence number within this range to see if the
  7326. * corresponding MPDU is actually present.
  7327. * This field is only valid if the FV bit is set.
  7328. * Value:
  7329. * The sequence number for the first MPDUs to check to flush.
  7330. * The sequence number is masked by 0x3f.
  7331. * - FLUSH_SEQ_NUM_END
  7332. * Bits 11:6
  7333. * Purpose: Indicate the end of a series of MPDUs to flush
  7334. * Value:
  7335. * The sequence number one larger than the sequence number of the
  7336. * last MPDU to check to flush.
  7337. * The sequence number is masked by 0x3f.
  7338. * Not all MPDUs within this series are necessarily valid - the host
  7339. * must check each sequence number within this range to see if the
  7340. * corresponding MPDU is actually present.
  7341. * This field is only valid if the FV bit is set.
  7342. * - REL_SEQ_NUM_START
  7343. * Bits 17:12
  7344. * Purpose: Indicate the start of a series of MPDUs to release.
  7345. * All MPDUs within this series are present and valid - the host
  7346. * need not check each sequence number within this range to see if
  7347. * the corresponding MPDU is actually present.
  7348. * This field is only valid if the RV bit is set.
  7349. * Value:
  7350. * The sequence number for the first MPDUs to check to release.
  7351. * The sequence number is masked by 0x3f.
  7352. * - REL_SEQ_NUM_END
  7353. * Bits 23:18
  7354. * Purpose: Indicate the end of a series of MPDUs to release.
  7355. * Value:
  7356. * The sequence number one larger than the sequence number of the
  7357. * last MPDU to check to release.
  7358. * The sequence number is masked by 0x3f.
  7359. * All MPDUs within this series are present and valid - the host
  7360. * need not check each sequence number within this range to see if
  7361. * the corresponding MPDU is actually present.
  7362. * This field is only valid if the RV bit is set.
  7363. * - NUM_MPDU_RANGES
  7364. * Bits 31:24
  7365. * Purpose: Indicate how many ranges of MPDUs are present.
  7366. * Each MPDU range consists of a series of contiguous MPDUs within the
  7367. * rx frame sequence which all have the same MPDU status.
  7368. * Value: 1-63 (typically a small number, like 1-3)
  7369. *
  7370. * Rx PPDU descriptor fields:
  7371. * - RSSI_CMB
  7372. * Bits 7:0
  7373. * Purpose: Combined RSSI from all active rx chains, across the active
  7374. * bandwidth.
  7375. * Value: RSSI dB units w.r.t. noise floor
  7376. * - TIMESTAMP_SUBMICROSEC
  7377. * Bits 15:8
  7378. * Purpose: high-resolution timestamp
  7379. * Value:
  7380. * Sub-microsecond time of PPDU reception.
  7381. * This timestamp ranges from [0,MAC clock MHz).
  7382. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  7383. * to form a high-resolution, large range rx timestamp.
  7384. * - PHY_ERR_CODE
  7385. * Bits 23:16
  7386. * Purpose:
  7387. * If the rx frame processing resulted in a PHY error, indicate what
  7388. * type of rx PHY error occurred.
  7389. * Value:
  7390. * This field is valid if the "P" (PHY_ERR) flag is set.
  7391. * TBD: document/specify the values for this field
  7392. * - PHY_ERR
  7393. * Bit 24
  7394. * Purpose: indicate whether the rx PPDU had a PHY error
  7395. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7396. * - LEGACY_RATE
  7397. * Bits 28:25
  7398. * Purpose:
  7399. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7400. * specify which rate was used.
  7401. * Value:
  7402. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7403. * flag.
  7404. * If LEGACY_RATE_SEL is 0:
  7405. * 0x8: OFDM 48 Mbps
  7406. * 0x9: OFDM 24 Mbps
  7407. * 0xA: OFDM 12 Mbps
  7408. * 0xB: OFDM 6 Mbps
  7409. * 0xC: OFDM 54 Mbps
  7410. * 0xD: OFDM 36 Mbps
  7411. * 0xE: OFDM 18 Mbps
  7412. * 0xF: OFDM 9 Mbps
  7413. * If LEGACY_RATE_SEL is 1:
  7414. * 0x8: CCK 11 Mbps long preamble
  7415. * 0x9: CCK 5.5 Mbps long preamble
  7416. * 0xA: CCK 2 Mbps long preamble
  7417. * 0xB: CCK 1 Mbps long preamble
  7418. * 0xC: CCK 11 Mbps short preamble
  7419. * 0xD: CCK 5.5 Mbps short preamble
  7420. * 0xE: CCK 2 Mbps short preamble
  7421. * - LEGACY_RATE_SEL
  7422. * Bit 29
  7423. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7424. * Value:
  7425. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7426. * used a legacy rate.
  7427. * 0 -> OFDM, 1 -> CCK
  7428. * - END_VALID
  7429. * Bit 30
  7430. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7431. * the start of the PPDU are valid. Specifically, the following
  7432. * fields are only valid if END_VALID is set:
  7433. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7434. * TIMESTAMP_SUBMICROSEC
  7435. * Value:
  7436. * 0 -> rx PPDU desc end fields are not valid
  7437. * 1 -> rx PPDU desc end fields are valid
  7438. * - START_VALID
  7439. * Bit 31
  7440. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7441. * the end of the PPDU are valid. Specifically, the following
  7442. * fields are only valid if START_VALID is set:
  7443. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7444. * VHT-SIG-A
  7445. * Value:
  7446. * 0 -> rx PPDU desc start fields are not valid
  7447. * 1 -> rx PPDU desc start fields are valid
  7448. * - RSSI0_PRI20
  7449. * Bits 7:0
  7450. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7451. * Value: RSSI dB units w.r.t. noise floor
  7452. *
  7453. * - RSSI0_EXT20
  7454. * Bits 7:0
  7455. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7456. * (if the rx bandwidth was >= 40 MHz)
  7457. * Value: RSSI dB units w.r.t. noise floor
  7458. * - RSSI0_EXT40
  7459. * Bits 7:0
  7460. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7461. * (if the rx bandwidth was >= 80 MHz)
  7462. * Value: RSSI dB units w.r.t. noise floor
  7463. * - RSSI0_EXT80
  7464. * Bits 7:0
  7465. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7466. * (if the rx bandwidth was >= 160 MHz)
  7467. * Value: RSSI dB units w.r.t. noise floor
  7468. *
  7469. * - RSSI1_PRI20
  7470. * Bits 7:0
  7471. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7472. * Value: RSSI dB units w.r.t. noise floor
  7473. * - RSSI1_EXT20
  7474. * Bits 7:0
  7475. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7476. * (if the rx bandwidth was >= 40 MHz)
  7477. * Value: RSSI dB units w.r.t. noise floor
  7478. * - RSSI1_EXT40
  7479. * Bits 7:0
  7480. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7481. * (if the rx bandwidth was >= 80 MHz)
  7482. * Value: RSSI dB units w.r.t. noise floor
  7483. * - RSSI1_EXT80
  7484. * Bits 7:0
  7485. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7486. * (if the rx bandwidth was >= 160 MHz)
  7487. * Value: RSSI dB units w.r.t. noise floor
  7488. *
  7489. * - RSSI2_PRI20
  7490. * Bits 7:0
  7491. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7492. * Value: RSSI dB units w.r.t. noise floor
  7493. * - RSSI2_EXT20
  7494. * Bits 7:0
  7495. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7496. * (if the rx bandwidth was >= 40 MHz)
  7497. * Value: RSSI dB units w.r.t. noise floor
  7498. * - RSSI2_EXT40
  7499. * Bits 7:0
  7500. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7501. * (if the rx bandwidth was >= 80 MHz)
  7502. * Value: RSSI dB units w.r.t. noise floor
  7503. * - RSSI2_EXT80
  7504. * Bits 7:0
  7505. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7506. * (if the rx bandwidth was >= 160 MHz)
  7507. * Value: RSSI dB units w.r.t. noise floor
  7508. *
  7509. * - RSSI3_PRI20
  7510. * Bits 7:0
  7511. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7512. * Value: RSSI dB units w.r.t. noise floor
  7513. * - RSSI3_EXT20
  7514. * Bits 7:0
  7515. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7516. * (if the rx bandwidth was >= 40 MHz)
  7517. * Value: RSSI dB units w.r.t. noise floor
  7518. * - RSSI3_EXT40
  7519. * Bits 7:0
  7520. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7521. * (if the rx bandwidth was >= 80 MHz)
  7522. * Value: RSSI dB units w.r.t. noise floor
  7523. * - RSSI3_EXT80
  7524. * Bits 7:0
  7525. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7526. * (if the rx bandwidth was >= 160 MHz)
  7527. * Value: RSSI dB units w.r.t. noise floor
  7528. *
  7529. * - TSF32
  7530. * Bits 31:0
  7531. * Purpose: specify the time the rx PPDU was received, in TSF units
  7532. * Value: 32 LSBs of the TSF
  7533. * - TIMESTAMP_MICROSEC
  7534. * Bits 31:0
  7535. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7536. * Value: PPDU rx time, in microseconds
  7537. * - VHT_SIG_A1
  7538. * Bits 23:0
  7539. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7540. * from the rx PPDU
  7541. * Value:
  7542. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7543. * VHT-SIG-A1 data.
  7544. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7545. * first 24 bits of the HT-SIG data.
  7546. * Otherwise, this field is invalid.
  7547. * Refer to the the 802.11 protocol for the definition of the
  7548. * HT-SIG and VHT-SIG-A1 fields
  7549. * - VHT_SIG_A2
  7550. * Bits 23:0
  7551. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7552. * from the rx PPDU
  7553. * Value:
  7554. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7555. * VHT-SIG-A2 data.
  7556. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7557. * last 24 bits of the HT-SIG data.
  7558. * Otherwise, this field is invalid.
  7559. * Refer to the the 802.11 protocol for the definition of the
  7560. * HT-SIG and VHT-SIG-A2 fields
  7561. * - PREAMBLE_TYPE
  7562. * Bits 31:24
  7563. * Purpose: indicate the PHY format of the received burst
  7564. * Value:
  7565. * 0x4: Legacy (OFDM/CCK)
  7566. * 0x8: HT
  7567. * 0x9: HT with TxBF
  7568. * 0xC: VHT
  7569. * 0xD: VHT with TxBF
  7570. * - SERVICE
  7571. * Bits 31:24
  7572. * Purpose: TBD
  7573. * Value: TBD
  7574. *
  7575. * Rx MSDU descriptor fields:
  7576. * - FW_RX_DESC_BYTES
  7577. * Bits 15:0
  7578. * Purpose: Indicate how many bytes in the Rx indication are used for
  7579. * FW Rx descriptors
  7580. *
  7581. * Payload fields:
  7582. * - MPDU_COUNT
  7583. * Bits 7:0
  7584. * Purpose: Indicate how many sequential MPDUs share the same status.
  7585. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7586. * - MPDU_STATUS
  7587. * Bits 15:8
  7588. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7589. * received successfully.
  7590. * Value:
  7591. * 0x1: success
  7592. * 0x2: FCS error
  7593. * 0x3: duplicate error
  7594. * 0x4: replay error
  7595. * 0x5: invalid peer
  7596. */
  7597. /* header fields */
  7598. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7599. #define HTT_RX_IND_EXT_TID_S 8
  7600. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7601. #define HTT_RX_IND_FLUSH_VALID_S 13
  7602. #define HTT_RX_IND_REL_VALID_M 0x4000
  7603. #define HTT_RX_IND_REL_VALID_S 14
  7604. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7605. #define HTT_RX_IND_PEER_ID_S 16
  7606. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7607. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7608. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7609. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7610. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7611. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7612. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7613. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7614. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7615. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7616. /* rx PPDU descriptor fields */
  7617. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7618. #define HTT_RX_IND_RSSI_CMB_S 0
  7619. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7620. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7621. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7622. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7623. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7624. #define HTT_RX_IND_PHY_ERR_S 24
  7625. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7626. #define HTT_RX_IND_LEGACY_RATE_S 25
  7627. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7628. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7629. #define HTT_RX_IND_END_VALID_M 0x40000000
  7630. #define HTT_RX_IND_END_VALID_S 30
  7631. #define HTT_RX_IND_START_VALID_M 0x80000000
  7632. #define HTT_RX_IND_START_VALID_S 31
  7633. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7634. #define HTT_RX_IND_RSSI_PRI20_S 0
  7635. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7636. #define HTT_RX_IND_RSSI_EXT20_S 8
  7637. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7638. #define HTT_RX_IND_RSSI_EXT40_S 16
  7639. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7640. #define HTT_RX_IND_RSSI_EXT80_S 24
  7641. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7642. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7643. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7644. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7645. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7646. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7647. #define HTT_RX_IND_SERVICE_M 0xff000000
  7648. #define HTT_RX_IND_SERVICE_S 24
  7649. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7650. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7651. /* rx MSDU descriptor fields */
  7652. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7653. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7654. /* payload fields */
  7655. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7656. #define HTT_RX_IND_MPDU_COUNT_S 0
  7657. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7658. #define HTT_RX_IND_MPDU_STATUS_S 8
  7659. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7660. do { \
  7661. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7662. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7663. } while (0)
  7664. #define HTT_RX_IND_EXT_TID_GET(word) \
  7665. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7666. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7667. do { \
  7668. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7669. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7670. } while (0)
  7671. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7672. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7673. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7674. do { \
  7675. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7676. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7677. } while (0)
  7678. #define HTT_RX_IND_REL_VALID_GET(word) \
  7679. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7680. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7681. do { \
  7682. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7683. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7684. } while (0)
  7685. #define HTT_RX_IND_PEER_ID_GET(word) \
  7686. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7687. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7690. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7691. } while (0)
  7692. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7693. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7694. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7695. do { \
  7696. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7697. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7698. } while (0)
  7699. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7700. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7701. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7702. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7705. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7706. } while (0)
  7707. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7708. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7709. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7710. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7713. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7714. } while (0)
  7715. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7716. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7717. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7718. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7719. do { \
  7720. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7721. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7722. } while (0)
  7723. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7724. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7725. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7726. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7727. do { \
  7728. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7729. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7730. } while (0)
  7731. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7732. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7733. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7734. /* FW rx PPDU descriptor fields */
  7735. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7736. do { \
  7737. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7738. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7739. } while (0)
  7740. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7741. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7742. HTT_RX_IND_RSSI_CMB_S)
  7743. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7746. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7747. } while (0)
  7748. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7749. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7750. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7751. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7754. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7755. } while (0)
  7756. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7757. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7758. HTT_RX_IND_PHY_ERR_CODE_S)
  7759. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7760. do { \
  7761. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7762. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7763. } while (0)
  7764. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7765. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7766. HTT_RX_IND_PHY_ERR_S)
  7767. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7770. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7771. } while (0)
  7772. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7773. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7774. HTT_RX_IND_LEGACY_RATE_S)
  7775. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7778. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7779. } while (0)
  7780. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7781. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7782. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7783. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7784. do { \
  7785. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7786. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7787. } while (0)
  7788. #define HTT_RX_IND_END_VALID_GET(word) \
  7789. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7790. HTT_RX_IND_END_VALID_S)
  7791. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7792. do { \
  7793. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7794. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7795. } while (0)
  7796. #define HTT_RX_IND_START_VALID_GET(word) \
  7797. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7798. HTT_RX_IND_START_VALID_S)
  7799. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7800. do { \
  7801. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7802. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7803. } while (0)
  7804. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7805. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7806. HTT_RX_IND_RSSI_PRI20_S)
  7807. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7808. do { \
  7809. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7810. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7811. } while (0)
  7812. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7813. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7814. HTT_RX_IND_RSSI_EXT20_S)
  7815. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7816. do { \
  7817. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7818. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7819. } while (0)
  7820. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7821. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7822. HTT_RX_IND_RSSI_EXT40_S)
  7823. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7824. do { \
  7825. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7826. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7827. } while (0)
  7828. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7829. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7830. HTT_RX_IND_RSSI_EXT80_S)
  7831. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7832. do { \
  7833. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7834. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7835. } while (0)
  7836. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7837. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7838. HTT_RX_IND_VHT_SIG_A1_S)
  7839. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7840. do { \
  7841. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7842. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7843. } while (0)
  7844. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7845. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7846. HTT_RX_IND_VHT_SIG_A2_S)
  7847. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7848. do { \
  7849. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7850. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7851. } while (0)
  7852. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7853. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7854. HTT_RX_IND_PREAMBLE_TYPE_S)
  7855. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7856. do { \
  7857. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7858. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7859. } while (0)
  7860. #define HTT_RX_IND_SERVICE_GET(word) \
  7861. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7862. HTT_RX_IND_SERVICE_S)
  7863. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7864. do { \
  7865. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7866. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7867. } while (0)
  7868. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7869. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7870. HTT_RX_IND_SA_ANT_MATRIX_S)
  7871. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7872. do { \
  7873. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7874. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7875. } while (0)
  7876. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7877. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7878. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7879. do { \
  7880. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7881. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7882. } while (0)
  7883. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7884. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7885. #define HTT_RX_IND_HL_BYTES \
  7886. (HTT_RX_IND_HDR_BYTES + \
  7887. 4 /* single FW rx MSDU descriptor */ + \
  7888. 4 /* single MPDU range information element */)
  7889. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7890. /* Could we use one macro entry? */
  7891. #define HTT_WORD_SET(word, field, value) \
  7892. do { \
  7893. HTT_CHECK_SET_VAL(field, value); \
  7894. (word) |= ((value) << field ## _S); \
  7895. } while (0)
  7896. #define HTT_WORD_GET(word, field) \
  7897. (((word) & field ## _M) >> field ## _S)
  7898. PREPACK struct hl_htt_rx_ind_base {
  7899. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7900. } POSTPACK;
  7901. /*
  7902. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7903. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7904. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7905. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7906. * htt_rx_ind_hl_rx_desc_t.
  7907. */
  7908. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7909. struct htt_rx_ind_hl_rx_desc_t {
  7910. A_UINT8 ver;
  7911. A_UINT8 len;
  7912. struct {
  7913. A_UINT8
  7914. first_msdu: 1,
  7915. last_msdu: 1,
  7916. c3_failed: 1,
  7917. c4_failed: 1,
  7918. ipv6: 1,
  7919. tcp: 1,
  7920. udp: 1,
  7921. reserved: 1;
  7922. } flags;
  7923. /* NOTE: no reserved space - don't append any new fields here */
  7924. };
  7925. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7926. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7927. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7928. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7929. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7930. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7931. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7932. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7933. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7934. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7935. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7936. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7937. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7938. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7939. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7940. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7941. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7942. /* This structure is used in HL, the basic descriptor information
  7943. * used by host. the structure is translated by FW from HW desc
  7944. * or generated by FW. But in HL monitor mode, the host would use
  7945. * the same structure with LL.
  7946. */
  7947. PREPACK struct hl_htt_rx_desc_base {
  7948. A_UINT32
  7949. seq_num:12,
  7950. encrypted:1,
  7951. chan_info_present:1,
  7952. resv0:2,
  7953. mcast_bcast:1,
  7954. fragment:1,
  7955. key_id_oct:8,
  7956. resv1:6;
  7957. A_UINT32
  7958. pn_31_0;
  7959. union {
  7960. struct {
  7961. A_UINT16 pn_47_32;
  7962. A_UINT16 pn_63_48;
  7963. } pn16;
  7964. A_UINT32 pn_63_32;
  7965. } u0;
  7966. A_UINT32
  7967. pn_95_64;
  7968. A_UINT32
  7969. pn_127_96;
  7970. } POSTPACK;
  7971. /*
  7972. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7973. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7974. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7975. * Please see htt_chan_change_t for description of the fields.
  7976. */
  7977. PREPACK struct htt_chan_info_t
  7978. {
  7979. A_UINT32 primary_chan_center_freq_mhz: 16,
  7980. contig_chan1_center_freq_mhz: 16;
  7981. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7982. phy_mode: 8,
  7983. reserved: 8;
  7984. } POSTPACK;
  7985. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7986. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7987. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7988. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7989. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7990. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7991. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7992. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7993. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7994. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7995. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7996. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7997. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7998. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7999. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8000. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8001. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8002. /* Channel information */
  8003. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8004. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8005. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8006. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8007. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8008. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8009. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8010. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8011. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8012. do { \
  8013. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8014. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8015. } while (0)
  8016. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8017. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8018. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8019. do { \
  8020. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8021. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8022. } while (0)
  8023. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8024. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8025. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8026. do { \
  8027. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8028. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8029. } while (0)
  8030. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8031. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8032. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8033. do { \
  8034. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8035. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8036. } while (0)
  8037. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8038. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8039. /*
  8040. * @brief target -> host message definition for FW offloaded pkts
  8041. *
  8042. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8043. *
  8044. * @details
  8045. * The following field definitions describe the format of the firmware
  8046. * offload deliver message sent from the target to the host.
  8047. *
  8048. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8049. *
  8050. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8051. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8052. * | reserved_1 | msg type |
  8053. * |--------------------------------------------------------------------------|
  8054. * | phy_timestamp_l32 |
  8055. * |--------------------------------------------------------------------------|
  8056. * | WORD2 (see below) |
  8057. * |--------------------------------------------------------------------------|
  8058. * | seqno | framectrl |
  8059. * |--------------------------------------------------------------------------|
  8060. * | reserved_3 | vdev_id | tid_num|
  8061. * |--------------------------------------------------------------------------|
  8062. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8063. * |--------------------------------------------------------------------------|
  8064. *
  8065. * where:
  8066. * STAT = status
  8067. * F = format (802.3 vs. 802.11)
  8068. *
  8069. * definition for word 2
  8070. *
  8071. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8072. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8073. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8074. * |--------------------------------------------------------------------------|
  8075. *
  8076. * where:
  8077. * PR = preamble
  8078. * BF = beamformed
  8079. */
  8080. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8081. {
  8082. A_UINT32 /* word 0 */
  8083. msg_type:8, /* [ 7: 0] */
  8084. reserved_1:24; /* [31: 8] */
  8085. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8086. A_UINT32 /* word 2 */
  8087. /* preamble:
  8088. * 0-OFDM,
  8089. * 1-CCk,
  8090. * 2-HT,
  8091. * 3-VHT
  8092. */
  8093. preamble: 2, /* [1:0] */
  8094. /* mcs:
  8095. * In case of HT preamble interpret
  8096. * MCS along with NSS.
  8097. * Valid values for HT are 0 to 7.
  8098. * HT mcs 0 with NSS 2 is mcs 8.
  8099. * Valid values for VHT are 0 to 9.
  8100. */
  8101. mcs: 4, /* [5:2] */
  8102. /* rate:
  8103. * This is applicable only for
  8104. * CCK and OFDM preamble type
  8105. * rate 0: OFDM 48 Mbps,
  8106. * 1: OFDM 24 Mbps,
  8107. * 2: OFDM 12 Mbps
  8108. * 3: OFDM 6 Mbps
  8109. * 4: OFDM 54 Mbps
  8110. * 5: OFDM 36 Mbps
  8111. * 6: OFDM 18 Mbps
  8112. * 7: OFDM 9 Mbps
  8113. * rate 0: CCK 11 Mbps Long
  8114. * 1: CCK 5.5 Mbps Long
  8115. * 2: CCK 2 Mbps Long
  8116. * 3: CCK 1 Mbps Long
  8117. * 4: CCK 11 Mbps Short
  8118. * 5: CCK 5.5 Mbps Short
  8119. * 6: CCK 2 Mbps Short
  8120. */
  8121. rate : 3, /* [ 8: 6] */
  8122. rssi : 8, /* [16: 9] units=dBm */
  8123. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8124. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8125. stbc : 1, /* [22] */
  8126. sgi : 1, /* [23] */
  8127. ldpc : 1, /* [24] */
  8128. beamformed: 1, /* [25] */
  8129. reserved_2: 6; /* [31:26] */
  8130. A_UINT32 /* word 3 */
  8131. framectrl:16, /* [15: 0] */
  8132. seqno:16; /* [31:16] */
  8133. A_UINT32 /* word 4 */
  8134. tid_num:5, /* [ 4: 0] actual TID number */
  8135. vdev_id:8, /* [12: 5] */
  8136. reserved_3:19; /* [31:13] */
  8137. A_UINT32 /* word 5 */
  8138. /* status:
  8139. * 0: tx_ok
  8140. * 1: retry
  8141. * 2: drop
  8142. * 3: filtered
  8143. * 4: abort
  8144. * 5: tid delete
  8145. * 6: sw abort
  8146. * 7: dropped by peer migration
  8147. */
  8148. status:3, /* [2:0] */
  8149. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8150. tx_mpdu_bytes:16, /* [19:4] */
  8151. /* Indicates retry count of offloaded/local generated Data tx frames */
  8152. tx_retry_cnt:6, /* [25:20] */
  8153. reserved_4:6; /* [31:26] */
  8154. } POSTPACK;
  8155. /* FW offload deliver ind message header fields */
  8156. /* DWORD one */
  8157. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8158. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8159. /* DWORD two */
  8160. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8161. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8162. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8163. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8164. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8165. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8166. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8167. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8168. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8169. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8170. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8171. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8172. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8173. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8174. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8175. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8176. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8177. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8178. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8179. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8180. /* DWORD three*/
  8181. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8182. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8183. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8184. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8185. /* DWORD four */
  8186. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8187. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8188. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8189. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8190. /* DWORD five */
  8191. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8192. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8193. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8194. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8195. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8196. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8197. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8198. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8199. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8200. do { \
  8201. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8202. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8203. } while (0)
  8204. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8205. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8206. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8207. do { \
  8208. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8209. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8210. } while (0)
  8211. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8212. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8213. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8214. do { \
  8215. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8216. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8217. } while (0)
  8218. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8219. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8220. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8223. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8224. } while (0)
  8225. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8226. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8227. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8230. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8231. } while (0)
  8232. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8233. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8234. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8237. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8238. } while (0)
  8239. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8240. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8241. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8244. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8245. } while (0)
  8246. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8247. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8248. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8251. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8252. } while (0)
  8253. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8254. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8255. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8258. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8259. } while (0)
  8260. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8261. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8262. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8265. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8266. } while (0)
  8267. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8268. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8269. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8272. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8273. } while (0)
  8274. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8275. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8276. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8279. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8280. } while (0)
  8281. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8282. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8283. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8286. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8287. } while (0)
  8288. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8289. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8290. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8293. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8294. } while (0)
  8295. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8296. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8297. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8298. do { \
  8299. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8300. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8301. } while (0)
  8302. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8303. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8304. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8305. do { \
  8306. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8307. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8308. } while (0)
  8309. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8310. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8311. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8314. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8315. } while (0)
  8316. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8317. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8318. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8319. do { \
  8320. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8321. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8322. } while (0)
  8323. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8324. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8325. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8326. do { \
  8327. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8328. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8329. } while (0)
  8330. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  8331. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  8332. /*
  8333. * @brief target -> host rx reorder flush message definition
  8334. *
  8335. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  8336. *
  8337. * @details
  8338. * The following field definitions describe the format of the rx flush
  8339. * message sent from the target to the host.
  8340. * The message consists of a 4-octet header, followed by one or more
  8341. * 4-octet payload information elements.
  8342. *
  8343. * |31 24|23 8|7 0|
  8344. * |--------------------------------------------------------------|
  8345. * | TID | peer ID | msg type |
  8346. * |--------------------------------------------------------------|
  8347. * | seq num end | seq num start | MPDU status | reserved |
  8348. * |--------------------------------------------------------------|
  8349. * First DWORD:
  8350. * - MSG_TYPE
  8351. * Bits 7:0
  8352. * Purpose: identifies this as an rx flush message
  8353. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  8354. * - PEER_ID
  8355. * Bits 23:8 (only bits 18:8 actually used)
  8356. * Purpose: identify which peer's rx data is being flushed
  8357. * Value: (rx) peer ID
  8358. * - TID
  8359. * Bits 31:24 (only bits 27:24 actually used)
  8360. * Purpose: Specifies which traffic identifier's rx data is being flushed
  8361. * Value: traffic identifier
  8362. * Second DWORD:
  8363. * - MPDU_STATUS
  8364. * Bits 15:8
  8365. * Purpose:
  8366. * Indicate whether the flushed MPDUs should be discarded or processed.
  8367. * Value:
  8368. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  8369. * stages of rx processing
  8370. * other: discard the MPDUs
  8371. * It is anticipated that flush messages will always have
  8372. * MPDU status == 1, but the status flag is included for
  8373. * flexibility.
  8374. * - SEQ_NUM_START
  8375. * Bits 23:16
  8376. * Purpose:
  8377. * Indicate the start of a series of consecutive MPDUs being flushed.
  8378. * Not all MPDUs within this range are necessarily valid - the host
  8379. * must check each sequence number within this range to see if the
  8380. * corresponding MPDU is actually present.
  8381. * Value:
  8382. * The sequence number for the first MPDU in the sequence.
  8383. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8384. * - SEQ_NUM_END
  8385. * Bits 30:24
  8386. * Purpose:
  8387. * Indicate the end of a series of consecutive MPDUs being flushed.
  8388. * Value:
  8389. * The sequence number one larger than the sequence number of the
  8390. * last MPDU being flushed.
  8391. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8392. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8393. * are to be released for further rx processing.
  8394. * Not all MPDUs within this range are necessarily valid - the host
  8395. * must check each sequence number within this range to see if the
  8396. * corresponding MPDU is actually present.
  8397. */
  8398. /* first DWORD */
  8399. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8400. #define HTT_RX_FLUSH_PEER_ID_S 8
  8401. #define HTT_RX_FLUSH_TID_M 0xff000000
  8402. #define HTT_RX_FLUSH_TID_S 24
  8403. /* second DWORD */
  8404. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8405. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8406. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8407. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8408. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8409. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8410. #define HTT_RX_FLUSH_BYTES 8
  8411. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8412. do { \
  8413. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8414. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8415. } while (0)
  8416. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8417. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8418. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8419. do { \
  8420. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8421. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8422. } while (0)
  8423. #define HTT_RX_FLUSH_TID_GET(word) \
  8424. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8425. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8426. do { \
  8427. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8428. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8429. } while (0)
  8430. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8431. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8432. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8433. do { \
  8434. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8435. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8436. } while (0)
  8437. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8438. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8439. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8442. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8443. } while (0)
  8444. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8445. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8446. /*
  8447. * @brief target -> host rx pn check indication message
  8448. *
  8449. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8450. *
  8451. * @details
  8452. * The following field definitions describe the format of the Rx PN check
  8453. * indication message sent from the target to the host.
  8454. * The message consists of a 4-octet header, followed by the start and
  8455. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8456. * IE is one octet containing the sequence number that failed the PN
  8457. * check.
  8458. *
  8459. * |31 24|23 8|7 0|
  8460. * |--------------------------------------------------------------|
  8461. * | TID | peer ID | msg type |
  8462. * |--------------------------------------------------------------|
  8463. * | Reserved | PN IE count | seq num end | seq num start|
  8464. * |--------------------------------------------------------------|
  8465. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8466. * |--------------------------------------------------------------|
  8467. * First DWORD:
  8468. * - MSG_TYPE
  8469. * Bits 7:0
  8470. * Purpose: Identifies this as an rx pn check indication message
  8471. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8472. * - PEER_ID
  8473. * Bits 23:8 (only bits 18:8 actually used)
  8474. * Purpose: identify which peer
  8475. * Value: (rx) peer ID
  8476. * - TID
  8477. * Bits 31:24 (only bits 27:24 actually used)
  8478. * Purpose: identify traffic identifier
  8479. * Value: traffic identifier
  8480. * Second DWORD:
  8481. * - SEQ_NUM_START
  8482. * Bits 7:0
  8483. * Purpose:
  8484. * Indicates the starting sequence number of the MPDU in this
  8485. * series of MPDUs that went though PN check.
  8486. * Value:
  8487. * The sequence number for the first MPDU in the sequence.
  8488. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8489. * - SEQ_NUM_END
  8490. * Bits 15:8
  8491. * Purpose:
  8492. * Indicates the ending sequence number of the MPDU in this
  8493. * series of MPDUs that went though PN check.
  8494. * Value:
  8495. * The sequence number one larger then the sequence number of the last
  8496. * MPDU being flushed.
  8497. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8498. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8499. * for invalid PN numbers and are ready to be released for further processing.
  8500. * Not all MPDUs within this range are necessarily valid - the host
  8501. * must check each sequence number within this range to see if the
  8502. * corresponding MPDU is actually present.
  8503. * - PN_IE_COUNT
  8504. * Bits 23:16
  8505. * Purpose:
  8506. * Used to determine the variable number of PN information elements in this
  8507. * message
  8508. *
  8509. * PN information elements:
  8510. * - PN_IE_x-
  8511. * Purpose:
  8512. * Each PN information element contains the sequence number of the MPDU that
  8513. * has failed the target PN check.
  8514. * Value:
  8515. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8516. * that failed the PN check.
  8517. */
  8518. /* first DWORD */
  8519. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8520. #define HTT_RX_PN_IND_PEER_ID_S 8
  8521. #define HTT_RX_PN_IND_TID_M 0xff000000
  8522. #define HTT_RX_PN_IND_TID_S 24
  8523. /* second DWORD */
  8524. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8525. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8526. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8527. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8528. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8529. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8530. #define HTT_RX_PN_IND_BYTES 8
  8531. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8534. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8535. } while (0)
  8536. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8537. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8538. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8539. do { \
  8540. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8541. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8542. } while (0)
  8543. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8544. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8545. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8546. do { \
  8547. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8548. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8549. } while (0)
  8550. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8551. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8552. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8555. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8556. } while (0)
  8557. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8558. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8559. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8562. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8563. } while (0)
  8564. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8565. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8566. /*
  8567. * @brief target -> host rx offload deliver message for LL system
  8568. *
  8569. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8570. *
  8571. * @details
  8572. * In a low latency system this message is sent whenever the offload
  8573. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8574. * The DMA of the actual packets into host memory is done before sending out
  8575. * this message. This message indicates only how many MSDUs to reap. The
  8576. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8577. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8578. * DMA'd by the MAC directly into host memory these packets do not contain
  8579. * the MAC descriptors in the header portion of the packet. Instead they contain
  8580. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8581. * message, the packets are delivered directly to the NW stack without going
  8582. * through the regular reorder buffering and PN checking path since it has
  8583. * already been done in target.
  8584. *
  8585. * |31 24|23 16|15 8|7 0|
  8586. * |-----------------------------------------------------------------------|
  8587. * | Total MSDU count | reserved | msg type |
  8588. * |-----------------------------------------------------------------------|
  8589. *
  8590. * @brief target -> host rx offload deliver message for HL system
  8591. *
  8592. * @details
  8593. * In a high latency system this message is sent whenever the offload manager
  8594. * flushes out the packets it has coalesced in its coalescing buffer. The
  8595. * actual packets are also carried along with this message. When the host
  8596. * receives this message, it is expected to deliver these packets to the NW
  8597. * stack directly instead of routing them through the reorder buffering and
  8598. * PN checking path since it has already been done in target.
  8599. *
  8600. * |31 24|23 16|15 8|7 0|
  8601. * |-----------------------------------------------------------------------|
  8602. * | Total MSDU count | reserved | msg type |
  8603. * |-----------------------------------------------------------------------|
  8604. * | peer ID | MSDU length |
  8605. * |-----------------------------------------------------------------------|
  8606. * | MSDU payload | FW Desc | tid | vdev ID |
  8607. * |-----------------------------------------------------------------------|
  8608. * | MSDU payload contd. |
  8609. * |-----------------------------------------------------------------------|
  8610. * | peer ID | MSDU length |
  8611. * |-----------------------------------------------------------------------|
  8612. * | MSDU payload | FW Desc | tid | vdev ID |
  8613. * |-----------------------------------------------------------------------|
  8614. * | MSDU payload contd. |
  8615. * |-----------------------------------------------------------------------|
  8616. *
  8617. */
  8618. /* first DWORD */
  8619. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8620. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8621. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8622. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8623. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8624. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8625. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8626. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8627. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8628. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8629. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8630. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8631. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8632. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8633. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8634. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8635. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8638. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8639. } while (0)
  8640. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8641. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8642. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8643. do { \
  8644. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8645. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8646. } while (0)
  8647. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8648. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8649. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8650. do { \
  8651. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8652. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8653. } while (0)
  8654. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8655. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8656. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8657. do { \
  8658. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8659. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8660. } while (0)
  8661. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8662. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8663. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8664. do { \
  8665. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8666. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8667. } while (0)
  8668. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8669. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8670. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8671. do { \
  8672. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8673. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8674. } while (0)
  8675. /**
  8676. * @brief target -> host rx peer map/unmap message definition
  8677. *
  8678. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8679. *
  8680. * @details
  8681. * The following diagram shows the format of the rx peer map message sent
  8682. * from the target to the host. This layout assumes the target operates
  8683. * as little-endian.
  8684. *
  8685. * This message always contains a SW peer ID. The main purpose of the
  8686. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8687. * with, so that the host can use that peer ID to determine which peer
  8688. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8689. * other purposes, such as identifying during tx completions which peer
  8690. * the tx frames in question were transmitted to.
  8691. *
  8692. * In certain generations of chips, the peer map message also contains
  8693. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8694. * to identify which peer the frame needs to be forwarded to (i.e. the
  8695. * peer assocated with the Destination MAC Address within the packet),
  8696. * and particularly which vdev needs to transmit the frame (for cases
  8697. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8698. * meaning as AST_INDEX_0.
  8699. * This DA-based peer ID that is provided for certain rx frames
  8700. * (the rx frames that need to be re-transmitted as tx frames)
  8701. * is the ID that the HW uses for referring to the peer in question,
  8702. * rather than the peer ID that the SW+FW use to refer to the peer.
  8703. *
  8704. *
  8705. * |31 24|23 16|15 8|7 0|
  8706. * |-----------------------------------------------------------------------|
  8707. * | SW peer ID | VDEV ID | msg type |
  8708. * |-----------------------------------------------------------------------|
  8709. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8710. * |-----------------------------------------------------------------------|
  8711. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8712. * |-----------------------------------------------------------------------|
  8713. *
  8714. *
  8715. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8716. *
  8717. * The following diagram shows the format of the rx peer unmap message sent
  8718. * from the target to the host.
  8719. *
  8720. * |31 24|23 16|15 8|7 0|
  8721. * |-----------------------------------------------------------------------|
  8722. * | SW peer ID | VDEV ID | msg type |
  8723. * |-----------------------------------------------------------------------|
  8724. *
  8725. * The following field definitions describe the format of the rx peer map
  8726. * and peer unmap messages sent from the target to the host.
  8727. * - MSG_TYPE
  8728. * Bits 7:0
  8729. * Purpose: identifies this as an rx peer map or peer unmap message
  8730. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8731. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8732. * - VDEV_ID
  8733. * Bits 15:8
  8734. * Purpose: Indicates which virtual device the peer is associated
  8735. * with.
  8736. * Value: vdev ID (used in the host to look up the vdev object)
  8737. * - PEER_ID (a.k.a. SW_PEER_ID)
  8738. * Bits 31:16
  8739. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8740. * freeing (unmap)
  8741. * Value: (rx) peer ID
  8742. * - MAC_ADDR_L32 (peer map only)
  8743. * Bits 31:0
  8744. * Purpose: Identifies which peer node the peer ID is for.
  8745. * Value: lower 4 bytes of peer node's MAC address
  8746. * - MAC_ADDR_U16 (peer map only)
  8747. * Bits 15:0
  8748. * Purpose: Identifies which peer node the peer ID is for.
  8749. * Value: upper 2 bytes of peer node's MAC address
  8750. * - HW_PEER_ID
  8751. * Bits 31:16
  8752. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8753. * address, so for rx frames marked for rx --> tx forwarding, the
  8754. * host can determine from the HW peer ID provided as meta-data with
  8755. * the rx frame which peer the frame is supposed to be forwarded to.
  8756. * Value: ID used by the MAC HW to identify the peer
  8757. */
  8758. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8759. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8760. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8761. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8762. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8763. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8764. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8765. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8766. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8767. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8768. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8769. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8770. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8771. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8772. do { \
  8773. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8774. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8775. } while (0)
  8776. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8777. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8778. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8779. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8780. do { \
  8781. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8782. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8783. } while (0)
  8784. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8785. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8786. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8787. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8788. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8789. do { \
  8790. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8791. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8792. } while (0)
  8793. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8794. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8795. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8796. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8797. #define HTT_RX_PEER_MAP_BYTES 12
  8798. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8799. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8800. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8801. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8802. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8803. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8804. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8805. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8806. #define HTT_RX_PEER_UNMAP_BYTES 4
  8807. /**
  8808. * @brief target -> host rx peer map V2 message definition
  8809. *
  8810. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8811. *
  8812. * @details
  8813. * The following diagram shows the format of the rx peer map v2 message sent
  8814. * from the target to the host. This layout assumes the target operates
  8815. * as little-endian.
  8816. *
  8817. * This message always contains a SW peer ID. The main purpose of the
  8818. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8819. * with, so that the host can use that peer ID to determine which peer
  8820. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8821. * other purposes, such as identifying during tx completions which peer
  8822. * the tx frames in question were transmitted to.
  8823. *
  8824. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8825. * is used during rx --> tx frame forwarding to identify which peer the
  8826. * frame needs to be forwarded to (i.e. the peer assocated with the
  8827. * Destination MAC Address within the packet), and particularly which vdev
  8828. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8829. * This DA-based peer ID that is provided for certain rx frames
  8830. * (the rx frames that need to be re-transmitted as tx frames)
  8831. * is the ID that the HW uses for referring to the peer in question,
  8832. * rather than the peer ID that the SW+FW use to refer to the peer.
  8833. *
  8834. * The HW peer id here is the same meaning as AST_INDEX_0.
  8835. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8836. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8837. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8838. * AST is valid.
  8839. *
  8840. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8841. * |-------------------------------------------------------------------------|
  8842. * | SW peer ID | VDEV ID | msg type |
  8843. * |-------------------------------------------------------------------------|
  8844. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8845. * |-------------------------------------------------------------------------|
  8846. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8847. * |-------------------------------------------------------------------------|
  8848. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8849. * |-------------------------------------------------------------------------|
  8850. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8851. * |-------------------------------------------------------------------------|
  8852. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8853. * |-------------------------------------------------------------------------|
  8854. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8855. * |-------------------------------------------------------------------------|
  8856. * | Reserved_2 |
  8857. * |-------------------------------------------------------------------------|
  8858. * Where:
  8859. * NH = Next Hop
  8860. * ASTVM = AST valid mask
  8861. * OA = on-chip AST valid bit
  8862. * ASTFM = AST flow mask
  8863. *
  8864. * The following field definitions describe the format of the rx peer map v2
  8865. * messages sent from the target to the host.
  8866. * - MSG_TYPE
  8867. * Bits 7:0
  8868. * Purpose: identifies this as an rx peer map v2 message
  8869. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8870. * - VDEV_ID
  8871. * Bits 15:8
  8872. * Purpose: Indicates which virtual device the peer is associated with.
  8873. * Value: vdev ID (used in the host to look up the vdev object)
  8874. * - SW_PEER_ID
  8875. * Bits 31:16
  8876. * Purpose: The peer ID (index) that WAL is allocating
  8877. * Value: (rx) peer ID
  8878. * - MAC_ADDR_L32
  8879. * Bits 31:0
  8880. * Purpose: Identifies which peer node the peer ID is for.
  8881. * Value: lower 4 bytes of peer node's MAC address
  8882. * - MAC_ADDR_U16
  8883. * Bits 15:0
  8884. * Purpose: Identifies which peer node the peer ID is for.
  8885. * Value: upper 2 bytes of peer node's MAC address
  8886. * - HW_PEER_ID / AST_INDEX_0
  8887. * Bits 31:16
  8888. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8889. * address, so for rx frames marked for rx --> tx forwarding, the
  8890. * host can determine from the HW peer ID provided as meta-data with
  8891. * the rx frame which peer the frame is supposed to be forwarded to.
  8892. * Value: ID used by the MAC HW to identify the peer
  8893. * - AST_HASH_VALUE
  8894. * Bits 15:0
  8895. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8896. * override feature.
  8897. * - NEXT_HOP
  8898. * Bit 16
  8899. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8900. * (Wireless Distribution System).
  8901. * - AST_VALID_MASK
  8902. * Bits 19:17
  8903. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8904. * - ONCHIP_AST_VALID_FLAG
  8905. * Bit 20
  8906. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8907. * is valid.
  8908. * - AST_INDEX_1
  8909. * Bits 15:0
  8910. * Purpose: indicate the second AST index for this peer
  8911. * - AST_0_FLOW_MASK
  8912. * Bits 19:16
  8913. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8914. * - AST_1_FLOW_MASK
  8915. * Bits 23:20
  8916. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8917. * - AST_2_FLOW_MASK
  8918. * Bits 27:24
  8919. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8920. * - AST_3_FLOW_MASK
  8921. * Bits 31:28
  8922. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8923. * - AST_INDEX_2
  8924. * Bits 15:0
  8925. * Purpose: indicate the third AST index for this peer
  8926. * - TID_VALID_HI_PRI
  8927. * Bits 23:16
  8928. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8929. * - TID_VALID_LOW_PRI
  8930. * Bits 31:24
  8931. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8932. * - AST_INDEX_3
  8933. * Bits 15:0
  8934. * Purpose: indicate the fourth AST index for this peer
  8935. * - ONCHIP_AST_IDX / RESERVED
  8936. * Bits 31:16
  8937. * Purpose: This field is valid only when split AST feature is enabled.
  8938. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8939. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8940. * address, this ast_idx is used for LMAC modules for RXPCU.
  8941. * Value: ID used by the LMAC HW to identify the peer
  8942. */
  8943. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8944. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8945. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8946. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8947. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8948. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8949. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8950. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8951. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8952. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8953. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8954. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8955. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8956. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8957. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8958. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8959. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8960. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8961. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8962. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8963. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8964. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8965. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8966. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8967. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8968. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8969. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8970. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8971. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8972. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8973. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8974. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8975. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8976. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8977. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8978. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8979. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8980. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8981. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8984. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8985. } while (0)
  8986. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8987. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8988. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8991. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8992. } while (0)
  8993. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8994. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8995. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8998. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8999. } while (0)
  9000. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9001. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9002. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9005. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9006. } while (0)
  9007. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9008. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9009. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9010. do { \
  9011. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9012. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9013. } while (0)
  9014. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9015. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9016. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9017. do { \
  9018. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9019. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9020. } while (0)
  9021. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9022. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9023. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9024. do { \
  9025. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9026. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9027. } while (0)
  9028. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9029. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9030. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9031. do { \
  9032. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9033. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9034. } while (0)
  9035. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9036. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9037. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9038. do { \
  9039. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9040. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9041. } while (0)
  9042. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9043. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9044. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9047. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9048. } while (0)
  9049. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9050. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9051. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9052. do { \
  9053. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9054. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9055. } while (0)
  9056. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9057. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9058. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9059. do { \
  9060. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9061. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9062. } while (0)
  9063. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9064. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9065. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9066. do { \
  9067. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9068. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9069. } while (0)
  9070. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9071. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9072. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9073. do { \
  9074. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9075. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9076. } while (0)
  9077. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9078. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9079. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9080. do { \
  9081. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9082. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9083. } while (0)
  9084. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9085. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9086. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9087. do { \
  9088. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9089. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9090. } while (0)
  9091. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9092. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9093. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9094. do { \
  9095. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9096. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9097. } while (0)
  9098. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9099. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9100. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9101. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9102. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9103. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9104. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9105. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9106. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9107. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9108. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9109. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9110. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9111. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9112. /**
  9113. * @brief target -> host rx peer map V3 message definition
  9114. *
  9115. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9116. *
  9117. * @details
  9118. * The following diagram shows the format of the rx peer map v3 message sent
  9119. * from the target to the host.
  9120. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9121. * This layout assumes the target operates as little-endian.
  9122. *
  9123. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9124. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9125. * | SW peer ID | VDEV ID | msg type |
  9126. * |-----------------+--------------------+-----------------+-----------------|
  9127. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9128. * |-----------------+--------------------+-----------------+-----------------|
  9129. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9130. * |-----------------+--------+-----------+-----------------+-----------------|
  9131. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9132. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9133. * | (8bits) | | (4bits) | |
  9134. * |-----------------+--------+--+--+--+--------------------------------------|
  9135. * | RESERVED |E |O | | |
  9136. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9137. * | |V |V | | |
  9138. * |-----------------+--------------------+-----------------------------------|
  9139. * | HTT_MSDU_IDX_ | RESERVED | |
  9140. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9141. * | (8bits) | | |
  9142. * |-----------------+--------------------+-----------------------------------|
  9143. * | Reserved_2 |
  9144. * |--------------------------------------------------------------------------|
  9145. * | Reserved_3 |
  9146. * |--------------------------------------------------------------------------|
  9147. *
  9148. * Where:
  9149. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9150. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9151. * NH = Next Hop
  9152. * The following field definitions describe the format of the rx peer map v3
  9153. * messages sent from the target to the host.
  9154. * - MSG_TYPE
  9155. * Bits 7:0
  9156. * Purpose: identifies this as a peer map v3 message
  9157. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9158. * - VDEV_ID
  9159. * Bits 15:8
  9160. * Purpose: Indicates which virtual device the peer is associated with.
  9161. * - SW_PEER_ID
  9162. * Bits 31:16
  9163. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9164. * - MAC_ADDR_L32
  9165. * Bits 31:0
  9166. * Purpose: Identifies which peer node the peer ID is for.
  9167. * Value: lower 4 bytes of peer node's MAC address
  9168. * - MAC_ADDR_U16
  9169. * Bits 15:0
  9170. * Purpose: Identifies which peer node the peer ID is for.
  9171. * Value: upper 2 bytes of peer node's MAC address
  9172. * - MULTICAST_SW_PEER_ID
  9173. * Bits 31:16
  9174. * Purpose: The multicast peer ID (index)
  9175. * Value: set to HTT_INVALID_PEER if not valid
  9176. * - HW_PEER_ID / AST_INDEX
  9177. * Bits 15:0
  9178. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9179. * address, so for rx frames marked for rx --> tx forwarding, the
  9180. * host can determine from the HW peer ID provided as meta-data with
  9181. * the rx frame which peer the frame is supposed to be forwarded to.
  9182. * - CACHE_SET_NUM
  9183. * Bits 19:16
  9184. * Purpose: Cache Set Number for AST_INDEX
  9185. * Cache set number that should be used to cache the index based
  9186. * search results, for address and flow search.
  9187. * This value should be equal to LSB 4 bits of the hash value
  9188. * of match data, in case of search index points to an entry which
  9189. * may be used in content based search also. The value can be
  9190. * anything when the entry pointed by search index will not be
  9191. * used for content based search.
  9192. * - HTT_MSDU_IDX_VALID_MASK
  9193. * Bits 31:24
  9194. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9195. * - ONCHIP_AST_IDX / RESERVED
  9196. * Bits 15:0
  9197. * Purpose: This field is valid only when split AST feature is enabled.
  9198. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9199. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9200. * address, this ast_idx is used for LMAC modules for RXPCU.
  9201. * - NEXT_HOP
  9202. * Bits 16
  9203. * Purpose: Flag indicates next_hop AST entry used for WDS
  9204. * (Wireless Distribution System).
  9205. * - ONCHIP_AST_VALID
  9206. * Bits 17
  9207. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9208. * - EXT_AST_VALID
  9209. * Bits 18
  9210. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9211. * - EXT_AST_INDEX
  9212. * Bits 15:0
  9213. * Purpose: This field describes Extended AST index
  9214. * Valid if EXT_AST_VALID flag set
  9215. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9216. * Bits 31:24
  9217. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9218. */
  9219. /* dword 0 */
  9220. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9221. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9222. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9223. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9224. /* dword 1 */
  9225. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9226. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9227. /* dword 2 */
  9228. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9229. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9230. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9231. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9232. /* dword 3 */
  9233. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9234. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9235. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9236. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9237. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9238. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9239. /* dword 4 */
  9240. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9241. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9242. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9243. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9244. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9245. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9246. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9247. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9248. /* dword 5 */
  9249. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9250. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9251. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9252. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9253. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9254. do { \
  9255. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9256. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9257. } while (0)
  9258. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9259. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9260. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9261. do { \
  9262. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9263. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9264. } while (0)
  9265. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9266. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9267. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9268. do { \
  9269. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9270. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9271. } while (0)
  9272. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9273. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9274. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9275. do { \
  9276. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9277. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9278. } while (0)
  9279. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9280. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9281. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9282. do { \
  9283. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9284. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9285. } while (0)
  9286. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9287. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9288. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9289. do { \
  9290. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9291. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9292. } while (0)
  9293. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9294. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9295. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9296. do { \
  9297. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9298. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9299. } while (0)
  9300. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9301. (((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)
  9302. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9303. do { \
  9304. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9305. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9306. } while (0)
  9307. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9308. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9309. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9310. do { \
  9311. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9312. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9313. } while (0)
  9314. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9315. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9316. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9317. do { \
  9318. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9319. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9320. } while (0)
  9321. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9322. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9323. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9324. do { \
  9325. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9326. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9327. } while (0)
  9328. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9329. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  9330. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  9331. do { \
  9332. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  9333. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  9334. } while (0)
  9335. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  9336. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  9337. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  9338. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  9339. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  9340. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  9341. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  9342. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  9343. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  9344. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9345. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9346. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  9347. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  9348. #define HTT_RX_PEER_MAP_V3_BYTES 32
  9349. /**
  9350. * @brief target -> host rx peer unmap V2 message definition
  9351. *
  9352. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  9353. *
  9354. * The following diagram shows the format of the rx peer unmap message sent
  9355. * from the target to the host.
  9356. *
  9357. * |31 24|23 16|15 8|7 0|
  9358. * |-----------------------------------------------------------------------|
  9359. * | SW peer ID | VDEV ID | msg type |
  9360. * |-----------------------------------------------------------------------|
  9361. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9362. * |-----------------------------------------------------------------------|
  9363. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  9364. * |-----------------------------------------------------------------------|
  9365. * | Peer Delete Duration |
  9366. * |-----------------------------------------------------------------------|
  9367. * | Reserved_0 | WDS Free Count |
  9368. * |-----------------------------------------------------------------------|
  9369. * | Reserved_1 |
  9370. * |-----------------------------------------------------------------------|
  9371. * | Reserved_2 |
  9372. * |-----------------------------------------------------------------------|
  9373. *
  9374. *
  9375. * The following field definitions describe the format of the rx peer unmap
  9376. * messages sent from the target to the host.
  9377. * - MSG_TYPE
  9378. * Bits 7:0
  9379. * Purpose: identifies this as an rx peer unmap v2 message
  9380. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  9381. * - VDEV_ID
  9382. * Bits 15:8
  9383. * Purpose: Indicates which virtual device the peer is associated
  9384. * with.
  9385. * Value: vdev ID (used in the host to look up the vdev object)
  9386. * - SW_PEER_ID
  9387. * Bits 31:16
  9388. * Purpose: The peer ID (index) that WAL is freeing
  9389. * Value: (rx) peer ID
  9390. * - MAC_ADDR_L32
  9391. * Bits 31:0
  9392. * Purpose: Identifies which peer node the peer ID is for.
  9393. * Value: lower 4 bytes of peer node's MAC address
  9394. * - MAC_ADDR_U16
  9395. * Bits 15:0
  9396. * Purpose: Identifies which peer node the peer ID is for.
  9397. * Value: upper 2 bytes of peer node's MAC address
  9398. * - NEXT_HOP
  9399. * Bits 16
  9400. * Purpose: Bit indicates next_hop AST entry used for WDS
  9401. * (Wireless Distribution System).
  9402. * - PEER_DELETE_DURATION
  9403. * Bits 31:0
  9404. * Purpose: Time taken to delete peer, in msec,
  9405. * Used for monitoring / debugging PEER delete response delay
  9406. * - PEER_WDS_FREE_COUNT
  9407. * Bits 15:0
  9408. * Purpose: Count of WDS entries deleted associated to peer deleted
  9409. */
  9410. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  9411. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  9412. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  9413. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  9414. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  9415. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  9416. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  9417. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  9418. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  9419. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  9420. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  9421. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  9422. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  9423. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  9424. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  9425. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  9426. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  9427. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  9428. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  9429. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  9430. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  9431. do { \
  9432. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  9433. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  9434. } while (0)
  9435. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  9436. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  9437. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  9438. do { \
  9439. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  9440. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  9441. } while (0)
  9442. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  9443. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  9444. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9445. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  9446. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  9447. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  9448. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  9449. /**
  9450. * @brief target -> host rx peer mlo map message definition
  9451. *
  9452. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  9453. *
  9454. * @details
  9455. * The following diagram shows the format of the rx mlo peer map message sent
  9456. * from the target to the host. This layout assumes the target operates
  9457. * as little-endian.
  9458. *
  9459. * MCC:
  9460. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  9461. *
  9462. * WIN:
  9463. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  9464. * It will be sent on the Assoc Link.
  9465. *
  9466. * This message always contains a MLO peer ID. The main purpose of the
  9467. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  9468. * with, so that the host can use that MLO peer ID to determine which peer
  9469. * transmitted the rx frame.
  9470. *
  9471. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  9472. * |-------------------------------------------------------------------------|
  9473. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  9474. * |-------------------------------------------------------------------------|
  9475. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9476. * |-------------------------------------------------------------------------|
  9477. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  9478. * |-------------------------------------------------------------------------|
  9479. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  9480. * |-------------------------------------------------------------------------|
  9481. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  9482. * |-------------------------------------------------------------------------|
  9483. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  9484. * |-------------------------------------------------------------------------|
  9485. * |RSVD |
  9486. * |-------------------------------------------------------------------------|
  9487. * |RSVD |
  9488. * |-------------------------------------------------------------------------|
  9489. * | htt_tlv_hdr_t |
  9490. * |-------------------------------------------------------------------------|
  9491. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9492. * |-------------------------------------------------------------------------|
  9493. * | htt_tlv_hdr_t |
  9494. * |-------------------------------------------------------------------------|
  9495. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9496. * |-------------------------------------------------------------------------|
  9497. * | htt_tlv_hdr_t |
  9498. * |-------------------------------------------------------------------------|
  9499. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9500. * |-------------------------------------------------------------------------|
  9501. *
  9502. * Where:
  9503. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  9504. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  9505. * V (valid) - 1 Bit Bit17
  9506. * CHIPID - 3 Bits
  9507. * TIDMASK - 8 Bits
  9508. * CACHE_SET_NUM - 8 Bits
  9509. *
  9510. * The following field definitions describe the format of the rx MLO peer map
  9511. * messages sent from the target to the host.
  9512. * - MSG_TYPE
  9513. * Bits 7:0
  9514. * Purpose: identifies this as an rx mlo peer map message
  9515. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  9516. *
  9517. * - MLO_PEER_ID
  9518. * Bits 23:8
  9519. * Purpose: The MLO peer ID (index).
  9520. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  9521. * Value: MLO peer ID
  9522. *
  9523. * - NUMLINK
  9524. * Bits: 26:24 (3Bits)
  9525. * Purpose: Indicate the max number of logical links supported per client.
  9526. * Value: number of logical links
  9527. *
  9528. * - PRC
  9529. * Bits: 29:27 (3Bits)
  9530. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  9531. * if there is migration of the primary chip.
  9532. * Value: Primary REO CHIPID
  9533. *
  9534. * - MAC_ADDR_L32
  9535. * Bits 31:0
  9536. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  9537. * Value: lower 4 bytes of peer node's MAC address
  9538. *
  9539. * - MAC_ADDR_U16
  9540. * Bits 15:0
  9541. * Purpose: Identifies which peer node the peer ID is for.
  9542. * Value: upper 2 bytes of peer node's MAC address
  9543. *
  9544. * - PRIMARY_TCL_AST_IDX
  9545. * Bits 15:0
  9546. * Purpose: Primary TCL AST index for this peer.
  9547. *
  9548. * - V
  9549. * 1 Bit Position 16
  9550. * Purpose: If the ast idx is valid.
  9551. *
  9552. * - CHIPID
  9553. * Bits 19:17
  9554. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  9555. *
  9556. * - TIDMASK
  9557. * Bits 27:20
  9558. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  9559. *
  9560. * - CACHE_SET_NUM
  9561. * Bits 31:28
  9562. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  9563. * Cache set number that should be used to cache the index based
  9564. * search results, for address and flow search.
  9565. * This value should be equal to LSB four bits of the hash value
  9566. * of match data, in case of search index points to an entry which
  9567. * may be used in content based search also. The value can be
  9568. * anything when the entry pointed by search index will not be
  9569. * used for content based search.
  9570. *
  9571. * - htt_tlv_hdr_t
  9572. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  9573. *
  9574. * Bits 11:0
  9575. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  9576. *
  9577. * Bits 23:12
  9578. * Purpose: Length, Length of the value that follows the header
  9579. *
  9580. * Bits 31:28
  9581. * Purpose: Reserved.
  9582. *
  9583. *
  9584. * - SW_PEER_ID
  9585. * Bits 15:0
  9586. * Purpose: The peer ID (index) that WAL is allocating
  9587. * Value: (rx) peer ID
  9588. *
  9589. * - VDEV_ID
  9590. * Bits 23:16
  9591. * Purpose: Indicates which virtual device the peer is associated with.
  9592. * Value: vdev ID (used in the host to look up the vdev object)
  9593. *
  9594. * - CHIPID
  9595. * Bits 26:24
  9596. * Purpose: Indicates which Chip id the peer is associated with.
  9597. * Value: chip ID (Provided by Host as part of QMI exchange)
  9598. */
  9599. typedef enum {
  9600. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  9601. } MLO_PEER_MAP_TLV_TAG_ID;
  9602. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  9603. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  9604. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  9605. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  9606. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  9607. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  9608. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9609. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  9610. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  9611. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  9612. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  9613. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  9614. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  9615. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  9616. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  9617. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  9618. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  9619. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  9620. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  9621. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  9622. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  9623. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  9624. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  9625. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  9626. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  9627. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  9628. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  9629. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  9630. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  9631. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  9632. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  9633. do { \
  9634. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  9635. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  9636. } while (0)
  9637. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  9638. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  9639. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  9640. do { \
  9641. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  9642. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  9643. } while (0)
  9644. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  9645. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  9646. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  9647. do { \
  9648. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  9649. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  9650. } while (0)
  9651. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  9652. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  9653. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  9654. do { \
  9655. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  9656. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  9657. } while (0)
  9658. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  9659. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  9660. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  9661. do { \
  9662. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  9663. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  9664. } while (0)
  9665. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  9666. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  9667. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  9668. do { \
  9669. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  9670. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  9671. } while (0)
  9672. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  9673. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  9674. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  9675. do { \
  9676. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  9677. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  9678. } while (0)
  9679. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  9680. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  9681. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  9682. do { \
  9683. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  9684. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  9685. } while (0)
  9686. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  9687. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  9688. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  9689. do { \
  9690. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  9691. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  9692. } while (0)
  9693. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  9694. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  9695. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  9696. do { \
  9697. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  9698. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  9699. } while (0)
  9700. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  9701. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  9702. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  9703. do { \
  9704. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  9705. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  9706. } while (0)
  9707. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  9708. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  9709. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  9712. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  9713. } while (0)
  9714. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  9715. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  9716. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  9717. do { \
  9718. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  9719. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  9720. } while (0)
  9721. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  9722. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  9723. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9724. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  9725. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  9726. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  9727. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  9728. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  9729. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  9730. *
  9731. * The following diagram shows the format of the rx mlo peer unmap message sent
  9732. * from the target to the host.
  9733. *
  9734. * |31 24|23 16|15 8|7 0|
  9735. * |-----------------------------------------------------------------------|
  9736. * | RSVD_24_31 | MLO peer ID | msg type |
  9737. * |-----------------------------------------------------------------------|
  9738. */
  9739. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  9740. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  9741. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  9742. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  9743. /**
  9744. * @brief target -> host message specifying security parameters
  9745. *
  9746. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  9747. *
  9748. * @details
  9749. * The following diagram shows the format of the security specification
  9750. * message sent from the target to the host.
  9751. * This security specification message tells the host whether a PN check is
  9752. * necessary on rx data frames, and if so, how large the PN counter is.
  9753. * This message also tells the host about the security processing to apply
  9754. * to defragmented rx frames - specifically, whether a Message Integrity
  9755. * Check is required, and the Michael key to use.
  9756. *
  9757. * |31 24|23 16|15|14 8|7 0|
  9758. * |-----------------------------------------------------------------------|
  9759. * | peer ID | U| security type | msg type |
  9760. * |-----------------------------------------------------------------------|
  9761. * | Michael Key K0 |
  9762. * |-----------------------------------------------------------------------|
  9763. * | Michael Key K1 |
  9764. * |-----------------------------------------------------------------------|
  9765. * | WAPI RSC Low0 |
  9766. * |-----------------------------------------------------------------------|
  9767. * | WAPI RSC Low1 |
  9768. * |-----------------------------------------------------------------------|
  9769. * | WAPI RSC Hi0 |
  9770. * |-----------------------------------------------------------------------|
  9771. * | WAPI RSC Hi1 |
  9772. * |-----------------------------------------------------------------------|
  9773. *
  9774. * The following field definitions describe the format of the security
  9775. * indication message sent from the target to the host.
  9776. * - MSG_TYPE
  9777. * Bits 7:0
  9778. * Purpose: identifies this as a security specification message
  9779. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  9780. * - SEC_TYPE
  9781. * Bits 14:8
  9782. * Purpose: specifies which type of security applies to the peer
  9783. * Value: htt_sec_type enum value
  9784. * - UNICAST
  9785. * Bit 15
  9786. * Purpose: whether this security is applied to unicast or multicast data
  9787. * Value: 1 -> unicast, 0 -> multicast
  9788. * - PEER_ID
  9789. * Bits 31:16
  9790. * Purpose: The ID number for the peer the security specification is for
  9791. * Value: peer ID
  9792. * - MICHAEL_KEY_K0
  9793. * Bits 31:0
  9794. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  9795. * Value: Michael Key K0 (if security type is TKIP)
  9796. * - MICHAEL_KEY_K1
  9797. * Bits 31:0
  9798. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  9799. * Value: Michael Key K1 (if security type is TKIP)
  9800. * - WAPI_RSC_LOW0
  9801. * Bits 31:0
  9802. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  9803. * Value: WAPI RSC Low0 (if security type is WAPI)
  9804. * - WAPI_RSC_LOW1
  9805. * Bits 31:0
  9806. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  9807. * Value: WAPI RSC Low1 (if security type is WAPI)
  9808. * - WAPI_RSC_HI0
  9809. * Bits 31:0
  9810. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  9811. * Value: WAPI RSC Hi0 (if security type is WAPI)
  9812. * - WAPI_RSC_HI1
  9813. * Bits 31:0
  9814. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  9815. * Value: WAPI RSC Hi1 (if security type is WAPI)
  9816. */
  9817. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  9818. #define HTT_SEC_IND_SEC_TYPE_S 8
  9819. #define HTT_SEC_IND_UNICAST_M 0x00008000
  9820. #define HTT_SEC_IND_UNICAST_S 15
  9821. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  9822. #define HTT_SEC_IND_PEER_ID_S 16
  9823. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  9826. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  9827. } while (0)
  9828. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  9829. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  9830. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  9833. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  9834. } while (0)
  9835. #define HTT_SEC_IND_UNICAST_GET(word) \
  9836. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  9837. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  9840. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  9841. } while (0)
  9842. #define HTT_SEC_IND_PEER_ID_GET(word) \
  9843. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  9844. #define HTT_SEC_IND_BYTES 28
  9845. /**
  9846. * @brief target -> host rx ADDBA / DELBA message definitions
  9847. *
  9848. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  9849. *
  9850. * @details
  9851. * The following diagram shows the format of the rx ADDBA message sent
  9852. * from the target to the host:
  9853. *
  9854. * |31 20|19 16|15 8|7 0|
  9855. * |---------------------------------------------------------------------|
  9856. * | peer ID | TID | window size | msg type |
  9857. * |---------------------------------------------------------------------|
  9858. *
  9859. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  9860. *
  9861. * The following diagram shows the format of the rx DELBA message sent
  9862. * from the target to the host:
  9863. *
  9864. * |31 20|19 16|15 10|9 8|7 0|
  9865. * |---------------------------------------------------------------------|
  9866. * | peer ID | TID | window size | IR| msg type |
  9867. * |---------------------------------------------------------------------|
  9868. *
  9869. * The following field definitions describe the format of the rx ADDBA
  9870. * and DELBA messages sent from the target to the host.
  9871. * - MSG_TYPE
  9872. * Bits 7:0
  9873. * Purpose: identifies this as an rx ADDBA or DELBA message
  9874. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  9875. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  9876. * - IR (initiator / recipient)
  9877. * Bits 9:8 (DELBA only)
  9878. * Purpose: specify whether the DELBA handshake was initiated by the
  9879. * local STA/AP, or by the peer STA/AP
  9880. * Value:
  9881. * 0 - unspecified
  9882. * 1 - initiator (a.k.a. originator)
  9883. * 2 - recipient (a.k.a. responder)
  9884. * 3 - unused / reserved
  9885. * - WIN_SIZE
  9886. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  9887. * Purpose: Specifies the length of the block ack window (max = 64).
  9888. * Value:
  9889. * block ack window length specified by the received ADDBA/DELBA
  9890. * management message.
  9891. * - TID
  9892. * Bits 19:16
  9893. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  9894. * Value:
  9895. * TID specified by the received ADDBA or DELBA management message.
  9896. * - PEER_ID
  9897. * Bits 31:20
  9898. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  9899. * Value:
  9900. * ID (hash value) used by the host for fast, direct lookup of
  9901. * host SW peer info, including rx reorder states.
  9902. */
  9903. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  9904. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  9905. #define HTT_RX_ADDBA_TID_M 0xf0000
  9906. #define HTT_RX_ADDBA_TID_S 16
  9907. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  9908. #define HTT_RX_ADDBA_PEER_ID_S 20
  9909. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  9910. do { \
  9911. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  9912. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  9913. } while (0)
  9914. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9915. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9916. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9917. do { \
  9918. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9919. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9920. } while (0)
  9921. #define HTT_RX_ADDBA_TID_GET(word) \
  9922. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9923. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9924. do { \
  9925. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9926. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9927. } while (0)
  9928. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9929. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9930. #define HTT_RX_ADDBA_BYTES 4
  9931. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9932. #define HTT_RX_DELBA_INITIATOR_S 8
  9933. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9934. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9935. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9936. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9937. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9938. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9939. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9940. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9941. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9942. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9943. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9946. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9947. } while (0)
  9948. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9949. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9950. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9953. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9954. } while (0)
  9955. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9956. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9957. #define HTT_RX_DELBA_BYTES 4
  9958. /**
  9959. * @brief tx queue group information element definition
  9960. *
  9961. * @details
  9962. * The following diagram shows the format of the tx queue group
  9963. * information element, which can be included in target --> host
  9964. * messages to specify the number of tx "credits" (tx descriptors
  9965. * for LL, or tx buffers for HL) available to a particular group
  9966. * of host-side tx queues, and which host-side tx queues belong to
  9967. * the group.
  9968. *
  9969. * |31|30 24|23 16|15|14|13 0|
  9970. * |------------------------------------------------------------------------|
  9971. * | X| reserved | tx queue grp ID | A| S| credit count |
  9972. * |------------------------------------------------------------------------|
  9973. * | vdev ID mask | AC mask |
  9974. * |------------------------------------------------------------------------|
  9975. *
  9976. * The following definitions describe the fields within the tx queue group
  9977. * information element:
  9978. * - credit_count
  9979. * Bits 13:1
  9980. * Purpose: specify how many tx credits are available to the tx queue group
  9981. * Value: An absolute or relative, positive or negative credit value
  9982. * The 'A' bit specifies whether the value is absolute or relative.
  9983. * The 'S' bit specifies whether the value is positive or negative.
  9984. * A negative value can only be relative, not absolute.
  9985. * An absolute value replaces any prior credit value the host has for
  9986. * the tx queue group in question.
  9987. * A relative value is added to the prior credit value the host has for
  9988. * the tx queue group in question.
  9989. * - sign
  9990. * Bit 14
  9991. * Purpose: specify whether the credit count is positive or negative
  9992. * Value: 0 -> positive, 1 -> negative
  9993. * - absolute
  9994. * Bit 15
  9995. * Purpose: specify whether the credit count is absolute or relative
  9996. * Value: 0 -> relative, 1 -> absolute
  9997. * - txq_group_id
  9998. * Bits 23:16
  9999. * Purpose: indicate which tx queue group's credit and/or membership are
  10000. * being specified
  10001. * Value: 0 to max_tx_queue_groups-1
  10002. * - reserved
  10003. * Bits 30:16
  10004. * Value: 0x0
  10005. * - eXtension
  10006. * Bit 31
  10007. * Purpose: specify whether another tx queue group info element follows
  10008. * Value: 0 -> no more tx queue group information elements
  10009. * 1 -> another tx queue group information element immediately follows
  10010. * - ac_mask
  10011. * Bits 15:0
  10012. * Purpose: specify which Access Categories belong to the tx queue group
  10013. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10014. * the tx queue group.
  10015. * The AC bit-mask values are obtained by left-shifting by the
  10016. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10017. * - vdev_id_mask
  10018. * Bits 31:16
  10019. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10020. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10021. * belong to the tx queue group.
  10022. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10023. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10024. */
  10025. PREPACK struct htt_txq_group {
  10026. A_UINT32
  10027. credit_count: 14,
  10028. sign: 1,
  10029. absolute: 1,
  10030. tx_queue_group_id: 8,
  10031. reserved0: 7,
  10032. extension: 1;
  10033. A_UINT32
  10034. ac_mask: 16,
  10035. vdev_id_mask: 16;
  10036. } POSTPACK;
  10037. /* first word */
  10038. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10039. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10040. #define HTT_TXQ_GROUP_SIGN_S 14
  10041. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10042. #define HTT_TXQ_GROUP_ABS_S 15
  10043. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10044. #define HTT_TXQ_GROUP_ID_S 16
  10045. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10046. #define HTT_TXQ_GROUP_EXT_S 31
  10047. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10048. /* second word */
  10049. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10050. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10051. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10052. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10053. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10054. do { \
  10055. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10056. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10057. } while (0)
  10058. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10059. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10060. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10061. do { \
  10062. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10063. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10064. } while (0)
  10065. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10066. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10067. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10068. do { \
  10069. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10070. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10071. } while (0)
  10072. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10073. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10074. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10077. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10078. } while (0)
  10079. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10080. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10081. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10082. do { \
  10083. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10084. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10085. } while (0)
  10086. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10087. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10088. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10091. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10092. } while (0)
  10093. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10094. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10095. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10096. do { \
  10097. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10098. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10099. } while (0)
  10100. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10101. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10102. /**
  10103. * @brief target -> host TX completion indication message definition
  10104. *
  10105. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10106. *
  10107. * @details
  10108. * The following diagram shows the format of the TX completion indication sent
  10109. * from the target to the host
  10110. *
  10111. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10112. * |-------------------------------------------------------------------|
  10113. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10114. * |-------------------------------------------------------------------|
  10115. * payload:| MSDU1 ID | MSDU0 ID |
  10116. * |-------------------------------------------------------------------|
  10117. * : MSDU3 ID | MSDU2 ID :
  10118. * |-------------------------------------------------------------------|
  10119. * | struct htt_tx_compl_ind_append_retries |
  10120. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10121. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10122. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10123. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10124. * |-------------------------------------------------------------------|
  10125. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10126. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10127. * | MSDU0 tx_tsf64_low |
  10128. * |-------------------------------------------------------------------|
  10129. * | MSDU0 tx_tsf64_high |
  10130. * |-------------------------------------------------------------------|
  10131. * | MSDU1 tx_tsf64_low |
  10132. * |-------------------------------------------------------------------|
  10133. * | MSDU1 tx_tsf64_high |
  10134. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10135. * | phy_timestamp |
  10136. * |-------------------------------------------------------------------|
  10137. * | rate specs (see below) |
  10138. * |-------------------------------------------------------------------|
  10139. * | seqctrl | framectrl |
  10140. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10141. * Where:
  10142. * A0 = append (a.k.a. append0)
  10143. * A1 = append1
  10144. * TP = MSDU tx power presence
  10145. * A2 = append2
  10146. * A3 = append3
  10147. * A4 = append4
  10148. *
  10149. * The following field definitions describe the format of the TX completion
  10150. * indication sent from the target to the host
  10151. * Header fields:
  10152. * - msg_type
  10153. * Bits 7:0
  10154. * Purpose: identifies this as HTT TX completion indication
  10155. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10156. * - status
  10157. * Bits 10:8
  10158. * Purpose: the TX completion status of payload fragmentations descriptors
  10159. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10160. * - tid
  10161. * Bits 14:11
  10162. * Purpose: the tid associated with those fragmentation descriptors. It is
  10163. * valid or not, depending on the tid_invalid bit.
  10164. * Value: 0 to 15
  10165. * - tid_invalid
  10166. * Bits 15:15
  10167. * Purpose: this bit indicates whether the tid field is valid or not
  10168. * Value: 0 indicates valid; 1 indicates invalid
  10169. * - num
  10170. * Bits 23:16
  10171. * Purpose: the number of payload in this indication
  10172. * Value: 1 to 255
  10173. * - append (a.k.a. append0)
  10174. * Bits 24:24
  10175. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10176. * the number of tx retries for one MSDU at the end of this message
  10177. * Value: 0 indicates no appending; 1 indicates appending
  10178. * - append1
  10179. * Bits 25:25
  10180. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10181. * contains the timestamp info for each TX msdu id in payload.
  10182. * The order of the timestamps matches the order of the MSDU IDs.
  10183. * Note that a big-endian host needs to account for the reordering
  10184. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10185. * conversion) when determining which tx timestamp corresponds to
  10186. * which MSDU ID.
  10187. * Value: 0 indicates no appending; 1 indicates appending
  10188. * - msdu_tx_power_presence
  10189. * Bits 26:26
  10190. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10191. * for each MSDU referenced by the TX_COMPL_IND message.
  10192. * The tx power is reported in 0.5 dBm units.
  10193. * The order of the per-MSDU tx power reports matches the order
  10194. * of the MSDU IDs.
  10195. * Note that a big-endian host needs to account for the reordering
  10196. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10197. * conversion) when determining which Tx Power corresponds to
  10198. * which MSDU ID.
  10199. * Value: 0 indicates MSDU tx power reports are not appended,
  10200. * 1 indicates MSDU tx power reports are appended
  10201. * - append2
  10202. * Bits 27:27
  10203. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10204. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10205. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10206. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10207. * for each MSDU, for convenience.
  10208. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10209. * this append2 bit is set).
  10210. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10211. * dB above the noise floor.
  10212. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10213. * 1 indicates MSDU ACK RSSI values are appended.
  10214. * - append3
  10215. * Bits 28:28
  10216. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10217. * contains the tx tsf info based on wlan global TSF for
  10218. * each TX msdu id in payload.
  10219. * The order of the tx tsf matches the order of the MSDU IDs.
  10220. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10221. * values to indicate the the lower 32 bits and higher 32 bits of
  10222. * the tx tsf.
  10223. * The tx_tsf64 here represents the time MSDU was acked and the
  10224. * tx_tsf64 has microseconds units.
  10225. * Value: 0 indicates no appending; 1 indicates appending
  10226. * - append4
  10227. * Bits 29:29
  10228. * Purpose: Indicate whether data frame control fields and fields required
  10229. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10230. * message. The order of the this message matches the order of
  10231. * the MSDU IDs.
  10232. * Value: 0 indicates frame control fields and fields required for
  10233. * radio tap header values are not appended,
  10234. * 1 indicates frame control fields and fields required for
  10235. * radio tap header values are appended.
  10236. * Payload fields:
  10237. * - hmsdu_id
  10238. * Bits 15:0
  10239. * Purpose: this ID is used to track the Tx buffer in host
  10240. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10241. */
  10242. PREPACK struct htt_tx_data_hdr_information {
  10243. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10244. A_UINT32 /* word 1 */
  10245. /* preamble:
  10246. * 0-OFDM,
  10247. * 1-CCk,
  10248. * 2-HT,
  10249. * 3-VHT
  10250. */
  10251. preamble: 2, /* [1:0] */
  10252. /* mcs:
  10253. * In case of HT preamble interpret
  10254. * MCS along with NSS.
  10255. * Valid values for HT are 0 to 7.
  10256. * HT mcs 0 with NSS 2 is mcs 8.
  10257. * Valid values for VHT are 0 to 9.
  10258. */
  10259. mcs: 4, /* [5:2] */
  10260. /* rate:
  10261. * This is applicable only for
  10262. * CCK and OFDM preamble type
  10263. * rate 0: OFDM 48 Mbps,
  10264. * 1: OFDM 24 Mbps,
  10265. * 2: OFDM 12 Mbps
  10266. * 3: OFDM 6 Mbps
  10267. * 4: OFDM 54 Mbps
  10268. * 5: OFDM 36 Mbps
  10269. * 6: OFDM 18 Mbps
  10270. * 7: OFDM 9 Mbps
  10271. * rate 0: CCK 11 Mbps Long
  10272. * 1: CCK 5.5 Mbps Long
  10273. * 2: CCK 2 Mbps Long
  10274. * 3: CCK 1 Mbps Long
  10275. * 4: CCK 11 Mbps Short
  10276. * 5: CCK 5.5 Mbps Short
  10277. * 6: CCK 2 Mbps Short
  10278. */
  10279. rate : 3, /* [ 8: 6] */
  10280. rssi : 8, /* [16: 9] units=dBm */
  10281. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10282. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10283. stbc : 1, /* [22] */
  10284. sgi : 1, /* [23] */
  10285. ldpc : 1, /* [24] */
  10286. beamformed: 1, /* [25] */
  10287. /* tx_retry_cnt:
  10288. * Indicates retry count of data tx frames provided by the host.
  10289. */
  10290. tx_retry_cnt: 6; /* [31:26] */
  10291. A_UINT32 /* word 2 */
  10292. framectrl:16, /* [15: 0] */
  10293. seqno:16; /* [31:16] */
  10294. } POSTPACK;
  10295. #define HTT_TX_COMPL_IND_STATUS_S 8
  10296. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10297. #define HTT_TX_COMPL_IND_TID_S 11
  10298. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10299. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10300. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10301. #define HTT_TX_COMPL_IND_NUM_S 16
  10302. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10303. #define HTT_TX_COMPL_IND_APPEND_S 24
  10304. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10305. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10306. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10307. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10308. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10309. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10310. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10311. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10312. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10313. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10314. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10315. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10316. do { \
  10317. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10318. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10319. } while (0)
  10320. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10321. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10322. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10323. do { \
  10324. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10325. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10326. } while (0)
  10327. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10328. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10329. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  10330. do { \
  10331. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  10332. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  10333. } while (0)
  10334. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  10335. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  10336. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  10337. do { \
  10338. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  10339. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  10340. } while (0)
  10341. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  10342. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  10343. HTT_TX_COMPL_IND_TID_INV_S)
  10344. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  10345. do { \
  10346. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  10347. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  10348. } while (0)
  10349. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  10350. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  10351. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  10352. do { \
  10353. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  10354. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  10355. } while (0)
  10356. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  10357. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  10358. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  10361. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  10362. } while (0)
  10363. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  10364. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  10365. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  10366. do { \
  10367. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  10368. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  10369. } while (0)
  10370. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  10371. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  10372. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  10373. do { \
  10374. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  10375. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  10376. } while (0)
  10377. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  10378. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  10379. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  10382. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  10383. } while (0)
  10384. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  10385. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  10386. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  10387. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  10388. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  10389. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  10390. #define HTT_TX_COMPL_IND_STAT_OK 0
  10391. /* DISCARD:
  10392. * current meaning:
  10393. * MSDUs were queued for transmission but filtered by HW or SW
  10394. * without any over the air attempts
  10395. * legacy meaning (HL Rome):
  10396. * MSDUs were discarded by the target FW without any over the air
  10397. * attempts due to lack of space
  10398. */
  10399. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  10400. /* NO_ACK:
  10401. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  10402. */
  10403. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  10404. /* POSTPONE:
  10405. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  10406. * be downloaded again later (in the appropriate order), when they are
  10407. * deliverable.
  10408. */
  10409. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  10410. /*
  10411. * The PEER_DEL tx completion status is used for HL cases
  10412. * where the peer the frame is for has been deleted.
  10413. * The host has already discarded its copy of the frame, but
  10414. * it still needs the tx completion to restore its credit.
  10415. */
  10416. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  10417. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  10418. #define HTT_TX_COMPL_IND_STAT_DROP 5
  10419. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  10420. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  10421. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  10422. PREPACK struct htt_tx_compl_ind_base {
  10423. A_UINT32 hdr;
  10424. A_UINT16 payload[1/*or more*/];
  10425. } POSTPACK;
  10426. PREPACK struct htt_tx_compl_ind_append_retries {
  10427. A_UINT16 msdu_id;
  10428. A_UINT8 tx_retries;
  10429. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  10430. 0: this is the last append_retries struct */
  10431. } POSTPACK;
  10432. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  10433. A_UINT32 timestamp[1/*or more*/];
  10434. } POSTPACK;
  10435. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  10436. A_UINT32 tx_tsf64_low;
  10437. A_UINT32 tx_tsf64_high;
  10438. } POSTPACK;
  10439. /* htt_tx_data_hdr_information payload extension fields: */
  10440. /* DWORD zero */
  10441. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  10442. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  10443. /* DWORD one */
  10444. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  10445. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  10446. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  10447. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  10448. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  10449. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  10450. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  10451. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  10452. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  10453. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  10454. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  10455. #define HTT_FW_TX_DATA_HDR_BW_S 19
  10456. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  10457. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  10458. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  10459. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  10460. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  10461. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  10462. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  10463. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  10464. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  10465. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  10466. /* DWORD two */
  10467. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  10468. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  10469. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  10470. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  10471. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  10472. do { \
  10473. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  10474. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  10475. } while (0)
  10476. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  10477. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  10478. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  10481. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  10482. } while (0)
  10483. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  10484. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  10485. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  10486. do { \
  10487. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  10488. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  10489. } while (0)
  10490. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  10491. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  10492. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  10495. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  10496. } while (0)
  10497. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  10498. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  10499. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  10502. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  10503. } while (0)
  10504. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  10505. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  10506. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  10507. do { \
  10508. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  10509. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  10510. } while (0)
  10511. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  10512. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  10513. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  10514. do { \
  10515. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  10516. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  10517. } while (0)
  10518. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  10519. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  10520. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  10521. do { \
  10522. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  10523. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  10524. } while (0)
  10525. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  10526. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  10527. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  10528. do { \
  10529. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  10530. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  10531. } while (0)
  10532. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  10533. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  10534. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  10535. do { \
  10536. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  10537. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  10538. } while (0)
  10539. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  10540. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  10541. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  10542. do { \
  10543. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  10544. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  10545. } while (0)
  10546. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  10547. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  10548. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  10549. do { \
  10550. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  10551. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  10552. } while (0)
  10553. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  10554. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  10555. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  10556. do { \
  10557. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  10558. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  10559. } while (0)
  10560. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  10561. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  10562. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  10563. do { \
  10564. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  10565. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  10566. } while (0)
  10567. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  10568. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  10569. /**
  10570. * @brief target -> host rate-control update indication message
  10571. *
  10572. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  10573. *
  10574. * @details
  10575. * The following diagram shows the format of the RC Update message
  10576. * sent from the target to the host, while processing the tx-completion
  10577. * of a transmitted PPDU.
  10578. *
  10579. * |31 24|23 16|15 8|7 0|
  10580. * |-------------------------------------------------------------|
  10581. * | peer ID | vdev ID | msg_type |
  10582. * |-------------------------------------------------------------|
  10583. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10584. * |-------------------------------------------------------------|
  10585. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  10586. * |-------------------------------------------------------------|
  10587. * | : |
  10588. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10589. * | : |
  10590. * |-------------------------------------------------------------|
  10591. * | : |
  10592. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10593. * | : |
  10594. * |-------------------------------------------------------------|
  10595. * : :
  10596. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10597. *
  10598. */
  10599. typedef struct {
  10600. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  10601. A_UINT32 rate_code_flags;
  10602. A_UINT32 flags; /* Encodes information such as excessive
  10603. retransmission, aggregate, some info
  10604. from .11 frame control,
  10605. STBC, LDPC, (SGI and Tx Chain Mask
  10606. are encoded in ptx_rc->flags field),
  10607. AMPDU truncation (BT/time based etc.),
  10608. RTS/CTS attempt */
  10609. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  10610. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  10611. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  10612. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  10613. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  10614. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  10615. } HTT_RC_TX_DONE_PARAMS;
  10616. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  10617. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  10618. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  10619. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  10620. #define HTT_RC_UPDATE_VDEVID_S 8
  10621. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  10622. #define HTT_RC_UPDATE_PEERID_S 16
  10623. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  10624. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  10625. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  10626. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  10627. do { \
  10628. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  10629. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  10630. } while (0)
  10631. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  10632. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  10633. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  10634. do { \
  10635. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  10636. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  10637. } while (0)
  10638. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  10639. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  10640. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  10641. do { \
  10642. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  10643. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  10644. } while (0)
  10645. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  10646. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  10647. /**
  10648. * @brief target -> host rx fragment indication message definition
  10649. *
  10650. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  10651. *
  10652. * @details
  10653. * The following field definitions describe the format of the rx fragment
  10654. * indication message sent from the target to the host.
  10655. * The rx fragment indication message shares the format of the
  10656. * rx indication message, but not all fields from the rx indication message
  10657. * are relevant to the rx fragment indication message.
  10658. *
  10659. *
  10660. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10661. * |-----------+-------------------+---------------------+-------------|
  10662. * | peer ID | |FV| ext TID | msg type |
  10663. * |-------------------------------------------------------------------|
  10664. * | | flush | flush |
  10665. * | | end | start |
  10666. * | | seq num | seq num |
  10667. * |-------------------------------------------------------------------|
  10668. * | reserved | FW rx desc bytes |
  10669. * |-------------------------------------------------------------------|
  10670. * | | FW MSDU Rx |
  10671. * | | desc B0 |
  10672. * |-------------------------------------------------------------------|
  10673. * Header fields:
  10674. * - MSG_TYPE
  10675. * Bits 7:0
  10676. * Purpose: identifies this as an rx fragment indication message
  10677. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  10678. * - EXT_TID
  10679. * Bits 12:8
  10680. * Purpose: identify the traffic ID of the rx data, including
  10681. * special "extended" TID values for multicast, broadcast, and
  10682. * non-QoS data frames
  10683. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10684. * - FLUSH_VALID (FV)
  10685. * Bit 13
  10686. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10687. * is valid
  10688. * Value:
  10689. * 1 -> flush IE is valid and needs to be processed
  10690. * 0 -> flush IE is not valid and should be ignored
  10691. * - PEER_ID
  10692. * Bits 31:16
  10693. * Purpose: Identify, by ID, which peer sent the rx data
  10694. * Value: ID of the peer who sent the rx data
  10695. * - FLUSH_SEQ_NUM_START
  10696. * Bits 5:0
  10697. * Purpose: Indicate the start of a series of MPDUs to flush
  10698. * Not all MPDUs within this series are necessarily valid - the host
  10699. * must check each sequence number within this range to see if the
  10700. * corresponding MPDU is actually present.
  10701. * This field is only valid if the FV bit is set.
  10702. * Value:
  10703. * The sequence number for the first MPDUs to check to flush.
  10704. * The sequence number is masked by 0x3f.
  10705. * - FLUSH_SEQ_NUM_END
  10706. * Bits 11:6
  10707. * Purpose: Indicate the end of a series of MPDUs to flush
  10708. * Value:
  10709. * The sequence number one larger than the sequence number of the
  10710. * last MPDU to check to flush.
  10711. * The sequence number is masked by 0x3f.
  10712. * Not all MPDUs within this series are necessarily valid - the host
  10713. * must check each sequence number within this range to see if the
  10714. * corresponding MPDU is actually present.
  10715. * This field is only valid if the FV bit is set.
  10716. * Rx descriptor fields:
  10717. * - FW_RX_DESC_BYTES
  10718. * Bits 15:0
  10719. * Purpose: Indicate how many bytes in the Rx indication are used for
  10720. * FW Rx descriptors
  10721. * Value: 1
  10722. */
  10723. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  10724. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  10725. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  10726. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  10727. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  10728. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  10729. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  10730. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  10731. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  10732. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  10733. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  10734. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  10735. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  10736. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  10737. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  10738. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  10739. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  10740. #define HTT_RX_FRAG_IND_BYTES \
  10741. (4 /* msg hdr */ + \
  10742. 4 /* flush spec */ + \
  10743. 4 /* (unused) FW rx desc bytes spec */ + \
  10744. 4 /* FW rx desc */)
  10745. /**
  10746. * @brief target -> host test message definition
  10747. *
  10748. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  10749. *
  10750. * @details
  10751. * The following field definitions describe the format of the test
  10752. * message sent from the target to the host.
  10753. * The message consists of a 4-octet header, followed by a variable
  10754. * number of 32-bit integer values, followed by a variable number
  10755. * of 8-bit character values.
  10756. *
  10757. * |31 16|15 8|7 0|
  10758. * |-----------------------------------------------------------|
  10759. * | num chars | num ints | msg type |
  10760. * |-----------------------------------------------------------|
  10761. * | int 0 |
  10762. * |-----------------------------------------------------------|
  10763. * | int 1 |
  10764. * |-----------------------------------------------------------|
  10765. * | ... |
  10766. * |-----------------------------------------------------------|
  10767. * | char 3 | char 2 | char 1 | char 0 |
  10768. * |-----------------------------------------------------------|
  10769. * | | | ... | char 4 |
  10770. * |-----------------------------------------------------------|
  10771. * - MSG_TYPE
  10772. * Bits 7:0
  10773. * Purpose: identifies this as a test message
  10774. * Value: HTT_MSG_TYPE_TEST
  10775. * - NUM_INTS
  10776. * Bits 15:8
  10777. * Purpose: indicate how many 32-bit integers follow the message header
  10778. * - NUM_CHARS
  10779. * Bits 31:16
  10780. * Purpose: indicate how many 8-bit charaters follow the series of integers
  10781. */
  10782. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  10783. #define HTT_RX_TEST_NUM_INTS_S 8
  10784. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  10785. #define HTT_RX_TEST_NUM_CHARS_S 16
  10786. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  10787. do { \
  10788. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  10789. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  10790. } while (0)
  10791. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  10792. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  10793. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  10796. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  10797. } while (0)
  10798. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  10799. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  10800. /**
  10801. * @brief target -> host packet log message
  10802. *
  10803. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  10804. *
  10805. * @details
  10806. * The following field definitions describe the format of the packet log
  10807. * message sent from the target to the host.
  10808. * The message consists of a 4-octet header,followed by a variable number
  10809. * of 32-bit character values.
  10810. *
  10811. * |31 16|15 12|11 10|9 8|7 0|
  10812. * |------------------------------------------------------------------|
  10813. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  10814. * |------------------------------------------------------------------|
  10815. * | payload |
  10816. * |------------------------------------------------------------------|
  10817. * - MSG_TYPE
  10818. * Bits 7:0
  10819. * Purpose: identifies this as a pktlog message
  10820. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  10821. * - mac_id
  10822. * Bits 9:8
  10823. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  10824. * Value: 0-3
  10825. * - pdev_id
  10826. * Bits 11:10
  10827. * Purpose: pdev_id
  10828. * Value: 0-3
  10829. * 0 (for rings at SOC level),
  10830. * 1/2/3 PDEV -> 0/1/2
  10831. * - payload_size
  10832. * Bits 31:16
  10833. * Purpose: explicitly specify the payload size
  10834. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  10835. */
  10836. PREPACK struct htt_pktlog_msg {
  10837. A_UINT32 header;
  10838. A_UINT32 payload[1/* or more */];
  10839. } POSTPACK;
  10840. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  10841. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  10842. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  10843. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  10844. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  10845. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  10846. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  10847. do { \
  10848. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  10849. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  10850. } while (0)
  10851. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  10852. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  10853. HTT_T2H_PKTLOG_MAC_ID_S)
  10854. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  10855. do { \
  10856. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  10857. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  10858. } while (0)
  10859. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  10860. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  10861. HTT_T2H_PKTLOG_PDEV_ID_S)
  10862. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  10863. do { \
  10864. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  10865. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  10866. } while (0)
  10867. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  10868. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  10869. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  10870. /*
  10871. * Rx reorder statistics
  10872. * NB: all the fields must be defined in 4 octets size.
  10873. */
  10874. struct rx_reorder_stats {
  10875. /* Non QoS MPDUs received */
  10876. A_UINT32 deliver_non_qos;
  10877. /* MPDUs received in-order */
  10878. A_UINT32 deliver_in_order;
  10879. /* Flush due to reorder timer expired */
  10880. A_UINT32 deliver_flush_timeout;
  10881. /* Flush due to move out of window */
  10882. A_UINT32 deliver_flush_oow;
  10883. /* Flush due to DELBA */
  10884. A_UINT32 deliver_flush_delba;
  10885. /* MPDUs dropped due to FCS error */
  10886. A_UINT32 fcs_error;
  10887. /* MPDUs dropped due to monitor mode non-data packet */
  10888. A_UINT32 mgmt_ctrl;
  10889. /* Unicast-data MPDUs dropped due to invalid peer */
  10890. A_UINT32 invalid_peer;
  10891. /* MPDUs dropped due to duplication (non aggregation) */
  10892. A_UINT32 dup_non_aggr;
  10893. /* MPDUs dropped due to processed before */
  10894. A_UINT32 dup_past;
  10895. /* MPDUs dropped due to duplicate in reorder queue */
  10896. A_UINT32 dup_in_reorder;
  10897. /* Reorder timeout happened */
  10898. A_UINT32 reorder_timeout;
  10899. /* invalid bar ssn */
  10900. A_UINT32 invalid_bar_ssn;
  10901. /* reorder reset due to bar ssn */
  10902. A_UINT32 ssn_reset;
  10903. /* Flush due to delete peer */
  10904. A_UINT32 deliver_flush_delpeer;
  10905. /* Flush due to offload*/
  10906. A_UINT32 deliver_flush_offload;
  10907. /* Flush due to out of buffer*/
  10908. A_UINT32 deliver_flush_oob;
  10909. /* MPDUs dropped due to PN check fail */
  10910. A_UINT32 pn_fail;
  10911. /* MPDUs dropped due to unable to allocate memory */
  10912. A_UINT32 store_fail;
  10913. /* Number of times the tid pool alloc succeeded */
  10914. A_UINT32 tid_pool_alloc_succ;
  10915. /* Number of times the MPDU pool alloc succeeded */
  10916. A_UINT32 mpdu_pool_alloc_succ;
  10917. /* Number of times the MSDU pool alloc succeeded */
  10918. A_UINT32 msdu_pool_alloc_succ;
  10919. /* Number of times the tid pool alloc failed */
  10920. A_UINT32 tid_pool_alloc_fail;
  10921. /* Number of times the MPDU pool alloc failed */
  10922. A_UINT32 mpdu_pool_alloc_fail;
  10923. /* Number of times the MSDU pool alloc failed */
  10924. A_UINT32 msdu_pool_alloc_fail;
  10925. /* Number of times the tid pool freed */
  10926. A_UINT32 tid_pool_free;
  10927. /* Number of times the MPDU pool freed */
  10928. A_UINT32 mpdu_pool_free;
  10929. /* Number of times the MSDU pool freed */
  10930. A_UINT32 msdu_pool_free;
  10931. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10932. A_UINT32 msdu_queued;
  10933. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10934. A_UINT32 msdu_recycled;
  10935. /* Number of MPDUs with invalid peer but A2 found in AST */
  10936. A_UINT32 invalid_peer_a2_in_ast;
  10937. /* Number of MPDUs with invalid peer but A3 found in AST */
  10938. A_UINT32 invalid_peer_a3_in_ast;
  10939. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10940. A_UINT32 invalid_peer_bmc_mpdus;
  10941. /* Number of MSDUs with err attention word */
  10942. A_UINT32 rxdesc_err_att;
  10943. /* Number of MSDUs with flag of peer_idx_invalid */
  10944. A_UINT32 rxdesc_err_peer_idx_inv;
  10945. /* Number of MSDUs with flag of peer_idx_timeout */
  10946. A_UINT32 rxdesc_err_peer_idx_to;
  10947. /* Number of MSDUs with flag of overflow */
  10948. A_UINT32 rxdesc_err_ov;
  10949. /* Number of MSDUs with flag of msdu_length_err */
  10950. A_UINT32 rxdesc_err_msdu_len;
  10951. /* Number of MSDUs with flag of mpdu_length_err */
  10952. A_UINT32 rxdesc_err_mpdu_len;
  10953. /* Number of MSDUs with flag of tkip_mic_err */
  10954. A_UINT32 rxdesc_err_tkip_mic;
  10955. /* Number of MSDUs with flag of decrypt_err */
  10956. A_UINT32 rxdesc_err_decrypt;
  10957. /* Number of MSDUs with flag of fcs_err */
  10958. A_UINT32 rxdesc_err_fcs;
  10959. /* Number of Unicast (bc_mc bit is not set in attention word)
  10960. * frames with invalid peer handler
  10961. */
  10962. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10963. /* Number of unicast frame directly (direct bit is set in attention word)
  10964. * to DUT with invalid peer handler
  10965. */
  10966. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10967. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10968. * frames with invalid peer handler
  10969. */
  10970. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10971. /* Number of MSDUs dropped due to no first MSDU flag */
  10972. A_UINT32 rxdesc_no_1st_msdu;
  10973. /* Number of MSDUs droped due to ring overflow */
  10974. A_UINT32 msdu_drop_ring_ov;
  10975. /* Number of MSDUs dropped due to FC mismatch */
  10976. A_UINT32 msdu_drop_fc_mismatch;
  10977. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10978. A_UINT32 msdu_drop_mgmt_remote_ring;
  10979. /* Number of MSDUs dropped due to errors not reported in attention word */
  10980. A_UINT32 msdu_drop_misc;
  10981. /* Number of MSDUs go to offload before reorder */
  10982. A_UINT32 offload_msdu_wal;
  10983. /* Number of data frame dropped by offload after reorder */
  10984. A_UINT32 offload_msdu_reorder;
  10985. /* Number of MPDUs with sequence number in the past and within the BA window */
  10986. A_UINT32 dup_past_within_window;
  10987. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10988. A_UINT32 dup_past_outside_window;
  10989. /* Number of MSDUs with decrypt/MIC error */
  10990. A_UINT32 rxdesc_err_decrypt_mic;
  10991. /* Number of data MSDUs received on both local and remote rings */
  10992. A_UINT32 data_msdus_on_both_rings;
  10993. /* MPDUs never filled */
  10994. A_UINT32 holes_not_filled;
  10995. };
  10996. /*
  10997. * Rx Remote buffer statistics
  10998. * NB: all the fields must be defined in 4 octets size.
  10999. */
  11000. struct rx_remote_buffer_mgmt_stats {
  11001. /* Total number of MSDUs reaped for Rx processing */
  11002. A_UINT32 remote_reaped;
  11003. /* MSDUs recycled within firmware */
  11004. A_UINT32 remote_recycled;
  11005. /* MSDUs stored by Data Rx */
  11006. A_UINT32 data_rx_msdus_stored;
  11007. /* Number of HTT indications from WAL Rx MSDU */
  11008. A_UINT32 wal_rx_ind;
  11009. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11010. A_UINT32 wal_rx_ind_unconsumed;
  11011. /* Number of HTT indications from Data Rx MSDU */
  11012. A_UINT32 data_rx_ind;
  11013. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11014. A_UINT32 data_rx_ind_unconsumed;
  11015. /* Number of HTT indications from ATHBUF */
  11016. A_UINT32 athbuf_rx_ind;
  11017. /* Number of remote buffers requested for refill */
  11018. A_UINT32 refill_buf_req;
  11019. /* Number of remote buffers filled by the host */
  11020. A_UINT32 refill_buf_rsp;
  11021. /* Number of times MAC hw_index = f/w write_index */
  11022. A_INT32 mac_no_bufs;
  11023. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11024. A_INT32 fw_indices_equal;
  11025. /* Number of times f/w finds no buffers to post */
  11026. A_INT32 host_no_bufs;
  11027. };
  11028. /*
  11029. * TXBF MU/SU packets and NDPA statistics
  11030. * NB: all the fields must be defined in 4 octets size.
  11031. */
  11032. struct rx_txbf_musu_ndpa_pkts_stats {
  11033. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11034. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11035. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11036. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11037. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11038. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11039. };
  11040. /*
  11041. * htt_dbg_stats_status -
  11042. * present - The requested stats have been delivered in full.
  11043. * This indicates that either the stats information was contained
  11044. * in its entirety within this message, or else this message
  11045. * completes the delivery of the requested stats info that was
  11046. * partially delivered through earlier STATS_CONF messages.
  11047. * partial - The requested stats have been delivered in part.
  11048. * One or more subsequent STATS_CONF messages with the same
  11049. * cookie value will be sent to deliver the remainder of the
  11050. * information.
  11051. * error - The requested stats could not be delivered, for example due
  11052. * to a shortage of memory to construct a message holding the
  11053. * requested stats.
  11054. * invalid - The requested stat type is either not recognized, or the
  11055. * target is configured to not gather the stats type in question.
  11056. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11057. * series_done - This special value indicates that no further stats info
  11058. * elements are present within a series of stats info elems
  11059. * (within a stats upload confirmation message).
  11060. */
  11061. enum htt_dbg_stats_status {
  11062. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11063. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11064. HTT_DBG_STATS_STATUS_ERROR = 2,
  11065. HTT_DBG_STATS_STATUS_INVALID = 3,
  11066. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11067. };
  11068. /**
  11069. * @brief target -> host statistics upload
  11070. *
  11071. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11072. *
  11073. * @details
  11074. * The following field definitions describe the format of the HTT target
  11075. * to host stats upload confirmation message.
  11076. * The message contains a cookie echoed from the HTT host->target stats
  11077. * upload request, which identifies which request the confirmation is
  11078. * for, and a series of tag-length-value stats information elements.
  11079. * The tag-length header for each stats info element also includes a
  11080. * status field, to indicate whether the request for the stat type in
  11081. * question was fully met, partially met, unable to be met, or invalid
  11082. * (if the stat type in question is disabled in the target).
  11083. * A special value of all 1's in this status field is used to indicate
  11084. * the end of the series of stats info elements.
  11085. *
  11086. *
  11087. * |31 16|15 8|7 5|4 0|
  11088. * |------------------------------------------------------------|
  11089. * | reserved | msg type |
  11090. * |------------------------------------------------------------|
  11091. * | cookie LSBs |
  11092. * |------------------------------------------------------------|
  11093. * | cookie MSBs |
  11094. * |------------------------------------------------------------|
  11095. * | stats entry length | reserved | S |stat type|
  11096. * |------------------------------------------------------------|
  11097. * | |
  11098. * | type-specific stats info |
  11099. * | |
  11100. * |------------------------------------------------------------|
  11101. * | stats entry length | reserved | S |stat type|
  11102. * |------------------------------------------------------------|
  11103. * | |
  11104. * | type-specific stats info |
  11105. * | |
  11106. * |------------------------------------------------------------|
  11107. * | n/a | reserved | 111 | n/a |
  11108. * |------------------------------------------------------------|
  11109. * Header fields:
  11110. * - MSG_TYPE
  11111. * Bits 7:0
  11112. * Purpose: identifies this is a statistics upload confirmation message
  11113. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11114. * - COOKIE_LSBS
  11115. * Bits 31:0
  11116. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11117. * message with its preceding host->target stats request message.
  11118. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11119. * - COOKIE_MSBS
  11120. * Bits 31:0
  11121. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11122. * message with its preceding host->target stats request message.
  11123. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11124. *
  11125. * Stats Information Element tag-length header fields:
  11126. * - STAT_TYPE
  11127. * Bits 4:0
  11128. * Purpose: identifies the type of statistics info held in the
  11129. * following information element
  11130. * Value: htt_dbg_stats_type
  11131. * - STATUS
  11132. * Bits 7:5
  11133. * Purpose: indicate whether the requested stats are present
  11134. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11135. * the completion of the stats entry series
  11136. * - LENGTH
  11137. * Bits 31:16
  11138. * Purpose: indicate the stats information size
  11139. * Value: This field specifies the number of bytes of stats information
  11140. * that follows the element tag-length header.
  11141. * It is expected but not required that this length is a multiple of
  11142. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11143. * subsequent stats entry header will begin on a 4-byte aligned
  11144. * boundary.
  11145. */
  11146. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11147. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11148. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11149. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11150. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11151. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11152. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11153. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11154. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11155. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11156. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11157. do { \
  11158. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11159. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11160. } while (0)
  11161. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11162. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11163. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11164. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11165. do { \
  11166. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11167. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11168. } while (0)
  11169. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11170. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11171. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11172. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11173. do { \
  11174. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11175. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11176. } while (0)
  11177. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11178. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11179. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11180. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11181. #define HTT_MAX_AGGR 64
  11182. #define HTT_HL_MAX_AGGR 18
  11183. /**
  11184. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11185. *
  11186. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11187. *
  11188. * @details
  11189. * The following field definitions describe the format of the HTT host
  11190. * to target frag_desc/msdu_ext bank configuration message.
  11191. * The message contains the based address and the min and max id of the
  11192. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11193. * MSDU_EXT/FRAG_DESC.
  11194. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11195. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11196. * the hardware does the mapping/translation.
  11197. *
  11198. * Total banks that can be configured is configured to 16.
  11199. *
  11200. * This should be called before any TX has be initiated by the HTT
  11201. *
  11202. * |31 16|15 8|7 5|4 0|
  11203. * |------------------------------------------------------------|
  11204. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11205. * |------------------------------------------------------------|
  11206. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11207. #if HTT_PADDR64
  11208. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11209. #endif
  11210. * |------------------------------------------------------------|
  11211. * | ... |
  11212. * |------------------------------------------------------------|
  11213. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11214. #if HTT_PADDR64
  11215. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11216. #endif
  11217. * |------------------------------------------------------------|
  11218. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11219. * |------------------------------------------------------------|
  11220. * | ... |
  11221. * |------------------------------------------------------------|
  11222. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11223. * |------------------------------------------------------------|
  11224. * Header fields:
  11225. * - MSG_TYPE
  11226. * Bits 7:0
  11227. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11228. * for systems with 64-bit format for bus addresses:
  11229. * - BANKx_BASE_ADDRESS_LO
  11230. * Bits 31:0
  11231. * Purpose: Provide a mechanism to specify the base address of the
  11232. * MSDU_EXT bank physical/bus address.
  11233. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11234. * - BANKx_BASE_ADDRESS_HI
  11235. * Bits 31:0
  11236. * Purpose: Provide a mechanism to specify the base address of the
  11237. * MSDU_EXT bank physical/bus address.
  11238. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11239. * for systems with 32-bit format for bus addresses:
  11240. * - BANKx_BASE_ADDRESS
  11241. * Bits 31:0
  11242. * Purpose: Provide a mechanism to specify the base address of the
  11243. * MSDU_EXT bank physical/bus address.
  11244. * Value: MSDU_EXT bank physical / bus address
  11245. * - BANKx_MIN_ID
  11246. * Bits 15:0
  11247. * Purpose: Provide a mechanism to specify the min index that needs to
  11248. * mapped.
  11249. * - BANKx_MAX_ID
  11250. * Bits 31:16
  11251. * Purpose: Provide a mechanism to specify the max index that needs to
  11252. * mapped.
  11253. *
  11254. */
  11255. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11256. * safe value.
  11257. * @note MAX supported banks is 16.
  11258. */
  11259. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11260. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11261. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11262. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11263. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11264. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11265. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11266. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11267. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11268. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11269. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11270. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11271. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11272. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11273. do { \
  11274. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11275. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11276. } while (0)
  11277. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11278. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11279. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11280. do { \
  11281. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11282. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11283. } while (0)
  11284. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11285. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11286. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11287. do { \
  11288. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11289. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11290. } while (0)
  11291. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11292. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11293. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11296. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11297. } while (0)
  11298. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11299. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11300. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11303. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11304. } while (0)
  11305. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11306. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11307. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11310. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11311. } while (0)
  11312. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11313. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11314. /*
  11315. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11316. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11317. * addresses are stored in a XXX-bit field.
  11318. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11319. * htt_tx_frag_desc64_bank_cfg_t structs.
  11320. */
  11321. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11322. _paddr_bits_, \
  11323. _paddr__bank_base_address_) \
  11324. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11325. /** word 0 \
  11326. * msg_type: 8, \
  11327. * pdev_id: 2, \
  11328. * swap: 1, \
  11329. * reserved0: 5, \
  11330. * num_banks: 8, \
  11331. * desc_size: 8; \
  11332. */ \
  11333. A_UINT32 word0; \
  11334. /* \
  11335. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  11336. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  11337. * the second A_UINT32). \
  11338. */ \
  11339. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11340. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11341. } POSTPACK
  11342. /* define htt_tx_frag_desc32_bank_cfg_t */
  11343. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  11344. /* define htt_tx_frag_desc64_bank_cfg_t */
  11345. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  11346. /*
  11347. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  11348. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  11349. */
  11350. #if HTT_PADDR64
  11351. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  11352. #else
  11353. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  11354. #endif
  11355. /**
  11356. * @brief target -> host HTT TX Credit total count update message definition
  11357. *
  11358. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  11359. *
  11360. *|31 16|15|14 9| 8 |7 0 |
  11361. *|---------------------+--+----------+-------+----------|
  11362. *|cur htt credit delta | Q| reserved | sign | msg type |
  11363. *|------------------------------------------------------|
  11364. *
  11365. * Header fields:
  11366. * - MSG_TYPE
  11367. * Bits 7:0
  11368. * Purpose: identifies this as a htt tx credit delta update message
  11369. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  11370. * - SIGN
  11371. * Bits 8
  11372. * identifies whether credit delta is positive or negative
  11373. * Value:
  11374. * - 0x0: credit delta is positive, rebalance in some buffers
  11375. * - 0x1: credit delta is negative, rebalance out some buffers
  11376. * - reserved
  11377. * Bits 14:9
  11378. * Value: 0x0
  11379. * - TXQ_GRP
  11380. * Bit 15
  11381. * Purpose: indicates whether any tx queue group information elements
  11382. * are appended to the tx credit update message
  11383. * Value: 0 -> no tx queue group information element is present
  11384. * 1 -> a tx queue group information element immediately follows
  11385. * - DELTA_COUNT
  11386. * Bits 31:16
  11387. * Purpose: Specify current htt credit delta absolute count
  11388. */
  11389. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  11390. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  11391. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  11392. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  11393. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  11394. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  11395. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  11396. do { \
  11397. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  11398. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  11399. } while (0)
  11400. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  11401. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  11402. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  11403. do { \
  11404. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  11405. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  11406. } while (0)
  11407. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  11408. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  11409. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  11410. do { \
  11411. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  11412. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  11413. } while (0)
  11414. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  11415. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  11416. #define HTT_TX_CREDIT_MSG_BYTES 4
  11417. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  11418. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  11419. /**
  11420. * @brief HTT WDI_IPA Operation Response Message
  11421. *
  11422. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  11423. *
  11424. * @details
  11425. * HTT WDI_IPA Operation Response message is sent by target
  11426. * to host confirming suspend or resume operation.
  11427. * |31 24|23 16|15 8|7 0|
  11428. * |----------------+----------------+----------------+----------------|
  11429. * | op_code | Rsvd | msg_type |
  11430. * |-------------------------------------------------------------------|
  11431. * | Rsvd | Response len |
  11432. * |-------------------------------------------------------------------|
  11433. * | |
  11434. * | Response-type specific info |
  11435. * | |
  11436. * | |
  11437. * |-------------------------------------------------------------------|
  11438. * Header fields:
  11439. * - MSG_TYPE
  11440. * Bits 7:0
  11441. * Purpose: Identifies this as WDI_IPA Operation Response message
  11442. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  11443. * - OP_CODE
  11444. * Bits 31:16
  11445. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  11446. * value: = enum htt_wdi_ipa_op_code
  11447. * - RSP_LEN
  11448. * Bits 16:0
  11449. * Purpose: length for the response-type specific info
  11450. * value: = length in bytes for response-type specific info
  11451. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  11452. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  11453. */
  11454. PREPACK struct htt_wdi_ipa_op_response_t
  11455. {
  11456. /* DWORD 0: flags and meta-data */
  11457. A_UINT32
  11458. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11459. reserved1: 8,
  11460. op_code: 16;
  11461. A_UINT32
  11462. rsp_len: 16,
  11463. reserved2: 16;
  11464. } POSTPACK;
  11465. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  11466. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  11467. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  11468. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  11469. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  11470. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  11471. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  11472. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  11473. do { \
  11474. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  11475. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  11476. } while (0)
  11477. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  11478. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  11479. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  11480. do { \
  11481. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  11482. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  11483. } while (0)
  11484. enum htt_phy_mode {
  11485. htt_phy_mode_11a = 0,
  11486. htt_phy_mode_11g = 1,
  11487. htt_phy_mode_11b = 2,
  11488. htt_phy_mode_11g_only = 3,
  11489. htt_phy_mode_11na_ht20 = 4,
  11490. htt_phy_mode_11ng_ht20 = 5,
  11491. htt_phy_mode_11na_ht40 = 6,
  11492. htt_phy_mode_11ng_ht40 = 7,
  11493. htt_phy_mode_11ac_vht20 = 8,
  11494. htt_phy_mode_11ac_vht40 = 9,
  11495. htt_phy_mode_11ac_vht80 = 10,
  11496. htt_phy_mode_11ac_vht20_2g = 11,
  11497. htt_phy_mode_11ac_vht40_2g = 12,
  11498. htt_phy_mode_11ac_vht80_2g = 13,
  11499. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  11500. htt_phy_mode_11ac_vht160 = 15,
  11501. htt_phy_mode_max,
  11502. };
  11503. /**
  11504. * @brief target -> host HTT channel change indication
  11505. *
  11506. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  11507. *
  11508. * @details
  11509. * Specify when a channel change occurs.
  11510. * This allows the host to precisely determine which rx frames arrived
  11511. * on the old channel and which rx frames arrived on the new channel.
  11512. *
  11513. *|31 |7 0 |
  11514. *|-------------------------------------------+----------|
  11515. *| reserved | msg type |
  11516. *|------------------------------------------------------|
  11517. *| primary_chan_center_freq_mhz |
  11518. *|------------------------------------------------------|
  11519. *| contiguous_chan1_center_freq_mhz |
  11520. *|------------------------------------------------------|
  11521. *| contiguous_chan2_center_freq_mhz |
  11522. *|------------------------------------------------------|
  11523. *| phy_mode |
  11524. *|------------------------------------------------------|
  11525. *
  11526. * Header fields:
  11527. * - MSG_TYPE
  11528. * Bits 7:0
  11529. * Purpose: identifies this as a htt channel change indication message
  11530. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  11531. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  11532. * Bits 31:0
  11533. * Purpose: identify the (center of the) new 20 MHz primary channel
  11534. * Value: center frequency of the 20 MHz primary channel, in MHz units
  11535. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  11536. * Bits 31:0
  11537. * Purpose: identify the (center of the) contiguous frequency range
  11538. * comprising the new channel.
  11539. * For example, if the new channel is a 80 MHz channel extending
  11540. * 60 MHz beyond the primary channel, this field would be 30 larger
  11541. * than the primary channel center frequency field.
  11542. * Value: center frequency of the contiguous frequency range comprising
  11543. * the full channel in MHz units
  11544. * (80+80 channels also use the CONTIG_CHAN2 field)
  11545. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  11546. * Bits 31:0
  11547. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  11548. * within a VHT 80+80 channel.
  11549. * This field is only relevant for VHT 80+80 channels.
  11550. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  11551. * channel (arbitrary value for cases besides VHT 80+80)
  11552. * - PHY_MODE
  11553. * Bits 31:0
  11554. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  11555. * and band
  11556. * Value: htt_phy_mode enum value
  11557. */
  11558. PREPACK struct htt_chan_change_t
  11559. {
  11560. /* DWORD 0: flags and meta-data */
  11561. A_UINT32
  11562. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11563. reserved1: 24;
  11564. A_UINT32 primary_chan_center_freq_mhz;
  11565. A_UINT32 contig_chan1_center_freq_mhz;
  11566. A_UINT32 contig_chan2_center_freq_mhz;
  11567. A_UINT32 phy_mode;
  11568. } POSTPACK;
  11569. /*
  11570. * Due to historical / backwards-compatibility reasons, maintain the
  11571. * below htt_chan_change_msg struct definition, which needs to be
  11572. * consistent with the above htt_chan_change_t struct definition
  11573. * (aside from the htt_chan_change_t definition including the msg_type
  11574. * dword within the message, and the htt_chan_change_msg only containing
  11575. * the payload of the message that follows the msg_type dword).
  11576. */
  11577. PREPACK struct htt_chan_change_msg {
  11578. A_UINT32 chan_mhz; /* frequency in mhz */
  11579. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  11580. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11581. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11582. } POSTPACK;
  11583. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  11584. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  11585. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  11586. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  11587. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  11588. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  11589. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  11590. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  11591. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  11592. do { \
  11593. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  11594. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  11595. } while (0)
  11596. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  11597. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  11598. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  11599. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  11600. do { \
  11601. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  11602. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  11603. } while (0)
  11604. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  11605. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  11606. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  11607. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  11608. do { \
  11609. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  11610. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  11611. } while (0)
  11612. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  11613. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  11614. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  11615. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  11616. do { \
  11617. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  11618. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  11619. } while (0)
  11620. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  11621. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  11622. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  11623. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  11624. /**
  11625. * @brief rx offload packet error message
  11626. *
  11627. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  11628. *
  11629. * @details
  11630. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  11631. * of target payload like mic err.
  11632. *
  11633. * |31 24|23 16|15 8|7 0|
  11634. * |----------------+----------------+----------------+----------------|
  11635. * | tid | vdev_id | msg_sub_type | msg_type |
  11636. * |-------------------------------------------------------------------|
  11637. * : (sub-type dependent content) :
  11638. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11639. * Header fields:
  11640. * - msg_type
  11641. * Bits 7:0
  11642. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  11643. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  11644. * - msg_sub_type
  11645. * Bits 15:8
  11646. * Purpose: Identifies which type of rx error is reported by this message
  11647. * value: htt_rx_ofld_pkt_err_type
  11648. * - vdev_id
  11649. * Bits 23:16
  11650. * Purpose: Identifies which vdev received the erroneous rx frame
  11651. * value:
  11652. * - tid
  11653. * Bits 31:24
  11654. * Purpose: Identifies the traffic type of the rx frame
  11655. * value:
  11656. *
  11657. * - The payload fields used if the sub-type == MIC error are shown below.
  11658. * Note - MIC err is per MSDU, while PN is per MPDU.
  11659. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  11660. * with MIC err in A-MSDU case, so FW will send only one HTT message
  11661. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  11662. * instead of sending separate HTT messages for each wrong MSDU within
  11663. * the MPDU.
  11664. *
  11665. * |31 24|23 16|15 8|7 0|
  11666. * |----------------+----------------+----------------+----------------|
  11667. * | Rsvd | key_id | peer_id |
  11668. * |-------------------------------------------------------------------|
  11669. * | receiver MAC addr 31:0 |
  11670. * |-------------------------------------------------------------------|
  11671. * | Rsvd | receiver MAC addr 47:32 |
  11672. * |-------------------------------------------------------------------|
  11673. * | transmitter MAC addr 31:0 |
  11674. * |-------------------------------------------------------------------|
  11675. * | Rsvd | transmitter MAC addr 47:32 |
  11676. * |-------------------------------------------------------------------|
  11677. * | PN 31:0 |
  11678. * |-------------------------------------------------------------------|
  11679. * | Rsvd | PN 47:32 |
  11680. * |-------------------------------------------------------------------|
  11681. * - peer_id
  11682. * Bits 15:0
  11683. * Purpose: identifies which peer is frame is from
  11684. * value:
  11685. * - key_id
  11686. * Bits 23:16
  11687. * Purpose: identifies key_id of rx frame
  11688. * value:
  11689. * - RA_31_0 (receiver MAC addr 31:0)
  11690. * Bits 31:0
  11691. * Purpose: identifies by MAC address which vdev received the frame
  11692. * value: MAC address lower 4 bytes
  11693. * - RA_47_32 (receiver MAC addr 47:32)
  11694. * Bits 15:0
  11695. * Purpose: identifies by MAC address which vdev received the frame
  11696. * value: MAC address upper 2 bytes
  11697. * - TA_31_0 (transmitter MAC addr 31:0)
  11698. * Bits 31:0
  11699. * Purpose: identifies by MAC address which peer transmitted the frame
  11700. * value: MAC address lower 4 bytes
  11701. * - TA_47_32 (transmitter MAC addr 47:32)
  11702. * Bits 15:0
  11703. * Purpose: identifies by MAC address which peer transmitted the frame
  11704. * value: MAC address upper 2 bytes
  11705. * - PN_31_0
  11706. * Bits 31:0
  11707. * Purpose: Identifies pn of rx frame
  11708. * value: PN lower 4 bytes
  11709. * - PN_47_32
  11710. * Bits 15:0
  11711. * Purpose: Identifies pn of rx frame
  11712. * value:
  11713. * TKIP or CCMP: PN upper 2 bytes
  11714. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  11715. */
  11716. enum htt_rx_ofld_pkt_err_type {
  11717. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  11718. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  11719. };
  11720. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  11721. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  11722. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  11723. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  11724. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  11725. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  11726. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  11727. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  11728. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  11729. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  11730. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  11731. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  11732. do { \
  11733. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  11734. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  11735. } while (0)
  11736. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  11737. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  11738. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  11739. do { \
  11740. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  11741. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  11742. } while (0)
  11743. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  11744. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  11745. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  11746. do { \
  11747. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  11748. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  11749. } while (0)
  11750. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  11751. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  11752. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  11753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  11754. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  11755. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  11756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  11757. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  11758. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  11759. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  11760. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  11761. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  11762. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  11763. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  11764. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  11765. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  11766. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  11767. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  11768. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  11769. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  11770. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  11771. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  11772. do { \
  11773. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  11774. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  11775. } while (0)
  11776. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  11777. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  11778. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  11779. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  11780. do { \
  11781. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  11782. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  11783. } while (0)
  11784. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  11785. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  11786. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  11787. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  11788. do { \
  11789. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  11790. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  11791. } while (0)
  11792. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  11793. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  11794. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  11795. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  11796. do { \
  11797. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  11798. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  11799. } while (0)
  11800. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  11801. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  11802. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  11803. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  11806. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  11807. } while (0)
  11808. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  11809. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  11810. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  11811. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  11814. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  11815. } while (0)
  11816. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  11817. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  11818. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  11819. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  11820. do { \
  11821. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  11822. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  11823. } while (0)
  11824. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  11825. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  11826. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  11827. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  11830. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  11831. } while (0)
  11832. /**
  11833. * @brief target -> host peer rate report message
  11834. *
  11835. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  11836. *
  11837. * @details
  11838. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  11839. * justified rate of all the peers.
  11840. *
  11841. * |31 24|23 16|15 8|7 0|
  11842. * |----------------+----------------+----------------+----------------|
  11843. * | peer_count | | msg_type |
  11844. * |-------------------------------------------------------------------|
  11845. * : Payload (variant number of peer rate report) :
  11846. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11847. * Header fields:
  11848. * - msg_type
  11849. * Bits 7:0
  11850. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  11851. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  11852. * - reserved
  11853. * Bits 15:8
  11854. * Purpose:
  11855. * value:
  11856. * - peer_count
  11857. * Bits 31:16
  11858. * Purpose: Specify how many peer rate report elements are present in the payload.
  11859. * value:
  11860. *
  11861. * Payload:
  11862. * There are variant number of peer rate report follow the first 32 bits.
  11863. * The peer rate report is defined as follows.
  11864. *
  11865. * |31 20|19 16|15 0|
  11866. * |-----------------------+---------+---------------------------------|-
  11867. * | reserved | phy | peer_id | \
  11868. * |-------------------------------------------------------------------| -> report #0
  11869. * | rate | /
  11870. * |-----------------------+---------+---------------------------------|-
  11871. * | reserved | phy | peer_id | \
  11872. * |-------------------------------------------------------------------| -> report #1
  11873. * | rate | /
  11874. * |-----------------------+---------+---------------------------------|-
  11875. * | reserved | phy | peer_id | \
  11876. * |-------------------------------------------------------------------| -> report #2
  11877. * | rate | /
  11878. * |-------------------------------------------------------------------|-
  11879. * : :
  11880. * : :
  11881. * : :
  11882. * :-------------------------------------------------------------------:
  11883. *
  11884. * - peer_id
  11885. * Bits 15:0
  11886. * Purpose: identify the peer
  11887. * value:
  11888. * - phy
  11889. * Bits 19:16
  11890. * Purpose: identify which phy is in use
  11891. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  11892. * Please see enum htt_peer_report_phy_type for detail.
  11893. * - reserved
  11894. * Bits 31:20
  11895. * Purpose:
  11896. * value:
  11897. * - rate
  11898. * Bits 31:0
  11899. * Purpose: represent the justified rate of the peer specified by peer_id
  11900. * value:
  11901. */
  11902. enum htt_peer_rate_report_phy_type {
  11903. HTT_PEER_RATE_REPORT_11B = 0,
  11904. HTT_PEER_RATE_REPORT_11A_G,
  11905. HTT_PEER_RATE_REPORT_11N,
  11906. HTT_PEER_RATE_REPORT_11AC,
  11907. };
  11908. #define HTT_PEER_RATE_REPORT_SIZE 8
  11909. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  11910. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  11911. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  11912. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  11913. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  11914. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11915. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11916. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11917. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11918. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11919. do { \
  11920. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11921. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11922. } while (0)
  11923. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11924. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11925. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11926. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11927. do { \
  11928. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11929. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11930. } while (0)
  11931. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11932. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11933. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11934. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11935. do { \
  11936. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11937. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11938. } while (0)
  11939. /**
  11940. * @brief target -> host flow pool map message
  11941. *
  11942. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11943. *
  11944. * @details
  11945. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11946. * a flow of descriptors.
  11947. *
  11948. * This message is in TLV format and indicates the parameters to be setup a
  11949. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11950. * receive descriptors from a specified pool.
  11951. *
  11952. * The message would appear as follows:
  11953. *
  11954. * |31 24|23 16|15 8|7 0|
  11955. * |----------------+----------------+----------------+----------------|
  11956. * header | reserved | num_flows | msg_type |
  11957. * |-------------------------------------------------------------------|
  11958. * | |
  11959. * : payload :
  11960. * | |
  11961. * |-------------------------------------------------------------------|
  11962. *
  11963. * The header field is one DWORD long and is interpreted as follows:
  11964. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11965. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11966. * this message
  11967. * b'16-31 - reserved: These bits are reserved for future use
  11968. *
  11969. * Payload:
  11970. * The payload would contain multiple objects of the following structure. Each
  11971. * object represents a flow.
  11972. *
  11973. * |31 24|23 16|15 8|7 0|
  11974. * |----------------+----------------+----------------+----------------|
  11975. * header | reserved | num_flows | msg_type |
  11976. * |-------------------------------------------------------------------|
  11977. * payload0| flow_type |
  11978. * |-------------------------------------------------------------------|
  11979. * | flow_id |
  11980. * |-------------------------------------------------------------------|
  11981. * | reserved0 | flow_pool_id |
  11982. * |-------------------------------------------------------------------|
  11983. * | reserved1 | flow_pool_size |
  11984. * |-------------------------------------------------------------------|
  11985. * | reserved2 |
  11986. * |-------------------------------------------------------------------|
  11987. * payload1| flow_type |
  11988. * |-------------------------------------------------------------------|
  11989. * | flow_id |
  11990. * |-------------------------------------------------------------------|
  11991. * | reserved0 | flow_pool_id |
  11992. * |-------------------------------------------------------------------|
  11993. * | reserved1 | flow_pool_size |
  11994. * |-------------------------------------------------------------------|
  11995. * | reserved2 |
  11996. * |-------------------------------------------------------------------|
  11997. * | . |
  11998. * | . |
  11999. * | . |
  12000. * |-------------------------------------------------------------------|
  12001. *
  12002. * Each payload is 5 DWORDS long and is interpreted as follows:
  12003. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12004. * this flow is associated. It can be VDEV, peer,
  12005. * or tid (AC). Based on enum htt_flow_type.
  12006. *
  12007. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12008. * object. For flow_type vdev it is set to the
  12009. * vdevid, for peer it is peerid and for tid, it is
  12010. * tid_num.
  12011. *
  12012. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12013. * in the host for this flow
  12014. * b'16:31 - reserved0: This field in reserved for the future. In case
  12015. * we have a hierarchical implementation (HCM) of
  12016. * pools, it can be used to indicate the ID of the
  12017. * parent-pool.
  12018. *
  12019. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12020. * Descriptors for this flow will be
  12021. * allocated from this pool in the host.
  12022. * b'16:31 - reserved1: This field in reserved for the future. In case
  12023. * we have a hierarchical implementation of pools,
  12024. * it can be used to indicate the max number of
  12025. * descriptors in the pool. The b'0:15 can be used
  12026. * to indicate min number of descriptors in the
  12027. * HCM scheme.
  12028. *
  12029. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12030. * we have a hierarchical implementation of pools,
  12031. * b'0:15 can be used to indicate the
  12032. * priority-based borrowing (PBB) threshold of
  12033. * the flow's pool. The b'16:31 are still left
  12034. * reserved.
  12035. */
  12036. enum htt_flow_type {
  12037. FLOW_TYPE_VDEV = 0,
  12038. /* Insert new flow types above this line */
  12039. };
  12040. PREPACK struct htt_flow_pool_map_payload_t {
  12041. A_UINT32 flow_type;
  12042. A_UINT32 flow_id;
  12043. A_UINT32 flow_pool_id:16,
  12044. reserved0:16;
  12045. A_UINT32 flow_pool_size:16,
  12046. reserved1:16;
  12047. A_UINT32 reserved2;
  12048. } POSTPACK;
  12049. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12050. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12051. (sizeof(struct htt_flow_pool_map_payload_t))
  12052. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12053. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12054. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12055. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12056. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12057. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12058. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12059. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12060. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12061. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12062. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12063. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12064. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12065. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12066. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12067. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12068. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12069. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12070. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12071. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12072. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12073. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12074. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12075. do { \
  12076. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12077. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12078. } while (0)
  12079. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12082. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12083. } while (0)
  12084. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12085. do { \
  12086. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12087. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12088. } while (0)
  12089. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12090. do { \
  12091. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12092. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12093. } while (0)
  12094. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12095. do { \
  12096. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12097. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12098. } while (0)
  12099. /**
  12100. * @brief target -> host flow pool unmap message
  12101. *
  12102. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12103. *
  12104. * @details
  12105. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12106. * down a flow of descriptors.
  12107. * This message indicates that for the flow (whose ID is provided) is wanting
  12108. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12109. * pool of descriptors from where descriptors are being allocated for this
  12110. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12111. * be unmapped by the host.
  12112. *
  12113. * The message would appear as follows:
  12114. *
  12115. * |31 24|23 16|15 8|7 0|
  12116. * |----------------+----------------+----------------+----------------|
  12117. * | reserved0 | msg_type |
  12118. * |-------------------------------------------------------------------|
  12119. * | flow_type |
  12120. * |-------------------------------------------------------------------|
  12121. * | flow_id |
  12122. * |-------------------------------------------------------------------|
  12123. * | reserved1 | flow_pool_id |
  12124. * |-------------------------------------------------------------------|
  12125. *
  12126. * The message is interpreted as follows:
  12127. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12128. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12129. * b'8:31 - reserved0: Reserved for future use
  12130. *
  12131. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12132. * this flow is associated. It can be VDEV, peer,
  12133. * or tid (AC). Based on enum htt_flow_type.
  12134. *
  12135. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12136. * object. For flow_type vdev it is set to the
  12137. * vdevid, for peer it is peerid and for tid, it is
  12138. * tid_num.
  12139. *
  12140. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12141. * used in the host for this flow
  12142. * b'16:31 - reserved0: This field in reserved for the future.
  12143. *
  12144. */
  12145. PREPACK struct htt_flow_pool_unmap_t {
  12146. A_UINT32 msg_type:8,
  12147. reserved0:24;
  12148. A_UINT32 flow_type;
  12149. A_UINT32 flow_id;
  12150. A_UINT32 flow_pool_id:16,
  12151. reserved1:16;
  12152. } POSTPACK;
  12153. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12154. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12155. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12156. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12157. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12158. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12159. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12160. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12161. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12162. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12163. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12164. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12165. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12166. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12167. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12168. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12169. do { \
  12170. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12171. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12172. } while (0)
  12173. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12174. do { \
  12175. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12176. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12177. } while (0)
  12178. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12179. do { \
  12180. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12181. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12182. } while (0)
  12183. /**
  12184. * @brief target -> host SRING setup done message
  12185. *
  12186. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12187. *
  12188. * @details
  12189. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12190. * SRNG ring setup is done
  12191. *
  12192. * This message indicates whether the last setup operation is successful.
  12193. * It will be sent to host when host set respose_required bit in
  12194. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12195. * The message would appear as follows:
  12196. *
  12197. * |31 24|23 16|15 8|7 0|
  12198. * |--------------- +----------------+----------------+----------------|
  12199. * | setup_status | ring_id | pdev_id | msg_type |
  12200. * |-------------------------------------------------------------------|
  12201. *
  12202. * The message is interpreted as follows:
  12203. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12204. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12205. * b'8:15 - pdev_id:
  12206. * 0 (for rings at SOC/UMAC level),
  12207. * 1/2/3 mac id (for rings at LMAC level)
  12208. * b'16:23 - ring_id: Identify the ring which is set up
  12209. * More details can be got from enum htt_srng_ring_id
  12210. * b'24:31 - setup_status: Indicate status of setup operation
  12211. * Refer to htt_ring_setup_status
  12212. */
  12213. PREPACK struct htt_sring_setup_done_t {
  12214. A_UINT32 msg_type: 8,
  12215. pdev_id: 8,
  12216. ring_id: 8,
  12217. setup_status: 8;
  12218. } POSTPACK;
  12219. enum htt_ring_setup_status {
  12220. htt_ring_setup_status_ok = 0,
  12221. htt_ring_setup_status_error,
  12222. };
  12223. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12224. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12225. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12226. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12227. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12228. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12229. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12230. do { \
  12231. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12232. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12233. } while (0)
  12234. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12235. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12236. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12237. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12238. HTT_SRING_SETUP_DONE_RING_ID_S)
  12239. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12240. do { \
  12241. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12242. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12243. } while (0)
  12244. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12245. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12246. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12247. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12248. HTT_SRING_SETUP_DONE_STATUS_S)
  12249. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12252. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12253. } while (0)
  12254. /**
  12255. * @brief target -> flow map flow info
  12256. *
  12257. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12258. *
  12259. * @details
  12260. * HTT TX map flow entry with tqm flow pointer
  12261. * Sent from firmware to host to add tqm flow pointer in corresponding
  12262. * flow search entry. Flow metadata is replayed back to host as part of this
  12263. * struct to enable host to find the specific flow search entry
  12264. *
  12265. * The message would appear as follows:
  12266. *
  12267. * |31 28|27 18|17 14|13 8|7 0|
  12268. * |-------+------------------------------------------+----------------|
  12269. * | rsvd0 | fse_hsh_idx | msg_type |
  12270. * |-------------------------------------------------------------------|
  12271. * | rsvd1 | tid | peer_id |
  12272. * |-------------------------------------------------------------------|
  12273. * | tqm_flow_pntr_lo |
  12274. * |-------------------------------------------------------------------|
  12275. * | tqm_flow_pntr_hi |
  12276. * |-------------------------------------------------------------------|
  12277. * | fse_meta_data |
  12278. * |-------------------------------------------------------------------|
  12279. *
  12280. * The message is interpreted as follows:
  12281. *
  12282. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12283. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12284. *
  12285. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12286. * for this flow entry
  12287. *
  12288. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12289. *
  12290. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12291. *
  12292. * dword1 - b'14:17 - tid
  12293. *
  12294. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12295. *
  12296. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12297. *
  12298. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12299. *
  12300. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12301. * given by host
  12302. */
  12303. PREPACK struct htt_tx_map_flow_info {
  12304. A_UINT32
  12305. msg_type: 8,
  12306. fse_hsh_idx: 20,
  12307. rsvd0: 4;
  12308. A_UINT32
  12309. peer_id: 14,
  12310. tid: 4,
  12311. rsvd1: 14;
  12312. A_UINT32 tqm_flow_pntr_lo;
  12313. A_UINT32 tqm_flow_pntr_hi;
  12314. struct htt_tx_flow_metadata fse_meta_data;
  12315. } POSTPACK;
  12316. /* DWORD 0 */
  12317. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12318. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12319. /* DWORD 1 */
  12320. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12321. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12322. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12323. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12324. /* DWORD 0 */
  12325. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12326. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12327. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12328. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12329. do { \
  12330. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  12331. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  12332. } while (0)
  12333. /* DWORD 1 */
  12334. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  12335. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  12336. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  12337. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  12338. do { \
  12339. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  12340. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  12341. } while (0)
  12342. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  12343. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  12344. HTT_TX_MAP_FLOW_INFO_TID_S)
  12345. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  12346. do { \
  12347. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  12348. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  12349. } while (0)
  12350. /*
  12351. * htt_dbg_ext_stats_status -
  12352. * present - The requested stats have been delivered in full.
  12353. * This indicates that either the stats information was contained
  12354. * in its entirety within this message, or else this message
  12355. * completes the delivery of the requested stats info that was
  12356. * partially delivered through earlier STATS_CONF messages.
  12357. * partial - The requested stats have been delivered in part.
  12358. * One or more subsequent STATS_CONF messages with the same
  12359. * cookie value will be sent to deliver the remainder of the
  12360. * information.
  12361. * error - The requested stats could not be delivered, for example due
  12362. * to a shortage of memory to construct a message holding the
  12363. * requested stats.
  12364. * invalid - The requested stat type is either not recognized, or the
  12365. * target is configured to not gather the stats type in question.
  12366. */
  12367. enum htt_dbg_ext_stats_status {
  12368. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  12369. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  12370. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  12371. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  12372. };
  12373. /**
  12374. * @brief target -> host ppdu stats upload
  12375. *
  12376. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  12377. *
  12378. * @details
  12379. * The following field definitions describe the format of the HTT target
  12380. * to host ppdu stats indication message.
  12381. *
  12382. *
  12383. * |31 16|15 12|11 10|9 8|7 0 |
  12384. * |----------------------------------------------------------------------|
  12385. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  12386. * |----------------------------------------------------------------------|
  12387. * | ppdu_id |
  12388. * |----------------------------------------------------------------------|
  12389. * | Timestamp in us |
  12390. * |----------------------------------------------------------------------|
  12391. * | reserved |
  12392. * |----------------------------------------------------------------------|
  12393. * | type-specific stats info |
  12394. * | (see htt_ppdu_stats.h) |
  12395. * |----------------------------------------------------------------------|
  12396. * Header fields:
  12397. * - MSG_TYPE
  12398. * Bits 7:0
  12399. * Purpose: Identifies this is a PPDU STATS indication
  12400. * message.
  12401. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  12402. * - mac_id
  12403. * Bits 9:8
  12404. * Purpose: mac_id of this ppdu_id
  12405. * Value: 0-3
  12406. * - pdev_id
  12407. * Bits 11:10
  12408. * Purpose: pdev_id of this ppdu_id
  12409. * Value: 0-3
  12410. * 0 (for rings at SOC level),
  12411. * 1/2/3 PDEV -> 0/1/2
  12412. * - payload_size
  12413. * Bits 31:16
  12414. * Purpose: total tlv size
  12415. * Value: payload_size in bytes
  12416. */
  12417. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  12418. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  12419. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  12420. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  12421. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  12422. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  12423. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  12424. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  12425. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  12426. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  12427. do { \
  12428. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  12429. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  12430. } while (0)
  12431. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  12432. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  12433. HTT_T2H_PPDU_STATS_MAC_ID_S)
  12434. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  12437. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  12438. } while (0)
  12439. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  12440. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  12441. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  12442. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  12443. do { \
  12444. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  12445. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  12446. } while (0)
  12447. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  12448. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  12449. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  12450. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  12451. do { \
  12452. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  12453. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  12454. } while (0)
  12455. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  12456. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  12457. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  12458. /* htt_t2h_ppdu_stats_ind_hdr_t
  12459. * This struct contains the fields within the header of the
  12460. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  12461. * stats info.
  12462. * This struct assumes little-endian layout, and thus is only
  12463. * suitable for use within processors known to be little-endian
  12464. * (such as the target).
  12465. * In contrast, the above macros provide endian-portable methods
  12466. * to get and set the bitfields within this PPDU_STATS_IND header.
  12467. */
  12468. typedef struct {
  12469. A_UINT32 msg_type: 8, /* bits 7:0 */
  12470. mac_id: 2, /* bits 9:8 */
  12471. pdev_id: 2, /* bits 11:10 */
  12472. reserved1: 4, /* bits 15:12 */
  12473. payload_size: 16; /* bits 31:16 */
  12474. A_UINT32 ppdu_id;
  12475. A_UINT32 timestamp_us;
  12476. A_UINT32 reserved2;
  12477. } htt_t2h_ppdu_stats_ind_hdr_t;
  12478. /**
  12479. * @brief target -> host extended statistics upload
  12480. *
  12481. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  12482. *
  12483. * @details
  12484. * The following field definitions describe the format of the HTT target
  12485. * to host stats upload confirmation message.
  12486. * The message contains a cookie echoed from the HTT host->target stats
  12487. * upload request, which identifies which request the confirmation is
  12488. * for, and a single stats can span over multiple HTT stats indication
  12489. * due to the HTT message size limitation so every HTT ext stats indication
  12490. * will have tag-length-value stats information elements.
  12491. * The tag-length header for each HTT stats IND message also includes a
  12492. * status field, to indicate whether the request for the stat type in
  12493. * question was fully met, partially met, unable to be met, or invalid
  12494. * (if the stat type in question is disabled in the target).
  12495. * A Done bit 1's indicate the end of the of stats info elements.
  12496. *
  12497. *
  12498. * |31 16|15 12|11|10 8|7 5|4 0|
  12499. * |--------------------------------------------------------------|
  12500. * | reserved | msg type |
  12501. * |--------------------------------------------------------------|
  12502. * | cookie LSBs |
  12503. * |--------------------------------------------------------------|
  12504. * | cookie MSBs |
  12505. * |--------------------------------------------------------------|
  12506. * | stats entry length | rsvd | D| S | stat type |
  12507. * |--------------------------------------------------------------|
  12508. * | type-specific stats info |
  12509. * | (see htt_stats.h) |
  12510. * |--------------------------------------------------------------|
  12511. * Header fields:
  12512. * - MSG_TYPE
  12513. * Bits 7:0
  12514. * Purpose: Identifies this is a extended statistics upload confirmation
  12515. * message.
  12516. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  12517. * - COOKIE_LSBS
  12518. * Bits 31:0
  12519. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12520. * message with its preceding host->target stats request message.
  12521. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12522. * - COOKIE_MSBS
  12523. * Bits 31:0
  12524. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12525. * message with its preceding host->target stats request message.
  12526. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12527. *
  12528. * Stats Information Element tag-length header fields:
  12529. * - STAT_TYPE
  12530. * Bits 7:0
  12531. * Purpose: identifies the type of statistics info held in the
  12532. * following information element
  12533. * Value: htt_dbg_ext_stats_type
  12534. * - STATUS
  12535. * Bits 10:8
  12536. * Purpose: indicate whether the requested stats are present
  12537. * Value: htt_dbg_ext_stats_status
  12538. * - DONE
  12539. * Bits 11
  12540. * Purpose:
  12541. * Indicates the completion of the stats entry, this will be the last
  12542. * stats conf HTT segment for the requested stats type.
  12543. * Value:
  12544. * 0 -> the stats retrieval is ongoing
  12545. * 1 -> the stats retrieval is complete
  12546. * - LENGTH
  12547. * Bits 31:16
  12548. * Purpose: indicate the stats information size
  12549. * Value: This field specifies the number of bytes of stats information
  12550. * that follows the element tag-length header.
  12551. * It is expected but not required that this length is a multiple of
  12552. * 4 bytes.
  12553. */
  12554. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  12555. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  12556. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  12557. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  12558. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  12559. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  12560. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  12561. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  12562. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  12563. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12564. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  12565. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  12566. do { \
  12567. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  12568. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  12569. } while (0)
  12570. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  12571. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  12572. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  12573. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  12574. do { \
  12575. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  12576. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  12577. } while (0)
  12578. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  12579. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  12580. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  12581. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  12582. do { \
  12583. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  12584. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  12585. } while (0)
  12586. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  12587. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  12588. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  12589. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12590. do { \
  12591. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  12592. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  12593. } while (0)
  12594. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  12595. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  12596. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  12597. typedef enum {
  12598. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  12599. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  12600. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  12601. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  12602. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  12603. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  12604. /* Reserved from 128 - 255 for target internal use.*/
  12605. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  12606. } HTT_PEER_TYPE;
  12607. /** macro to convert MAC address from char array to HTT word format */
  12608. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  12609. (phtt_mac_addr)->mac_addr31to0 = \
  12610. (((c_macaddr)[0] << 0) | \
  12611. ((c_macaddr)[1] << 8) | \
  12612. ((c_macaddr)[2] << 16) | \
  12613. ((c_macaddr)[3] << 24)); \
  12614. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  12615. } while (0)
  12616. /**
  12617. * @brief target -> host monitor mac header indication message
  12618. *
  12619. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  12620. *
  12621. * @details
  12622. * The following diagram shows the format of the monitor mac header message
  12623. * sent from the target to the host.
  12624. * This message is primarily sent when promiscuous rx mode is enabled.
  12625. * One message is sent per rx PPDU.
  12626. *
  12627. * |31 24|23 16|15 8|7 0|
  12628. * |-------------------------------------------------------------|
  12629. * | peer_id | reserved0 | msg_type |
  12630. * |-------------------------------------------------------------|
  12631. * | reserved1 | num_mpdu |
  12632. * |-------------------------------------------------------------|
  12633. * | struct hw_rx_desc |
  12634. * | (see wal_rx_desc.h) |
  12635. * |-------------------------------------------------------------|
  12636. * | struct ieee80211_frame_addr4 |
  12637. * | (see ieee80211_defs.h) |
  12638. * |-------------------------------------------------------------|
  12639. * | struct ieee80211_frame_addr4 |
  12640. * | (see ieee80211_defs.h) |
  12641. * |-------------------------------------------------------------|
  12642. * | ...... |
  12643. * |-------------------------------------------------------------|
  12644. *
  12645. * Header fields:
  12646. * - msg_type
  12647. * Bits 7:0
  12648. * Purpose: Identifies this is a monitor mac header indication message.
  12649. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  12650. * - peer_id
  12651. * Bits 31:16
  12652. * Purpose: Software peer id given by host during association,
  12653. * During promiscuous mode, the peer ID will be invalid (0xFF)
  12654. * for rx PPDUs received from unassociated peers.
  12655. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  12656. * - num_mpdu
  12657. * Bits 15:0
  12658. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  12659. * delivered within the message.
  12660. * Value: 1 to 32
  12661. * num_mpdu is limited to a maximum value of 32, due to buffer
  12662. * size limits. For PPDUs with more than 32 MPDUs, only the
  12663. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  12664. * the PPDU will be provided.
  12665. */
  12666. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  12667. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  12668. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  12669. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  12670. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  12671. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  12674. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  12675. } while (0)
  12676. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  12677. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  12678. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  12679. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  12680. do { \
  12681. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  12682. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  12683. } while (0)
  12684. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  12685. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  12686. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  12687. /**
  12688. * @brief target -> host flow pool resize Message
  12689. *
  12690. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  12691. *
  12692. * @details
  12693. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  12694. * the flow pool associated with the specified ID is resized
  12695. *
  12696. * The message would appear as follows:
  12697. *
  12698. * |31 16|15 8|7 0|
  12699. * |---------------------------------+----------------+----------------|
  12700. * | reserved0 | Msg type |
  12701. * |-------------------------------------------------------------------|
  12702. * | flow pool new size | flow pool ID |
  12703. * |-------------------------------------------------------------------|
  12704. *
  12705. * The message is interpreted as follows:
  12706. * b'0:7 - msg_type: This will be set to 0x21
  12707. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  12708. *
  12709. * b'0:15 - flow pool ID: Existing flow pool ID
  12710. *
  12711. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  12712. *
  12713. */
  12714. PREPACK struct htt_flow_pool_resize_t {
  12715. A_UINT32 msg_type:8,
  12716. reserved0:24;
  12717. A_UINT32 flow_pool_id:16,
  12718. flow_pool_new_size:16;
  12719. } POSTPACK;
  12720. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  12721. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  12722. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  12723. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  12724. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  12725. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  12726. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  12727. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  12728. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  12729. do { \
  12730. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  12731. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  12732. } while (0)
  12733. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  12734. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  12735. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  12736. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  12737. do { \
  12738. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  12739. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  12740. } while (0)
  12741. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  12742. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  12743. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  12744. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  12745. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  12746. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  12747. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  12748. /*
  12749. * The read and write indices point to the data within the host buffer.
  12750. * Because the first 4 bytes of the host buffer is used for the read index and
  12751. * the next 4 bytes for the write index, the data itself starts at offset 8.
  12752. * The read index and write index are the byte offsets from the base of the
  12753. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  12754. * Refer the ASCII text picture below.
  12755. */
  12756. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  12757. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  12758. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  12759. /*
  12760. ***************************************************************************
  12761. *
  12762. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12763. *
  12764. ***************************************************************************
  12765. *
  12766. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  12767. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  12768. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  12769. * written into the Host memory region mentioned below.
  12770. *
  12771. * Read index is updated by the Host. At any point of time, the read index will
  12772. * indicate the index that will next be read by the Host. The read index is
  12773. * in units of bytes offset from the base of the meta-data buffer.
  12774. *
  12775. * Write index is updated by the FW. At any point of time, the write index will
  12776. * indicate from where the FW can start writing any new data. The write index is
  12777. * in units of bytes offset from the base of the meta-data buffer.
  12778. *
  12779. * If the Host is not fast enough in reading the CFR data, any new capture data
  12780. * would be dropped if there is no space left to write the new captures.
  12781. *
  12782. * The last 4 bytes of the memory region will have the magic pattern
  12783. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  12784. * not overrun the host buffer.
  12785. *
  12786. * ,--------------------. read and write indices store the
  12787. * | | byte offset from the base of the
  12788. * | ,--------+--------. meta-data buffer to the next
  12789. * | | | | location within the data buffer
  12790. * | | v v that will be read / written
  12791. * ************************************************************************
  12792. * * Read * Write * * Magic *
  12793. * * index * index * CFR data1 ...... CFR data N * pattern *
  12794. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  12795. * ************************************************************************
  12796. * |<---------- data buffer ---------->|
  12797. *
  12798. * |<----------------- meta-data buffer allocated in Host ----------------|
  12799. *
  12800. * Note:
  12801. * - Considering the 4 bytes needed to store the Read index (R) and the
  12802. * Write index (W), the initial value is as follows:
  12803. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  12804. * - Buffer empty condition:
  12805. * R = W
  12806. *
  12807. * Regarding CFR data format:
  12808. * --------------------------
  12809. *
  12810. * Each CFR tone is stored in HW as 16-bits with the following format:
  12811. * {bits[15:12], bits[11:6], bits[5:0]} =
  12812. * {unsigned exponent (4 bits),
  12813. * signed mantissa_real (6 bits),
  12814. * signed mantissa_imag (6 bits)}
  12815. *
  12816. * CFR_real = mantissa_real * 2^(exponent-5)
  12817. * CFR_imag = mantissa_imag * 2^(exponent-5)
  12818. *
  12819. *
  12820. * The CFR data is written to the 16-bit unsigned output array (buff) in
  12821. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  12822. *
  12823. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  12824. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  12825. * .
  12826. * .
  12827. * .
  12828. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  12829. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  12830. */
  12831. /* Bandwidth of peer CFR captures */
  12832. typedef enum {
  12833. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  12834. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  12835. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  12836. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  12837. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  12838. HTT_PEER_CFR_CAPTURE_BW_MAX,
  12839. } HTT_PEER_CFR_CAPTURE_BW;
  12840. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  12841. * was captured
  12842. */
  12843. typedef enum {
  12844. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  12845. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  12846. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  12847. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  12848. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  12849. } HTT_PEER_CFR_CAPTURE_MODE;
  12850. typedef enum {
  12851. /* This message type is currently used for the below purpose:
  12852. *
  12853. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  12854. * wmi_peer_cfr_capture_cmd.
  12855. * If payload_present bit is set to 0 then the associated memory region
  12856. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  12857. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  12858. * message; the CFR dump will be present at the end of the message,
  12859. * after the chan_phy_mode.
  12860. */
  12861. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  12862. /* Always keep this last */
  12863. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  12864. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  12865. /**
  12866. * @brief target -> host CFR dump completion indication message definition
  12867. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  12868. *
  12869. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  12870. *
  12871. * @details
  12872. * The following diagram shows the format of the Channel Frequency Response
  12873. * (CFR) dump completion indication. This inidcation is sent to the Host when
  12874. * the channel capture of a peer is copied by Firmware into the Host memory
  12875. *
  12876. * **************************************************************************
  12877. *
  12878. * Message format when the CFR capture message type is
  12879. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12880. *
  12881. * **************************************************************************
  12882. *
  12883. * |31 16|15 |8|7 0|
  12884. * |----------------------------------------------------------------|
  12885. * header: | reserved |P| msg_type |
  12886. * word 0 | | | |
  12887. * |----------------------------------------------------------------|
  12888. * payload: | cfr_capture_msg_type |
  12889. * word 1 | |
  12890. * |----------------------------------------------------------------|
  12891. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  12892. * word 2 | | | | | | | | |
  12893. * |----------------------------------------------------------------|
  12894. * | mac_addr31to0 |
  12895. * word 3 | |
  12896. * |----------------------------------------------------------------|
  12897. * | unused / reserved | mac_addr47to32 |
  12898. * word 4 | | |
  12899. * |----------------------------------------------------------------|
  12900. * | index |
  12901. * word 5 | |
  12902. * |----------------------------------------------------------------|
  12903. * | length |
  12904. * word 6 | |
  12905. * |----------------------------------------------------------------|
  12906. * | timestamp |
  12907. * word 7 | |
  12908. * |----------------------------------------------------------------|
  12909. * | counter |
  12910. * word 8 | |
  12911. * |----------------------------------------------------------------|
  12912. * | chan_mhz |
  12913. * word 9 | |
  12914. * |----------------------------------------------------------------|
  12915. * | band_center_freq1 |
  12916. * word 10 | |
  12917. * |----------------------------------------------------------------|
  12918. * | band_center_freq2 |
  12919. * word 11 | |
  12920. * |----------------------------------------------------------------|
  12921. * | chan_phy_mode |
  12922. * word 12 | |
  12923. * |----------------------------------------------------------------|
  12924. * where,
  12925. * P - payload present bit (payload_present explained below)
  12926. * req_id - memory request id (mem_req_id explained below)
  12927. * S - status field (status explained below)
  12928. * capbw - capture bandwidth (capture_bw explained below)
  12929. * mode - mode of capture (mode explained below)
  12930. * sts - space time streams (sts_count explained below)
  12931. * chbw - channel bandwidth (channel_bw explained below)
  12932. * captype - capture type (cap_type explained below)
  12933. *
  12934. * The following field definitions describe the format of the CFR dump
  12935. * completion indication sent from the target to the host
  12936. *
  12937. * Header fields:
  12938. *
  12939. * Word 0
  12940. * - msg_type
  12941. * Bits 7:0
  12942. * Purpose: Identifies this as CFR TX completion indication
  12943. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12944. * - payload_present
  12945. * Bit 8
  12946. * Purpose: Identifies how CFR data is sent to host
  12947. * Value: 0 - If CFR Payload is written to host memory
  12948. * 1 - If CFR Payload is sent as part of HTT message
  12949. * (This is the requirement for SDIO/USB where it is
  12950. * not possible to write CFR data to host memory)
  12951. * - reserved
  12952. * Bits 31:9
  12953. * Purpose: Reserved
  12954. * Value: 0
  12955. *
  12956. * Payload fields:
  12957. *
  12958. * Word 1
  12959. * - cfr_capture_msg_type
  12960. * Bits 31:0
  12961. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12962. * to specify the format used for the remainder of the message
  12963. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12964. * (currently only MSG_TYPE_1 is defined)
  12965. *
  12966. * Word 2
  12967. * - mem_req_id
  12968. * Bits 6:0
  12969. * Purpose: Contain the mem request id of the region where the CFR capture
  12970. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12971. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12972. this value is invalid)
  12973. * - status
  12974. * Bit 7
  12975. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12976. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12977. * - capture_bw
  12978. * Bits 10:8
  12979. * Purpose: Carry the bandwidth of the CFR capture
  12980. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12981. * - mode
  12982. * Bits 13:11
  12983. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12984. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12985. * - sts_count
  12986. * Bits 16:14
  12987. * Purpose: Carry the number of space time streams
  12988. * Value: Number of space time streams
  12989. * - channel_bw
  12990. * Bits 19:17
  12991. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12992. * measurement
  12993. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12994. * - cap_type
  12995. * Bits 23:20
  12996. * Purpose: Carry the type of the capture
  12997. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12998. * - vdev_id
  12999. * Bits 31:24
  13000. * Purpose: Carry the virtual device id
  13001. * Value: vdev ID
  13002. *
  13003. * Word 3
  13004. * - mac_addr31to0
  13005. * Bits 31:0
  13006. * Purpose: Contain the bits 31:0 of the peer MAC address
  13007. * Value: Bits 31:0 of the peer MAC address
  13008. *
  13009. * Word 4
  13010. * - mac_addr47to32
  13011. * Bits 15:0
  13012. * Purpose: Contain the bits 47:32 of the peer MAC address
  13013. * Value: Bits 47:32 of the peer MAC address
  13014. *
  13015. * Word 5
  13016. * - index
  13017. * Bits 31:0
  13018. * Purpose: Contain the index at which this CFR dump was written in the Host
  13019. * allocated memory. This index is the number of bytes from the base address.
  13020. * Value: Index position
  13021. *
  13022. * Word 6
  13023. * - length
  13024. * Bits 31:0
  13025. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13026. * Value: Length of the CFR capture of the peer
  13027. *
  13028. * Word 7
  13029. * - timestamp
  13030. * Bits 31:0
  13031. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13032. * clock used for this timestamp is private to the target and not visible to
  13033. * the host i.e., Host can interpret only the relative timestamp deltas from
  13034. * one message to the next, but can't interpret the absolute timestamp from a
  13035. * single message.
  13036. * Value: Timestamp in microseconds
  13037. *
  13038. * Word 8
  13039. * - counter
  13040. * Bits 31:0
  13041. * Purpose: Carry the count of the current CFR capture from FW. This is
  13042. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13043. * in host memory)
  13044. * Value: Count of the current CFR capture
  13045. *
  13046. * Word 9
  13047. * - chan_mhz
  13048. * Bits 31:0
  13049. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13050. * Value: Primary 20 channel frequency
  13051. *
  13052. * Word 10
  13053. * - band_center_freq1
  13054. * Bits 31:0
  13055. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13056. * Value: Center frequency 1 in MHz
  13057. *
  13058. * Word 11
  13059. * - band_center_freq2
  13060. * Bits 31:0
  13061. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13062. * the VDEV
  13063. * 80plus80 mode
  13064. * Value: Center frequency 2 in MHz
  13065. *
  13066. * Word 12
  13067. * - chan_phy_mode
  13068. * Bits 31:0
  13069. * Purpose: Carry the phy mode of the channel, of the VDEV
  13070. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13071. */
  13072. PREPACK struct htt_cfr_dump_ind_type_1 {
  13073. A_UINT32 mem_req_id:7,
  13074. status:1,
  13075. capture_bw:3,
  13076. mode:3,
  13077. sts_count:3,
  13078. channel_bw:3,
  13079. cap_type:4,
  13080. vdev_id:8;
  13081. htt_mac_addr addr;
  13082. A_UINT32 index;
  13083. A_UINT32 length;
  13084. A_UINT32 timestamp;
  13085. A_UINT32 counter;
  13086. struct htt_chan_change_msg chan;
  13087. } POSTPACK;
  13088. PREPACK struct htt_cfr_dump_compl_ind {
  13089. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13090. union {
  13091. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13092. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13093. /* If there is a need to change the memory layout and its associated
  13094. * HTT indication format, a new CFR capture message type can be
  13095. * introduced and added into this union.
  13096. */
  13097. };
  13098. } POSTPACK;
  13099. /*
  13100. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13101. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13102. */
  13103. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13104. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13105. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13106. do { \
  13107. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13108. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13109. } while(0)
  13110. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13111. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13112. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13113. /*
  13114. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13115. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13116. */
  13117. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13118. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13119. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13120. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13121. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13122. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13123. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13124. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13125. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13126. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13127. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13128. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13129. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13130. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13131. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13132. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13133. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13134. do { \
  13135. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13136. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13137. } while (0)
  13138. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13139. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13140. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13141. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13142. do { \
  13143. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13144. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13145. } while (0)
  13146. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13147. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13148. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13149. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13150. do { \
  13151. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13152. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13153. } while (0)
  13154. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13155. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13156. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13157. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13158. do { \
  13159. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13160. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13161. } while (0)
  13162. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13163. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13164. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13165. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13166. do { \
  13167. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13168. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13169. } while (0)
  13170. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13171. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13172. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13173. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13174. do { \
  13175. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13176. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13177. } while (0)
  13178. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13179. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13180. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13181. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13182. do { \
  13183. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13184. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13185. } while (0)
  13186. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13187. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13188. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13189. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13190. do { \
  13191. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13192. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13193. } while (0)
  13194. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13195. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13196. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13197. /**
  13198. * @brief target -> host peer (PPDU) stats message
  13199. *
  13200. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13201. *
  13202. * @details
  13203. * This message is generated by FW when FW is sending stats to host
  13204. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13205. * This message is sent autonomously by the target rather than upon request
  13206. * by the host.
  13207. * The following field definitions describe the format of the HTT target
  13208. * to host peer stats indication message.
  13209. *
  13210. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13211. * or more PPDU stats records.
  13212. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13213. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13214. * then the message would start with the
  13215. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13216. * below.
  13217. *
  13218. * |31 16|15|14|13 11|10 9|8|7 0|
  13219. * |-------------------------------------------------------------|
  13220. * | reserved |MSG_TYPE |
  13221. * |-------------------------------------------------------------|
  13222. * rec 0 | TLV header |
  13223. * rec 0 |-------------------------------------------------------------|
  13224. * rec 0 | ppdu successful bytes |
  13225. * rec 0 |-------------------------------------------------------------|
  13226. * rec 0 | ppdu retry bytes |
  13227. * rec 0 |-------------------------------------------------------------|
  13228. * rec 0 | ppdu failed bytes |
  13229. * rec 0 |-------------------------------------------------------------|
  13230. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13231. * rec 0 |-------------------------------------------------------------|
  13232. * rec 0 | retried MSDUs | successful MSDUs |
  13233. * rec 0 |-------------------------------------------------------------|
  13234. * rec 0 | TX duration | failed MSDUs |
  13235. * rec 0 |-------------------------------------------------------------|
  13236. * ...
  13237. * |-------------------------------------------------------------|
  13238. * rec N | TLV header |
  13239. * rec N |-------------------------------------------------------------|
  13240. * rec N | ppdu successful bytes |
  13241. * rec N |-------------------------------------------------------------|
  13242. * rec N | ppdu retry bytes |
  13243. * rec N |-------------------------------------------------------------|
  13244. * rec N | ppdu failed bytes |
  13245. * rec N |-------------------------------------------------------------|
  13246. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13247. * rec N |-------------------------------------------------------------|
  13248. * rec N | retried MSDUs | successful MSDUs |
  13249. * rec N |-------------------------------------------------------------|
  13250. * rec N | TX duration | failed MSDUs |
  13251. * rec N |-------------------------------------------------------------|
  13252. *
  13253. * where:
  13254. * A = is A-MPDU flag
  13255. * BA = block-ack failure flags
  13256. * BW = bandwidth spec
  13257. * SG = SGI enabled spec
  13258. * S = skipped rate ctrl
  13259. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13260. *
  13261. * Header
  13262. * ------
  13263. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13264. * dword0 - b'8:31 - reserved : Reserved for future use
  13265. *
  13266. * payload include below peer_stats information
  13267. * --------------------------------------------
  13268. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13269. * @tx_success_bytes : total successful bytes in the PPDU.
  13270. * @tx_retry_bytes : total retried bytes in the PPDU.
  13271. * @tx_failed_bytes : total failed bytes in the PPDU.
  13272. * @tx_ratecode : rate code used for the PPDU.
  13273. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13274. * @ba_ack_failed : BA/ACK failed for this PPDU
  13275. * b00 -> BA received
  13276. * b01 -> BA failed once
  13277. * b10 -> BA failed twice, when HW retry is enabled.
  13278. * @bw : BW
  13279. * b00 -> 20 MHz
  13280. * b01 -> 40 MHz
  13281. * b10 -> 80 MHz
  13282. * b11 -> 160 MHz (or 80+80)
  13283. * @sg : SGI enabled
  13284. * @s : skipped ratectrl
  13285. * @peer_id : peer id
  13286. * @tx_success_msdus : successful MSDUs
  13287. * @tx_retry_msdus : retried MSDUs
  13288. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13289. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13290. */
  13291. /**
  13292. * @brief target -> host backpressure event
  13293. *
  13294. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13295. *
  13296. * @details
  13297. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13298. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13299. * This message will only be sent if the backpressure condition has existed
  13300. * continuously for an initial period (100 ms).
  13301. * Repeat messages with updated information will be sent after each
  13302. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13303. * This message indicates the ring id along with current head and tail index
  13304. * locations (i.e. write and read indices).
  13305. * The backpressure time indicates the time in ms for which continous
  13306. * backpressure has been observed in the ring.
  13307. *
  13308. * The message format is as follows:
  13309. *
  13310. * |31 24|23 16|15 8|7 0|
  13311. * |----------------+----------------+----------------+----------------|
  13312. * | ring_id | ring_type | pdev_id | msg_type |
  13313. * |-------------------------------------------------------------------|
  13314. * | tail_idx | head_idx |
  13315. * |-------------------------------------------------------------------|
  13316. * | backpressure_time_ms |
  13317. * |-------------------------------------------------------------------|
  13318. *
  13319. * The message is interpreted as follows:
  13320. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13321. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13322. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13323. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13324. the msg is for LMAC ring.
  13325. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13326. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13327. * htt_backpressure_lmac_ring_id. This represents
  13328. * the ring id for which continous backpressure is seen
  13329. *
  13330. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  13331. * the ring indicated by the ring_id
  13332. *
  13333. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  13334. * the ring indicated by the ring id
  13335. *
  13336. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  13337. * backpressure has been seen in the ring
  13338. * indicated by the ring_id.
  13339. * Units = milliseconds
  13340. */
  13341. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  13342. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  13343. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  13344. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  13345. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  13346. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  13347. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  13348. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  13349. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  13350. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  13351. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  13352. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  13353. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  13354. do { \
  13355. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  13356. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  13357. } while (0)
  13358. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  13359. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  13360. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  13361. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  13362. do { \
  13363. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  13364. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  13365. } while (0)
  13366. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  13367. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  13368. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  13369. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  13370. do { \
  13371. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  13372. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  13373. } while (0)
  13374. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  13375. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  13376. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  13377. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  13378. do { \
  13379. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  13380. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  13381. } while (0)
  13382. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  13383. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  13384. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  13385. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  13386. do { \
  13387. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  13388. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  13389. } while (0)
  13390. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  13391. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  13392. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  13393. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  13394. do { \
  13395. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  13396. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  13397. } while (0)
  13398. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  13399. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  13400. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  13401. enum htt_backpressure_ring_type {
  13402. HTT_SW_RING_TYPE_UMAC,
  13403. HTT_SW_RING_TYPE_LMAC,
  13404. HTT_SW_RING_TYPE_MAX,
  13405. };
  13406. /* Ring id for which the message is sent to host */
  13407. enum htt_backpressure_umac_ringid {
  13408. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  13409. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  13410. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  13411. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  13412. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  13413. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  13414. HTT_SW_RING_IDX_REO_REO2FW_RING,
  13415. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  13416. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  13417. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  13418. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  13419. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  13420. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  13421. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  13422. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  13423. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  13424. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  13425. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  13426. HTT_SW_UMAC_RING_IDX_MAX,
  13427. };
  13428. enum htt_backpressure_lmac_ringid {
  13429. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  13430. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  13431. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  13432. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  13433. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  13434. HTT_SW_RING_IDX_RXDMA2FW_RING,
  13435. HTT_SW_RING_IDX_RXDMA2SW_RING,
  13436. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  13437. HTT_SW_RING_IDX_RXDMA2REO_RING,
  13438. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  13439. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  13440. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  13441. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  13442. HTT_SW_LMAC_RING_IDX_MAX,
  13443. };
  13444. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  13445. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  13446. pdev_id: 8,
  13447. ring_type: 8, /* htt_backpressure_ring_type */
  13448. /*
  13449. * ring_id holds an enum value from either
  13450. * htt_backpressure_umac_ringid or
  13451. * htt_backpressure_lmac_ringid, based on
  13452. * the ring_type setting.
  13453. */
  13454. ring_id: 8;
  13455. A_UINT16 head_idx;
  13456. A_UINT16 tail_idx;
  13457. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  13458. } POSTPACK;
  13459. /*
  13460. * Defines two 32 bit words that can be used by the target to indicate a per
  13461. * user RU allocation and rate information.
  13462. *
  13463. * This information is currently provided in the "sw_response_reference_ptr"
  13464. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  13465. * "rx_ppdu_end_user_stats" TLV.
  13466. *
  13467. * VALID:
  13468. * The consumer of these words must explicitly check the valid bit,
  13469. * and only attempt interpretation of any of the remaining fields if
  13470. * the valid bit is set to 1.
  13471. *
  13472. * VERSION:
  13473. * The consumer of these words must also explicitly check the version bit,
  13474. * and only use the V0 definition if the VERSION field is set to 0.
  13475. *
  13476. * Version 1 is currently undefined, with the exception of the VALID and
  13477. * VERSION fields.
  13478. *
  13479. * Version 0:
  13480. *
  13481. * The fields below are duplicated per BW.
  13482. *
  13483. * The consumer must determine which BW field to use, based on the UL OFDMA
  13484. * PPDU BW indicated by HW.
  13485. *
  13486. * RU_START: RU26 start index for the user.
  13487. * Note that this is always using the RU26 index, regardless
  13488. * of the actual RU assigned to the user
  13489. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  13490. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  13491. *
  13492. * For example, 20MHz (the value in the top row is RU_START)
  13493. *
  13494. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  13495. * RU Size 1 (52): | | | | | |
  13496. * RU Size 2 (106): | | | |
  13497. * RU Size 3 (242): | |
  13498. *
  13499. * RU_SIZE: Indicates the RU size, as defined by enum
  13500. * htt_ul_ofdma_user_info_ru_size.
  13501. *
  13502. * LDPC: LDPC enabled (if 0, BCC is used)
  13503. *
  13504. * DCM: DCM enabled
  13505. *
  13506. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  13507. * |---------------------------------+--------------------------------|
  13508. * |Ver|Valid| FW internal |
  13509. * |---------------------------------+--------------------------------|
  13510. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  13511. * |---------------------------------+--------------------------------|
  13512. */
  13513. enum htt_ul_ofdma_user_info_ru_size {
  13514. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  13515. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  13516. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  13517. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  13518. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  13519. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  13520. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  13521. };
  13522. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  13523. struct htt_ul_ofdma_user_info_v0 {
  13524. A_UINT32 word0;
  13525. A_UINT32 word1;
  13526. };
  13527. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  13528. A_UINT32 w0_fw_rsvd:30; \
  13529. A_UINT32 w0_valid:1; \
  13530. A_UINT32 w0_version:1;
  13531. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  13532. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13533. };
  13534. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  13535. A_UINT32 w1_nss:3; \
  13536. A_UINT32 w1_mcs:4; \
  13537. A_UINT32 w1_ldpc:1; \
  13538. A_UINT32 w1_dcm:1; \
  13539. A_UINT32 w1_ru_start:7; \
  13540. A_UINT32 w1_ru_size:3; \
  13541. A_UINT32 w1_trig_type:4; \
  13542. A_UINT32 w1_unused:9;
  13543. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  13544. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13545. };
  13546. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  13547. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  13548. union {
  13549. A_UINT32 word0;
  13550. struct {
  13551. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13552. };
  13553. };
  13554. union {
  13555. A_UINT32 word1;
  13556. struct {
  13557. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13558. };
  13559. };
  13560. } POSTPACK;
  13561. enum HTT_UL_OFDMA_TRIG_TYPE {
  13562. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  13563. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  13564. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  13565. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  13566. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  13567. };
  13568. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  13569. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  13570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  13571. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  13572. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  13573. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  13574. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  13575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  13576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  13577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  13578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  13579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  13580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  13581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  13582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  13583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  13584. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  13585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  13586. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  13587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  13588. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  13589. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  13590. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  13591. /*--- word 0 ---*/
  13592. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  13593. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  13594. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  13595. do { \
  13596. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  13597. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  13598. } while (0)
  13599. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  13600. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  13601. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  13602. do { \
  13603. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  13604. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  13605. } while (0)
  13606. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  13607. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  13608. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  13609. do { \
  13610. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  13611. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  13612. } while (0)
  13613. /*--- word 1 ---*/
  13614. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  13615. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  13616. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  13617. do { \
  13618. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  13619. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  13620. } while (0)
  13621. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  13622. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  13623. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  13624. do { \
  13625. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  13626. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  13627. } while (0)
  13628. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  13629. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  13630. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  13631. do { \
  13632. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  13633. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  13634. } while (0)
  13635. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  13636. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  13637. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  13638. do { \
  13639. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  13640. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  13641. } while (0)
  13642. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  13643. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  13644. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  13645. do { \
  13646. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  13647. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  13648. } while (0)
  13649. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  13650. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  13651. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  13652. do { \
  13653. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  13654. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  13655. } while (0)
  13656. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  13657. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  13658. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  13659. do { \
  13660. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  13661. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  13662. } while (0)
  13663. /**
  13664. * @brief target -> host channel calibration data message
  13665. *
  13666. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  13667. *
  13668. * @brief host -> target channel calibration data message
  13669. *
  13670. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  13671. *
  13672. * @details
  13673. * The following field definitions describe the format of the channel
  13674. * calibration data message sent from the target to the host when
  13675. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  13676. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  13677. * The message is defined as htt_chan_caldata_msg followed by a variable
  13678. * number of 32-bit character values.
  13679. *
  13680. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  13681. * |------------------------------------------------------------------|
  13682. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  13683. * |------------------------------------------------------------------|
  13684. * | payload size | mhz |
  13685. * |------------------------------------------------------------------|
  13686. * | center frequency 2 | center frequency 1 |
  13687. * |------------------------------------------------------------------|
  13688. * | check sum |
  13689. * |------------------------------------------------------------------|
  13690. * | payload |
  13691. * |------------------------------------------------------------------|
  13692. * message info field:
  13693. * - MSG_TYPE
  13694. * Bits 7:0
  13695. * Purpose: identifies this as a channel calibration data message
  13696. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  13697. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  13698. * - SUB_TYPE
  13699. * Bits 11:8
  13700. * Purpose: T2H: indicates whether target is providing chan cal data
  13701. * to the host to store, or requesting that the host
  13702. * download previously-stored data.
  13703. * H2T: indicates whether the host is providing the requested
  13704. * channel cal data, or if it is rejecting the data
  13705. * request because it does not have the requested data.
  13706. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  13707. * - CHKSUM_VALID
  13708. * Bit 12
  13709. * Purpose: indicates if the checksum field is valid
  13710. * value:
  13711. * - FRAG
  13712. * Bit 19:16
  13713. * Purpose: indicates the fragment index for message
  13714. * value: 0 for first fragment, 1 for second fragment, ...
  13715. * - APPEND
  13716. * Bit 20
  13717. * Purpose: indicates if this is the last fragment
  13718. * value: 0 = final fragment, 1 = more fragments will be appended
  13719. *
  13720. * channel and payload size field
  13721. * - MHZ
  13722. * Bits 15:0
  13723. * Purpose: indicates the channel primary frequency
  13724. * Value:
  13725. * - PAYLOAD_SIZE
  13726. * Bits 31:16
  13727. * Purpose: indicates the bytes of calibration data in payload
  13728. * Value:
  13729. *
  13730. * center frequency field
  13731. * - CENTER FREQUENCY 1
  13732. * Bits 15:0
  13733. * Purpose: indicates the channel center frequency
  13734. * Value: channel center frequency, in MHz units
  13735. * - CENTER FREQUENCY 2
  13736. * Bits 31:16
  13737. * Purpose: indicates the secondary channel center frequency,
  13738. * only for 11acvht 80plus80 mode
  13739. * Value: secondary channel center frequeny, in MHz units, if applicable
  13740. *
  13741. * checksum field
  13742. * - CHECK_SUM
  13743. * Bits 31:0
  13744. * Purpose: check the payload data, it is just for this fragment.
  13745. * This is intended for the target to check that the channel
  13746. * calibration data returned by the host is the unmodified data
  13747. * that was previously provided to the host by the target.
  13748. * value: checksum of fragment payload
  13749. */
  13750. PREPACK struct htt_chan_caldata_msg {
  13751. /* DWORD 0: message info */
  13752. A_UINT32
  13753. msg_type: 8,
  13754. sub_type: 4 ,
  13755. chksum_valid: 1, /** 1:valid, 0:invalid */
  13756. reserved1: 3,
  13757. frag_idx: 4, /** fragment index for calibration data */
  13758. appending: 1, /** 0: no fragment appending,
  13759. * 1: extra fragment appending */
  13760. reserved2: 11;
  13761. /* DWORD 1: channel and payload size */
  13762. A_UINT32
  13763. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  13764. payload_size: 16; /** unit: bytes */
  13765. /* DWORD 2: center frequency */
  13766. A_UINT32
  13767. band_center_freq1: 16, /** Center frequency 1 in MHz */
  13768. band_center_freq2: 16; /** Center frequency 2 in MHz,
  13769. * valid only for 11acvht 80plus80 mode */
  13770. /* DWORD 3: check sum */
  13771. A_UINT32 chksum;
  13772. /* variable length for calibration data */
  13773. A_UINT32 payload[1/* or more */];
  13774. } POSTPACK;
  13775. /* T2H SUBTYPE */
  13776. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  13777. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  13778. /* H2T SUBTYPE */
  13779. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  13780. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  13781. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  13782. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  13783. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  13784. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  13785. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  13786. do { \
  13787. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  13788. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  13789. } while (0)
  13790. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  13791. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  13792. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  13793. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  13794. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  13795. do { \
  13796. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  13797. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  13798. } while (0)
  13799. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  13800. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  13801. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  13802. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  13803. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  13804. do { \
  13805. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  13806. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  13807. } while (0)
  13808. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  13809. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  13810. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  13811. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  13812. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  13813. do { \
  13814. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  13815. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  13816. } while (0)
  13817. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  13818. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  13819. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  13820. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  13821. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  13822. do { \
  13823. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  13824. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  13825. } while (0)
  13826. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  13827. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  13828. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  13829. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  13830. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  13831. do { \
  13832. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  13833. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  13834. } while (0)
  13835. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  13836. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  13837. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  13838. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  13839. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  13840. do { \
  13841. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  13842. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  13843. } while (0)
  13844. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  13845. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  13846. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  13847. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  13848. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  13849. do { \
  13850. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  13851. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  13852. } while (0)
  13853. /**
  13854. * @brief target -> host FSE CMEM based send
  13855. *
  13856. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  13857. *
  13858. * @details
  13859. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  13860. * FSE placement in CMEM is enabled.
  13861. *
  13862. * This message sends the non-secure CMEM base address.
  13863. * It will be sent to host in response to message
  13864. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  13865. * The message would appear as follows:
  13866. *
  13867. * |31 24|23 16|15 8|7 0|
  13868. * |----------------+----------------+----------------+----------------|
  13869. * | reserved | num_entries | msg_type |
  13870. * |----------------+----------------+----------------+----------------|
  13871. * | base_address_lo |
  13872. * |----------------+----------------+----------------+----------------|
  13873. * | base_address_hi |
  13874. * |-------------------------------------------------------------------|
  13875. *
  13876. * The message is interpreted as follows:
  13877. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  13878. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  13879. * b'8:15 - number_entries: Indicated the number of entries
  13880. * programmed.
  13881. * b'16:31 - reserved.
  13882. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  13883. * CMEM base address
  13884. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  13885. * CMEM base address
  13886. */
  13887. PREPACK struct htt_cmem_base_send_t {
  13888. A_UINT32 msg_type: 8,
  13889. num_entries: 8,
  13890. reserved: 16;
  13891. A_UINT32 base_address_lo;
  13892. A_UINT32 base_address_hi;
  13893. } POSTPACK;
  13894. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  13895. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  13896. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  13897. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  13898. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  13899. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  13900. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  13901. do { \
  13902. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  13903. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13904. } while (0)
  13905. /**
  13906. * @brief - HTT PPDU ID format
  13907. *
  13908. * @details
  13909. * The following field definitions describe the format of the PPDU ID.
  13910. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  13911. *
  13912. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  13913. * +--------------------------------------------------------------------------
  13914. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13915. * +--------------------------------------------------------------------------
  13916. *
  13917. * sch id :Schedule command id
  13918. * Bits [11 : 0] : monotonically increasing counter to track the
  13919. * PPDU posted to a specific transmit queue.
  13920. *
  13921. * hwq_id: Hardware Queue ID.
  13922. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13923. *
  13924. * mac_id: MAC ID
  13925. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13926. *
  13927. * seq_idx: Sequence index.
  13928. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13929. * a particular TXOP.
  13930. *
  13931. * tqm_cmd: HWSCH/TQM flag.
  13932. * Bit [23] : Always set to 0.
  13933. *
  13934. * seq_cmd_type: Sequence command type.
  13935. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13936. * Refer to enum HTT_STATS_FTYPE for values.
  13937. */
  13938. PREPACK struct htt_ppdu_id {
  13939. A_UINT32
  13940. sch_id: 12,
  13941. hwq_id: 5,
  13942. mac_id: 2,
  13943. seq_idx: 2,
  13944. reserved1: 2,
  13945. tqm_cmd: 1,
  13946. seq_cmd_type: 6,
  13947. reserved2: 2;
  13948. } POSTPACK;
  13949. #define HTT_PPDU_ID_SCH_ID_S 0
  13950. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13951. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13952. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13953. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13954. do { \
  13955. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13956. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13957. } while (0)
  13958. #define HTT_PPDU_ID_HWQ_ID_S 12
  13959. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13960. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13961. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13962. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13963. do { \
  13964. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13965. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13966. } while (0)
  13967. #define HTT_PPDU_ID_MAC_ID_S 17
  13968. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13969. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13970. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13971. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13972. do { \
  13973. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13974. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13975. } while (0)
  13976. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13977. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13978. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13979. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13980. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13981. do { \
  13982. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13983. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13984. } while (0)
  13985. #define HTT_PPDU_ID_TQM_CMD_S 23
  13986. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13987. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13988. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13989. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13990. do { \
  13991. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13992. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13993. } while (0)
  13994. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13995. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13996. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13997. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13998. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13999. do { \
  14000. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14001. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14002. } while (0)
  14003. /**
  14004. * @brief target -> RX PEER METADATA V0 format
  14005. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14006. * message from target, and will confirm to the target which peer metadata
  14007. * version to use in the wmi_init message.
  14008. *
  14009. * The following diagram shows the format of the RX PEER METADATA.
  14010. *
  14011. * |31 24|23 16|15 8|7 0|
  14012. * |-----------------------------------------------------------------------|
  14013. * | Reserved | VDEV ID | PEER ID |
  14014. * |-----------------------------------------------------------------------|
  14015. */
  14016. PREPACK struct htt_rx_peer_metadata_v0 {
  14017. A_UINT32
  14018. peer_id: 16,
  14019. vdev_id: 8,
  14020. reserved1: 8;
  14021. } POSTPACK;
  14022. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14023. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14024. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14025. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14026. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14027. do { \
  14028. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14029. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14030. } while (0)
  14031. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14032. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14033. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14034. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14035. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14036. do { \
  14037. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14038. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14039. } while (0)
  14040. /**
  14041. * @brief target -> RX PEER METADATA V1 format
  14042. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14043. * message from target, and will confirm to the target which peer metadata
  14044. * version to use in the wmi_init message.
  14045. *
  14046. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14047. *
  14048. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14049. * |-----------------------------------------------------------------------|
  14050. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14051. * |-----------------------------------------------------------------------|
  14052. */
  14053. PREPACK struct htt_rx_peer_metadata_v1 {
  14054. A_UINT32
  14055. peer_id: 13,
  14056. ml_peer_valid: 1,
  14057. reserved1: 2,
  14058. vdev_id: 8,
  14059. lmac_id: 2,
  14060. chip_id: 3,
  14061. reserved2: 3;
  14062. } POSTPACK;
  14063. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14064. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14065. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14066. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14067. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14068. do { \
  14069. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14070. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14071. } while (0)
  14072. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14073. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14074. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14075. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14076. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14077. do { \
  14078. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14079. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14080. } while (0)
  14081. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14082. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14083. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14084. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14085. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14086. do { \
  14087. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14088. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14089. } while (0)
  14090. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14091. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14092. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14093. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14094. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14095. do { \
  14096. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14097. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14098. } while (0)
  14099. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14100. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14101. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14102. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14103. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14104. do { \
  14105. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14106. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14107. } while (0)
  14108. /*
  14109. * In some systems, the host SW wants to specify priorities between
  14110. * different MSDU / flow queues within the same peer-TID.
  14111. * The below enums are used for the host to identify to the target
  14112. * which MSDU queue's priority it wants to adjust.
  14113. */
  14114. /*
  14115. * The MSDUQ index describe index of TCL HW, where each index is
  14116. * used for queuing particular types of MSDUs.
  14117. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14118. */
  14119. enum HTT_MSDUQ_INDEX {
  14120. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14121. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14122. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14123. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14124. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14125. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14126. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14127. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14128. HTT_MSDUQ_MAX_INDEX,
  14129. };
  14130. /* MSDU qtype definition */
  14131. enum HTT_MSDU_QTYPE {
  14132. /*
  14133. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14134. * relative priority. Instead, the relative priority of CRIT_0 versus
  14135. * CRIT_1 is controlled by the FW, through the configuration parameters
  14136. * it applies to the queues.
  14137. */
  14138. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14139. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14140. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14141. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14142. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14143. /* New MSDU_QTYPE should be added above this line */
  14144. /*
  14145. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14146. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14147. * any host/target message definitions. The QTYPE_MAX value can
  14148. * only be used internally within the host or within the target.
  14149. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14150. * it must regard the unexpected value as a default qtype value,
  14151. * or ignore it.
  14152. */
  14153. HTT_MSDU_QTYPE_MAX,
  14154. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14155. };
  14156. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14157. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14158. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14159. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14160. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14161. };
  14162. /**
  14163. * @brief target -> host mlo timestamp offset indication
  14164. *
  14165. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14166. *
  14167. * @details
  14168. * The following field definitions describe the format of the HTT target
  14169. * to host mlo timestamp offset indication message.
  14170. *
  14171. *
  14172. * |31 16|15 12|11 10|9 8|7 0 |
  14173. * |----------------------------------------------------------------------|
  14174. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14175. * |----------------------------------------------------------------------|
  14176. * | Sync time stamp lo in us |
  14177. * |----------------------------------------------------------------------|
  14178. * | Sync time stamp hi in us |
  14179. * |----------------------------------------------------------------------|
  14180. * | mlo time stamp offset lo in us |
  14181. * |----------------------------------------------------------------------|
  14182. * | mlo time stamp offset hi in us |
  14183. * |----------------------------------------------------------------------|
  14184. * | mlo time stamp offset clocks in clock ticks |
  14185. * |----------------------------------------------------------------------|
  14186. * |31 26|25 16|15 0 |
  14187. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14188. * | | compensation in clks | |
  14189. * |----------------------------------------------------------------------|
  14190. * |31 22|21 0 |
  14191. * | rsvd 3 | mlo time stamp comp timer period |
  14192. * |----------------------------------------------------------------------|
  14193. * The message is interpreted as follows:
  14194. *
  14195. * dword0 - b'0:7 - msg_type: This will be set to
  14196. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14197. * value: 0x28
  14198. *
  14199. * dword0 - b'9:8 - pdev_id
  14200. *
  14201. * dword0 - b'11:10 - chip_id
  14202. *
  14203. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14204. *
  14205. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14206. *
  14207. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14208. * which last sync interrupt was received
  14209. *
  14210. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14211. * which last sync interrupt was received
  14212. *
  14213. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14214. *
  14215. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14216. *
  14217. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14218. *
  14219. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14220. *
  14221. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14222. * for sub us resolution
  14223. *
  14224. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14225. *
  14226. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14227. * is applied, in us
  14228. *
  14229. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14230. */
  14231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14242. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14243. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14244. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14246. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14247. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14248. do { \
  14249. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14250. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14251. } while (0)
  14252. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14253. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14254. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14255. do { \
  14256. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14257. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14258. } while (0)
  14259. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14260. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14261. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14262. do { \
  14263. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14264. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14265. } while (0)
  14266. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14267. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14268. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14269. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14270. do { \
  14271. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14272. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14273. } while (0)
  14274. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14275. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14276. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14277. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14278. do { \
  14279. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14280. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14281. } while (0)
  14282. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14283. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14284. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14285. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14288. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14289. } while (0)
  14290. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14291. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14292. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14293. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14294. do { \
  14295. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14296. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14297. } while (0)
  14298. typedef struct {
  14299. A_UINT32 msg_type: 8, /* bits 7:0 */
  14300. pdev_id: 2, /* bits 9:8 */
  14301. chip_id: 2, /* bits 11:10 */
  14302. reserved1: 4, /* bits 15:12 */
  14303. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14304. A_UINT32 sync_timestamp_lo_us;
  14305. A_UINT32 sync_timestamp_hi_us;
  14306. A_UINT32 mlo_timestamp_offset_lo_us;
  14307. A_UINT32 mlo_timestamp_offset_hi_us;
  14308. A_UINT32 mlo_timestamp_offset_clks;
  14309. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14310. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14311. reserved2: 6; /* bits 31:26 */
  14312. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14313. reserved3: 10; /* bits 31:22 */
  14314. } htt_t2h_mlo_offset_ind_t;
  14315. /*
  14316. * @brief target -> host VDEV TX RX STATS
  14317. *
  14318. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14319. *
  14320. * @details
  14321. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14322. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  14323. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  14324. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  14325. * periodically by target even in the absence of any further HTT request
  14326. * messages from host.
  14327. *
  14328. * The message is formatted as follows:
  14329. *
  14330. * |31 16|15 8|7 0|
  14331. * |---------------------------------+----------------+----------------|
  14332. * | payload_size | pdev_id | msg_type |
  14333. * |---------------------------------+----------------+----------------|
  14334. * | reserved0 |
  14335. * |-------------------------------------------------------------------|
  14336. * | reserved1 |
  14337. * |-------------------------------------------------------------------|
  14338. * | reserved2 |
  14339. * |-------------------------------------------------------------------|
  14340. * | |
  14341. * | VDEV specific Tx Rx stats info |
  14342. * | |
  14343. * |-------------------------------------------------------------------|
  14344. *
  14345. * The message is interpreted as follows:
  14346. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  14347. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  14348. * b'8:15 - pdev_id
  14349. * b'16:31 - size in bytes of the payload that follows the 16-byte
  14350. * message header fields (msg_type through reserved2)
  14351. * dword1 - b'0:31 - reserved0.
  14352. * dword2 - b'0:31 - reserved1.
  14353. * dword3 - b'0:31 - reserved2.
  14354. */
  14355. typedef struct {
  14356. A_UINT32 msg_type: 8,
  14357. pdev_id: 8,
  14358. payload_size: 16;
  14359. A_UINT32 reserved0;
  14360. A_UINT32 reserved1;
  14361. A_UINT32 reserved2;
  14362. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  14363. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  14364. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  14365. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  14366. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  14367. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  14368. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  14369. do { \
  14370. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  14371. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  14372. } while (0)
  14373. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  14374. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  14375. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  14376. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  14377. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  14378. do { \
  14379. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  14380. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  14381. } while (0)
  14382. /* SOC related stats */
  14383. typedef struct {
  14384. htt_tlv_hdr_t tlv_hdr;
  14385. /* When TQM is not able to find the peers during Tx, then it drops the packets
  14386. * This can be due to either the peer is deleted or deletion is ongoing
  14387. * */
  14388. A_UINT32 inv_peers_msdu_drop_count_lo;
  14389. A_UINT32 inv_peers_msdu_drop_count_hi;
  14390. } htt_t2h_soc_txrx_stats_common_tlv;
  14391. /* VDEV HW Tx/Rx stats */
  14392. typedef struct {
  14393. htt_tlv_hdr_t tlv_hdr;
  14394. A_UINT32 vdev_id;
  14395. /* Rx msdu byte cnt */
  14396. A_UINT32 rx_msdu_byte_cnt_lo;
  14397. A_UINT32 rx_msdu_byte_cnt_hi;
  14398. /* Rx msdu cnt */
  14399. A_UINT32 rx_msdu_cnt_lo;
  14400. A_UINT32 rx_msdu_cnt_hi;
  14401. /* tx msdu byte cnt */
  14402. A_UINT32 tx_msdu_byte_cnt_lo;
  14403. A_UINT32 tx_msdu_byte_cnt_hi;
  14404. /* tx msdu cnt */
  14405. A_UINT32 tx_msdu_cnt_lo;
  14406. A_UINT32 tx_msdu_cnt_hi;
  14407. /* tx excessive retry discarded msdu cnt*/
  14408. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  14409. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  14410. /* TX congestion ctrl msdu drop cnt */
  14411. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  14412. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  14413. /* discarded tx msdus cnt coz of time to live expiry */
  14414. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  14415. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  14416. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  14417. #endif