htt.h 719 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865
  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_MAX_TAG,
  627. } htt_tlv_tag_t;
  628. #define HTT_STATS_TLV_TAG_M 0x00000fff
  629. #define HTT_STATS_TLV_TAG_S 0
  630. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  631. #define HTT_STATS_TLV_LENGTH_S 12
  632. #define HTT_STATS_TLV_TAG_GET(_var) \
  633. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  634. HTT_STATS_TLV_TAG_S)
  635. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  636. do { \
  637. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  638. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  639. } while (0)
  640. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  641. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  642. HTT_STATS_TLV_LENGTH_S)
  643. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  644. do { \
  645. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  646. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  647. } while (0)
  648. /*=== host -> target messages ===============================================*/
  649. enum htt_h2t_msg_type {
  650. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  651. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  652. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  653. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  654. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  655. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  656. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  657. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  658. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  659. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  660. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  661. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  662. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  663. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  664. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  665. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  666. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  667. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  668. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  669. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  670. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  671. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  672. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  673. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  674. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  675. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  676. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  677. /* keep this last */
  678. HTT_H2T_NUM_MSGS
  679. };
  680. /*
  681. * HTT host to target message type -
  682. * stored in bits 7:0 of the first word of the message
  683. */
  684. #define HTT_H2T_MSG_TYPE_M 0xff
  685. #define HTT_H2T_MSG_TYPE_S 0
  686. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  687. do { \
  688. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  689. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  690. } while (0)
  691. #define HTT_H2T_MSG_TYPE_GET(word) \
  692. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  693. /**
  694. * @brief host -> target version number request message definition
  695. *
  696. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  697. *
  698. *
  699. * |31 24|23 16|15 8|7 0|
  700. * |----------------+----------------+----------------+----------------|
  701. * | reserved | msg type |
  702. * |-------------------------------------------------------------------|
  703. * : option request TLV (optional) |
  704. * :...................................................................:
  705. *
  706. * The VER_REQ message may consist of a single 4-byte word, or may be
  707. * extended with TLVs that specify which HTT options the host is requesting
  708. * from the target.
  709. * The following option TLVs may be appended to the VER_REQ message:
  710. * - HL_SUPPRESS_TX_COMPL_IND
  711. * - HL_MAX_TX_QUEUE_GROUPS
  712. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  713. * may be appended to the VER_REQ message (but only one TLV of each type).
  714. *
  715. * Header fields:
  716. * - MSG_TYPE
  717. * Bits 7:0
  718. * Purpose: identifies this as a version number request message
  719. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  720. */
  721. #define HTT_VER_REQ_BYTES 4
  722. /* TBDXXX: figure out a reasonable number */
  723. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  724. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  725. /**
  726. * @brief HTT tx MSDU descriptor
  727. *
  728. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  729. *
  730. * @details
  731. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  732. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  733. * the target firmware needs for the FW's tx processing, particularly
  734. * for creating the HW msdu descriptor.
  735. * The same HTT tx descriptor is used for HL and LL systems, though
  736. * a few fields within the tx descriptor are used only by LL or
  737. * only by HL.
  738. * The HTT tx descriptor is defined in two manners: by a struct with
  739. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  740. * definitions.
  741. * The target should use the struct def, for simplicitly and clarity,
  742. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  743. * neutral. Specifically, the host shall use the get/set macros built
  744. * around the mask + shift defs.
  745. */
  746. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  747. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  748. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  749. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  750. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  751. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  752. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  753. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  754. #define HTT_TX_VDEV_ID_WORD 0
  755. #define HTT_TX_VDEV_ID_MASK 0x3f
  756. #define HTT_TX_VDEV_ID_SHIFT 16
  757. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  758. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  759. #define HTT_TX_MSDU_LEN_DWORD 1
  760. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  761. /*
  762. * HTT_VAR_PADDR macros
  763. * Allow physical / bus addresses to be either a single 32-bit value,
  764. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  765. */
  766. #define HTT_VAR_PADDR32(var_name) \
  767. A_UINT32 var_name
  768. #define HTT_VAR_PADDR64_LE(var_name) \
  769. struct { \
  770. /* little-endian: lo precedes hi */ \
  771. A_UINT32 lo; \
  772. A_UINT32 hi; \
  773. } var_name
  774. /*
  775. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  776. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  777. * addresses are stored in a XXX-bit field.
  778. * This macro is used to define both htt_tx_msdu_desc32_t and
  779. * htt_tx_msdu_desc64_t structs.
  780. */
  781. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  782. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  783. { \
  784. /* DWORD 0: flags and meta-data */ \
  785. A_UINT32 \
  786. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  787. \
  788. /* pkt_subtype - \
  789. * Detailed specification of the tx frame contents, extending the \
  790. * general specification provided by pkt_type. \
  791. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  792. * pkt_type | pkt_subtype \
  793. * ============================================================== \
  794. * 802.3 | bit 0:3 - Reserved \
  795. * | bit 4: 0x0 - Copy-Engine Classification Results \
  796. * | not appended to the HTT message \
  797. * | 0x1 - Copy-Engine Classification Results \
  798. * | appended to the HTT message in the \
  799. * | format: \
  800. * | [HTT tx desc, frame header, \
  801. * | CE classification results] \
  802. * | The CE classification results begin \
  803. * | at the next 4-byte boundary after \
  804. * | the frame header. \
  805. * ------------+------------------------------------------------- \
  806. * Eth2 | bit 0:3 - Reserved \
  807. * | bit 4: 0x0 - Copy-Engine Classification Results \
  808. * | not appended to the HTT message \
  809. * | 0x1 - Copy-Engine Classification Results \
  810. * | appended to the HTT message. \
  811. * | See the above specification of the \
  812. * | CE classification results location. \
  813. * ------------+------------------------------------------------- \
  814. * native WiFi | bit 0:3 - Reserved \
  815. * | bit 4: 0x0 - Copy-Engine Classification Results \
  816. * | not appended to the HTT message \
  817. * | 0x1 - Copy-Engine Classification Results \
  818. * | appended to the HTT message. \
  819. * | See the above specification of the \
  820. * | CE classification results location. \
  821. * ------------+------------------------------------------------- \
  822. * mgmt | 0x0 - 802.11 MAC header absent \
  823. * | 0x1 - 802.11 MAC header present \
  824. * ------------+------------------------------------------------- \
  825. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  826. * | 0x1 - 802.11 MAC header present \
  827. * | bit 1: 0x0 - allow aggregation \
  828. * | 0x1 - don't allow aggregation \
  829. * | bit 2: 0x0 - perform encryption \
  830. * | 0x1 - don't perform encryption \
  831. * | bit 3: 0x0 - perform tx classification / queuing \
  832. * | 0x1 - don't perform tx classification; \
  833. * | insert the frame into the "misc" \
  834. * | tx queue \
  835. * | bit 4: 0x0 - Copy-Engine Classification Results \
  836. * | not appended to the HTT message \
  837. * | 0x1 - Copy-Engine Classification Results \
  838. * | appended to the HTT message. \
  839. * | See the above specification of the \
  840. * | CE classification results location. \
  841. */ \
  842. pkt_subtype: 5, \
  843. \
  844. /* pkt_type - \
  845. * General specification of the tx frame contents. \
  846. * The htt_pkt_type enum should be used to specify and check the \
  847. * value of this field. \
  848. */ \
  849. pkt_type: 3, \
  850. \
  851. /* vdev_id - \
  852. * ID for the vdev that is sending this tx frame. \
  853. * For certain non-standard packet types, e.g. pkt_type == raw \
  854. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  855. * This field is used primarily for determining where to queue \
  856. * broadcast and multicast frames. \
  857. */ \
  858. vdev_id: 6, \
  859. /* ext_tid - \
  860. * The extended traffic ID. \
  861. * If the TID is unknown, the extended TID is set to \
  862. * HTT_TX_EXT_TID_INVALID. \
  863. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  864. * value of the QoS TID. \
  865. * If the tx frame is non-QoS data, then the extended TID is set to \
  866. * HTT_TX_EXT_TID_NON_QOS. \
  867. * If the tx frame is multicast or broadcast, then the extended TID \
  868. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  869. */ \
  870. ext_tid: 5, \
  871. \
  872. /* postponed - \
  873. * This flag indicates whether the tx frame has been downloaded to \
  874. * the target before but discarded by the target, and now is being \
  875. * downloaded again; or if this is a new frame that is being \
  876. * downloaded for the first time. \
  877. * This flag allows the target to determine the correct order for \
  878. * transmitting new vs. old frames. \
  879. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  880. * This flag only applies to HL systems, since in LL systems, \
  881. * the tx flow control is handled entirely within the target. \
  882. */ \
  883. postponed: 1, \
  884. \
  885. /* extension - \
  886. * This flag indicates whether a HTT tx MSDU extension descriptor \
  887. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  888. * \
  889. * 0x0 - no extension MSDU descriptor is present \
  890. * 0x1 - an extension MSDU descriptor immediately follows the \
  891. * regular MSDU descriptor \
  892. */ \
  893. extension: 1, \
  894. \
  895. /* cksum_offload - \
  896. * This flag indicates whether checksum offload is enabled or not \
  897. * for this frame. Target FW use this flag to turn on HW checksumming \
  898. * 0x0 - No checksum offload \
  899. * 0x1 - L3 header checksum only \
  900. * 0x2 - L4 checksum only \
  901. * 0x3 - L3 header checksum + L4 checksum \
  902. */ \
  903. cksum_offload: 2, \
  904. \
  905. /* tx_comp_req - \
  906. * This flag indicates whether Tx Completion \
  907. * from fw is required or not. \
  908. * This flag is only relevant if tx completion is not \
  909. * universally enabled. \
  910. * For all LL systems, tx completion is mandatory, \
  911. * so this flag will be irrelevant. \
  912. * For HL systems tx completion is optional, but HL systems in which \
  913. * the bus throughput exceeds the WLAN throughput will \
  914. * probably want to always use tx completion, and thus \
  915. * would not check this flag. \
  916. * This flag is required when tx completions are not used universally, \
  917. * but are still required for certain tx frames for which \
  918. * an OTA delivery acknowledgment is needed by the host. \
  919. * In practice, this would be for HL systems in which the \
  920. * bus throughput is less than the WLAN throughput. \
  921. * \
  922. * 0x0 - Tx Completion Indication from Fw not required \
  923. * 0x1 - Tx Completion Indication from Fw is required \
  924. */ \
  925. tx_compl_req: 1; \
  926. \
  927. \
  928. /* DWORD 1: MSDU length and ID */ \
  929. A_UINT32 \
  930. len: 16, /* MSDU length, in bytes */ \
  931. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  932. * and this id is used to calculate fragmentation \
  933. * descriptor pointer inside the target based on \
  934. * the base address, configured inside the target. \
  935. */ \
  936. \
  937. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  938. /* frags_desc_ptr - \
  939. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  940. * where the tx frame's fragments reside in memory. \
  941. * This field only applies to LL systems, since in HL systems the \
  942. * (degenerate single-fragment) fragmentation descriptor is created \
  943. * within the target. \
  944. */ \
  945. _paddr__frags_desc_ptr_; \
  946. \
  947. /* DWORD 3 (or 4): peerid, chanfreq */ \
  948. /* \
  949. * Peer ID : Target can use this value to know which peer-id packet \
  950. * destined to. \
  951. * It's intended to be specified by host in case of NAWDS. \
  952. */ \
  953. A_UINT16 peerid; \
  954. \
  955. /* \
  956. * Channel frequency: This identifies the desired channel \
  957. * frequency (in mhz) for tx frames. This is used by FW to help \
  958. * determine when it is safe to transmit or drop frames for \
  959. * off-channel operation. \
  960. * The default value of zero indicates to FW that the corresponding \
  961. * VDEV's home channel (if there is one) is the desired channel \
  962. * frequency. \
  963. */ \
  964. A_UINT16 chanfreq; \
  965. \
  966. /* Reason reserved is commented is increasing the htt structure size \
  967. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  968. * A_UINT32 reserved_dword3_bits0_31; \
  969. */ \
  970. } POSTPACK
  971. /* define a htt_tx_msdu_desc32_t type */
  972. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  973. /* define a htt_tx_msdu_desc64_t type */
  974. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  975. /*
  976. * Make htt_tx_msdu_desc_t be an alias for either
  977. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  978. */
  979. #if HTT_PADDR64
  980. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  981. #else
  982. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  983. #endif
  984. /* decriptor information for Management frame*/
  985. /*
  986. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  987. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  988. */
  989. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  990. extern A_UINT32 mgmt_hdr_len;
  991. PREPACK struct htt_mgmt_tx_desc_t {
  992. A_UINT32 msg_type;
  993. #if HTT_PADDR64
  994. A_UINT64 frag_paddr; /* DMAble address of the data */
  995. #else
  996. A_UINT32 frag_paddr; /* DMAble address of the data */
  997. #endif
  998. A_UINT32 desc_id; /* returned to host during completion
  999. * to free the meory*/
  1000. A_UINT32 len; /* Fragment length */
  1001. A_UINT32 vdev_id; /* virtual device ID*/
  1002. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1003. } POSTPACK;
  1004. PREPACK struct htt_mgmt_tx_compl_ind {
  1005. A_UINT32 desc_id;
  1006. A_UINT32 status;
  1007. } POSTPACK;
  1008. /*
  1009. * This SDU header size comes from the summation of the following:
  1010. * 1. Max of:
  1011. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1012. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1013. * b. 802.11 header, for raw frames: 36 bytes
  1014. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1015. * QoS header, HT header)
  1016. * c. 802.3 header, for ethernet frames: 14 bytes
  1017. * (destination address, source address, ethertype / length)
  1018. * 2. Max of:
  1019. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1020. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1021. * 3. 802.1Q VLAN header: 4 bytes
  1022. * 4. LLC/SNAP header: 8 bytes
  1023. */
  1024. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1025. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1026. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1027. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1028. A_COMPILE_TIME_ASSERT(
  1029. htt_encap_hdr_size_max_check_nwifi,
  1030. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1031. A_COMPILE_TIME_ASSERT(
  1032. htt_encap_hdr_size_max_check_enet,
  1033. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1034. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1035. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1036. #define HTT_TX_HDR_SIZE_802_1Q 4
  1037. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1038. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1039. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1040. HTT_TX_HDR_SIZE_802_1Q + \
  1041. HTT_TX_HDR_SIZE_LLC_SNAP)
  1042. #define HTT_HL_TX_FRM_HDR_LEN \
  1043. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1044. #define HTT_LL_TX_FRM_HDR_LEN \
  1045. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1046. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1047. /* dword 0 */
  1048. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1049. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1050. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1051. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1052. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1053. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1054. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1055. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1056. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1057. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1058. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1059. #define HTT_TX_DESC_PKT_TYPE_S 13
  1060. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1061. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1062. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1063. #define HTT_TX_DESC_VDEV_ID_S 16
  1064. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1065. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1066. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1067. #define HTT_TX_DESC_EXT_TID_S 22
  1068. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1069. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1070. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1071. #define HTT_TX_DESC_POSTPONED_S 27
  1072. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1073. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1074. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1075. #define HTT_TX_DESC_EXTENSION_S 28
  1076. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1077. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1078. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1079. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1080. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1081. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1082. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1083. #define HTT_TX_DESC_TX_COMP_S 31
  1084. /* dword 1 */
  1085. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1086. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1087. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1088. #define HTT_TX_DESC_FRM_LEN_S 0
  1089. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1090. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1091. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1092. #define HTT_TX_DESC_FRM_ID_S 16
  1093. /* dword 2 */
  1094. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1095. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1096. /* for systems using 64-bit format for bus addresses */
  1097. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1098. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1099. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1100. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1101. /* for systems using 32-bit format for bus addresses */
  1102. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1103. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1104. /* dword 3 */
  1105. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1106. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1107. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1108. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1109. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1110. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1111. #if HTT_PADDR64
  1112. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1113. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1114. #else
  1115. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1116. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1117. #endif
  1118. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1119. #define HTT_TX_DESC_PEER_ID_S 0
  1120. /*
  1121. * TEMPORARY:
  1122. * The original definitions for the PEER_ID fields contained typos
  1123. * (with _DESC_PADDR appended to this PEER_ID field name).
  1124. * Retain deprecated original names for PEER_ID fields until all code that
  1125. * refers to them has been updated.
  1126. */
  1127. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1128. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1129. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1130. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1131. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1132. HTT_TX_DESC_PEER_ID_M
  1133. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1134. HTT_TX_DESC_PEER_ID_S
  1135. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1136. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1137. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1138. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1139. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1140. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1141. #if HTT_PADDR64
  1142. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1143. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1144. #else
  1145. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1146. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1147. #endif
  1148. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1149. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1150. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1151. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1152. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1153. do { \
  1154. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1155. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1156. } while (0)
  1157. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1158. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1159. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1160. do { \
  1161. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1162. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1163. } while (0)
  1164. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1165. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1166. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1167. do { \
  1168. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1169. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1170. } while (0)
  1171. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1172. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1173. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1174. do { \
  1175. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1176. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1177. } while (0)
  1178. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1179. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1180. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1181. do { \
  1182. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1183. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1184. } while (0)
  1185. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1186. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1187. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1188. do { \
  1189. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1190. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1191. } while (0)
  1192. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1193. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1194. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1195. do { \
  1196. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1197. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1198. } while (0)
  1199. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1200. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1201. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1202. do { \
  1203. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1204. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1205. } while (0)
  1206. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1207. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1208. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1209. do { \
  1210. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1211. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1212. } while (0)
  1213. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1214. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1215. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1218. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1219. } while (0)
  1220. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1221. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1222. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1226. } while (0)
  1227. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1229. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1236. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1240. } while (0)
  1241. /* enums used in the HTT tx MSDU extension descriptor */
  1242. enum {
  1243. htt_tx_guard_interval_regular = 0,
  1244. htt_tx_guard_interval_short = 1,
  1245. };
  1246. enum {
  1247. htt_tx_preamble_type_ofdm = 0,
  1248. htt_tx_preamble_type_cck = 1,
  1249. htt_tx_preamble_type_ht = 2,
  1250. htt_tx_preamble_type_vht = 3,
  1251. };
  1252. enum {
  1253. htt_tx_bandwidth_5MHz = 0,
  1254. htt_tx_bandwidth_10MHz = 1,
  1255. htt_tx_bandwidth_20MHz = 2,
  1256. htt_tx_bandwidth_40MHz = 3,
  1257. htt_tx_bandwidth_80MHz = 4,
  1258. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1259. };
  1260. /**
  1261. * @brief HTT tx MSDU extension descriptor
  1262. * @details
  1263. * If the target supports HTT tx MSDU extension descriptors, the host has
  1264. * the option of appending the following struct following the regular
  1265. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1266. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1267. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1268. * tx specs for each frame.
  1269. */
  1270. PREPACK struct htt_tx_msdu_desc_ext_t {
  1271. /* DWORD 0: flags */
  1272. A_UINT32
  1273. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1274. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1275. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1276. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1277. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1278. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1279. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1280. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1281. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1282. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1283. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1284. /* DWORD 1: tx power, tx rate, tx BW */
  1285. A_UINT32
  1286. /* pwr -
  1287. * Specify what power the tx frame needs to be transmitted at.
  1288. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1289. * The value needs to be appropriately sign-extended when extracting
  1290. * the value from the message and storing it in a variable that is
  1291. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1292. * automatically handles this sign-extension.)
  1293. * If the transmission uses multiple tx chains, this power spec is
  1294. * the total transmit power, assuming incoherent combination of
  1295. * per-chain power to produce the total power.
  1296. */
  1297. pwr: 8,
  1298. /* mcs_mask -
  1299. * Specify the allowable values for MCS index (modulation and coding)
  1300. * to use for transmitting the frame.
  1301. *
  1302. * For HT / VHT preamble types, this mask directly corresponds to
  1303. * the HT or VHT MCS indices that are allowed. For each bit N set
  1304. * within the mask, MCS index N is allowed for transmitting the frame.
  1305. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1306. * rates versus OFDM rates, so the host has the option of specifying
  1307. * that the target must transmit the frame with CCK or OFDM rates
  1308. * (not HT or VHT), but leaving the decision to the target whether
  1309. * to use CCK or OFDM.
  1310. *
  1311. * For CCK and OFDM, the bits within this mask are interpreted as
  1312. * follows:
  1313. * bit 0 -> CCK 1 Mbps rate is allowed
  1314. * bit 1 -> CCK 2 Mbps rate is allowed
  1315. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1316. * bit 3 -> CCK 11 Mbps rate is allowed
  1317. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1318. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1319. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1320. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1321. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1322. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1323. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1324. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1325. *
  1326. * The MCS index specification needs to be compatible with the
  1327. * bandwidth mask specification. For example, a MCS index == 9
  1328. * specification is inconsistent with a preamble type == VHT,
  1329. * Nss == 1, and channel bandwidth == 20 MHz.
  1330. *
  1331. * Furthermore, the host has only a limited ability to specify to
  1332. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1333. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1334. */
  1335. mcs_mask: 12,
  1336. /* nss_mask -
  1337. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1338. * Each bit in this mask corresponds to a Nss value:
  1339. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1340. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1341. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1342. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1343. * The values in the Nss mask must be suitable for the recipient, e.g.
  1344. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1345. * recipient which only supports 2x2 MIMO.
  1346. */
  1347. nss_mask: 4,
  1348. /* guard_interval -
  1349. * Specify a htt_tx_guard_interval enum value to indicate whether
  1350. * the transmission should use a regular guard interval or a
  1351. * short guard interval.
  1352. */
  1353. guard_interval: 1,
  1354. /* preamble_type_mask -
  1355. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1356. * may choose from for transmitting this frame.
  1357. * The bits in this mask correspond to the values in the
  1358. * htt_tx_preamble_type enum. For example, to allow the target
  1359. * to transmit the frame as either CCK or OFDM, this field would
  1360. * be set to
  1361. * (1 << htt_tx_preamble_type_ofdm) |
  1362. * (1 << htt_tx_preamble_type_cck)
  1363. */
  1364. preamble_type_mask: 4,
  1365. reserved1_31_29: 3; /* unused, set to 0x0 */
  1366. /* DWORD 2: tx chain mask, tx retries */
  1367. A_UINT32
  1368. /* chain_mask - specify which chains to transmit from */
  1369. chain_mask: 4,
  1370. /* retry_limit -
  1371. * Specify the maximum number of transmissions, including the
  1372. * initial transmission, to attempt before giving up if no ack
  1373. * is received.
  1374. * If the tx rate is specified, then all retries shall use the
  1375. * same rate as the initial transmission.
  1376. * If no tx rate is specified, the target can choose whether to
  1377. * retain the original rate during the retransmissions, or to
  1378. * fall back to a more robust rate.
  1379. */
  1380. retry_limit: 4,
  1381. /* bandwidth_mask -
  1382. * Specify what channel widths may be used for the transmission.
  1383. * A value of zero indicates "don't care" - the target may choose
  1384. * the transmission bandwidth.
  1385. * The bits within this mask correspond to the htt_tx_bandwidth
  1386. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1387. * The bandwidth_mask must be consistent with the preamble_type_mask
  1388. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1389. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1390. */
  1391. bandwidth_mask: 6,
  1392. reserved2_31_14: 18; /* unused, set to 0x0 */
  1393. /* DWORD 3: tx expiry time (TSF) LSBs */
  1394. A_UINT32 expire_tsf_lo;
  1395. /* DWORD 4: tx expiry time (TSF) MSBs */
  1396. A_UINT32 expire_tsf_hi;
  1397. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1398. } POSTPACK;
  1399. /* DWORD 0 */
  1400. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1401. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1402. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1403. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1404. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1405. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1406. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1407. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1408. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1409. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1420. /* DWORD 1 */
  1421. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1422. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1423. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1424. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1425. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1426. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1427. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1428. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1429. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1430. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1431. /* DWORD 2 */
  1432. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1433. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1434. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1435. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1436. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1437. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1438. /* DWORD 0 */
  1439. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1440. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1441. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1442. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1443. do { \
  1444. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1445. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1446. } while (0)
  1447. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1448. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1449. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1450. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1451. do { \
  1452. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1453. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1454. } while (0)
  1455. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1456. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1457. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1458. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1459. do { \
  1460. HTT_CHECK_SET_VAL( \
  1461. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1462. ((_var) |= ((_val) \
  1463. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1464. } while (0)
  1465. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1466. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1467. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1468. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1469. do { \
  1470. HTT_CHECK_SET_VAL( \
  1471. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1472. ((_var) |= ((_val) \
  1473. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1474. } while (0)
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1476. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1477. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1479. do { \
  1480. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1481. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1482. } while (0)
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1484. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1485. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1487. do { \
  1488. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1489. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1490. } while (0)
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1492. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1493. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1495. do { \
  1496. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1497. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1498. } while (0)
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1500. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1501. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1503. do { \
  1504. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1505. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1506. } while (0)
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1508. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1509. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1511. do { \
  1512. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1513. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1514. } while (0)
  1515. /* DWORD 1 */
  1516. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1517. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1518. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1519. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1520. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1521. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1522. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1523. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1524. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1525. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1526. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1527. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1528. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1529. do { \
  1530. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1531. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1532. } while (0)
  1533. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1534. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1535. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1536. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1537. do { \
  1538. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1539. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1540. } while (0)
  1541. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1542. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1543. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1544. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1545. do { \
  1546. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1547. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1548. } while (0)
  1549. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1550. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1551. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1552. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1553. do { \
  1554. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1555. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1556. } while (0)
  1557. /* DWORD 2 */
  1558. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1559. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1560. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1561. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1562. do { \
  1563. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1564. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1565. } while (0)
  1566. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1567. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1568. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1569. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1570. do { \
  1571. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1572. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1573. } while (0)
  1574. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1575. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1576. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1577. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1578. do { \
  1579. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1580. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1581. } while (0)
  1582. typedef enum {
  1583. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1584. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1585. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1586. } htt_11ax_ltf_subtype_t;
  1587. typedef enum {
  1588. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1589. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1590. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1591. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1592. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1593. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1594. } htt_tx_ext2_preamble_type_t;
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1596. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1597. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1598. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1599. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1600. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1607. /**
  1608. * @brief HTT tx MSDU extension descriptor v2
  1609. * @details
  1610. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1611. * is received as tcl_exit_base->host_meta_info in firmware.
  1612. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1613. * are already part of tcl_exit_base.
  1614. */
  1615. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1616. /* DWORD 0: flags */
  1617. A_UINT32
  1618. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1619. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1620. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1621. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1622. valid_retries : 1, /* if set, tx retries spec is valid */
  1623. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1624. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1625. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1626. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1627. valid_key_flags : 1, /* if set, key flags is valid */
  1628. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1629. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1630. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1631. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1632. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1633. 1 = ENCRYPT,
  1634. 2 ~ 3 - Reserved */
  1635. /* retry_limit -
  1636. * Specify the maximum number of transmissions, including the
  1637. * initial transmission, to attempt before giving up if no ack
  1638. * is received.
  1639. * If the tx rate is specified, then all retries shall use the
  1640. * same rate as the initial transmission.
  1641. * If no tx rate is specified, the target can choose whether to
  1642. * retain the original rate during the retransmissions, or to
  1643. * fall back to a more robust rate.
  1644. */
  1645. retry_limit : 4,
  1646. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1647. * Valid only for 11ax preamble types HE_SU
  1648. * and HE_EXT_SU
  1649. */
  1650. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1651. * Valid only for 11ax preamble types HE_SU
  1652. * and HE_EXT_SU
  1653. */
  1654. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1655. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1656. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1657. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1658. */
  1659. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1660. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1661. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1662. * Use cases:
  1663. * Any time firmware uses TQM-BYPASS for Data
  1664. * TID, firmware expect host to set this bit.
  1665. */
  1666. /* DWORD 1: tx power, tx rate */
  1667. A_UINT32
  1668. power : 8, /* unit of the power field is 0.5 dbm
  1669. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1670. * signed value ranging from -64dbm to 63.5 dbm
  1671. */
  1672. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1673. * Setting more than one MCS isn't currently
  1674. * supported by the target (but is supported
  1675. * in the interface in case in the future
  1676. * the target supports specifications of
  1677. * a limited set of MCS values.
  1678. */
  1679. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1680. * Setting more than one Nss isn't currently
  1681. * supported by the target (but is supported
  1682. * in the interface in case in the future
  1683. * the target supports specifications of
  1684. * a limited set of Nss values.
  1685. */
  1686. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1687. update_peer_cache : 1; /* When set these custom values will be
  1688. * used for all packets, until the next
  1689. * update via this ext header.
  1690. * This is to make sure not all packets
  1691. * need to include this header.
  1692. */
  1693. /* DWORD 2: tx chain mask, tx retries */
  1694. A_UINT32
  1695. /* chain_mask - specify which chains to transmit from */
  1696. chain_mask : 8,
  1697. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1698. * TODO: Update Enum values for key_flags
  1699. */
  1700. /*
  1701. * Channel frequency: This identifies the desired channel
  1702. * frequency (in MHz) for tx frames. This is used by FW to help
  1703. * determine when it is safe to transmit or drop frames for
  1704. * off-channel operation.
  1705. * The default value of zero indicates to FW that the corresponding
  1706. * VDEV's home channel (if there is one) is the desired channel
  1707. * frequency.
  1708. */
  1709. chanfreq : 16;
  1710. /* DWORD 3: tx expiry time (TSF) LSBs */
  1711. A_UINT32 expire_tsf_lo;
  1712. /* DWORD 4: tx expiry time (TSF) MSBs */
  1713. A_UINT32 expire_tsf_hi;
  1714. /* DWORD 5: flags to control routing / processing of the MSDU */
  1715. A_UINT32
  1716. /* learning_frame
  1717. * When this flag is set, this frame will be dropped by FW
  1718. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1719. */
  1720. learning_frame : 1,
  1721. /* send_as_standalone
  1722. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1723. * i.e. with no A-MSDU or A-MPDU aggregation.
  1724. * The scope is extended to other use-cases.
  1725. */
  1726. send_as_standalone : 1,
  1727. /* is_host_opaque_valid
  1728. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1729. * with valid information.
  1730. */
  1731. is_host_opaque_valid : 1,
  1732. rsvd0 : 29;
  1733. /* DWORD 6 : Host opaque cookie for special frames */
  1734. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1735. rsvd1 : 16;
  1736. /*
  1737. * This structure can be expanded further up to 40 bytes
  1738. * by adding further DWORDs as needed.
  1739. */
  1740. } POSTPACK;
  1741. /* DWORD 0 */
  1742. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1743. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1744. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1745. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1746. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1747. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1749. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1750. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1768. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1769. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1770. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1771. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1772. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1773. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1774. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1775. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1776. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1777. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1778. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1779. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1780. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1781. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1782. /* DWORD 1 */
  1783. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1784. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1785. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1786. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1787. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1788. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1789. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1790. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1791. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1792. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1793. /* DWORD 2 */
  1794. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1795. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1796. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1797. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1798. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1799. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1800. /* DWORD 5 */
  1801. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1802. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1803. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1804. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1805. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1806. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1807. /* DWORD 6 */
  1808. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1809. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1810. /* DWORD 0 */
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1812. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1813. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1815. do { \
  1816. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1817. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1818. } while (0)
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1820. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1821. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1823. do { \
  1824. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1825. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1826. } while (0)
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1834. } while (0)
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1836. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1837. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL( \
  1841. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1842. ((_var) |= ((_val) \
  1843. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1844. } while (0)
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1846. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1847. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1849. do { \
  1850. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1851. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1852. } while (0)
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1854. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1855. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1857. do { \
  1858. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1859. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1860. } while (0)
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1862. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1863. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1865. do { \
  1866. HTT_CHECK_SET_VAL( \
  1867. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1868. ((_var) |= ((_val) \
  1869. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1870. } while (0)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1872. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1875. do { \
  1876. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1877. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1878. } while (0)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1880. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1881. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1883. do { \
  1884. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1885. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1886. } while (0)
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1888. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1889. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1891. do { \
  1892. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1893. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1894. } while (0)
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1896. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1897. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1899. do { \
  1900. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1901. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1902. } while (0)
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1904. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1905. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1907. do { \
  1908. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1909. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1910. } while (0)
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1912. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1913. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1918. } while (0)
  1919. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1920. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1921. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1922. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1926. } while (0)
  1927. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1928. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1929. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1930. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1934. } while (0)
  1935. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1974. } while (0)
  1975. /* DWORD 1 */
  1976. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1977. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1978. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1979. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1980. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1981. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1982. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1983. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1984. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1985. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1986. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1987. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1988. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1992. } while (0)
  1993. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1994. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1995. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1996. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2000. } while (0)
  2001. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2002. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2003. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2004. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2008. } while (0)
  2009. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2010. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2011. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2012. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2016. } while (0)
  2017. /* DWORD 2 */
  2018. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2019. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2020. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2021. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2025. } while (0)
  2026. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2027. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2028. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2029. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2033. } while (0)
  2034. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2035. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2036. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2037. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2038. do { \
  2039. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2040. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2041. } while (0)
  2042. /* DWORD 5 */
  2043. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2066. } while (0)
  2067. /* DWORD 6 */
  2068. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2075. } while (0)
  2076. typedef enum {
  2077. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2078. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2079. } htt_tcl_metadata_type;
  2080. /**
  2081. * @brief HTT TCL command number format
  2082. * @details
  2083. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2084. * available to firmware as tcl_exit_base->tcl_status_number.
  2085. * For regular / multicast packets host will send vdev and mac id and for
  2086. * NAWDS packets, host will send peer id.
  2087. * A_UINT32 is used to avoid endianness conversion problems.
  2088. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2089. */
  2090. typedef struct {
  2091. A_UINT32
  2092. type: 1, /* vdev_id based or peer_id based */
  2093. rsvd: 31;
  2094. } htt_tx_tcl_vdev_or_peer_t;
  2095. typedef struct {
  2096. A_UINT32
  2097. type: 1, /* vdev_id based or peer_id based */
  2098. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2099. vdev_id: 8,
  2100. pdev_id: 2,
  2101. host_inspected:1,
  2102. rsvd: 19;
  2103. } htt_tx_tcl_vdev_metadata;
  2104. typedef struct {
  2105. A_UINT32
  2106. type: 1, /* vdev_id based or peer_id based */
  2107. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2108. peer_id: 14,
  2109. rsvd: 16;
  2110. } htt_tx_tcl_peer_metadata;
  2111. PREPACK struct htt_tx_tcl_metadata {
  2112. union {
  2113. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2114. htt_tx_tcl_vdev_metadata vdev_meta;
  2115. htt_tx_tcl_peer_metadata peer_meta;
  2116. };
  2117. } POSTPACK;
  2118. /* DWORD 0 */
  2119. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2120. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2121. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2122. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2123. /* VDEV metadata */
  2124. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2125. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2126. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2127. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2128. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2129. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2130. /* PEER metadata */
  2131. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2132. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2133. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2134. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2135. HTT_TX_TCL_METADATA_TYPE_S)
  2136. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2137. do { \
  2138. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2139. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2140. } while (0)
  2141. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2142. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2143. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2144. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2145. do { \
  2146. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2147. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2148. } while (0)
  2149. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2150. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2151. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2152. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2156. } while (0)
  2157. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2158. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2159. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2160. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2164. } while (0)
  2165. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2166. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2167. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2168. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2169. do { \
  2170. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2171. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2172. } while (0)
  2173. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2174. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2175. HTT_TX_TCL_METADATA_PEER_ID_S)
  2176. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2180. } while (0)
  2181. typedef enum {
  2182. HTT_TX_FW2WBM_TX_STATUS_OK,
  2183. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2184. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2185. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2186. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2187. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2188. HTT_TX_FW2WBM_TX_STATUS_MAX
  2189. } htt_tx_fw2wbm_tx_status_t;
  2190. typedef enum {
  2191. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2192. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2193. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2194. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2195. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2196. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2197. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2198. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2199. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2200. } htt_tx_fw2wbm_reinject_reason_t;
  2201. /**
  2202. * @brief HTT TX WBM Completion from firmware to host
  2203. * @details
  2204. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2205. * DWORD 3 and 4 for software based completions (Exception frames and
  2206. * TQM bypass frames)
  2207. * For software based completions, wbm_release_ring->release_source_module will
  2208. * be set to release_source_fw
  2209. */
  2210. PREPACK struct htt_tx_wbm_completion {
  2211. A_UINT32
  2212. sch_cmd_id: 24,
  2213. exception_frame: 1, /* If set, this packet was queued via exception path */
  2214. rsvd0_31_25: 7;
  2215. A_UINT32
  2216. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2217. * reception of an ACK or BA, this field indicates
  2218. * the RSSI of the received ACK or BA frame.
  2219. * When the frame is removed as result of a direct
  2220. * remove command from the SW, this field is set
  2221. * to 0x0 (which is never a valid value when real
  2222. * RSSI is available).
  2223. * Units: dB w.r.t noise floor
  2224. */
  2225. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2226. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2227. rsvd1_31_16: 16;
  2228. } POSTPACK;
  2229. /* DWORD 0 */
  2230. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2231. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2232. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2233. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2234. /* DWORD 1 */
  2235. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2236. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2237. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2238. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2239. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2240. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2241. /* DWORD 0 */
  2242. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2244. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2245. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2249. } while (0)
  2250. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2252. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2253. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2257. } while (0)
  2258. /* DWORD 1 */
  2259. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2260. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2261. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2262. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2266. } while (0)
  2267. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2268. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2269. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2270. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2274. } while (0)
  2275. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2276. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2277. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2278. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2282. } while (0)
  2283. /**
  2284. * @brief HTT TX WBM Completion from firmware to host
  2285. * @details
  2286. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2287. * (WBM) offload HW.
  2288. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2289. * For software based completions, release_source_module will
  2290. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2291. * struct wbm_release_ring and then switch to this after looking at
  2292. * release_source_module.
  2293. */
  2294. PREPACK struct htt_tx_wbm_completion_v2 {
  2295. A_UINT32
  2296. used_by_hw0; /* Refer to struct wbm_release_ring */
  2297. A_UINT32
  2298. used_by_hw1; /* Refer to struct wbm_release_ring */
  2299. A_UINT32
  2300. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2301. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2302. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2303. exception_frame: 1,
  2304. rsvd0: 12, /* For future use */
  2305. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2306. rsvd1: 1; /* For future use */
  2307. A_UINT32
  2308. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2309. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2310. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2311. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2312. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2313. */
  2314. A_UINT32
  2315. data1: 32;
  2316. A_UINT32
  2317. data2: 32;
  2318. A_UINT32
  2319. used_by_hw3; /* Refer to struct wbm_release_ring */
  2320. } POSTPACK;
  2321. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2322. /* DWORD 3 */
  2323. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2324. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2325. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2326. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2327. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2328. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2329. /* DWORD 3 */
  2330. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2331. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2332. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2333. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2334. do { \
  2335. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2336. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2337. } while (0)
  2338. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2339. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2340. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2341. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2342. do { \
  2343. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2344. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2345. } while (0)
  2346. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2347. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2348. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2349. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2350. do { \
  2351. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2352. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2353. } while (0)
  2354. /**
  2355. * @brief HTT TX WBM transmit status from firmware to host
  2356. * @details
  2357. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2358. * (WBM) offload HW.
  2359. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2360. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2361. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2362. */
  2363. PREPACK struct htt_tx_wbm_transmit_status {
  2364. A_UINT32
  2365. sch_cmd_id: 24,
  2366. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2367. * reception of an ACK or BA, this field indicates
  2368. * the RSSI of the received ACK or BA frame.
  2369. * When the frame is removed as result of a direct
  2370. * remove command from the SW, this field is set
  2371. * to 0x0 (which is never a valid value when real
  2372. * RSSI is available).
  2373. * Units: dB w.r.t noise floor
  2374. */
  2375. A_UINT32
  2376. sw_peer_id: 16,
  2377. tid_num: 5,
  2378. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2379. * and tid_num fields contain valid data.
  2380. * If this "valid" flag is not set, the
  2381. * sw_peer_id and tid_num fields must be ignored.
  2382. */
  2383. mcast: 1,
  2384. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2385. * contains valid data.
  2386. */
  2387. reserved0: 8;
  2388. A_UINT32
  2389. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2390. * packets in the wbm completion path
  2391. */
  2392. } POSTPACK;
  2393. /* DWORD 4 */
  2394. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2395. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2396. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2397. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2398. /* DWORD 5 */
  2399. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2400. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2401. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2402. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2403. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2404. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2405. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2406. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2407. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2408. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2409. /* DWORD 4 */
  2410. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2411. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2412. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2413. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2414. do { \
  2415. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2416. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2417. } while (0)
  2418. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2419. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2420. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2421. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2422. do { \
  2423. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2424. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2425. } while (0)
  2426. /* DWORD 5 */
  2427. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2428. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2429. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2430. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2431. do { \
  2432. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2433. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2434. } while (0)
  2435. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2436. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2437. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2438. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2442. } while (0)
  2443. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2444. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2445. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2446. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2450. } while (0)
  2451. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2452. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2453. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2454. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2458. } while (0)
  2459. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2460. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2461. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2462. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2465. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2466. } while (0)
  2467. /**
  2468. * @brief HTT TX WBM reinject status from firmware to host
  2469. * @details
  2470. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2471. * (WBM) offload HW.
  2472. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2473. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2474. */
  2475. PREPACK struct htt_tx_wbm_reinject_status {
  2476. A_UINT32
  2477. reserved0: 32;
  2478. A_UINT32
  2479. reserved1: 32;
  2480. A_UINT32
  2481. reserved2: 32;
  2482. } POSTPACK;
  2483. /**
  2484. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2485. * @details
  2486. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2487. * (WBM) offload HW.
  2488. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2489. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2490. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2491. * STA side.
  2492. */
  2493. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2494. A_UINT32
  2495. mec_sa_addr_31_0;
  2496. A_UINT32
  2497. mec_sa_addr_47_32: 16,
  2498. sa_ast_index: 16;
  2499. A_UINT32
  2500. vdev_id: 8,
  2501. reserved0: 24;
  2502. } POSTPACK;
  2503. /* DWORD 4 - mec_sa_addr_31_0 */
  2504. /* DWORD 5 */
  2505. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2506. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2507. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2508. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2509. /* DWORD 6 */
  2510. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2511. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2512. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2513. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2514. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2515. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2516. do { \
  2517. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2518. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2519. } while (0)
  2520. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2521. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2522. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2523. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2524. do { \
  2525. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2526. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2527. } while (0)
  2528. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2529. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2530. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2531. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2532. do { \
  2533. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2534. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2535. } while (0)
  2536. typedef enum {
  2537. TX_FLOW_PRIORITY_BE,
  2538. TX_FLOW_PRIORITY_HIGH,
  2539. TX_FLOW_PRIORITY_LOW,
  2540. } htt_tx_flow_priority_t;
  2541. typedef enum {
  2542. TX_FLOW_LATENCY_SENSITIVE,
  2543. TX_FLOW_LATENCY_INSENSITIVE,
  2544. } htt_tx_flow_latency_t;
  2545. typedef enum {
  2546. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2547. TX_FLOW_INTERACTIVE_TRAFFIC,
  2548. TX_FLOW_PERIODIC_TRAFFIC,
  2549. TX_FLOW_BURSTY_TRAFFIC,
  2550. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2551. } htt_tx_flow_traffic_pattern_t;
  2552. /**
  2553. * @brief HTT TX Flow search metadata format
  2554. * @details
  2555. * Host will set this metadata in flow table's flow search entry along with
  2556. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2557. * firmware and TQM ring if the flow search entry wins.
  2558. * This metadata is available to firmware in that first MSDU's
  2559. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2560. * to one of the available flows for specific tid and returns the tqm flow
  2561. * pointer as part of htt_tx_map_flow_info message.
  2562. */
  2563. PREPACK struct htt_tx_flow_metadata {
  2564. A_UINT32
  2565. rsvd0_1_0: 2,
  2566. tid: 4,
  2567. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2568. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2569. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2570. * Else choose final tid based on latency, priority.
  2571. */
  2572. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2573. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2574. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2575. } POSTPACK;
  2576. /* DWORD 0 */
  2577. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2578. #define HTT_TX_FLOW_METADATA_TID_S 2
  2579. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2580. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2581. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2582. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2583. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2584. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2585. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2586. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2587. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2588. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2589. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2590. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2591. /* DWORD 0 */
  2592. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2593. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2594. HTT_TX_FLOW_METADATA_TID_S)
  2595. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2596. do { \
  2597. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2598. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2599. } while (0)
  2600. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2601. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2602. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2603. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2604. do { \
  2605. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2606. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2607. } while (0)
  2608. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2609. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2610. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2611. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2612. do { \
  2613. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2614. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2615. } while (0)
  2616. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2617. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2618. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2619. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2620. do { \
  2621. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2622. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2623. } while (0)
  2624. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2625. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2626. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2627. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2628. do { \
  2629. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2630. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2631. } while (0)
  2632. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2633. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2634. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2635. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2636. do { \
  2637. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2638. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2639. } while (0)
  2640. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2641. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2642. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2643. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2644. do { \
  2645. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2646. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2647. } while (0)
  2648. /**
  2649. * @brief host -> target ADD WDS Entry
  2650. *
  2651. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2652. *
  2653. * @brief host -> target DELETE WDS Entry
  2654. *
  2655. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2656. *
  2657. * @details
  2658. * HTT wds entry from source port learning
  2659. * Host will learn wds entries from rx and send this message to firmware
  2660. * to enable firmware to configure/delete AST entries for wds clients.
  2661. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2662. * and when SA's entry is deleted, firmware removes this AST entry
  2663. *
  2664. * The message would appear as follows:
  2665. *
  2666. * |31 30|29 |17 16|15 8|7 0|
  2667. * |----------------+----------------+----------------+----------------|
  2668. * | rsvd0 |PDVID| vdev_id | msg_type |
  2669. * |-------------------------------------------------------------------|
  2670. * | sa_addr_31_0 |
  2671. * |-------------------------------------------------------------------|
  2672. * | | ta_peer_id | sa_addr_47_32 |
  2673. * |-------------------------------------------------------------------|
  2674. * Where PDVID = pdev_id
  2675. *
  2676. * The message is interpreted as follows:
  2677. *
  2678. * dword0 - b'0:7 - msg_type: This will be set to
  2679. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2680. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2681. *
  2682. * dword0 - b'8:15 - vdev_id
  2683. *
  2684. * dword0 - b'16:17 - pdev_id
  2685. *
  2686. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2687. *
  2688. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2689. *
  2690. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2691. *
  2692. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2693. */
  2694. PREPACK struct htt_wds_entry {
  2695. A_UINT32
  2696. msg_type: 8,
  2697. vdev_id: 8,
  2698. pdev_id: 2,
  2699. rsvd0: 14;
  2700. A_UINT32 sa_addr_31_0;
  2701. A_UINT32
  2702. sa_addr_47_32: 16,
  2703. ta_peer_id: 14,
  2704. rsvd2: 2;
  2705. } POSTPACK;
  2706. /* DWORD 0 */
  2707. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2708. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2709. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2710. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2711. /* DWORD 2 */
  2712. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2713. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2714. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2715. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2716. /* DWORD 0 */
  2717. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2718. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2719. HTT_WDS_ENTRY_VDEV_ID_S)
  2720. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2721. do { \
  2722. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2723. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2724. } while (0)
  2725. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2726. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2727. HTT_WDS_ENTRY_PDEV_ID_S)
  2728. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2729. do { \
  2730. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2731. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2732. } while (0)
  2733. /* DWORD 2 */
  2734. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2735. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2736. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2737. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2738. do { \
  2739. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2740. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2741. } while (0)
  2742. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2743. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2744. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2745. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2746. do { \
  2747. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2748. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2749. } while (0)
  2750. /**
  2751. * @brief MAC DMA rx ring setup specification
  2752. *
  2753. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2754. *
  2755. * @details
  2756. * To allow for dynamic rx ring reconfiguration and to avoid race
  2757. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2758. * it uses. Instead, it sends this message to the target, indicating how
  2759. * the rx ring used by the host should be set up and maintained.
  2760. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2761. * specifications.
  2762. *
  2763. * |31 16|15 8|7 0|
  2764. * |---------------------------------------------------------------|
  2765. * header: | reserved | num rings | msg type |
  2766. * |---------------------------------------------------------------|
  2767. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2768. #if HTT_PADDR64
  2769. * | FW_IDX shadow register physical address (bits 63:32) |
  2770. #endif
  2771. * |---------------------------------------------------------------|
  2772. * | rx ring base physical address (bits 31:0) |
  2773. #if HTT_PADDR64
  2774. * | rx ring base physical address (bits 63:32) |
  2775. #endif
  2776. * |---------------------------------------------------------------|
  2777. * | rx ring buffer size | rx ring length |
  2778. * |---------------------------------------------------------------|
  2779. * | FW_IDX initial value | enabled flags |
  2780. * |---------------------------------------------------------------|
  2781. * | MSDU payload offset | 802.11 header offset |
  2782. * |---------------------------------------------------------------|
  2783. * | PPDU end offset | PPDU start offset |
  2784. * |---------------------------------------------------------------|
  2785. * | MPDU end offset | MPDU start offset |
  2786. * |---------------------------------------------------------------|
  2787. * | MSDU end offset | MSDU start offset |
  2788. * |---------------------------------------------------------------|
  2789. * | frag info offset | rx attention offset |
  2790. * |---------------------------------------------------------------|
  2791. * payload 2, if present, has the same format as payload 1
  2792. * Header fields:
  2793. * - MSG_TYPE
  2794. * Bits 7:0
  2795. * Purpose: identifies this as an rx ring configuration message
  2796. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2797. * - NUM_RINGS
  2798. * Bits 15:8
  2799. * Purpose: indicates whether the host is setting up one rx ring or two
  2800. * Value: 1 or 2
  2801. * Payload:
  2802. * for systems using 64-bit format for bus addresses:
  2803. * - IDX_SHADOW_REG_PADDR_LO
  2804. * Bits 31:0
  2805. * Value: lower 4 bytes of physical address of the host's
  2806. * FW_IDX shadow register
  2807. * - IDX_SHADOW_REG_PADDR_HI
  2808. * Bits 31:0
  2809. * Value: upper 4 bytes of physical address of the host's
  2810. * FW_IDX shadow register
  2811. * - RING_BASE_PADDR_LO
  2812. * Bits 31:0
  2813. * Value: lower 4 bytes of physical address of the host's rx ring
  2814. * - RING_BASE_PADDR_HI
  2815. * Bits 31:0
  2816. * Value: uppper 4 bytes of physical address of the host's rx ring
  2817. * for systems using 32-bit format for bus addresses:
  2818. * - IDX_SHADOW_REG_PADDR
  2819. * Bits 31:0
  2820. * Value: physical address of the host's FW_IDX shadow register
  2821. * - RING_BASE_PADDR
  2822. * Bits 31:0
  2823. * Value: physical address of the host's rx ring
  2824. * - RING_LEN
  2825. * Bits 15:0
  2826. * Value: number of elements in the rx ring
  2827. * - RING_BUF_SZ
  2828. * Bits 31:16
  2829. * Value: size of the buffers referenced by the rx ring, in byte units
  2830. * - ENABLED_FLAGS
  2831. * Bits 15:0
  2832. * Value: 1-bit flags to show whether different rx fields are enabled
  2833. * bit 0: 802.11 header enabled (1) or disabled (0)
  2834. * bit 1: MSDU payload enabled (1) or disabled (0)
  2835. * bit 2: PPDU start enabled (1) or disabled (0)
  2836. * bit 3: PPDU end enabled (1) or disabled (0)
  2837. * bit 4: MPDU start enabled (1) or disabled (0)
  2838. * bit 5: MPDU end enabled (1) or disabled (0)
  2839. * bit 6: MSDU start enabled (1) or disabled (0)
  2840. * bit 7: MSDU end enabled (1) or disabled (0)
  2841. * bit 8: rx attention enabled (1) or disabled (0)
  2842. * bit 9: frag info enabled (1) or disabled (0)
  2843. * bit 10: unicast rx enabled (1) or disabled (0)
  2844. * bit 11: multicast rx enabled (1) or disabled (0)
  2845. * bit 12: ctrl rx enabled (1) or disabled (0)
  2846. * bit 13: mgmt rx enabled (1) or disabled (0)
  2847. * bit 14: null rx enabled (1) or disabled (0)
  2848. * bit 15: phy data rx enabled (1) or disabled (0)
  2849. * - IDX_INIT_VAL
  2850. * Bits 31:16
  2851. * Purpose: Specify the initial value for the FW_IDX.
  2852. * Value: the number of buffers initially present in the host's rx ring
  2853. * - OFFSET_802_11_HDR
  2854. * Bits 15:0
  2855. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2856. * - OFFSET_MSDU_PAYLOAD
  2857. * Bits 31:16
  2858. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2859. * - OFFSET_PPDU_START
  2860. * Bits 15:0
  2861. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2862. * - OFFSET_PPDU_END
  2863. * Bits 31:16
  2864. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2865. * - OFFSET_MPDU_START
  2866. * Bits 15:0
  2867. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2868. * - OFFSET_MPDU_END
  2869. * Bits 31:16
  2870. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2871. * - OFFSET_MSDU_START
  2872. * Bits 15:0
  2873. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2874. * - OFFSET_MSDU_END
  2875. * Bits 31:16
  2876. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2877. * - OFFSET_RX_ATTN
  2878. * Bits 15:0
  2879. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2880. * - OFFSET_FRAG_INFO
  2881. * Bits 31:16
  2882. * Value: offset in QUAD-bytes of frag info table
  2883. */
  2884. /* header fields */
  2885. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2886. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2887. /* payload fields */
  2888. /* for systems using a 64-bit format for bus addresses */
  2889. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2890. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2891. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2892. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2893. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2894. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2895. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2896. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2897. /* for systems using a 32-bit format for bus addresses */
  2898. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2899. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2900. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2901. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2902. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2903. #define HTT_RX_RING_CFG_LEN_S 0
  2904. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2905. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2906. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2907. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2908. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2909. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2910. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2911. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2912. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2913. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2914. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2915. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2916. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2917. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2918. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2919. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2920. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2921. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2922. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2923. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2924. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2925. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2926. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2927. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2928. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2929. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2930. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2931. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2932. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2933. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2934. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2935. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2936. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2937. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2938. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2939. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2940. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2941. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2943. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2944. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2945. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2946. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2947. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2948. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2949. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2950. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2951. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2952. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2954. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2955. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2956. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2957. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2958. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2959. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2960. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2961. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2962. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2963. #if HTT_PADDR64
  2964. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2965. #else
  2966. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2967. #endif
  2968. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2969. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2970. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2971. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2972. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2975. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2976. } while (0)
  2977. /* degenerate case for 32-bit fields */
  2978. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2979. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2980. ((_var) = (_val))
  2981. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2982. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2983. ((_var) = (_val))
  2984. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2985. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2986. ((_var) = (_val))
  2987. /* degenerate case for 32-bit fields */
  2988. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2989. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2990. ((_var) = (_val))
  2991. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2992. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2993. ((_var) = (_val))
  2994. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2995. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2996. ((_var) = (_val))
  2997. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2998. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2999. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3000. do { \
  3001. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3002. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3003. } while (0)
  3004. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3005. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3006. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3007. do { \
  3008. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3009. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3010. } while (0)
  3011. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3012. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3013. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3014. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3017. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3018. } while (0)
  3019. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3021. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3022. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3023. do { \
  3024. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3025. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3026. } while (0)
  3027. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3028. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3029. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3030. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3031. do { \
  3032. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3033. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3034. } while (0)
  3035. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3036. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3037. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3038. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3039. do { \
  3040. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3041. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3042. } while (0)
  3043. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3044. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3045. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3046. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3047. do { \
  3048. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3049. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3050. } while (0)
  3051. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3052. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3053. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3054. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3055. do { \
  3056. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3057. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3058. } while (0)
  3059. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3060. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3061. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3062. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3063. do { \
  3064. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3065. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3066. } while (0)
  3067. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3068. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3069. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3070. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3071. do { \
  3072. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3073. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3074. } while (0)
  3075. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3076. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3077. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3078. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3079. do { \
  3080. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3081. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3082. } while (0)
  3083. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3084. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3085. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3086. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3087. do { \
  3088. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3089. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3090. } while (0)
  3091. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3092. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3093. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3094. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3095. do { \
  3096. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3097. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3098. } while (0)
  3099. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3100. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3101. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3102. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3103. do { \
  3104. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3105. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3106. } while (0)
  3107. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3108. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3109. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3110. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3113. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3114. } while (0)
  3115. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3116. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3117. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3118. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3119. do { \
  3120. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3121. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3122. } while (0)
  3123. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3124. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3125. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3126. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3127. do { \
  3128. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3129. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3130. } while (0)
  3131. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3132. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3133. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3134. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3135. do { \
  3136. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3137. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3138. } while (0)
  3139. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3140. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3141. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3142. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3143. do { \
  3144. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3145. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3146. } while (0)
  3147. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3148. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3149. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3150. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3151. do { \
  3152. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3153. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3154. } while (0)
  3155. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3156. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3157. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3158. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3159. do { \
  3160. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3161. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3162. } while (0)
  3163. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3164. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3165. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3166. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3167. do { \
  3168. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3169. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3170. } while (0)
  3171. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3172. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3173. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3174. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3175. do { \
  3176. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3177. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3178. } while (0)
  3179. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3180. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3181. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3182. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3183. do { \
  3184. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3185. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3186. } while (0)
  3187. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3188. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3189. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3190. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3191. do { \
  3192. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3193. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3194. } while (0)
  3195. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3196. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3197. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3198. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3199. do { \
  3200. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3201. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3202. } while (0)
  3203. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3204. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3205. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3206. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3207. do { \
  3208. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3209. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3210. } while (0)
  3211. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3212. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3213. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3214. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3215. do { \
  3216. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3217. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3218. } while (0)
  3219. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3220. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3221. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3222. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3223. do { \
  3224. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3225. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3226. } while (0)
  3227. /**
  3228. * @brief host -> target FW statistics retrieve
  3229. *
  3230. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3231. *
  3232. * @details
  3233. * The following field definitions describe the format of the HTT host
  3234. * to target FW stats retrieve message. The message specifies the type of
  3235. * stats host wants to retrieve.
  3236. *
  3237. * |31 24|23 16|15 8|7 0|
  3238. * |-----------------------------------------------------------|
  3239. * | stats types request bitmask | msg type |
  3240. * |-----------------------------------------------------------|
  3241. * | stats types reset bitmask | reserved |
  3242. * |-----------------------------------------------------------|
  3243. * | stats type | config value |
  3244. * |-----------------------------------------------------------|
  3245. * | cookie LSBs |
  3246. * |-----------------------------------------------------------|
  3247. * | cookie MSBs |
  3248. * |-----------------------------------------------------------|
  3249. * Header fields:
  3250. * - MSG_TYPE
  3251. * Bits 7:0
  3252. * Purpose: identifies this is a stats upload request message
  3253. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3254. * - UPLOAD_TYPES
  3255. * Bits 31:8
  3256. * Purpose: identifies which types of FW statistics to upload
  3257. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3258. * - RESET_TYPES
  3259. * Bits 31:8
  3260. * Purpose: identifies which types of FW statistics to reset
  3261. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3262. * - CFG_VAL
  3263. * Bits 23:0
  3264. * Purpose: give an opaque configuration value to the specified stats type
  3265. * Value: stats-type specific configuration value
  3266. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3267. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3268. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3269. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3270. * - CFG_STAT_TYPE
  3271. * Bits 31:24
  3272. * Purpose: specify which stats type (if any) the config value applies to
  3273. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3274. * a valid configuration specification
  3275. * - COOKIE_LSBS
  3276. * Bits 31:0
  3277. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3278. * message with its preceding host->target stats request message.
  3279. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3280. * - COOKIE_MSBS
  3281. * Bits 31:0
  3282. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3283. * message with its preceding host->target stats request message.
  3284. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3285. */
  3286. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3287. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3288. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3289. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3290. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3291. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3292. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3293. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3294. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3295. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3296. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3297. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3298. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3299. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3300. do { \
  3301. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3302. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3303. } while (0)
  3304. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3305. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3306. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3307. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3308. do { \
  3309. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3310. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3311. } while (0)
  3312. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3313. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3314. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3315. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3316. do { \
  3317. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3318. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3319. } while (0)
  3320. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3321. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3322. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3323. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3324. do { \
  3325. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3326. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3327. } while (0)
  3328. /**
  3329. * @brief host -> target HTT out-of-band sync request
  3330. *
  3331. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3332. *
  3333. * @details
  3334. * The HTT SYNC tells the target to suspend processing of subsequent
  3335. * HTT host-to-target messages until some other target agent locally
  3336. * informs the target HTT FW that the current sync counter is equal to
  3337. * or greater than (in a modulo sense) the sync counter specified in
  3338. * the SYNC message.
  3339. * This allows other host-target components to synchronize their operation
  3340. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3341. * security key has been downloaded to and activated by the target.
  3342. * In the absence of any explicit synchronization counter value
  3343. * specification, the target HTT FW will use zero as the default current
  3344. * sync value.
  3345. *
  3346. * |31 24|23 16|15 8|7 0|
  3347. * |-----------------------------------------------------------|
  3348. * | reserved | sync count | msg type |
  3349. * |-----------------------------------------------------------|
  3350. * Header fields:
  3351. * - MSG_TYPE
  3352. * Bits 7:0
  3353. * Purpose: identifies this as a sync message
  3354. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3355. * - SYNC_COUNT
  3356. * Bits 15:8
  3357. * Purpose: specifies what sync value the HTT FW will wait for from
  3358. * an out-of-band specification to resume its operation
  3359. * Value: in-band sync counter value to compare against the out-of-band
  3360. * counter spec.
  3361. * The HTT target FW will suspend its host->target message processing
  3362. * as long as
  3363. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3364. */
  3365. #define HTT_H2T_SYNC_MSG_SZ 4
  3366. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3367. #define HTT_H2T_SYNC_COUNT_S 8
  3368. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3369. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3370. HTT_H2T_SYNC_COUNT_S)
  3371. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3372. do { \
  3373. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3374. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3375. } while (0)
  3376. /**
  3377. * @brief host -> target HTT aggregation configuration
  3378. *
  3379. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3380. */
  3381. #define HTT_AGGR_CFG_MSG_SZ 4
  3382. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3383. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3384. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3385. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3386. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3387. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3388. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3389. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3392. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3393. } while (0)
  3394. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3395. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3396. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3397. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3400. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3401. } while (0)
  3402. /**
  3403. * @brief host -> target HTT configure max amsdu info per vdev
  3404. *
  3405. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3406. *
  3407. * @details
  3408. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3409. *
  3410. * |31 21|20 16|15 8|7 0|
  3411. * |-----------------------------------------------------------|
  3412. * | reserved | vdev id | max amsdu | msg type |
  3413. * |-----------------------------------------------------------|
  3414. * Header fields:
  3415. * - MSG_TYPE
  3416. * Bits 7:0
  3417. * Purpose: identifies this as a aggr cfg ex message
  3418. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3419. * - MAX_NUM_AMSDU_SUBFRM
  3420. * Bits 15:8
  3421. * Purpose: max MSDUs per A-MSDU
  3422. * - VDEV_ID
  3423. * Bits 20:16
  3424. * Purpose: ID of the vdev to which this limit is applied
  3425. */
  3426. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3427. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3428. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3429. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3430. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3431. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3432. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3433. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3434. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3435. do { \
  3436. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3437. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3438. } while (0)
  3439. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3440. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3441. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3442. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3443. do { \
  3444. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3445. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3446. } while (0)
  3447. /**
  3448. * @brief HTT WDI_IPA Config Message
  3449. *
  3450. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3451. *
  3452. * @details
  3453. * The HTT WDI_IPA config message is created/sent by host at driver
  3454. * init time. It contains information about data structures used on
  3455. * WDI_IPA TX and RX path.
  3456. * TX CE ring is used for pushing packet metadata from IPA uC
  3457. * to WLAN FW
  3458. * TX Completion ring is used for generating TX completions from
  3459. * WLAN FW to IPA uC
  3460. * RX Indication ring is used for indicating RX packets from FW
  3461. * to IPA uC
  3462. * RX Ring2 is used as either completion ring or as second
  3463. * indication ring. when Ring2 is used as completion ring, IPA uC
  3464. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3465. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3466. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3467. * indicated in RX Indication ring. Please see WDI_IPA specification
  3468. * for more details.
  3469. * |31 24|23 16|15 8|7 0|
  3470. * |----------------+----------------+----------------+----------------|
  3471. * | tx pkt pool size | Rsvd | msg_type |
  3472. * |-------------------------------------------------------------------|
  3473. * | tx comp ring base (bits 31:0) |
  3474. #if HTT_PADDR64
  3475. * | tx comp ring base (bits 63:32) |
  3476. #endif
  3477. * |-------------------------------------------------------------------|
  3478. * | tx comp ring size |
  3479. * |-------------------------------------------------------------------|
  3480. * | tx comp WR_IDX physical address (bits 31:0) |
  3481. #if HTT_PADDR64
  3482. * | tx comp WR_IDX physical address (bits 63:32) |
  3483. #endif
  3484. * |-------------------------------------------------------------------|
  3485. * | tx CE WR_IDX physical address (bits 31:0) |
  3486. #if HTT_PADDR64
  3487. * | tx CE WR_IDX physical address (bits 63:32) |
  3488. #endif
  3489. * |-------------------------------------------------------------------|
  3490. * | rx indication ring base (bits 31:0) |
  3491. #if HTT_PADDR64
  3492. * | rx indication ring base (bits 63:32) |
  3493. #endif
  3494. * |-------------------------------------------------------------------|
  3495. * | rx indication ring size |
  3496. * |-------------------------------------------------------------------|
  3497. * | rx ind RD_IDX physical address (bits 31:0) |
  3498. #if HTT_PADDR64
  3499. * | rx ind RD_IDX physical address (bits 63:32) |
  3500. #endif
  3501. * |-------------------------------------------------------------------|
  3502. * | rx ind WR_IDX physical address (bits 31:0) |
  3503. #if HTT_PADDR64
  3504. * | rx ind WR_IDX physical address (bits 63:32) |
  3505. #endif
  3506. * |-------------------------------------------------------------------|
  3507. * |-------------------------------------------------------------------|
  3508. * | rx ring2 base (bits 31:0) |
  3509. #if HTT_PADDR64
  3510. * | rx ring2 base (bits 63:32) |
  3511. #endif
  3512. * |-------------------------------------------------------------------|
  3513. * | rx ring2 size |
  3514. * |-------------------------------------------------------------------|
  3515. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3516. #if HTT_PADDR64
  3517. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3518. #endif
  3519. * |-------------------------------------------------------------------|
  3520. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3521. #if HTT_PADDR64
  3522. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3523. #endif
  3524. * |-------------------------------------------------------------------|
  3525. *
  3526. * Header fields:
  3527. * Header fields:
  3528. * - MSG_TYPE
  3529. * Bits 7:0
  3530. * Purpose: Identifies this as WDI_IPA config message
  3531. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3532. * - TX_PKT_POOL_SIZE
  3533. * Bits 15:0
  3534. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3535. * WDI_IPA TX path
  3536. * For systems using 32-bit format for bus addresses:
  3537. * - TX_COMP_RING_BASE_ADDR
  3538. * Bits 31:0
  3539. * Purpose: TX Completion Ring base address in DDR
  3540. * - TX_COMP_RING_SIZE
  3541. * Bits 31:0
  3542. * Purpose: TX Completion Ring size (must be power of 2)
  3543. * - TX_COMP_WR_IDX_ADDR
  3544. * Bits 31:0
  3545. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3546. * updates the Write Index for WDI_IPA TX completion ring
  3547. * - TX_CE_WR_IDX_ADDR
  3548. * Bits 31:0
  3549. * Purpose: DDR address where IPA uC
  3550. * updates the WR Index for TX CE ring
  3551. * (needed for fusion platforms)
  3552. * - RX_IND_RING_BASE_ADDR
  3553. * Bits 31:0
  3554. * Purpose: RX Indication Ring base address in DDR
  3555. * - RX_IND_RING_SIZE
  3556. * Bits 31:0
  3557. * Purpose: RX Indication Ring size
  3558. * - RX_IND_RD_IDX_ADDR
  3559. * Bits 31:0
  3560. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3561. * RX indication ring
  3562. * - RX_IND_WR_IDX_ADDR
  3563. * Bits 31:0
  3564. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3565. * updates the Write Index for WDI_IPA RX indication ring
  3566. * - RX_RING2_BASE_ADDR
  3567. * Bits 31:0
  3568. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3569. * - RX_RING2_SIZE
  3570. * Bits 31:0
  3571. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3572. * - RX_RING2_RD_IDX_ADDR
  3573. * Bits 31:0
  3574. * Purpose: If Second RX ring is Indication ring, DDR address where
  3575. * IPA uC updates the Read Index for Ring2.
  3576. * If Second RX ring is completion ring, this is NOT used
  3577. * - RX_RING2_WR_IDX_ADDR
  3578. * Bits 31:0
  3579. * Purpose: If Second RX ring is Indication ring, DDR address where
  3580. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3581. * If second RX ring is completion ring, DDR address where
  3582. * IPA uC updates the Write Index for Ring 2.
  3583. * For systems using 64-bit format for bus addresses:
  3584. * - TX_COMP_RING_BASE_ADDR_LO
  3585. * Bits 31:0
  3586. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3587. * - TX_COMP_RING_BASE_ADDR_HI
  3588. * Bits 31:0
  3589. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3590. * - TX_COMP_RING_SIZE
  3591. * Bits 31:0
  3592. * Purpose: TX Completion Ring size (must be power of 2)
  3593. * - TX_COMP_WR_IDX_ADDR_LO
  3594. * Bits 31:0
  3595. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3596. * Lower 4 bytes of DDR address where WIFI FW
  3597. * updates the Write Index for WDI_IPA TX completion ring
  3598. * - TX_COMP_WR_IDX_ADDR_HI
  3599. * Bits 31:0
  3600. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3601. * Higher 4 bytes of DDR address where WIFI FW
  3602. * updates the Write Index for WDI_IPA TX completion ring
  3603. * - TX_CE_WR_IDX_ADDR_LO
  3604. * Bits 31:0
  3605. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3606. * updates the WR Index for TX CE ring
  3607. * (needed for fusion platforms)
  3608. * - TX_CE_WR_IDX_ADDR_HI
  3609. * Bits 31:0
  3610. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3611. * updates the WR Index for TX CE ring
  3612. * (needed for fusion platforms)
  3613. * - RX_IND_RING_BASE_ADDR_LO
  3614. * Bits 31:0
  3615. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3616. * - RX_IND_RING_BASE_ADDR_HI
  3617. * Bits 31:0
  3618. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3619. * - RX_IND_RING_SIZE
  3620. * Bits 31:0
  3621. * Purpose: RX Indication Ring size
  3622. * - RX_IND_RD_IDX_ADDR_LO
  3623. * Bits 31:0
  3624. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3625. * for WDI_IPA RX indication ring
  3626. * - RX_IND_RD_IDX_ADDR_HI
  3627. * Bits 31:0
  3628. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3629. * for WDI_IPA RX indication ring
  3630. * - RX_IND_WR_IDX_ADDR_LO
  3631. * Bits 31:0
  3632. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3633. * Lower 4 bytes of DDR address where WIFI FW
  3634. * updates the Write Index for WDI_IPA RX indication ring
  3635. * - RX_IND_WR_IDX_ADDR_HI
  3636. * Bits 31:0
  3637. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3638. * Higher 4 bytes of DDR address where WIFI FW
  3639. * updates the Write Index for WDI_IPA RX indication ring
  3640. * - RX_RING2_BASE_ADDR_LO
  3641. * Bits 31:0
  3642. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3643. * - RX_RING2_BASE_ADDR_HI
  3644. * Bits 31:0
  3645. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3646. * - RX_RING2_SIZE
  3647. * Bits 31:0
  3648. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3649. * - RX_RING2_RD_IDX_ADDR_LO
  3650. * Bits 31:0
  3651. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3652. * DDR address where IPA uC updates the Read Index for Ring2.
  3653. * If Second RX ring is completion ring, this is NOT used
  3654. * - RX_RING2_RD_IDX_ADDR_HI
  3655. * Bits 31:0
  3656. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3657. * DDR address where IPA uC updates the Read Index for Ring2.
  3658. * If Second RX ring is completion ring, this is NOT used
  3659. * - RX_RING2_WR_IDX_ADDR_LO
  3660. * Bits 31:0
  3661. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3662. * DDR address where WIFI FW updates the Write Index
  3663. * for WDI_IPA RX ring2
  3664. * If second RX ring is completion ring, lower 4 bytes of
  3665. * DDR address where IPA uC updates the Write Index for Ring 2.
  3666. * - RX_RING2_WR_IDX_ADDR_HI
  3667. * Bits 31:0
  3668. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3669. * DDR address where WIFI FW updates the Write Index
  3670. * for WDI_IPA RX ring2
  3671. * If second RX ring is completion ring, higher 4 bytes of
  3672. * DDR address where IPA uC updates the Write Index for Ring 2.
  3673. */
  3674. #if HTT_PADDR64
  3675. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3676. #else
  3677. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3678. #endif
  3679. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3680. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3681. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3682. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3683. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3684. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3685. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3686. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3687. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3688. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3689. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3690. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3695. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3696. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3697. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3698. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3699. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3700. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3701. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3702. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3703. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3705. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3707. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3709. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3715. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3717. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3719. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3721. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3741. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3742. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3743. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3744. do { \
  3745. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3746. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3747. } while (0)
  3748. /* for systems using 32-bit format for bus addr */
  3749. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3750. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3751. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3754. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3755. } while (0)
  3756. /* for systems using 64-bit format for bus addr */
  3757. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3758. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3759. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3760. do { \
  3761. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3762. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3763. } while (0)
  3764. /* for systems using 64-bit format for bus addr */
  3765. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3766. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3767. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3768. do { \
  3769. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3770. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3771. } while (0)
  3772. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3773. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3774. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3775. do { \
  3776. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3777. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3778. } while (0)
  3779. /* for systems using 32-bit format for bus addr */
  3780. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3781. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3782. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3783. do { \
  3784. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3785. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3786. } while (0)
  3787. /* for systems using 64-bit format for bus addr */
  3788. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3789. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3790. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3791. do { \
  3792. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3793. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3794. } while (0)
  3795. /* for systems using 64-bit format for bus addr */
  3796. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3797. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3798. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3799. do { \
  3800. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3801. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3802. } while (0)
  3803. /* for systems using 32-bit format for bus addr */
  3804. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3805. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3806. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3807. do { \
  3808. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3809. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3810. } while (0)
  3811. /* for systems using 64-bit format for bus addr */
  3812. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3813. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3814. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3815. do { \
  3816. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3817. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3818. } while (0)
  3819. /* for systems using 64-bit format for bus addr */
  3820. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3821. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3822. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3823. do { \
  3824. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3825. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3826. } while (0)
  3827. /* for systems using 32-bit format for bus addr */
  3828. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3829. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3830. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3831. do { \
  3832. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3833. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3834. } while (0)
  3835. /* for systems using 64-bit format for bus addr */
  3836. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3837. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3838. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3839. do { \
  3840. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3841. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3842. } while (0)
  3843. /* for systems using 64-bit format for bus addr */
  3844. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3845. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3846. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3847. do { \
  3848. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3849. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3850. } while (0)
  3851. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3852. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3853. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3854. do { \
  3855. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3856. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3857. } while (0)
  3858. /* for systems using 32-bit format for bus addr */
  3859. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3860. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3861. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3862. do { \
  3863. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3864. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3865. } while (0)
  3866. /* for systems using 64-bit format for bus addr */
  3867. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3868. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3869. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3870. do { \
  3871. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3872. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3873. } while (0)
  3874. /* for systems using 64-bit format for bus addr */
  3875. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3876. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3877. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3878. do { \
  3879. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3880. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3881. } while (0)
  3882. /* for systems using 32-bit format for bus addr */
  3883. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3884. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3885. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3886. do { \
  3887. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3888. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3889. } while (0)
  3890. /* for systems using 64-bit format for bus addr */
  3891. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3892. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3893. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3894. do { \
  3895. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3896. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3897. } while (0)
  3898. /* for systems using 64-bit format for bus addr */
  3899. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3900. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3901. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3902. do { \
  3903. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3904. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3905. } while (0)
  3906. /* for systems using 32-bit format for bus addr */
  3907. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3908. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3909. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3910. do { \
  3911. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3912. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3913. } while (0)
  3914. /* for systems using 64-bit format for bus addr */
  3915. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3916. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3917. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3918. do { \
  3919. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3920. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3921. } while (0)
  3922. /* for systems using 64-bit format for bus addr */
  3923. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3924. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3925. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3926. do { \
  3927. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3928. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3929. } while (0)
  3930. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3931. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3932. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3933. do { \
  3934. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3935. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3936. } while (0)
  3937. /* for systems using 32-bit format for bus addr */
  3938. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3939. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3940. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3941. do { \
  3942. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3943. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3944. } while (0)
  3945. /* for systems using 64-bit format for bus addr */
  3946. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3947. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3948. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3949. do { \
  3950. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3951. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3952. } while (0)
  3953. /* for systems using 64-bit format for bus addr */
  3954. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3955. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3956. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3957. do { \
  3958. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3959. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3960. } while (0)
  3961. /* for systems using 32-bit format for bus addr */
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3963. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3964. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3965. do { \
  3966. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3967. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3968. } while (0)
  3969. /* for systems using 64-bit format for bus addr */
  3970. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3971. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3972. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3973. do { \
  3974. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3975. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3976. } while (0)
  3977. /* for systems using 64-bit format for bus addr */
  3978. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3979. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3980. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3981. do { \
  3982. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3983. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3984. } while (0)
  3985. /*
  3986. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3987. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3988. * addresses are stored in a XXX-bit field.
  3989. * This macro is used to define both htt_wdi_ipa_config32_t and
  3990. * htt_wdi_ipa_config64_t structs.
  3991. */
  3992. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3993. _paddr__tx_comp_ring_base_addr_, \
  3994. _paddr__tx_comp_wr_idx_addr_, \
  3995. _paddr__tx_ce_wr_idx_addr_, \
  3996. _paddr__rx_ind_ring_base_addr_, \
  3997. _paddr__rx_ind_rd_idx_addr_, \
  3998. _paddr__rx_ind_wr_idx_addr_, \
  3999. _paddr__rx_ring2_base_addr_,\
  4000. _paddr__rx_ring2_rd_idx_addr_,\
  4001. _paddr__rx_ring2_wr_idx_addr_) \
  4002. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4003. { \
  4004. /* DWORD 0: flags and meta-data */ \
  4005. A_UINT32 \
  4006. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4007. reserved: 8, \
  4008. tx_pkt_pool_size: 16;\
  4009. /* DWORD 1 */\
  4010. _paddr__tx_comp_ring_base_addr_;\
  4011. /* DWORD 2 (or 3)*/\
  4012. A_UINT32 tx_comp_ring_size;\
  4013. /* DWORD 3 (or 4)*/\
  4014. _paddr__tx_comp_wr_idx_addr_;\
  4015. /* DWORD 4 (or 6)*/\
  4016. _paddr__tx_ce_wr_idx_addr_;\
  4017. /* DWORD 5 (or 8)*/\
  4018. _paddr__rx_ind_ring_base_addr_;\
  4019. /* DWORD 6 (or 10)*/\
  4020. A_UINT32 rx_ind_ring_size;\
  4021. /* DWORD 7 (or 11)*/\
  4022. _paddr__rx_ind_rd_idx_addr_;\
  4023. /* DWORD 8 (or 13)*/\
  4024. _paddr__rx_ind_wr_idx_addr_;\
  4025. /* DWORD 9 (or 15)*/\
  4026. _paddr__rx_ring2_base_addr_;\
  4027. /* DWORD 10 (or 17) */\
  4028. A_UINT32 rx_ring2_size;\
  4029. /* DWORD 11 (or 18) */\
  4030. _paddr__rx_ring2_rd_idx_addr_;\
  4031. /* DWORD 12 (or 20) */\
  4032. _paddr__rx_ring2_wr_idx_addr_;\
  4033. } POSTPACK
  4034. /* define a htt_wdi_ipa_config32_t type */
  4035. 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));
  4036. /* define a htt_wdi_ipa_config64_t type */
  4037. 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));
  4038. #if HTT_PADDR64
  4039. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4040. #else
  4041. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4042. #endif
  4043. enum htt_wdi_ipa_op_code {
  4044. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4045. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4046. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4047. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4048. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4049. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4050. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4051. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4052. /* keep this last */
  4053. HTT_WDI_IPA_OPCODE_MAX
  4054. };
  4055. /**
  4056. * @brief HTT WDI_IPA Operation Request Message
  4057. *
  4058. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4059. *
  4060. * @details
  4061. * HTT WDI_IPA Operation Request message is sent by host
  4062. * to either suspend or resume WDI_IPA TX or RX path.
  4063. * |31 24|23 16|15 8|7 0|
  4064. * |----------------+----------------+----------------+----------------|
  4065. * | op_code | Rsvd | msg_type |
  4066. * |-------------------------------------------------------------------|
  4067. *
  4068. * Header fields:
  4069. * - MSG_TYPE
  4070. * Bits 7:0
  4071. * Purpose: Identifies this as WDI_IPA Operation Request message
  4072. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4073. * - OP_CODE
  4074. * Bits 31:16
  4075. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4076. * value: = enum htt_wdi_ipa_op_code
  4077. */
  4078. PREPACK struct htt_wdi_ipa_op_request_t
  4079. {
  4080. /* DWORD 0: flags and meta-data */
  4081. A_UINT32
  4082. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4083. reserved: 8,
  4084. op_code: 16;
  4085. } POSTPACK;
  4086. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4087. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4088. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4089. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4090. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4091. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4092. do { \
  4093. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4094. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4095. } while (0)
  4096. /*
  4097. * @brief host -> target HTT_SRING_SETUP message
  4098. *
  4099. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4100. *
  4101. * @details
  4102. * After target is booted up, Host can send SRING setup message for
  4103. * each host facing LMAC SRING. Target setups up HW registers based
  4104. * on setup message and confirms back to Host if response_required is set.
  4105. * Host should wait for confirmation message before sending new SRING
  4106. * setup message
  4107. *
  4108. * The message would appear as follows:
  4109. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4110. * |--------------- +-----------------+-----------------+-----------------|
  4111. * | ring_type | ring_id | pdev_id | msg_type |
  4112. * |----------------------------------------------------------------------|
  4113. * | ring_base_addr_lo |
  4114. * |----------------------------------------------------------------------|
  4115. * | ring_base_addr_hi |
  4116. * |----------------------------------------------------------------------|
  4117. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4118. * |----------------------------------------------------------------------|
  4119. * | ring_head_offset32_remote_addr_lo |
  4120. * |----------------------------------------------------------------------|
  4121. * | ring_head_offset32_remote_addr_hi |
  4122. * |----------------------------------------------------------------------|
  4123. * | ring_tail_offset32_remote_addr_lo |
  4124. * |----------------------------------------------------------------------|
  4125. * | ring_tail_offset32_remote_addr_hi |
  4126. * |----------------------------------------------------------------------|
  4127. * | ring_msi_addr_lo |
  4128. * |----------------------------------------------------------------------|
  4129. * | ring_msi_addr_hi |
  4130. * |----------------------------------------------------------------------|
  4131. * | ring_msi_data |
  4132. * |----------------------------------------------------------------------|
  4133. * | intr_timer_th |IM| intr_batch_counter_th |
  4134. * |----------------------------------------------------------------------|
  4135. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4136. * |----------------------------------------------------------------------|
  4137. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4138. * |----------------------------------------------------------------------|
  4139. * Where
  4140. * IM = sw_intr_mode
  4141. * RR = response_required
  4142. * PTCF = prefetch_timer_cfg
  4143. * IP = IPA drop flag
  4144. *
  4145. * The message is interpreted as follows:
  4146. * dword0 - b'0:7 - msg_type: This will be set to
  4147. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4148. * b'8:15 - pdev_id:
  4149. * 0 (for rings at SOC/UMAC level),
  4150. * 1/2/3 mac id (for rings at LMAC level)
  4151. * b'16:23 - ring_id: identify which ring is to setup,
  4152. * more details can be got from enum htt_srng_ring_id
  4153. * b'24:31 - ring_type: identify type of host rings,
  4154. * more details can be got from enum htt_srng_ring_type
  4155. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4156. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4157. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4158. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4159. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4160. * SW_TO_HW_RING.
  4161. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4162. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4163. * Lower 32 bits of memory address of the remote variable
  4164. * storing the 4-byte word offset that identifies the head
  4165. * element within the ring.
  4166. * (The head offset variable has type A_UINT32.)
  4167. * Valid for HW_TO_SW and SW_TO_SW rings.
  4168. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4169. * Upper 32 bits of memory address of the remote variable
  4170. * storing the 4-byte word offset that identifies the head
  4171. * element within the ring.
  4172. * (The head offset variable has type A_UINT32.)
  4173. * Valid for HW_TO_SW and SW_TO_SW rings.
  4174. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4175. * Lower 32 bits of memory address of the remote variable
  4176. * storing the 4-byte word offset that identifies the tail
  4177. * element within the ring.
  4178. * (The tail offset variable has type A_UINT32.)
  4179. * Valid for HW_TO_SW and SW_TO_SW rings.
  4180. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4181. * Upper 32 bits of memory address of the remote variable
  4182. * storing the 4-byte word offset that identifies the tail
  4183. * element within the ring.
  4184. * (The tail offset variable has type A_UINT32.)
  4185. * Valid for HW_TO_SW and SW_TO_SW rings.
  4186. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4187. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4188. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4189. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4190. * dword10 - b'0:31 - ring_msi_data: MSI data
  4191. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4192. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4193. * dword11 - b'0:14 - intr_batch_counter_th:
  4194. * batch counter threshold is in units of 4-byte words.
  4195. * HW internally maintains and increments batch count.
  4196. * (see SRING spec for detail description).
  4197. * When batch count reaches threshold value, an interrupt
  4198. * is generated by HW.
  4199. * b'15 - sw_intr_mode:
  4200. * This configuration shall be static.
  4201. * Only programmed at power up.
  4202. * 0: generate pulse style sw interrupts
  4203. * 1: generate level style sw interrupts
  4204. * b'16:31 - intr_timer_th:
  4205. * The timer init value when timer is idle or is
  4206. * initialized to start downcounting.
  4207. * In 8us units (to cover a range of 0 to 524 ms)
  4208. * dword12 - b'0:15 - intr_low_threshold:
  4209. * Used only by Consumer ring to generate ring_sw_int_p.
  4210. * Ring entries low threshold water mark, that is used
  4211. * in combination with the interrupt timer as well as
  4212. * the the clearing of the level interrupt.
  4213. * b'16:18 - prefetch_timer_cfg:
  4214. * Used only by Consumer ring to set timer mode to
  4215. * support Application prefetch handling.
  4216. * The external tail offset/pointer will be updated
  4217. * at following intervals:
  4218. * 3'b000: (Prefetch feature disabled; used only for debug)
  4219. * 3'b001: 1 usec
  4220. * 3'b010: 4 usec
  4221. * 3'b011: 8 usec (default)
  4222. * 3'b100: 16 usec
  4223. * Others: Reserverd
  4224. * b'19 - response_required:
  4225. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4226. * b'20 - ipa_drop_flag:
  4227. Indicates that host will config ipa drop threshold percentage
  4228. * b'21:31 - reserved: reserved for future use
  4229. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4230. * b'8:15 - ipa drop high threshold percentage:
  4231. * b'16:31 - Reserved
  4232. */
  4233. PREPACK struct htt_sring_setup_t {
  4234. A_UINT32 msg_type: 8,
  4235. pdev_id: 8,
  4236. ring_id: 8,
  4237. ring_type: 8;
  4238. A_UINT32 ring_base_addr_lo;
  4239. A_UINT32 ring_base_addr_hi;
  4240. A_UINT32 ring_size: 16,
  4241. ring_entry_size: 8,
  4242. ring_misc_cfg_flag: 8;
  4243. A_UINT32 ring_head_offset32_remote_addr_lo;
  4244. A_UINT32 ring_head_offset32_remote_addr_hi;
  4245. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4246. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4247. A_UINT32 ring_msi_addr_lo;
  4248. A_UINT32 ring_msi_addr_hi;
  4249. A_UINT32 ring_msi_data;
  4250. A_UINT32 intr_batch_counter_th: 15,
  4251. sw_intr_mode: 1,
  4252. intr_timer_th: 16;
  4253. A_UINT32 intr_low_threshold: 16,
  4254. prefetch_timer_cfg: 3,
  4255. response_required: 1,
  4256. ipa_drop_flag: 1,
  4257. reserved1: 11;
  4258. A_UINT32 ipa_drop_low_threshold: 8,
  4259. ipa_drop_high_threshold: 8,
  4260. reserved: 16;
  4261. } POSTPACK;
  4262. enum htt_srng_ring_type {
  4263. HTT_HW_TO_SW_RING = 0,
  4264. HTT_SW_TO_HW_RING,
  4265. HTT_SW_TO_SW_RING,
  4266. /* Insert new ring types above this line */
  4267. };
  4268. enum htt_srng_ring_id {
  4269. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4270. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4271. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4272. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4273. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4274. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4275. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4276. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4277. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4278. /* Add Other SRING which can't be directly configured by host software above this line */
  4279. };
  4280. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4281. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4282. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4283. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4284. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4285. HTT_SRING_SETUP_PDEV_ID_S)
  4286. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4289. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4290. } while (0)
  4291. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4292. #define HTT_SRING_SETUP_RING_ID_S 16
  4293. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4294. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4295. HTT_SRING_SETUP_RING_ID_S)
  4296. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4299. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4300. } while (0)
  4301. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4302. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4303. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4304. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4305. HTT_SRING_SETUP_RING_TYPE_S)
  4306. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4309. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4310. } while (0)
  4311. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4312. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4313. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4314. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4315. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4316. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4319. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4320. } while (0)
  4321. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4322. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4323. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4324. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4325. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4326. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4329. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4330. } while (0)
  4331. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4332. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4333. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4334. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4335. HTT_SRING_SETUP_RING_SIZE_S)
  4336. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4339. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4340. } while (0)
  4341. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4342. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4343. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4344. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4345. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4346. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4349. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4350. } while (0)
  4351. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4352. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4353. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4354. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4355. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4356. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4359. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4360. } while (0)
  4361. /* This control bit is applicable to only Producer, which updates Ring ID field
  4362. * of each descriptor before pushing into the ring.
  4363. * 0: updates ring_id(default)
  4364. * 1: ring_id updating disabled */
  4365. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4366. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4367. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4368. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4369. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4370. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4371. do { \
  4372. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4373. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4374. } while (0)
  4375. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4376. * of each descriptor before pushing into the ring.
  4377. * 0: updates Loopcnt(default)
  4378. * 1: Loopcnt updating disabled */
  4379. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4380. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4381. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4382. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4383. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4384. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4385. do { \
  4386. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4387. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4388. } while (0)
  4389. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4390. * into security_id port of GXI/AXI. */
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4393. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4394. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4395. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4399. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4400. } while (0)
  4401. /* During MSI write operation, SRNG drives value of this register bit into
  4402. * swap bit of GXI/AXI. */
  4403. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4404. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4405. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4406. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4407. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4408. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4409. do { \
  4410. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4411. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4412. } while (0)
  4413. /* During Pointer write operation, SRNG drives value of this register bit into
  4414. * swap bit of GXI/AXI. */
  4415. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4416. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4417. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4418. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4419. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4420. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4421. do { \
  4422. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4423. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4424. } while (0)
  4425. /* During any data or TLV write operation, SRNG drives value of this register
  4426. * bit into swap bit of GXI/AXI. */
  4427. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4428. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4429. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4430. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4431. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4432. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4433. do { \
  4434. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4435. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4436. } while (0)
  4437. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4438. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4439. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4440. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4441. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4442. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4443. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4444. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4447. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4448. } while (0)
  4449. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4450. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4451. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4452. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4453. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4454. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4455. do { \
  4456. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4457. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4458. } while (0)
  4459. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4460. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4461. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4462. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4463. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4464. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4465. do { \
  4466. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4467. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4468. } while (0)
  4469. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4470. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4471. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4472. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4473. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4474. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4475. do { \
  4476. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4477. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4478. } while (0)
  4479. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4480. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4481. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4482. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4483. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4484. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4485. do { \
  4486. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4487. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4488. } while (0)
  4489. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4490. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4491. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4492. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4493. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4494. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4495. do { \
  4496. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4497. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4498. } while (0)
  4499. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4500. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4501. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4502. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4503. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4504. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4505. do { \
  4506. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4507. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4508. } while (0)
  4509. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4510. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4511. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4512. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4513. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4514. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4515. do { \
  4516. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4517. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4518. } while (0)
  4519. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4520. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4521. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4522. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4523. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4524. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4527. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4528. } while (0)
  4529. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4530. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4531. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4532. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4533. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4534. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4537. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4538. } while (0)
  4539. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4540. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4541. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4542. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4543. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4544. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4547. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4548. } while (0)
  4549. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4550. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4551. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4552. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4553. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4554. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4557. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4558. } while (0)
  4559. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4560. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4561. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4562. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4563. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4564. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4567. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4568. } while (0)
  4569. /**
  4570. * @brief host -> target RX ring selection config message
  4571. *
  4572. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4573. *
  4574. * @details
  4575. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4576. * configure RXDMA rings.
  4577. * The configuration is per ring based and includes both packet subtypes
  4578. * and PPDU/MPDU TLVs.
  4579. *
  4580. * The message would appear as follows:
  4581. *
  4582. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4583. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4584. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4585. * |-------------------------------------------------------------------|
  4586. * | rsvd2 | ring_buffer_size |
  4587. * |-------------------------------------------------------------------|
  4588. * | packet_type_enable_flags_0 |
  4589. * |-------------------------------------------------------------------|
  4590. * | packet_type_enable_flags_1 |
  4591. * |-------------------------------------------------------------------|
  4592. * | packet_type_enable_flags_2 |
  4593. * |-------------------------------------------------------------------|
  4594. * | packet_type_enable_flags_3 |
  4595. * |-------------------------------------------------------------------|
  4596. * | tlv_filter_in_flags |
  4597. * |-------------------------------------------------------------------|
  4598. * | rx_header_offset | rx_packet_offset |
  4599. * |-------------------------------------------------------------------|
  4600. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4601. * |-------------------------------------------------------------------|
  4602. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4603. * |-------------------------------------------------------------------|
  4604. * | rsvd3 | rx_attention_offset |
  4605. * |-------------------------------------------------------------------|
  4606. * | rsvd4 | mo| fp| rx_drop_threshold |
  4607. * | |ndp|ndp| |
  4608. * |-------------------------------------------------------------------|
  4609. * Where:
  4610. * PS = pkt_swap
  4611. * SS = status_swap
  4612. * OV = rx_offsets_valid
  4613. * DT = drop_thresh_valid
  4614. * The message is interpreted as follows:
  4615. * dword0 - b'0:7 - msg_type: This will be set to
  4616. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4617. * b'8:15 - pdev_id:
  4618. * 0 (for rings at SOC/UMAC level),
  4619. * 1/2/3 mac id (for rings at LMAC level)
  4620. * b'16:23 - ring_id : Identify the ring to configure.
  4621. * More details can be got from enum htt_srng_ring_id
  4622. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4623. * BUF_RING_CFG_0 defs within HW .h files,
  4624. * e.g. wmac_top_reg_seq_hwioreg.h
  4625. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4626. * BUF_RING_CFG_0 defs within HW .h files,
  4627. * e.g. wmac_top_reg_seq_hwioreg.h
  4628. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4629. * configuration fields are valid
  4630. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4631. * rx_drop_threshold field is valid
  4632. * b'28:31 - rsvd1: reserved for future use
  4633. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4634. * in byte units.
  4635. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4636. * - b'16:31 - rsvd2: Reserved for future use
  4637. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4638. * Enable MGMT packet from 0b0000 to 0b1001
  4639. * bits from low to high: FP, MD, MO - 3 bits
  4640. * FP: Filter_Pass
  4641. * MD: Monitor_Direct
  4642. * MO: Monitor_Other
  4643. * 10 mgmt subtypes * 3 bits -> 30 bits
  4644. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4645. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4646. * Enable MGMT packet from 0b1010 to 0b1111
  4647. * bits from low to high: FP, MD, MO - 3 bits
  4648. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4649. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4650. * Enable CTRL packet from 0b0000 to 0b1001
  4651. * bits from low to high: FP, MD, MO - 3 bits
  4652. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4653. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4654. * Enable CTRL packet from 0b1010 to 0b1111,
  4655. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4656. * bits from low to high: FP, MD, MO - 3 bits
  4657. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4658. * dword6 - b'0:31 - tlv_filter_in_flags:
  4659. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4660. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4661. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4662. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4663. * A value of 0 will be considered as ignore this config.
  4664. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4665. * e.g. wmac_top_reg_seq_hwioreg.h
  4666. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4667. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4668. * A value of 0 will be considered as ignore this config.
  4669. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4670. * e.g. wmac_top_reg_seq_hwioreg.h
  4671. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4672. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4673. * A value of 0 will be considered as ignore this config.
  4674. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4675. * e.g. wmac_top_reg_seq_hwioreg.h
  4676. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4677. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4678. * A value of 0 will be considered as ignore this config.
  4679. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4680. * e.g. wmac_top_reg_seq_hwioreg.h
  4681. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4682. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4683. * A value of 0 will be considered as ignore this config.
  4684. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4685. * e.g. wmac_top_reg_seq_hwioreg.h
  4686. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4687. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4688. * A value of 0 will be considered as ignore this config.
  4689. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4690. * e.g. wmac_top_reg_seq_hwioreg.h
  4691. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4692. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4693. * A value of 0 will be considered as ignore this config.
  4694. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4695. * e.g. wmac_top_reg_seq_hwioreg.h
  4696. * - b'16:31 - rsvd3 for future use
  4697. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4698. * to source rings. Consumer drops packets if the available
  4699. * words in the ring falls below the configured threshold
  4700. * value.
  4701. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4702. * by host. 1 -> subscribed
  4703. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4704. * by host. 1 -> subscribed
  4705. */
  4706. PREPACK struct htt_rx_ring_selection_cfg_t {
  4707. A_UINT32 msg_type: 8,
  4708. pdev_id: 8,
  4709. ring_id: 8,
  4710. status_swap: 1,
  4711. pkt_swap: 1,
  4712. rx_offsets_valid: 1,
  4713. drop_thresh_valid: 1,
  4714. rsvd1: 4;
  4715. A_UINT32 ring_buffer_size: 16,
  4716. rsvd2: 16;
  4717. A_UINT32 packet_type_enable_flags_0;
  4718. A_UINT32 packet_type_enable_flags_1;
  4719. A_UINT32 packet_type_enable_flags_2;
  4720. A_UINT32 packet_type_enable_flags_3;
  4721. A_UINT32 tlv_filter_in_flags;
  4722. A_UINT32 rx_packet_offset: 16,
  4723. rx_header_offset: 16;
  4724. A_UINT32 rx_mpdu_end_offset: 16,
  4725. rx_mpdu_start_offset: 16;
  4726. A_UINT32 rx_msdu_end_offset: 16,
  4727. rx_msdu_start_offset: 16;
  4728. A_UINT32 rx_attn_offset: 16,
  4729. rsvd3: 16;
  4730. A_UINT32 rx_drop_threshold: 10,
  4731. fp_ndp: 1,
  4732. mo_ndp: 1,
  4733. rsvd4: 20;
  4734. } POSTPACK;
  4735. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4736. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4737. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4738. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4739. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4740. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4741. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4745. } while (0)
  4746. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4747. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4748. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4749. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4750. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4751. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4754. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4755. } while (0)
  4756. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4757. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4758. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4759. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4760. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4761. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4764. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4765. } while (0)
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4769. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4770. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4774. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4775. } while (0)
  4776. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4777. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4778. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4779. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4780. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4781. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4784. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4785. } while (0)
  4786. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4787. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4788. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4789. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4790. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4791. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4794. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4795. } while (0)
  4796. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4797. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4798. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4799. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4800. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4801. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4802. do { \
  4803. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4804. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4805. } while (0)
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4809. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4810. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4814. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4815. } while (0)
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4819. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4820. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4822. do { \
  4823. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4824. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4825. } while (0)
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4829. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4830. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4832. do { \
  4833. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4834. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4835. } while (0)
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4839. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4840. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4842. do { \
  4843. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4844. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4845. } while (0)
  4846. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4847. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4848. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4849. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4850. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4851. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4852. do { \
  4853. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4854. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4855. } while (0)
  4856. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4857. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4858. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4859. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4860. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4861. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4862. do { \
  4863. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4864. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4865. } while (0)
  4866. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4867. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4868. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4869. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4870. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4871. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4874. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4875. } while (0)
  4876. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4877. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4878. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4879. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4880. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4881. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4882. do { \
  4883. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4884. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4885. } while (0)
  4886. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4888. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4889. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4890. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4891. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4892. do { \
  4893. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4894. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4895. } while (0)
  4896. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4898. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4899. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4900. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4901. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4904. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4905. } while (0)
  4906. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4908. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4909. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4910. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4911. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4914. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4915. } while (0)
  4916. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4918. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4919. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4920. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4921. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4922. do { \
  4923. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4924. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4925. } while (0)
  4926. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4928. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4929. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4930. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4931. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4932. do { \
  4933. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4934. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4935. } while (0)
  4936. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4937. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4938. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4939. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4940. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4941. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4942. do { \
  4943. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4944. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4945. } while (0)
  4946. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4947. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4948. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4949. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4950. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4951. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4952. do { \
  4953. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4954. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4955. } while (0)
  4956. /*
  4957. * Subtype based MGMT frames enable bits.
  4958. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4959. */
  4960. /* association request */
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4967. /* association response */
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4974. /* Reassociation request */
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4981. /* Reassociation response */
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4988. /* Probe request */
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4995. /* Probe response */
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5002. /* Timing Advertisement */
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5009. /* Reserved */
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5016. /* Beacon */
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5023. /* ATIM */
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5030. /* Disassociation */
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5037. /* Authentication */
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5044. /* Deauthentication */
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5051. /* Action */
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5058. /* Action No Ack */
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5065. /* Reserved */
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5072. /*
  5073. * Subtype based CTRL frames enable bits.
  5074. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5075. */
  5076. /* Reserved */
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5083. /* Reserved */
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5090. /* Reserved */
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5097. /* Reserved */
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5104. /* Reserved */
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5111. /* Reserved */
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5118. /* Reserved */
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5125. /* Control Wrapper */
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5132. /* Block Ack Request */
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5139. /* Block Ack*/
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5146. /* PS-POLL */
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5153. /* RTS */
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5160. /* CTS */
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5167. /* ACK */
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5174. /* CF-END */
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5181. /* CF-END + CF-ACK */
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5188. /* Multicast data */
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5195. /* Unicast data */
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5202. /* NULL data */
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5210. do { \
  5211. HTT_CHECK_SET_VAL(httsym, value); \
  5212. (word) |= (value) << httsym##_S; \
  5213. } while (0)
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5215. (((word) & httsym##_M) >> httsym##_S)
  5216. #define htt_rx_ring_pkt_enable_subtype_set( \
  5217. word, flag, mode, type, subtype, val) \
  5218. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5219. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5220. #define htt_rx_ring_pkt_enable_subtype_get( \
  5221. word, flag, mode, type, subtype) \
  5222. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5223. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5224. /* Definition to filter in TLVs */
  5225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5234. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5235. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5251. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5252. do { \
  5253. HTT_CHECK_SET_VAL(httsym, enable); \
  5254. (word) |= (enable) << httsym##_S; \
  5255. } while (0)
  5256. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5257. (((word) & httsym##_M) >> httsym##_S)
  5258. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5259. HTT_RX_RING_TLV_ENABLE_SET( \
  5260. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5261. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5262. HTT_RX_RING_TLV_ENABLE_GET( \
  5263. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5264. /**
  5265. * @brief host --> target Receive Flow Steering configuration message definition
  5266. *
  5267. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5268. *
  5269. * host --> target Receive Flow Steering configuration message definition.
  5270. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5271. * The reason for this is we want RFS to be configured and ready before MAC
  5272. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5273. *
  5274. * |31 24|23 16|15 9|8|7 0|
  5275. * |----------------+----------------+----------------+----------------|
  5276. * | reserved |E| msg type |
  5277. * |-------------------------------------------------------------------|
  5278. * Where E = RFS enable flag
  5279. *
  5280. * The RFS_CONFIG message consists of a single 4-byte word.
  5281. *
  5282. * Header fields:
  5283. * - MSG_TYPE
  5284. * Bits 7:0
  5285. * Purpose: identifies this as a RFS config msg
  5286. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5287. * - RFS_CONFIG
  5288. * Bit 8
  5289. * Purpose: Tells target whether to enable (1) or disable (0)
  5290. * flow steering feature when sending rx indication messages to host
  5291. */
  5292. #define HTT_H2T_RFS_CONFIG_M 0x100
  5293. #define HTT_H2T_RFS_CONFIG_S 8
  5294. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5295. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5296. HTT_H2T_RFS_CONFIG_S)
  5297. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5298. do { \
  5299. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5300. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5301. } while (0)
  5302. #define HTT_RFS_CFG_REQ_BYTES 4
  5303. /**
  5304. * @brief host -> target FW extended statistics retrieve
  5305. *
  5306. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5307. *
  5308. * @details
  5309. * The following field definitions describe the format of the HTT host
  5310. * to target FW extended stats retrieve message.
  5311. * The message specifies the type of stats the host wants to retrieve.
  5312. *
  5313. * |31 24|23 16|15 8|7 0|
  5314. * |-----------------------------------------------------------|
  5315. * | reserved | stats type | pdev_mask | msg type |
  5316. * |-----------------------------------------------------------|
  5317. * | config param [0] |
  5318. * |-----------------------------------------------------------|
  5319. * | config param [1] |
  5320. * |-----------------------------------------------------------|
  5321. * | config param [2] |
  5322. * |-----------------------------------------------------------|
  5323. * | config param [3] |
  5324. * |-----------------------------------------------------------|
  5325. * | reserved |
  5326. * |-----------------------------------------------------------|
  5327. * | cookie LSBs |
  5328. * |-----------------------------------------------------------|
  5329. * | cookie MSBs |
  5330. * |-----------------------------------------------------------|
  5331. * Header fields:
  5332. * - MSG_TYPE
  5333. * Bits 7:0
  5334. * Purpose: identifies this is a extended stats upload request message
  5335. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5336. * - PDEV_MASK
  5337. * Bits 8:15
  5338. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5339. * Value: This is a overloaded field, refer to usage and interpretation of
  5340. * PDEV in interface document.
  5341. * Bit 8 : Reserved for SOC stats
  5342. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5343. * Indicates MACID_MASK in DBS
  5344. * - STATS_TYPE
  5345. * Bits 23:16
  5346. * Purpose: identifies which FW statistics to upload
  5347. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5348. * - Reserved
  5349. * Bits 31:24
  5350. * - CONFIG_PARAM [0]
  5351. * Bits 31:0
  5352. * Purpose: give an opaque configuration value to the specified stats type
  5353. * Value: stats-type specific configuration value
  5354. * Refer to htt_stats.h for interpretation for each stats sub_type
  5355. * - CONFIG_PARAM [1]
  5356. * Bits 31:0
  5357. * Purpose: give an opaque configuration value to the specified stats type
  5358. * Value: stats-type specific configuration value
  5359. * Refer to htt_stats.h for interpretation for each stats sub_type
  5360. * - CONFIG_PARAM [2]
  5361. * Bits 31:0
  5362. * Purpose: give an opaque configuration value to the specified stats type
  5363. * Value: stats-type specific configuration value
  5364. * Refer to htt_stats.h for interpretation for each stats sub_type
  5365. * - CONFIG_PARAM [3]
  5366. * Bits 31:0
  5367. * Purpose: give an opaque configuration value to the specified stats type
  5368. * Value: stats-type specific configuration value
  5369. * Refer to htt_stats.h for interpretation for each stats sub_type
  5370. * - Reserved [31:0] for future use.
  5371. * - COOKIE_LSBS
  5372. * Bits 31:0
  5373. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5374. * message with its preceding host->target stats request message.
  5375. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5376. * - COOKIE_MSBS
  5377. * Bits 31:0
  5378. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5379. * message with its preceding host->target stats request message.
  5380. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5381. */
  5382. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5383. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5384. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5385. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5386. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5387. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5388. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5389. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5390. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5391. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5392. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5393. do { \
  5394. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5395. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5396. } while (0)
  5397. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5398. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5399. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5400. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5401. do { \
  5402. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5403. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5404. } while (0)
  5405. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5406. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5407. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5408. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5411. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5412. } while (0)
  5413. /**
  5414. * @brief host -> target FW PPDU_STATS request message
  5415. *
  5416. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5417. *
  5418. * @details
  5419. * The following field definitions describe the format of the HTT host
  5420. * to target FW for PPDU_STATS_CFG msg.
  5421. * The message allows the host to configure the PPDU_STATS_IND messages
  5422. * produced by the target.
  5423. *
  5424. * |31 24|23 16|15 8|7 0|
  5425. * |-----------------------------------------------------------|
  5426. * | REQ bit mask | pdev_mask | msg type |
  5427. * |-----------------------------------------------------------|
  5428. * Header fields:
  5429. * - MSG_TYPE
  5430. * Bits 7:0
  5431. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5432. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5433. * - PDEV_MASK
  5434. * Bits 8:15
  5435. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5436. * Value: This is a overloaded field, refer to usage and interpretation of
  5437. * PDEV in interface document.
  5438. * Bit 8 : Reserved for SOC stats
  5439. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5440. * Indicates MACID_MASK in DBS
  5441. * - REQ_TLV_BIT_MASK
  5442. * Bits 16:31
  5443. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5444. * needs to be included in the target's PPDU_STATS_IND messages.
  5445. * Value: refer htt_ppdu_stats_tlv_tag_t
  5446. *
  5447. */
  5448. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5449. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5450. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5451. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5452. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5453. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5454. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5455. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5456. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5457. do { \
  5458. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5459. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5460. } while (0)
  5461. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5462. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5463. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5464. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5467. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5468. } while (0)
  5469. /**
  5470. * @brief Host-->target HTT RX FSE setup message
  5471. *
  5472. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5473. *
  5474. * @details
  5475. * Through this message, the host will provide details of the flow tables
  5476. * in host DDR along with hash keys.
  5477. * This message can be sent per SOC or per PDEV, which is differentiated
  5478. * by pdev id values.
  5479. * The host will allocate flow search table and sends table size,
  5480. * physical DMA address of flow table, and hash keys to firmware to
  5481. * program into the RXOLE FSE HW block.
  5482. *
  5483. * The following field definitions describe the format of the RX FSE setup
  5484. * message sent from the host to target
  5485. *
  5486. * Header fields:
  5487. * dword0 - b'7:0 - msg_type: This will be set to
  5488. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5489. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5490. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5491. * pdev's LMAC ring.
  5492. * b'31:16 - reserved : Reserved for future use
  5493. * dword1 - b'19:0 - number of records: This field indicates the number of
  5494. * entries in the flow table. For example: 8k number of
  5495. * records is equivalent to
  5496. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5497. * b'27:20 - max search: This field specifies the skid length to FSE
  5498. * parser HW module whenever match is not found at the
  5499. * exact index pointed by hash.
  5500. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5501. * Refer htt_ip_da_sa_prefix below for more details.
  5502. * b'31:30 - reserved: Reserved for future use
  5503. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5504. * table allocated by host in DDR
  5505. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5506. * table allocated by host in DDR
  5507. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5508. * entry hashing
  5509. *
  5510. *
  5511. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5512. * |---------------------------------------------------------------|
  5513. * | reserved | pdev_id | MSG_TYPE |
  5514. * |---------------------------------------------------------------|
  5515. * |resvd|IPDSA| max_search | Number of records |
  5516. * |---------------------------------------------------------------|
  5517. * | base address lo |
  5518. * |---------------------------------------------------------------|
  5519. * | base address high |
  5520. * |---------------------------------------------------------------|
  5521. * | toeplitz key 31_0 |
  5522. * |---------------------------------------------------------------|
  5523. * | toeplitz key 63_32 |
  5524. * |---------------------------------------------------------------|
  5525. * | toeplitz key 95_64 |
  5526. * |---------------------------------------------------------------|
  5527. * | toeplitz key 127_96 |
  5528. * |---------------------------------------------------------------|
  5529. * | toeplitz key 159_128 |
  5530. * |---------------------------------------------------------------|
  5531. * | toeplitz key 191_160 |
  5532. * |---------------------------------------------------------------|
  5533. * | toeplitz key 223_192 |
  5534. * |---------------------------------------------------------------|
  5535. * | toeplitz key 255_224 |
  5536. * |---------------------------------------------------------------|
  5537. * | toeplitz key 287_256 |
  5538. * |---------------------------------------------------------------|
  5539. * | reserved | toeplitz key 314_288(26:0 bits) |
  5540. * |---------------------------------------------------------------|
  5541. * where:
  5542. * IPDSA = ip_da_sa
  5543. */
  5544. /**
  5545. * @brief: htt_ip_da_sa_prefix
  5546. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5547. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5548. * documentation per RFC3849
  5549. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5550. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5551. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5552. */
  5553. enum htt_ip_da_sa_prefix {
  5554. HTT_RX_IPV6_20010db8,
  5555. HTT_RX_IPV4_MAPPED_IPV6,
  5556. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5557. HTT_RX_IPV6_64FF9B,
  5558. };
  5559. /**
  5560. * @brief Host-->target HTT RX FISA configure and enable
  5561. *
  5562. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5563. *
  5564. * @details
  5565. * The host will send this command down to configure and enable the FISA
  5566. * operational params.
  5567. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5568. * register.
  5569. * Should configure both the MACs.
  5570. *
  5571. * dword0 - b'7:0 - msg_type:
  5572. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5573. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5574. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5575. * pdev's LMAC ring.
  5576. * b'31:16 - reserved : Reserved for future use
  5577. *
  5578. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5579. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5580. * packets. 1 flow search will be skipped
  5581. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5582. * tcp,udp packets
  5583. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5584. * calculation
  5585. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5586. * calculation
  5587. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5588. * calculation
  5589. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5590. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5591. * length
  5592. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5593. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5594. * length
  5595. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5596. * num jump
  5597. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5598. * num jump
  5599. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5600. * data type switch has happend for MPDU Sequence num jump
  5601. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5602. * for MPDU Sequence num jump
  5603. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5604. * for decrypt errors
  5605. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5606. * while aggregating a msdu
  5607. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5608. * The aggregation is done until (number of MSDUs aggregated
  5609. * < LIMIT + 1)
  5610. * b'31:18 - Reserved
  5611. *
  5612. * fisa_control_value - 32bit value FW can write to register
  5613. *
  5614. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5615. * Threshold value for FISA timeout (units are microseconds).
  5616. * When the global timestamp exceeds this threshold, FISA
  5617. * aggregation will be restarted.
  5618. * A value of 0 means timeout is disabled.
  5619. * Compare the threshold register with timestamp field in
  5620. * flow entry to generate timeout for the flow.
  5621. *
  5622. * |31 18 |17 16|15 8|7 0|
  5623. * |-------------------------------------------------------------|
  5624. * | reserved | pdev_mask | msg type |
  5625. * |-------------------------------------------------------------|
  5626. * | reserved | FISA_CTRL |
  5627. * |-------------------------------------------------------------|
  5628. * | FISA_TIMEOUT_THRESH |
  5629. * |-------------------------------------------------------------|
  5630. */
  5631. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5632. A_UINT32 msg_type:8,
  5633. pdev_id:8,
  5634. reserved0:16;
  5635. /**
  5636. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5637. * [17:0]
  5638. */
  5639. union {
  5640. /*
  5641. * fisa_control_bits structure is deprecated.
  5642. * Please use fisa_control_bits_v2 going forward.
  5643. */
  5644. struct {
  5645. A_UINT32 fisa_enable: 1,
  5646. ipsec_skip_search: 1,
  5647. nontcp_skip_search: 1,
  5648. add_ipv4_fixed_hdr_len: 1,
  5649. add_ipv6_fixed_hdr_len: 1,
  5650. add_tcp_fixed_hdr_len: 1,
  5651. add_udp_hdr_len: 1,
  5652. chksum_cum_ip_len_en: 1,
  5653. disable_tid_check: 1,
  5654. disable_ta_check: 1,
  5655. disable_qos_check: 1,
  5656. disable_raw_check: 1,
  5657. disable_decrypt_err_check: 1,
  5658. disable_msdu_drop_check: 1,
  5659. fisa_aggr_limit: 4,
  5660. reserved: 14;
  5661. } fisa_control_bits;
  5662. struct {
  5663. A_UINT32 fisa_enable: 1,
  5664. fisa_aggr_limit: 4,
  5665. reserved: 27;
  5666. } fisa_control_bits_v2;
  5667. A_UINT32 fisa_control_value;
  5668. } u_fisa_control;
  5669. /**
  5670. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5671. * timeout threshold for aggregation. Unit in usec.
  5672. * [31:0]
  5673. */
  5674. A_UINT32 fisa_timeout_threshold;
  5675. } POSTPACK;
  5676. /* DWord 0: pdev-ID */
  5677. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5678. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5679. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5680. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5681. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5682. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5686. } while (0)
  5687. /* Dword 1: fisa_control_value fisa config */
  5688. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5689. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5690. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5691. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5692. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5693. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5697. } while (0)
  5698. /* Dword 1: fisa_control_value ipsec_skip_search */
  5699. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5700. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5701. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5702. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5703. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5704. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5707. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5708. } while (0)
  5709. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5710. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5711. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5712. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5713. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5714. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5715. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5716. do { \
  5717. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5718. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5719. } while (0)
  5720. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5721. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5722. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5723. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5724. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5725. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5726. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5727. do { \
  5728. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5729. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5730. } while (0)
  5731. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5732. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5733. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5734. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5735. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5736. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5737. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5738. do { \
  5739. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5740. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5741. } while (0)
  5742. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5743. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5744. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5745. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5746. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5747. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5748. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5749. do { \
  5750. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5751. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5752. } while (0)
  5753. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5754. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5755. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5756. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5757. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5758. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5759. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5760. do { \
  5761. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5762. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5763. } while (0)
  5764. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5765. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5766. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5767. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5768. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5769. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5770. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5771. do { \
  5772. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5773. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5774. } while (0)
  5775. /* Dword 1: fisa_control_value disable_tid_check */
  5776. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5777. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5778. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5779. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5780. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5781. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5782. do { \
  5783. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5784. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5785. } while (0)
  5786. /* Dword 1: fisa_control_value disable_ta_check */
  5787. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5788. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5789. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5790. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5791. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5792. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5793. do { \
  5794. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5795. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5796. } while (0)
  5797. /* Dword 1: fisa_control_value disable_qos_check */
  5798. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5799. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5800. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5801. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5802. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5803. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5804. do { \
  5805. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5806. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5807. } while (0)
  5808. /* Dword 1: fisa_control_value disable_raw_check */
  5809. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5810. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5811. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5812. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5813. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5814. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5815. do { \
  5816. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5817. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5818. } while (0)
  5819. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5820. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5821. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5822. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5823. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5824. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5825. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5826. do { \
  5827. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5828. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5829. } while (0)
  5830. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5831. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5832. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5833. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5834. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5835. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5836. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5837. do { \
  5838. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5839. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5840. } while (0)
  5841. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5842. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5843. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5844. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5845. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5846. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5847. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5848. do { \
  5849. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5850. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5851. } while (0)
  5852. /* Dword 1: fisa_control_value fisa config */
  5853. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5854. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5855. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5856. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5857. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5858. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5859. do { \
  5860. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5861. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5862. } while (0)
  5863. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5864. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5865. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5866. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5867. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5868. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5869. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5870. do { \
  5871. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5872. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5873. } while (0)
  5874. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5875. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5876. pdev_id:8,
  5877. reserved0:16;
  5878. A_UINT32 num_records:20,
  5879. max_search:8,
  5880. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5881. reserved1:2;
  5882. A_UINT32 base_addr_lo;
  5883. A_UINT32 base_addr_hi;
  5884. A_UINT32 toeplitz31_0;
  5885. A_UINT32 toeplitz63_32;
  5886. A_UINT32 toeplitz95_64;
  5887. A_UINT32 toeplitz127_96;
  5888. A_UINT32 toeplitz159_128;
  5889. A_UINT32 toeplitz191_160;
  5890. A_UINT32 toeplitz223_192;
  5891. A_UINT32 toeplitz255_224;
  5892. A_UINT32 toeplitz287_256;
  5893. A_UINT32 toeplitz314_288:27,
  5894. reserved2:5;
  5895. } POSTPACK;
  5896. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5897. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5898. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5899. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5900. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5901. /* DWORD 0: Pdev ID */
  5902. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5903. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5904. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5905. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5906. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5907. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5908. do { \
  5909. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5910. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5911. } while (0)
  5912. /* DWORD 1:num of records */
  5913. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5914. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5915. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5916. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5917. HTT_RX_FSE_SETUP_NUM_REC_S)
  5918. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5921. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5922. } while (0)
  5923. /* DWORD 1:max_search */
  5924. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5925. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5926. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5927. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5928. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5929. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5930. do { \
  5931. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5932. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5933. } while (0)
  5934. /* DWORD 1:ip_da_sa prefix */
  5935. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5936. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5937. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5938. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5939. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5940. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5941. do { \
  5942. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5943. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5944. } while (0)
  5945. /* DWORD 2: Base Address LO */
  5946. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5947. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5948. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5949. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5950. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5951. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5952. do { \
  5953. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5954. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5955. } while (0)
  5956. /* DWORD 3: Base Address High */
  5957. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5958. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5959. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5960. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5961. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5962. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5963. do { \
  5964. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5965. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5966. } while (0)
  5967. /* DWORD 4-12: Hash Value */
  5968. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5969. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5970. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5971. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5972. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5973. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5974. do { \
  5975. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5976. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5977. } while (0)
  5978. /* DWORD 13: Hash Value 314:288 bits */
  5979. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5980. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5981. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5982. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5985. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5986. } while (0)
  5987. /**
  5988. * @brief Host-->target HTT RX FSE operation message
  5989. *
  5990. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5991. *
  5992. * @details
  5993. * The host will send this Flow Search Engine (FSE) operation message for
  5994. * every flow add/delete operation.
  5995. * The FSE operation includes FSE full cache invalidation or individual entry
  5996. * invalidation.
  5997. * This message can be sent per SOC or per PDEV which is differentiated
  5998. * by pdev id values.
  5999. *
  6000. * |31 16|15 8|7 1|0|
  6001. * |-------------------------------------------------------------|
  6002. * | reserved | pdev_id | MSG_TYPE |
  6003. * |-------------------------------------------------------------|
  6004. * | reserved | operation |I|
  6005. * |-------------------------------------------------------------|
  6006. * | ip_src_addr_31_0 |
  6007. * |-------------------------------------------------------------|
  6008. * | ip_src_addr_63_32 |
  6009. * |-------------------------------------------------------------|
  6010. * | ip_src_addr_95_64 |
  6011. * |-------------------------------------------------------------|
  6012. * | ip_src_addr_127_96 |
  6013. * |-------------------------------------------------------------|
  6014. * | ip_dst_addr_31_0 |
  6015. * |-------------------------------------------------------------|
  6016. * | ip_dst_addr_63_32 |
  6017. * |-------------------------------------------------------------|
  6018. * | ip_dst_addr_95_64 |
  6019. * |-------------------------------------------------------------|
  6020. * | ip_dst_addr_127_96 |
  6021. * |-------------------------------------------------------------|
  6022. * | l4_dst_port | l4_src_port |
  6023. * | (32-bit SPI incase of IPsec) |
  6024. * |-------------------------------------------------------------|
  6025. * | reserved | l4_proto |
  6026. * |-------------------------------------------------------------|
  6027. *
  6028. * where I is 1-bit ipsec_valid.
  6029. *
  6030. * The following field definitions describe the format of the RX FSE operation
  6031. * message sent from the host to target for every add/delete flow entry to flow
  6032. * table.
  6033. *
  6034. * Header fields:
  6035. * dword0 - b'7:0 - msg_type: This will be set to
  6036. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6037. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6038. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6039. * specified pdev's LMAC ring.
  6040. * b'31:16 - reserved : Reserved for future use
  6041. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6042. * (Internet Protocol Security).
  6043. * IPsec describes the framework for providing security at
  6044. * IP layer. IPsec is defined for both versions of IP:
  6045. * IPV4 and IPV6.
  6046. * Please refer to htt_rx_flow_proto enumeration below for
  6047. * more info.
  6048. * ipsec_valid = 1 for IPSEC packets
  6049. * ipsec_valid = 0 for IP Packets
  6050. * b'7:1 - operation: This indicates types of FSE operation.
  6051. * Refer to htt_rx_fse_operation enumeration:
  6052. * 0 - No Cache Invalidation required
  6053. * 1 - Cache invalidate only one entry given by IP
  6054. * src/dest address at DWORD[2:9]
  6055. * 2 - Complete FSE Cache Invalidation
  6056. * 3 - FSE Disable
  6057. * 4 - FSE Enable
  6058. * b'31:8 - reserved: Reserved for future use
  6059. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6060. * for per flow addition/deletion
  6061. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6062. * and the subsequent 3 A_UINT32 will be padding bytes.
  6063. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6064. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6065. * from 0 to 65535 but only 0 to 1023 are designated as
  6066. * well-known ports. Refer to [RFC1700] for more details.
  6067. * This field is valid only if
  6068. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6069. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6070. * range from 0 to 65535 but only 0 to 1023 are designated
  6071. * as well-known ports. Refer to [RFC1700] for more details.
  6072. * This field is valid only if
  6073. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6074. * - SPI (31:0): Security Parameters Index is an
  6075. * identification tag added to the header while using IPsec
  6076. * for tunneling the IP traffici.
  6077. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6078. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6079. * Assigned Internet Protocol Numbers.
  6080. * l4_proto numbers for standard protocol like UDP/TCP
  6081. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6082. * l4_proto = 17 for UDP etc.
  6083. * b'31:8 - reserved: Reserved for future use.
  6084. *
  6085. */
  6086. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6087. A_UINT32 msg_type:8,
  6088. pdev_id:8,
  6089. reserved0:16;
  6090. A_UINT32 ipsec_valid:1,
  6091. operation:7,
  6092. reserved1:24;
  6093. A_UINT32 ip_src_addr_31_0;
  6094. A_UINT32 ip_src_addr_63_32;
  6095. A_UINT32 ip_src_addr_95_64;
  6096. A_UINT32 ip_src_addr_127_96;
  6097. A_UINT32 ip_dest_addr_31_0;
  6098. A_UINT32 ip_dest_addr_63_32;
  6099. A_UINT32 ip_dest_addr_95_64;
  6100. A_UINT32 ip_dest_addr_127_96;
  6101. union {
  6102. A_UINT32 spi;
  6103. struct {
  6104. A_UINT32 l4_src_port:16,
  6105. l4_dest_port:16;
  6106. } ip;
  6107. } u;
  6108. A_UINT32 l4_proto:8,
  6109. reserved:24;
  6110. } POSTPACK;
  6111. /**
  6112. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6113. *
  6114. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6115. *
  6116. * @details
  6117. * The host will send this Full monitor mode register configuration message.
  6118. * This message can be sent per SOC or per PDEV which is differentiated
  6119. * by pdev id values.
  6120. *
  6121. * |31 16|15 11|10 8|7 3|2|1|0|
  6122. * |-------------------------------------------------------------|
  6123. * | reserved | pdev_id | MSG_TYPE |
  6124. * |-------------------------------------------------------------|
  6125. * | reserved |Release Ring |N|Z|E|
  6126. * |-------------------------------------------------------------|
  6127. *
  6128. * where E is 1-bit full monitor mode enable/disable.
  6129. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6130. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6131. *
  6132. * The following field definitions describe the format of the full monitor
  6133. * mode configuration message sent from the host to target for each pdev.
  6134. *
  6135. * Header fields:
  6136. * dword0 - b'7:0 - msg_type: This will be set to
  6137. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6138. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6139. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6140. * specified pdev's LMAC ring.
  6141. * b'31:16 - reserved : Reserved for future use.
  6142. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6143. * monitor mode rxdma register is to be enabled or disabled.
  6144. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6145. * additional descriptors at ppdu end for zero mpdus
  6146. * enabled or disabled.
  6147. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6148. * additional descriptors at ppdu end for non zero mpdus
  6149. * enabled or disabled.
  6150. * b'10:3 - release_ring: This indicates the destination ring
  6151. * selection for the descriptor at the end of PPDU
  6152. * 0 - REO ring select
  6153. * 1 - FW ring select
  6154. * 2 - SW ring select
  6155. * 3 - Release ring select
  6156. * Refer to htt_rx_full_mon_release_ring.
  6157. * b'31:11 - reserved for future use
  6158. */
  6159. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6160. A_UINT32 msg_type:8,
  6161. pdev_id:8,
  6162. reserved0:16;
  6163. A_UINT32 full_monitor_mode_enable:1,
  6164. addnl_descs_zero_mpdus_end:1,
  6165. addnl_descs_non_zero_mpdus_end:1,
  6166. release_ring:8,
  6167. reserved1:21;
  6168. } POSTPACK;
  6169. /**
  6170. * Enumeration for full monitor mode destination ring select
  6171. * 0 - REO destination ring select
  6172. * 1 - FW destination ring select
  6173. * 2 - SW destination ring select
  6174. * 3 - Release destination ring select
  6175. */
  6176. enum htt_rx_full_mon_release_ring {
  6177. HTT_RX_MON_RING_REO,
  6178. HTT_RX_MON_RING_FW,
  6179. HTT_RX_MON_RING_SW,
  6180. HTT_RX_MON_RING_RELEASE,
  6181. };
  6182. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6183. /* DWORD 0: Pdev ID */
  6184. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6185. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6186. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6187. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6188. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6189. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6190. do { \
  6191. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6192. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6193. } while (0)
  6194. /* DWORD 1:ENABLE */
  6195. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6196. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6197. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6198. do { \
  6199. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6200. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6201. } while (0)
  6202. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6203. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6204. /* DWORD 1:ZERO_MPDU */
  6205. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6206. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6207. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6208. do { \
  6209. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6210. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6211. } while (0)
  6212. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6213. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6214. /* DWORD 1:NON_ZERO_MPDU */
  6215. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6216. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6217. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6218. do { \
  6219. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6220. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6221. } while (0)
  6222. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6223. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6224. /* DWORD 1:RELEASE_RINGS */
  6225. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6226. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6227. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6228. do { \
  6229. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6230. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6231. } while (0)
  6232. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6233. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6234. /**
  6235. * Enumeration for IP Protocol or IPSEC Protocol
  6236. * IPsec describes the framework for providing security at IP layer.
  6237. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6238. */
  6239. enum htt_rx_flow_proto {
  6240. HTT_RX_FLOW_IP_PROTO,
  6241. HTT_RX_FLOW_IPSEC_PROTO,
  6242. };
  6243. /**
  6244. * Enumeration for FSE Cache Invalidation
  6245. * 0 - No Cache Invalidation required
  6246. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6247. * 2 - Complete FSE Cache Invalidation
  6248. * 3 - FSE Disable
  6249. * 4 - FSE Enable
  6250. */
  6251. enum htt_rx_fse_operation {
  6252. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6253. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6254. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6255. HTT_RX_FSE_DISABLE,
  6256. HTT_RX_FSE_ENABLE,
  6257. };
  6258. /* DWORD 0: Pdev ID */
  6259. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6260. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6261. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6262. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6263. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6264. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6265. do { \
  6266. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6267. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6268. } while (0)
  6269. /* DWORD 1:IP PROTO or IPSEC */
  6270. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6271. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6272. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6273. do { \
  6274. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6275. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6276. } while (0)
  6277. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6278. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6279. /* DWORD 1:FSE Operation */
  6280. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6281. #define HTT_RX_FSE_OPERATION_S 1
  6282. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6283. do { \
  6284. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6285. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6286. } while (0)
  6287. #define HTT_RX_FSE_OPERATION_GET(word) \
  6288. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6289. /* DWORD 2-9:IP Address */
  6290. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6291. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6292. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6293. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6294. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6295. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6298. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6299. } while (0)
  6300. /* DWORD 10:Source Port Number */
  6301. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6302. #define HTT_RX_FSE_SOURCEPORT_S 0
  6303. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6306. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6307. } while (0)
  6308. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6309. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6310. /* DWORD 11:Destination Port Number */
  6311. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6312. #define HTT_RX_FSE_DESTPORT_S 16
  6313. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6316. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6317. } while (0)
  6318. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6319. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6320. /* DWORD 10-11:SPI (In case of IPSEC) */
  6321. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6322. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6323. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6324. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6325. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6326. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6329. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6330. } while (0)
  6331. /* DWORD 12:L4 PROTO */
  6332. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6333. #define HTT_RX_FSE_L4_PROTO_S 0
  6334. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6337. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6338. } while (0)
  6339. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6340. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6341. /**
  6342. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6343. *
  6344. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6345. *
  6346. * |31 24|23 |15 8|7 2|1|0|
  6347. * |----------------+----------------+----------------+----------------|
  6348. * | reserved | pdev_id | msg_type |
  6349. * |---------------------------------+----------------+----------------|
  6350. * | reserved |E|F|
  6351. * |---------------------------------+----------------+----------------|
  6352. * Where E = Configure the target to provide the 3-tuple hash value in
  6353. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6354. * F = Configure the target to provide the 3-tuple hash value in
  6355. * flow_id_toeplitz field of rx_msdu_start tlv
  6356. *
  6357. * The following field definitions describe the format of the 3 tuple hash value
  6358. * message sent from the host to target as part of initialization sequence.
  6359. *
  6360. * Header fields:
  6361. * dword0 - b'7:0 - msg_type: This will be set to
  6362. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6363. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6364. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6365. * specified pdev's LMAC ring.
  6366. * b'31:16 - reserved : Reserved for future use
  6367. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6368. * b'1 - toeplitz_hash_2_or_4_field_enable
  6369. * b'31:2 - reserved : Reserved for future use
  6370. * ---------+------+----------------------------------------------------------
  6371. * bit1 | bit0 | Functionality
  6372. * ---------+------+----------------------------------------------------------
  6373. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6374. * | | in flow_id_toeplitz field
  6375. * ---------+------+----------------------------------------------------------
  6376. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6377. * | | in toeplitz_hash_2_or_4 field
  6378. * ---------+------+----------------------------------------------------------
  6379. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6380. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6381. * ---------+------+----------------------------------------------------------
  6382. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6383. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6384. * | | toeplitz_hash_2_or_4 field
  6385. *----------------------------------------------------------------------------
  6386. */
  6387. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6388. A_UINT32 msg_type :8,
  6389. pdev_id :8,
  6390. reserved0 :16;
  6391. A_UINT32 flow_id_toeplitz_field_enable :1,
  6392. toeplitz_hash_2_or_4_field_enable :1,
  6393. reserved1 :30;
  6394. } POSTPACK;
  6395. /* DWORD0 : pdev_id configuration Macros */
  6396. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6397. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6398. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6399. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6400. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6401. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6402. do { \
  6403. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6404. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6405. } while (0)
  6406. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6407. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6408. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6409. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6410. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6411. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6412. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6413. do { \
  6414. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6415. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6416. } while (0)
  6417. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6418. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6419. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6420. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6421. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6422. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6423. do { \
  6424. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6425. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6426. } while (0)
  6427. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6428. /**
  6429. * @brief host --> target Host PA Address Size
  6430. *
  6431. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6432. *
  6433. * @details
  6434. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6435. * provide the physical start address and size of each of the memory
  6436. * areas within host DDR that the target FW may need to access.
  6437. *
  6438. * For example, the host can use this message to allow the target FW
  6439. * to set up access to the host's pools of TQM link descriptors.
  6440. * The message would appear as follows:
  6441. *
  6442. * |31 24|23 16|15 8|7 0|
  6443. * |----------------+----------------+----------------+----------------|
  6444. * | reserved | num_entries | msg_type |
  6445. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6446. * | mem area 0 size |
  6447. * |----------------+----------------+----------------+----------------|
  6448. * | mem area 0 physical_address_lo |
  6449. * |----------------+----------------+----------------+----------------|
  6450. * | mem area 0 physical_address_hi |
  6451. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6452. * | mem area 1 size |
  6453. * |----------------+----------------+----------------+----------------|
  6454. * | mem area 1 physical_address_lo |
  6455. * |----------------+----------------+----------------+----------------|
  6456. * | mem area 1 physical_address_hi |
  6457. * |----------------+----------------+----------------+----------------|
  6458. * ...
  6459. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6460. * | mem area N size |
  6461. * |----------------+----------------+----------------+----------------|
  6462. * | mem area N physical_address_lo |
  6463. * |----------------+----------------+----------------+----------------|
  6464. * | mem area N physical_address_hi |
  6465. * |----------------+----------------+----------------+----------------|
  6466. *
  6467. * The message is interpreted as follows:
  6468. * dword0 - b'0:7 - msg_type: This will be set to
  6469. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6470. * b'8:15 - number_entries: Indicated the number of host memory
  6471. * areas specified within the remainder of the message
  6472. * b'16:31 - reserved.
  6473. * dword1 - b'0:31 - memory area 0 size in bytes
  6474. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6475. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6476. * and similar for memory area 1 through memory area N.
  6477. */
  6478. PREPACK struct htt_h2t_host_paddr_size {
  6479. A_UINT32 msg_type: 8,
  6480. num_entries: 8,
  6481. reserved: 16;
  6482. } POSTPACK;
  6483. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6484. A_UINT32 size;
  6485. A_UINT32 physical_address_lo;
  6486. A_UINT32 physical_address_hi;
  6487. } POSTPACK;
  6488. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6489. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6490. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6491. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6492. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6493. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6494. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6497. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6498. } while (0)
  6499. /**
  6500. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  6501. *
  6502. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  6503. *
  6504. * @details
  6505. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  6506. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  6507. *
  6508. * The message would appear as follows:
  6509. *
  6510. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  6511. * |---------------------------------+---+---+----------+-+-----------|
  6512. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  6513. * |---------------------+---+---+---+---+---+----------+-+-----------|
  6514. *
  6515. *
  6516. * The message is interpreted as follows:
  6517. * dword0 - b'0:7 - msg_type: This will be set to
  6518. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  6519. * b'8 - override bit to drive MSDUs to PPE ring
  6520. * b'9:13 - REO destination ring indication
  6521. * b'14 - Multi buffer msdu override enable bit
  6522. * b'15 - Intra BSS override
  6523. * b'16 - Decap raw override
  6524. * b'17 - Decap Native wifi override
  6525. * b'18 - IP frag override
  6526. * b'19:31 - reserved
  6527. */
  6528. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  6529. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  6530. override: 1,
  6531. reo_destination_indication: 5,
  6532. multi_buffer_msdu_override_en: 1,
  6533. intra_bss_override: 1,
  6534. decap_raw_override: 1,
  6535. decap_nwifi_override: 1,
  6536. ip_frag_override: 1,
  6537. reserved: 13;
  6538. } POSTPACK;
  6539. /* DWORD 0: Override */
  6540. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  6541. #define HTT_PPE_CFG_OVERRIDE_S 8
  6542. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  6543. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  6544. HTT_PPE_CFG_OVERRIDE_S)
  6545. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  6546. do { \
  6547. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  6548. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  6549. } while (0)
  6550. /* DWORD 0: REO Destination Indication*/
  6551. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  6552. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  6553. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  6554. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  6555. HTT_PPE_CFG_REO_DEST_IND_S)
  6556. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  6557. do { \
  6558. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  6559. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  6560. } while (0)
  6561. /* DWORD 0: Multi buffer MSDU override */
  6562. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  6563. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  6564. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  6565. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  6566. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  6567. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  6568. do { \
  6569. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  6570. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  6571. } while (0)
  6572. /* DWORD 0: Intra BSS override */
  6573. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  6574. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  6575. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  6576. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  6577. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  6578. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  6579. do { \
  6580. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  6581. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  6582. } while (0)
  6583. /* DWORD 0: Decap RAW override */
  6584. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  6585. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  6586. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  6587. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  6588. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  6589. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  6590. do { \
  6591. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  6592. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  6593. } while (0)
  6594. /* DWORD 0: Decap NWIFI override */
  6595. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  6596. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  6597. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  6598. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  6599. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  6600. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  6603. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  6604. } while (0)
  6605. /* DWORD 0: IP frag override */
  6606. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  6607. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  6608. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  6609. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  6610. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  6611. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  6614. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  6615. } while (0)
  6616. /*
  6617. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  6618. *
  6619. * @details
  6620. * The following field definitions describe the format of the HTT host
  6621. * to target FW VDEV TX RX stats retrieve message.
  6622. * The message specifies the type of stats the host wants to retrieve.
  6623. *
  6624. * |31 27|26 25|24 17|16|15 8|7 0|
  6625. * |-----------------------------------------------------------|
  6626. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  6627. * |-----------------------------------------------------------|
  6628. * | vdev_id lower bitmask |
  6629. * |-----------------------------------------------------------|
  6630. * | vdev_id upper bitmask |
  6631. * |-----------------------------------------------------------|
  6632. * Header fields:
  6633. * Where:
  6634. * dword0 - b'7:0 - msg_type: This will be set to
  6635. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  6636. * b'15:8 - pdev id
  6637. * b'16(E) - Enable/Disable the vdev HW stats
  6638. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  6639. * b'25:26(R) - Reset stats bits
  6640. * 0: don't reset stats
  6641. * 1: reset stats once
  6642. * 2: reset stats at the start of each periodic interval
  6643. * b'27:31 - reserved for future use
  6644. * dword1 - b'0:31 - vdev_id lower bitmask
  6645. * dword2 - b'0:31 - vdev_id upper bitmask
  6646. */
  6647. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  6648. A_UINT32 msg_type :8,
  6649. pdev_id :8,
  6650. enable :1,
  6651. periodic_interval :8,
  6652. reset_stats_bits :2,
  6653. reserved0 :5;
  6654. A_UINT32 vdev_id_lower_bitmask;
  6655. A_UINT32 vdev_id_upper_bitmask;
  6656. } POSTPACK;
  6657. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  6658. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  6659. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  6660. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  6661. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  6662. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  6663. do { \
  6664. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  6665. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  6666. } while (0)
  6667. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  6668. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  6669. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  6670. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  6671. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  6672. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  6675. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  6676. } while (0)
  6677. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  6678. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  6679. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  6680. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  6681. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  6682. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  6683. do { \
  6684. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  6685. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  6686. } while (0)
  6687. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  6688. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  6689. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  6690. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  6691. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  6692. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  6693. do { \
  6694. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  6695. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  6696. } while (0)
  6697. /*=== target -> host messages ===============================================*/
  6698. enum htt_t2h_msg_type {
  6699. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6700. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6701. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6702. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6703. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6704. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6705. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6706. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6707. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6708. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6709. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6710. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6711. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6712. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6713. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6714. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6715. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6716. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6717. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6718. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6719. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6720. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6721. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6722. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6723. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6724. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6725. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6726. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6727. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6728. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6729. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6730. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6731. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6732. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6733. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6734. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6735. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6736. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6737. /* TX_OFFLOAD_DELIVER_IND:
  6738. * Forward the target's locally-generated packets to the host,
  6739. * to provide to the monitor mode interface.
  6740. */
  6741. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6742. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6743. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6744. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6745. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  6746. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  6747. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  6748. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  6749. HTT_T2H_MSG_TYPE_TEST,
  6750. /* keep this last */
  6751. HTT_T2H_NUM_MSGS
  6752. };
  6753. /*
  6754. * HTT target to host message type -
  6755. * stored in bits 7:0 of the first word of the message
  6756. */
  6757. #define HTT_T2H_MSG_TYPE_M 0xff
  6758. #define HTT_T2H_MSG_TYPE_S 0
  6759. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6760. do { \
  6761. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6762. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6763. } while (0)
  6764. #define HTT_T2H_MSG_TYPE_GET(word) \
  6765. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6766. /**
  6767. * @brief target -> host version number confirmation message definition
  6768. *
  6769. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6770. *
  6771. * |31 24|23 16|15 8|7 0|
  6772. * |----------------+----------------+----------------+----------------|
  6773. * | reserved | major number | minor number | msg type |
  6774. * |-------------------------------------------------------------------|
  6775. * : option request TLV (optional) |
  6776. * :...................................................................:
  6777. *
  6778. * The VER_CONF message may consist of a single 4-byte word, or may be
  6779. * extended with TLVs that specify HTT options selected by the target.
  6780. * The following option TLVs may be appended to the VER_CONF message:
  6781. * - LL_BUS_ADDR_SIZE
  6782. * - HL_SUPPRESS_TX_COMPL_IND
  6783. * - MAX_TX_QUEUE_GROUPS
  6784. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6785. * may be appended to the VER_CONF message (but only one TLV of each type).
  6786. *
  6787. * Header fields:
  6788. * - MSG_TYPE
  6789. * Bits 7:0
  6790. * Purpose: identifies this as a version number confirmation message
  6791. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6792. * - VER_MINOR
  6793. * Bits 15:8
  6794. * Purpose: Specify the minor number of the HTT message library version
  6795. * in use by the target firmware.
  6796. * The minor number specifies the specific revision within a range
  6797. * of fundamentally compatible HTT message definition revisions.
  6798. * Compatible revisions involve adding new messages or perhaps
  6799. * adding new fields to existing messages, in a backwards-compatible
  6800. * manner.
  6801. * Incompatible revisions involve changing the message type values,
  6802. * or redefining existing messages.
  6803. * Value: minor number
  6804. * - VER_MAJOR
  6805. * Bits 15:8
  6806. * Purpose: Specify the major number of the HTT message library version
  6807. * in use by the target firmware.
  6808. * The major number specifies the family of minor revisions that are
  6809. * fundamentally compatible with each other, but not with prior or
  6810. * later families.
  6811. * Value: major number
  6812. */
  6813. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6814. #define HTT_VER_CONF_MINOR_S 8
  6815. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6816. #define HTT_VER_CONF_MAJOR_S 16
  6817. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6818. do { \
  6819. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6820. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6821. } while (0)
  6822. #define HTT_VER_CONF_MINOR_GET(word) \
  6823. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6824. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6825. do { \
  6826. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6827. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6828. } while (0)
  6829. #define HTT_VER_CONF_MAJOR_GET(word) \
  6830. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6831. #define HTT_VER_CONF_BYTES 4
  6832. /**
  6833. * @brief - target -> host HTT Rx In order indication message
  6834. *
  6835. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6836. *
  6837. * @details
  6838. *
  6839. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6840. * |----------------+-------------------+---------------------+---------------|
  6841. * | peer ID | P| F| O| ext TID | msg type |
  6842. * |--------------------------------------------------------------------------|
  6843. * | MSDU count | Reserved | vdev id |
  6844. * |--------------------------------------------------------------------------|
  6845. * | MSDU 0 bus address (bits 31:0) |
  6846. #if HTT_PADDR64
  6847. * | MSDU 0 bus address (bits 63:32) |
  6848. #endif
  6849. * |--------------------------------------------------------------------------|
  6850. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6851. * |--------------------------------------------------------------------------|
  6852. * | MSDU 1 bus address (bits 31:0) |
  6853. #if HTT_PADDR64
  6854. * | MSDU 1 bus address (bits 63:32) |
  6855. #endif
  6856. * |--------------------------------------------------------------------------|
  6857. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6858. * |--------------------------------------------------------------------------|
  6859. */
  6860. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6861. *
  6862. * @details
  6863. * bits
  6864. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6865. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6866. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6867. * | | frag | | | | fail |chksum fail|
  6868. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6869. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6870. */
  6871. struct htt_rx_in_ord_paddr_ind_hdr_t
  6872. {
  6873. A_UINT32 /* word 0 */
  6874. msg_type: 8,
  6875. ext_tid: 5,
  6876. offload: 1,
  6877. frag: 1,
  6878. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6879. peer_id: 16;
  6880. A_UINT32 /* word 1 */
  6881. vap_id: 8,
  6882. /* NOTE:
  6883. * This reserved_1 field is not truly reserved - certain targets use
  6884. * this field internally to store debug information, and do not zero
  6885. * out the contents of the field before uploading the message to the
  6886. * host. Thus, any host-target communication supported by this field
  6887. * is limited to using values that are never used by the debug
  6888. * information stored by certain targets in the reserved_1 field.
  6889. * In particular, the targets in question don't use the value 0x3
  6890. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6891. * so this previously-unused value within these bits is available to
  6892. * use as the host / target PKT_CAPTURE_MODE flag.
  6893. */
  6894. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6895. /* if pkt_capture_mode == 0x3, host should
  6896. * send rx frames to monitor mode interface
  6897. */
  6898. msdu_cnt: 16;
  6899. };
  6900. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6901. {
  6902. A_UINT32 dma_addr;
  6903. A_UINT32
  6904. length: 16,
  6905. fw_desc: 8,
  6906. msdu_info:8;
  6907. };
  6908. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6909. {
  6910. A_UINT32 dma_addr_lo;
  6911. A_UINT32 dma_addr_hi;
  6912. A_UINT32
  6913. length: 16,
  6914. fw_desc: 8,
  6915. msdu_info:8;
  6916. };
  6917. #if HTT_PADDR64
  6918. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6919. #else
  6920. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6921. #endif
  6922. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6923. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6924. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6925. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6926. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6927. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6928. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6929. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6930. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6931. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6932. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6933. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6934. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6935. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6936. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6937. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6938. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6939. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6940. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6941. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6942. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6943. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6944. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6945. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6946. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6947. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6948. /* for systems using 64-bit format for bus addresses */
  6949. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6950. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6951. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6952. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6953. /* for systems using 32-bit format for bus addresses */
  6954. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6955. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6956. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6957. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6958. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6959. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6960. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6961. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6962. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6963. do { \
  6964. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6965. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6966. } while (0)
  6967. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6968. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6969. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6970. do { \
  6971. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6972. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6973. } while (0)
  6974. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6975. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6976. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6979. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6980. } while (0)
  6981. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6982. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6983. /*
  6984. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6985. * deliver the rx frames to the monitor mode interface.
  6986. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6987. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6988. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6989. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6990. */
  6991. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6992. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6993. do { \
  6994. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6995. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6996. } while (0)
  6997. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6998. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6999. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7000. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7003. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7004. } while (0)
  7005. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7006. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7007. /* for systems using 64-bit format for bus addresses */
  7008. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7009. do { \
  7010. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7011. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7012. } while (0)
  7013. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7014. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7015. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7016. do { \
  7017. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7018. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7019. } while (0)
  7020. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7021. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7022. /* for systems using 32-bit format for bus addresses */
  7023. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7024. do { \
  7025. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7026. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7027. } while (0)
  7028. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7029. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7030. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7031. do { \
  7032. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7033. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7034. } while (0)
  7035. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7036. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7037. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7038. do { \
  7039. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7040. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7041. } while (0)
  7042. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7043. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7044. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7047. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7048. } while (0)
  7049. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7050. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7051. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7052. do { \
  7053. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7054. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7055. } while (0)
  7056. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7057. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7058. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7059. do { \
  7060. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7061. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7062. } while (0)
  7063. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7064. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7065. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7066. do { \
  7067. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7068. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7069. } while (0)
  7070. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7071. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7072. /* definitions used within target -> host rx indication message */
  7073. PREPACK struct htt_rx_ind_hdr_prefix_t
  7074. {
  7075. A_UINT32 /* word 0 */
  7076. msg_type: 8,
  7077. ext_tid: 5,
  7078. release_valid: 1,
  7079. flush_valid: 1,
  7080. reserved0: 1,
  7081. peer_id: 16;
  7082. A_UINT32 /* word 1 */
  7083. flush_start_seq_num: 6,
  7084. flush_end_seq_num: 6,
  7085. release_start_seq_num: 6,
  7086. release_end_seq_num: 6,
  7087. num_mpdu_ranges: 8;
  7088. } POSTPACK;
  7089. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7090. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7091. #define HTT_TGT_RSSI_INVALID 0x80
  7092. PREPACK struct htt_rx_ppdu_desc_t
  7093. {
  7094. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7095. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7096. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7097. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7098. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7099. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7100. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7101. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7102. A_UINT32 /* word 0 */
  7103. rssi_cmb: 8,
  7104. timestamp_submicrosec: 8,
  7105. phy_err_code: 8,
  7106. phy_err: 1,
  7107. legacy_rate: 4,
  7108. legacy_rate_sel: 1,
  7109. end_valid: 1,
  7110. start_valid: 1;
  7111. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7112. union {
  7113. A_UINT32 /* word 1 */
  7114. rssi0_pri20: 8,
  7115. rssi0_ext20: 8,
  7116. rssi0_ext40: 8,
  7117. rssi0_ext80: 8;
  7118. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7119. } u0;
  7120. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7121. union {
  7122. A_UINT32 /* word 2 */
  7123. rssi1_pri20: 8,
  7124. rssi1_ext20: 8,
  7125. rssi1_ext40: 8,
  7126. rssi1_ext80: 8;
  7127. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7128. } u1;
  7129. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7130. union {
  7131. A_UINT32 /* word 3 */
  7132. rssi2_pri20: 8,
  7133. rssi2_ext20: 8,
  7134. rssi2_ext40: 8,
  7135. rssi2_ext80: 8;
  7136. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7137. } u2;
  7138. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7139. union {
  7140. A_UINT32 /* word 4 */
  7141. rssi3_pri20: 8,
  7142. rssi3_ext20: 8,
  7143. rssi3_ext40: 8,
  7144. rssi3_ext80: 8;
  7145. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7146. } u3;
  7147. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7148. A_UINT32 tsf32; /* word 5 */
  7149. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7150. A_UINT32 timestamp_microsec; /* word 6 */
  7151. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7152. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7153. A_UINT32 /* word 7 */
  7154. vht_sig_a1: 24,
  7155. preamble_type: 8;
  7156. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7157. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7158. A_UINT32 /* word 8 */
  7159. vht_sig_a2: 24,
  7160. /* sa_ant_matrix
  7161. * For cases where a single rx chain has options to be connected to
  7162. * different rx antennas, show which rx antennas were in use during
  7163. * receipt of a given PPDU.
  7164. * This sa_ant_matrix provides a bitmask of the antennas used while
  7165. * receiving this frame.
  7166. */
  7167. sa_ant_matrix: 8;
  7168. } POSTPACK;
  7169. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7170. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7171. PREPACK struct htt_rx_ind_hdr_suffix_t
  7172. {
  7173. A_UINT32 /* word 0 */
  7174. fw_rx_desc_bytes: 16,
  7175. reserved0: 16;
  7176. } POSTPACK;
  7177. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7178. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7179. PREPACK struct htt_rx_ind_hdr_t
  7180. {
  7181. struct htt_rx_ind_hdr_prefix_t prefix;
  7182. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7183. struct htt_rx_ind_hdr_suffix_t suffix;
  7184. } POSTPACK;
  7185. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7186. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7187. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7188. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7189. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7190. /*
  7191. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7192. * the offset into the HTT rx indication message at which the
  7193. * FW rx PPDU descriptor resides
  7194. */
  7195. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7196. /*
  7197. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7198. * the offset into the HTT rx indication message at which the
  7199. * header suffix (FW rx MSDU byte count) resides
  7200. */
  7201. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7202. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7203. /*
  7204. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7205. * the offset into the HTT rx indication message at which the per-MSDU
  7206. * information starts
  7207. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7208. * per-MSDU information portion of the message. The per-MSDU info itself
  7209. * starts at byte 12.
  7210. */
  7211. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7212. /**
  7213. * @brief target -> host rx indication message definition
  7214. *
  7215. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7216. *
  7217. * @details
  7218. * The following field definitions describe the format of the rx indication
  7219. * message sent from the target to the host.
  7220. * The message consists of three major sections:
  7221. * 1. a fixed-length header
  7222. * 2. a variable-length list of firmware rx MSDU descriptors
  7223. * 3. one or more 4-octet MPDU range information elements
  7224. * The fixed length header itself has two sub-sections
  7225. * 1. the message meta-information, including identification of the
  7226. * sender and type of the received data, and a 4-octet flush/release IE
  7227. * 2. the firmware rx PPDU descriptor
  7228. *
  7229. * The format of the message is depicted below.
  7230. * in this depiction, the following abbreviations are used for information
  7231. * elements within the message:
  7232. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7233. * elements associated with the PPDU start are valid.
  7234. * Specifically, the following fields are valid only if SV is set:
  7235. * RSSI (all variants), L, legacy rate, preamble type, service,
  7236. * VHT-SIG-A
  7237. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7238. * elements associated with the PPDU end are valid.
  7239. * Specifically, the following fields are valid only if EV is set:
  7240. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7241. * - L - Legacy rate selector - if legacy rates are used, this flag
  7242. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7243. * (L == 0) PHY.
  7244. * - P - PHY error flag - boolean indication of whether the rx frame had
  7245. * a PHY error
  7246. *
  7247. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7248. * |----------------+-------------------+---------------------+---------------|
  7249. * | peer ID | |RV|FV| ext TID | msg type |
  7250. * |--------------------------------------------------------------------------|
  7251. * | num | release | release | flush | flush |
  7252. * | MPDU | end | start | end | start |
  7253. * | ranges | seq num | seq num | seq num | seq num |
  7254. * |==========================================================================|
  7255. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7256. * |V|V| | rate | | | timestamp | RSSI |
  7257. * |--------------------------------------------------------------------------|
  7258. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7259. * |--------------------------------------------------------------------------|
  7260. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7261. * |--------------------------------------------------------------------------|
  7262. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7263. * |--------------------------------------------------------------------------|
  7264. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7265. * |--------------------------------------------------------------------------|
  7266. * | TSF LSBs |
  7267. * |--------------------------------------------------------------------------|
  7268. * | microsec timestamp |
  7269. * |--------------------------------------------------------------------------|
  7270. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7271. * |--------------------------------------------------------------------------|
  7272. * | service | HT-SIG / VHT-SIG-A2 |
  7273. * |==========================================================================|
  7274. * | reserved | FW rx desc bytes |
  7275. * |--------------------------------------------------------------------------|
  7276. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7277. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7278. * |--------------------------------------------------------------------------|
  7279. * : : :
  7280. * |--------------------------------------------------------------------------|
  7281. * | alignment | MSDU Rx |
  7282. * | padding | desc Bn |
  7283. * |--------------------------------------------------------------------------|
  7284. * | reserved | MPDU range status | MPDU count |
  7285. * |--------------------------------------------------------------------------|
  7286. * : reserved : MPDU range status : MPDU count :
  7287. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7288. *
  7289. * Header fields:
  7290. * - MSG_TYPE
  7291. * Bits 7:0
  7292. * Purpose: identifies this as an rx indication message
  7293. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7294. * - EXT_TID
  7295. * Bits 12:8
  7296. * Purpose: identify the traffic ID of the rx data, including
  7297. * special "extended" TID values for multicast, broadcast, and
  7298. * non-QoS data frames
  7299. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7300. * - FLUSH_VALID (FV)
  7301. * Bit 13
  7302. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7303. * is valid
  7304. * Value:
  7305. * 1 -> flush IE is valid and needs to be processed
  7306. * 0 -> flush IE is not valid and should be ignored
  7307. * - REL_VALID (RV)
  7308. * Bit 13
  7309. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7310. * is valid
  7311. * Value:
  7312. * 1 -> release IE is valid and needs to be processed
  7313. * 0 -> release IE is not valid and should be ignored
  7314. * - PEER_ID
  7315. * Bits 31:16
  7316. * Purpose: Identify, by ID, which peer sent the rx data
  7317. * Value: ID of the peer who sent the rx data
  7318. * - FLUSH_SEQ_NUM_START
  7319. * Bits 5:0
  7320. * Purpose: Indicate the start of a series of MPDUs to flush
  7321. * Not all MPDUs within this series are necessarily valid - the host
  7322. * must check each sequence number within this range to see if the
  7323. * corresponding MPDU is actually present.
  7324. * This field is only valid if the FV bit is set.
  7325. * Value:
  7326. * The sequence number for the first MPDUs to check to flush.
  7327. * The sequence number is masked by 0x3f.
  7328. * - FLUSH_SEQ_NUM_END
  7329. * Bits 11:6
  7330. * Purpose: Indicate the end of a series of MPDUs to flush
  7331. * Value:
  7332. * The sequence number one larger than the sequence number of the
  7333. * last MPDU to check to flush.
  7334. * The sequence number is masked by 0x3f.
  7335. * Not all MPDUs within this series are necessarily valid - the host
  7336. * must check each sequence number within this range to see if the
  7337. * corresponding MPDU is actually present.
  7338. * This field is only valid if the FV bit is set.
  7339. * - REL_SEQ_NUM_START
  7340. * Bits 17:12
  7341. * Purpose: Indicate the start of a series of MPDUs to release.
  7342. * All MPDUs within this series are present and valid - the host
  7343. * need not check each sequence number within this range to see if
  7344. * the corresponding MPDU is actually present.
  7345. * This field is only valid if the RV bit is set.
  7346. * Value:
  7347. * The sequence number for the first MPDUs to check to release.
  7348. * The sequence number is masked by 0x3f.
  7349. * - REL_SEQ_NUM_END
  7350. * Bits 23:18
  7351. * Purpose: Indicate the end of a series of MPDUs to release.
  7352. * Value:
  7353. * The sequence number one larger than the sequence number of the
  7354. * last MPDU to check to release.
  7355. * The sequence number is masked by 0x3f.
  7356. * All MPDUs within this series are present and valid - the host
  7357. * need not check each sequence number within this range to see if
  7358. * the corresponding MPDU is actually present.
  7359. * This field is only valid if the RV bit is set.
  7360. * - NUM_MPDU_RANGES
  7361. * Bits 31:24
  7362. * Purpose: Indicate how many ranges of MPDUs are present.
  7363. * Each MPDU range consists of a series of contiguous MPDUs within the
  7364. * rx frame sequence which all have the same MPDU status.
  7365. * Value: 1-63 (typically a small number, like 1-3)
  7366. *
  7367. * Rx PPDU descriptor fields:
  7368. * - RSSI_CMB
  7369. * Bits 7:0
  7370. * Purpose: Combined RSSI from all active rx chains, across the active
  7371. * bandwidth.
  7372. * Value: RSSI dB units w.r.t. noise floor
  7373. * - TIMESTAMP_SUBMICROSEC
  7374. * Bits 15:8
  7375. * Purpose: high-resolution timestamp
  7376. * Value:
  7377. * Sub-microsecond time of PPDU reception.
  7378. * This timestamp ranges from [0,MAC clock MHz).
  7379. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  7380. * to form a high-resolution, large range rx timestamp.
  7381. * - PHY_ERR_CODE
  7382. * Bits 23:16
  7383. * Purpose:
  7384. * If the rx frame processing resulted in a PHY error, indicate what
  7385. * type of rx PHY error occurred.
  7386. * Value:
  7387. * This field is valid if the "P" (PHY_ERR) flag is set.
  7388. * TBD: document/specify the values for this field
  7389. * - PHY_ERR
  7390. * Bit 24
  7391. * Purpose: indicate whether the rx PPDU had a PHY error
  7392. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7393. * - LEGACY_RATE
  7394. * Bits 28:25
  7395. * Purpose:
  7396. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7397. * specify which rate was used.
  7398. * Value:
  7399. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7400. * flag.
  7401. * If LEGACY_RATE_SEL is 0:
  7402. * 0x8: OFDM 48 Mbps
  7403. * 0x9: OFDM 24 Mbps
  7404. * 0xA: OFDM 12 Mbps
  7405. * 0xB: OFDM 6 Mbps
  7406. * 0xC: OFDM 54 Mbps
  7407. * 0xD: OFDM 36 Mbps
  7408. * 0xE: OFDM 18 Mbps
  7409. * 0xF: OFDM 9 Mbps
  7410. * If LEGACY_RATE_SEL is 1:
  7411. * 0x8: CCK 11 Mbps long preamble
  7412. * 0x9: CCK 5.5 Mbps long preamble
  7413. * 0xA: CCK 2 Mbps long preamble
  7414. * 0xB: CCK 1 Mbps long preamble
  7415. * 0xC: CCK 11 Mbps short preamble
  7416. * 0xD: CCK 5.5 Mbps short preamble
  7417. * 0xE: CCK 2 Mbps short preamble
  7418. * - LEGACY_RATE_SEL
  7419. * Bit 29
  7420. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7421. * Value:
  7422. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7423. * used a legacy rate.
  7424. * 0 -> OFDM, 1 -> CCK
  7425. * - END_VALID
  7426. * Bit 30
  7427. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7428. * the start of the PPDU are valid. Specifically, the following
  7429. * fields are only valid if END_VALID is set:
  7430. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7431. * TIMESTAMP_SUBMICROSEC
  7432. * Value:
  7433. * 0 -> rx PPDU desc end fields are not valid
  7434. * 1 -> rx PPDU desc end fields are valid
  7435. * - START_VALID
  7436. * Bit 31
  7437. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7438. * the end of the PPDU are valid. Specifically, the following
  7439. * fields are only valid if START_VALID is set:
  7440. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7441. * VHT-SIG-A
  7442. * Value:
  7443. * 0 -> rx PPDU desc start fields are not valid
  7444. * 1 -> rx PPDU desc start fields are valid
  7445. * - RSSI0_PRI20
  7446. * Bits 7:0
  7447. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7448. * Value: RSSI dB units w.r.t. noise floor
  7449. *
  7450. * - RSSI0_EXT20
  7451. * Bits 7:0
  7452. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7453. * (if the rx bandwidth was >= 40 MHz)
  7454. * Value: RSSI dB units w.r.t. noise floor
  7455. * - RSSI0_EXT40
  7456. * Bits 7:0
  7457. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7458. * (if the rx bandwidth was >= 80 MHz)
  7459. * Value: RSSI dB units w.r.t. noise floor
  7460. * - RSSI0_EXT80
  7461. * Bits 7:0
  7462. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7463. * (if the rx bandwidth was >= 160 MHz)
  7464. * Value: RSSI dB units w.r.t. noise floor
  7465. *
  7466. * - RSSI1_PRI20
  7467. * Bits 7:0
  7468. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7469. * Value: RSSI dB units w.r.t. noise floor
  7470. * - RSSI1_EXT20
  7471. * Bits 7:0
  7472. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7473. * (if the rx bandwidth was >= 40 MHz)
  7474. * Value: RSSI dB units w.r.t. noise floor
  7475. * - RSSI1_EXT40
  7476. * Bits 7:0
  7477. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7478. * (if the rx bandwidth was >= 80 MHz)
  7479. * Value: RSSI dB units w.r.t. noise floor
  7480. * - RSSI1_EXT80
  7481. * Bits 7:0
  7482. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7483. * (if the rx bandwidth was >= 160 MHz)
  7484. * Value: RSSI dB units w.r.t. noise floor
  7485. *
  7486. * - RSSI2_PRI20
  7487. * Bits 7:0
  7488. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7489. * Value: RSSI dB units w.r.t. noise floor
  7490. * - RSSI2_EXT20
  7491. * Bits 7:0
  7492. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7493. * (if the rx bandwidth was >= 40 MHz)
  7494. * Value: RSSI dB units w.r.t. noise floor
  7495. * - RSSI2_EXT40
  7496. * Bits 7:0
  7497. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7498. * (if the rx bandwidth was >= 80 MHz)
  7499. * Value: RSSI dB units w.r.t. noise floor
  7500. * - RSSI2_EXT80
  7501. * Bits 7:0
  7502. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7503. * (if the rx bandwidth was >= 160 MHz)
  7504. * Value: RSSI dB units w.r.t. noise floor
  7505. *
  7506. * - RSSI3_PRI20
  7507. * Bits 7:0
  7508. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7509. * Value: RSSI dB units w.r.t. noise floor
  7510. * - RSSI3_EXT20
  7511. * Bits 7:0
  7512. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7513. * (if the rx bandwidth was >= 40 MHz)
  7514. * Value: RSSI dB units w.r.t. noise floor
  7515. * - RSSI3_EXT40
  7516. * Bits 7:0
  7517. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7518. * (if the rx bandwidth was >= 80 MHz)
  7519. * Value: RSSI dB units w.r.t. noise floor
  7520. * - RSSI3_EXT80
  7521. * Bits 7:0
  7522. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7523. * (if the rx bandwidth was >= 160 MHz)
  7524. * Value: RSSI dB units w.r.t. noise floor
  7525. *
  7526. * - TSF32
  7527. * Bits 31:0
  7528. * Purpose: specify the time the rx PPDU was received, in TSF units
  7529. * Value: 32 LSBs of the TSF
  7530. * - TIMESTAMP_MICROSEC
  7531. * Bits 31:0
  7532. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7533. * Value: PPDU rx time, in microseconds
  7534. * - VHT_SIG_A1
  7535. * Bits 23:0
  7536. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7537. * from the rx PPDU
  7538. * Value:
  7539. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7540. * VHT-SIG-A1 data.
  7541. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7542. * first 24 bits of the HT-SIG data.
  7543. * Otherwise, this field is invalid.
  7544. * Refer to the the 802.11 protocol for the definition of the
  7545. * HT-SIG and VHT-SIG-A1 fields
  7546. * - VHT_SIG_A2
  7547. * Bits 23:0
  7548. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7549. * from the rx PPDU
  7550. * Value:
  7551. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7552. * VHT-SIG-A2 data.
  7553. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7554. * last 24 bits of the HT-SIG data.
  7555. * Otherwise, this field is invalid.
  7556. * Refer to the the 802.11 protocol for the definition of the
  7557. * HT-SIG and VHT-SIG-A2 fields
  7558. * - PREAMBLE_TYPE
  7559. * Bits 31:24
  7560. * Purpose: indicate the PHY format of the received burst
  7561. * Value:
  7562. * 0x4: Legacy (OFDM/CCK)
  7563. * 0x8: HT
  7564. * 0x9: HT with TxBF
  7565. * 0xC: VHT
  7566. * 0xD: VHT with TxBF
  7567. * - SERVICE
  7568. * Bits 31:24
  7569. * Purpose: TBD
  7570. * Value: TBD
  7571. *
  7572. * Rx MSDU descriptor fields:
  7573. * - FW_RX_DESC_BYTES
  7574. * Bits 15:0
  7575. * Purpose: Indicate how many bytes in the Rx indication are used for
  7576. * FW Rx descriptors
  7577. *
  7578. * Payload fields:
  7579. * - MPDU_COUNT
  7580. * Bits 7:0
  7581. * Purpose: Indicate how many sequential MPDUs share the same status.
  7582. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7583. * - MPDU_STATUS
  7584. * Bits 15:8
  7585. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7586. * received successfully.
  7587. * Value:
  7588. * 0x1: success
  7589. * 0x2: FCS error
  7590. * 0x3: duplicate error
  7591. * 0x4: replay error
  7592. * 0x5: invalid peer
  7593. */
  7594. /* header fields */
  7595. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7596. #define HTT_RX_IND_EXT_TID_S 8
  7597. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7598. #define HTT_RX_IND_FLUSH_VALID_S 13
  7599. #define HTT_RX_IND_REL_VALID_M 0x4000
  7600. #define HTT_RX_IND_REL_VALID_S 14
  7601. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7602. #define HTT_RX_IND_PEER_ID_S 16
  7603. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7604. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7605. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7606. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7607. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7608. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7609. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7610. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7611. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7612. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7613. /* rx PPDU descriptor fields */
  7614. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7615. #define HTT_RX_IND_RSSI_CMB_S 0
  7616. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7617. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7618. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7619. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7620. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7621. #define HTT_RX_IND_PHY_ERR_S 24
  7622. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7623. #define HTT_RX_IND_LEGACY_RATE_S 25
  7624. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7625. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7626. #define HTT_RX_IND_END_VALID_M 0x40000000
  7627. #define HTT_RX_IND_END_VALID_S 30
  7628. #define HTT_RX_IND_START_VALID_M 0x80000000
  7629. #define HTT_RX_IND_START_VALID_S 31
  7630. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7631. #define HTT_RX_IND_RSSI_PRI20_S 0
  7632. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7633. #define HTT_RX_IND_RSSI_EXT20_S 8
  7634. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7635. #define HTT_RX_IND_RSSI_EXT40_S 16
  7636. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7637. #define HTT_RX_IND_RSSI_EXT80_S 24
  7638. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7639. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7640. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7641. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7642. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7643. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7644. #define HTT_RX_IND_SERVICE_M 0xff000000
  7645. #define HTT_RX_IND_SERVICE_S 24
  7646. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7647. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7648. /* rx MSDU descriptor fields */
  7649. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7650. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7651. /* payload fields */
  7652. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7653. #define HTT_RX_IND_MPDU_COUNT_S 0
  7654. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7655. #define HTT_RX_IND_MPDU_STATUS_S 8
  7656. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7657. do { \
  7658. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7659. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7660. } while (0)
  7661. #define HTT_RX_IND_EXT_TID_GET(word) \
  7662. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7663. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7664. do { \
  7665. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7666. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7667. } while (0)
  7668. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7669. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7670. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7673. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7674. } while (0)
  7675. #define HTT_RX_IND_REL_VALID_GET(word) \
  7676. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7677. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7680. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7681. } while (0)
  7682. #define HTT_RX_IND_PEER_ID_GET(word) \
  7683. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7684. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7687. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7688. } while (0)
  7689. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7690. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7691. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7694. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7695. } while (0)
  7696. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7697. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7698. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7699. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7702. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7703. } while (0)
  7704. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7705. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7706. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7707. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7708. do { \
  7709. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7710. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7711. } while (0)
  7712. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7713. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7714. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7715. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7718. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7719. } while (0)
  7720. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7721. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7722. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7723. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7726. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7727. } while (0)
  7728. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7729. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7730. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7731. /* FW rx PPDU descriptor fields */
  7732. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7733. do { \
  7734. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7735. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7736. } while (0)
  7737. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7738. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7739. HTT_RX_IND_RSSI_CMB_S)
  7740. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7743. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7744. } while (0)
  7745. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7746. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7747. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7748. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7749. do { \
  7750. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7751. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7752. } while (0)
  7753. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7754. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7755. HTT_RX_IND_PHY_ERR_CODE_S)
  7756. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7757. do { \
  7758. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7759. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7760. } while (0)
  7761. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7762. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7763. HTT_RX_IND_PHY_ERR_S)
  7764. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7765. do { \
  7766. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7767. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7768. } while (0)
  7769. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7770. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7771. HTT_RX_IND_LEGACY_RATE_S)
  7772. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7775. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7776. } while (0)
  7777. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7778. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7779. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7780. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7781. do { \
  7782. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7783. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7784. } while (0)
  7785. #define HTT_RX_IND_END_VALID_GET(word) \
  7786. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7787. HTT_RX_IND_END_VALID_S)
  7788. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7791. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7792. } while (0)
  7793. #define HTT_RX_IND_START_VALID_GET(word) \
  7794. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7795. HTT_RX_IND_START_VALID_S)
  7796. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7797. do { \
  7798. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7799. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7800. } while (0)
  7801. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7802. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7803. HTT_RX_IND_RSSI_PRI20_S)
  7804. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7805. do { \
  7806. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7807. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7808. } while (0)
  7809. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7810. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7811. HTT_RX_IND_RSSI_EXT20_S)
  7812. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7813. do { \
  7814. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7815. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7816. } while (0)
  7817. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7818. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7819. HTT_RX_IND_RSSI_EXT40_S)
  7820. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7821. do { \
  7822. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7823. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7824. } while (0)
  7825. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7826. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7827. HTT_RX_IND_RSSI_EXT80_S)
  7828. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7829. do { \
  7830. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7831. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7832. } while (0)
  7833. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7834. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7835. HTT_RX_IND_VHT_SIG_A1_S)
  7836. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7837. do { \
  7838. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7839. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7840. } while (0)
  7841. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7842. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7843. HTT_RX_IND_VHT_SIG_A2_S)
  7844. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7845. do { \
  7846. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7847. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7848. } while (0)
  7849. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7850. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7851. HTT_RX_IND_PREAMBLE_TYPE_S)
  7852. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7853. do { \
  7854. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7855. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7856. } while (0)
  7857. #define HTT_RX_IND_SERVICE_GET(word) \
  7858. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7859. HTT_RX_IND_SERVICE_S)
  7860. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7861. do { \
  7862. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7863. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7864. } while (0)
  7865. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7866. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7867. HTT_RX_IND_SA_ANT_MATRIX_S)
  7868. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7869. do { \
  7870. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7871. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7872. } while (0)
  7873. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7874. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7875. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7876. do { \
  7877. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7878. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7879. } while (0)
  7880. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7881. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7882. #define HTT_RX_IND_HL_BYTES \
  7883. (HTT_RX_IND_HDR_BYTES + \
  7884. 4 /* single FW rx MSDU descriptor */ + \
  7885. 4 /* single MPDU range information element */)
  7886. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7887. /* Could we use one macro entry? */
  7888. #define HTT_WORD_SET(word, field, value) \
  7889. do { \
  7890. HTT_CHECK_SET_VAL(field, value); \
  7891. (word) |= ((value) << field ## _S); \
  7892. } while (0)
  7893. #define HTT_WORD_GET(word, field) \
  7894. (((word) & field ## _M) >> field ## _S)
  7895. PREPACK struct hl_htt_rx_ind_base {
  7896. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7897. } POSTPACK;
  7898. /*
  7899. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7900. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7901. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7902. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7903. * htt_rx_ind_hl_rx_desc_t.
  7904. */
  7905. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7906. struct htt_rx_ind_hl_rx_desc_t {
  7907. A_UINT8 ver;
  7908. A_UINT8 len;
  7909. struct {
  7910. A_UINT8
  7911. first_msdu: 1,
  7912. last_msdu: 1,
  7913. c3_failed: 1,
  7914. c4_failed: 1,
  7915. ipv6: 1,
  7916. tcp: 1,
  7917. udp: 1,
  7918. reserved: 1;
  7919. } flags;
  7920. /* NOTE: no reserved space - don't append any new fields here */
  7921. };
  7922. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7923. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7924. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7925. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7926. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7927. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7928. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7929. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7930. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7931. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7932. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7933. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7934. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7935. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7936. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7937. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7938. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7939. /* This structure is used in HL, the basic descriptor information
  7940. * used by host. the structure is translated by FW from HW desc
  7941. * or generated by FW. But in HL monitor mode, the host would use
  7942. * the same structure with LL.
  7943. */
  7944. PREPACK struct hl_htt_rx_desc_base {
  7945. A_UINT32
  7946. seq_num:12,
  7947. encrypted:1,
  7948. chan_info_present:1,
  7949. resv0:2,
  7950. mcast_bcast:1,
  7951. fragment:1,
  7952. key_id_oct:8,
  7953. resv1:6;
  7954. A_UINT32
  7955. pn_31_0;
  7956. union {
  7957. struct {
  7958. A_UINT16 pn_47_32;
  7959. A_UINT16 pn_63_48;
  7960. } pn16;
  7961. A_UINT32 pn_63_32;
  7962. } u0;
  7963. A_UINT32
  7964. pn_95_64;
  7965. A_UINT32
  7966. pn_127_96;
  7967. } POSTPACK;
  7968. /*
  7969. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7970. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7971. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7972. * Please see htt_chan_change_t for description of the fields.
  7973. */
  7974. PREPACK struct htt_chan_info_t
  7975. {
  7976. A_UINT32 primary_chan_center_freq_mhz: 16,
  7977. contig_chan1_center_freq_mhz: 16;
  7978. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7979. phy_mode: 8,
  7980. reserved: 8;
  7981. } POSTPACK;
  7982. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7983. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7984. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7985. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7986. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7987. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7988. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7989. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7990. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7991. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7992. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7993. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7994. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7995. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7996. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7997. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7998. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7999. /* Channel information */
  8000. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8001. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8002. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8003. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8004. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8005. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8006. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8007. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8008. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8009. do { \
  8010. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8011. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8012. } while (0)
  8013. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8014. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8015. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8016. do { \
  8017. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8018. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8019. } while (0)
  8020. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8021. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8022. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8023. do { \
  8024. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8025. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8026. } while (0)
  8027. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8028. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8029. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8030. do { \
  8031. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8032. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8033. } while (0)
  8034. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8035. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8036. /*
  8037. * @brief target -> host message definition for FW offloaded pkts
  8038. *
  8039. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8040. *
  8041. * @details
  8042. * The following field definitions describe the format of the firmware
  8043. * offload deliver message sent from the target to the host.
  8044. *
  8045. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8046. *
  8047. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8048. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8049. * | reserved_1 | msg type |
  8050. * |--------------------------------------------------------------------------|
  8051. * | phy_timestamp_l32 |
  8052. * |--------------------------------------------------------------------------|
  8053. * | WORD2 (see below) |
  8054. * |--------------------------------------------------------------------------|
  8055. * | seqno | framectrl |
  8056. * |--------------------------------------------------------------------------|
  8057. * | reserved_3 | vdev_id | tid_num|
  8058. * |--------------------------------------------------------------------------|
  8059. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8060. * |--------------------------------------------------------------------------|
  8061. *
  8062. * where:
  8063. * STAT = status
  8064. * F = format (802.3 vs. 802.11)
  8065. *
  8066. * definition for word 2
  8067. *
  8068. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8069. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8070. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8071. * |--------------------------------------------------------------------------|
  8072. *
  8073. * where:
  8074. * PR = preamble
  8075. * BF = beamformed
  8076. */
  8077. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8078. {
  8079. A_UINT32 /* word 0 */
  8080. msg_type:8, /* [ 7: 0] */
  8081. reserved_1:24; /* [31: 8] */
  8082. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8083. A_UINT32 /* word 2 */
  8084. /* preamble:
  8085. * 0-OFDM,
  8086. * 1-CCk,
  8087. * 2-HT,
  8088. * 3-VHT
  8089. */
  8090. preamble: 2, /* [1:0] */
  8091. /* mcs:
  8092. * In case of HT preamble interpret
  8093. * MCS along with NSS.
  8094. * Valid values for HT are 0 to 7.
  8095. * HT mcs 0 with NSS 2 is mcs 8.
  8096. * Valid values for VHT are 0 to 9.
  8097. */
  8098. mcs: 4, /* [5:2] */
  8099. /* rate:
  8100. * This is applicable only for
  8101. * CCK and OFDM preamble type
  8102. * rate 0: OFDM 48 Mbps,
  8103. * 1: OFDM 24 Mbps,
  8104. * 2: OFDM 12 Mbps
  8105. * 3: OFDM 6 Mbps
  8106. * 4: OFDM 54 Mbps
  8107. * 5: OFDM 36 Mbps
  8108. * 6: OFDM 18 Mbps
  8109. * 7: OFDM 9 Mbps
  8110. * rate 0: CCK 11 Mbps Long
  8111. * 1: CCK 5.5 Mbps Long
  8112. * 2: CCK 2 Mbps Long
  8113. * 3: CCK 1 Mbps Long
  8114. * 4: CCK 11 Mbps Short
  8115. * 5: CCK 5.5 Mbps Short
  8116. * 6: CCK 2 Mbps Short
  8117. */
  8118. rate : 3, /* [ 8: 6] */
  8119. rssi : 8, /* [16: 9] units=dBm */
  8120. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8121. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8122. stbc : 1, /* [22] */
  8123. sgi : 1, /* [23] */
  8124. ldpc : 1, /* [24] */
  8125. beamformed: 1, /* [25] */
  8126. reserved_2: 6; /* [31:26] */
  8127. A_UINT32 /* word 3 */
  8128. framectrl:16, /* [15: 0] */
  8129. seqno:16; /* [31:16] */
  8130. A_UINT32 /* word 4 */
  8131. tid_num:5, /* [ 4: 0] actual TID number */
  8132. vdev_id:8, /* [12: 5] */
  8133. reserved_3:19; /* [31:13] */
  8134. A_UINT32 /* word 5 */
  8135. /* status:
  8136. * 0: tx_ok
  8137. * 1: retry
  8138. * 2: drop
  8139. * 3: filtered
  8140. * 4: abort
  8141. * 5: tid delete
  8142. * 6: sw abort
  8143. * 7: dropped by peer migration
  8144. */
  8145. status:3, /* [2:0] */
  8146. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8147. tx_mpdu_bytes:16, /* [19:4] */
  8148. /* Indicates retry count of offloaded/local generated Data tx frames */
  8149. tx_retry_cnt:6, /* [25:20] */
  8150. reserved_4:6; /* [31:26] */
  8151. } POSTPACK;
  8152. /* FW offload deliver ind message header fields */
  8153. /* DWORD one */
  8154. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8155. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8156. /* DWORD two */
  8157. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8158. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8159. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8160. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8161. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8162. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8163. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8164. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8165. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8166. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8167. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8168. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8169. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8170. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8171. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8172. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8173. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8174. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8175. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8176. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8177. /* DWORD three*/
  8178. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8179. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8180. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8181. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8182. /* DWORD four */
  8183. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8184. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8185. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8186. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8187. /* DWORD five */
  8188. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8189. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8190. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8191. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8192. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8193. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8194. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8195. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8196. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8197. do { \
  8198. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8199. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8200. } while (0)
  8201. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8202. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8203. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8204. do { \
  8205. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8206. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8207. } while (0)
  8208. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8209. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8210. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8211. do { \
  8212. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8213. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8214. } while (0)
  8215. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8216. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8217. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8218. do { \
  8219. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8220. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8221. } while (0)
  8222. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8223. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8224. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8225. do { \
  8226. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8227. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8228. } while (0)
  8229. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8230. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8231. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8232. do { \
  8233. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8234. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8235. } while (0)
  8236. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8237. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8238. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8239. do { \
  8240. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8241. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8242. } while (0)
  8243. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8244. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8245. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8246. do { \
  8247. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8248. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8249. } while (0)
  8250. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8251. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8252. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8253. do { \
  8254. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8255. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8256. } while (0)
  8257. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8258. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8259. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8260. do { \
  8261. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8262. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8263. } while (0)
  8264. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8265. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8266. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8267. do { \
  8268. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8269. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8270. } while (0)
  8271. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8272. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8273. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8274. do { \
  8275. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8276. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8277. } while (0)
  8278. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8279. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8280. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8281. do { \
  8282. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8283. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8284. } while (0)
  8285. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8286. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8287. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8288. do { \
  8289. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8290. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8291. } while (0)
  8292. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8293. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8294. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8295. do { \
  8296. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8297. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8298. } while (0)
  8299. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8300. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8301. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8302. do { \
  8303. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8304. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8305. } while (0)
  8306. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8307. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8308. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8309. do { \
  8310. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8311. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8312. } while (0)
  8313. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8314. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8315. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8316. do { \
  8317. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8318. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8319. } while (0)
  8320. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8321. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8322. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8325. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8326. } while (0)
  8327. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  8328. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  8329. /*
  8330. * @brief target -> host rx reorder flush message definition
  8331. *
  8332. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  8333. *
  8334. * @details
  8335. * The following field definitions describe the format of the rx flush
  8336. * message sent from the target to the host.
  8337. * The message consists of a 4-octet header, followed by one or more
  8338. * 4-octet payload information elements.
  8339. *
  8340. * |31 24|23 8|7 0|
  8341. * |--------------------------------------------------------------|
  8342. * | TID | peer ID | msg type |
  8343. * |--------------------------------------------------------------|
  8344. * | seq num end | seq num start | MPDU status | reserved |
  8345. * |--------------------------------------------------------------|
  8346. * First DWORD:
  8347. * - MSG_TYPE
  8348. * Bits 7:0
  8349. * Purpose: identifies this as an rx flush message
  8350. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  8351. * - PEER_ID
  8352. * Bits 23:8 (only bits 18:8 actually used)
  8353. * Purpose: identify which peer's rx data is being flushed
  8354. * Value: (rx) peer ID
  8355. * - TID
  8356. * Bits 31:24 (only bits 27:24 actually used)
  8357. * Purpose: Specifies which traffic identifier's rx data is being flushed
  8358. * Value: traffic identifier
  8359. * Second DWORD:
  8360. * - MPDU_STATUS
  8361. * Bits 15:8
  8362. * Purpose:
  8363. * Indicate whether the flushed MPDUs should be discarded or processed.
  8364. * Value:
  8365. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  8366. * stages of rx processing
  8367. * other: discard the MPDUs
  8368. * It is anticipated that flush messages will always have
  8369. * MPDU status == 1, but the status flag is included for
  8370. * flexibility.
  8371. * - SEQ_NUM_START
  8372. * Bits 23:16
  8373. * Purpose:
  8374. * Indicate the start of a series of consecutive MPDUs being flushed.
  8375. * Not all MPDUs within this range are necessarily valid - the host
  8376. * must check each sequence number within this range to see if the
  8377. * corresponding MPDU is actually present.
  8378. * Value:
  8379. * The sequence number for the first MPDU in the sequence.
  8380. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8381. * - SEQ_NUM_END
  8382. * Bits 30:24
  8383. * Purpose:
  8384. * Indicate the end of a series of consecutive MPDUs being flushed.
  8385. * Value:
  8386. * The sequence number one larger than the sequence number of the
  8387. * last MPDU being flushed.
  8388. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8389. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8390. * are to be released for further rx processing.
  8391. * Not all MPDUs within this range are necessarily valid - the host
  8392. * must check each sequence number within this range to see if the
  8393. * corresponding MPDU is actually present.
  8394. */
  8395. /* first DWORD */
  8396. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8397. #define HTT_RX_FLUSH_PEER_ID_S 8
  8398. #define HTT_RX_FLUSH_TID_M 0xff000000
  8399. #define HTT_RX_FLUSH_TID_S 24
  8400. /* second DWORD */
  8401. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8402. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8403. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8404. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8405. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8406. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8407. #define HTT_RX_FLUSH_BYTES 8
  8408. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8409. do { \
  8410. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8411. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8412. } while (0)
  8413. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8414. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8415. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8416. do { \
  8417. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8418. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8419. } while (0)
  8420. #define HTT_RX_FLUSH_TID_GET(word) \
  8421. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8422. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8423. do { \
  8424. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8425. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8426. } while (0)
  8427. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8428. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8429. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8430. do { \
  8431. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8432. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8433. } while (0)
  8434. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8435. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8436. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8437. do { \
  8438. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8439. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8440. } while (0)
  8441. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8442. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8443. /*
  8444. * @brief target -> host rx pn check indication message
  8445. *
  8446. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8447. *
  8448. * @details
  8449. * The following field definitions describe the format of the Rx PN check
  8450. * indication message sent from the target to the host.
  8451. * The message consists of a 4-octet header, followed by the start and
  8452. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8453. * IE is one octet containing the sequence number that failed the PN
  8454. * check.
  8455. *
  8456. * |31 24|23 8|7 0|
  8457. * |--------------------------------------------------------------|
  8458. * | TID | peer ID | msg type |
  8459. * |--------------------------------------------------------------|
  8460. * | Reserved | PN IE count | seq num end | seq num start|
  8461. * |--------------------------------------------------------------|
  8462. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8463. * |--------------------------------------------------------------|
  8464. * First DWORD:
  8465. * - MSG_TYPE
  8466. * Bits 7:0
  8467. * Purpose: Identifies this as an rx pn check indication message
  8468. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8469. * - PEER_ID
  8470. * Bits 23:8 (only bits 18:8 actually used)
  8471. * Purpose: identify which peer
  8472. * Value: (rx) peer ID
  8473. * - TID
  8474. * Bits 31:24 (only bits 27:24 actually used)
  8475. * Purpose: identify traffic identifier
  8476. * Value: traffic identifier
  8477. * Second DWORD:
  8478. * - SEQ_NUM_START
  8479. * Bits 7:0
  8480. * Purpose:
  8481. * Indicates the starting sequence number of the MPDU in this
  8482. * series of MPDUs that went though PN check.
  8483. * Value:
  8484. * The sequence number for the first MPDU in the sequence.
  8485. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8486. * - SEQ_NUM_END
  8487. * Bits 15:8
  8488. * Purpose:
  8489. * Indicates the ending sequence number of the MPDU in this
  8490. * series of MPDUs that went though PN check.
  8491. * Value:
  8492. * The sequence number one larger then the sequence number of the last
  8493. * MPDU being flushed.
  8494. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8495. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8496. * for invalid PN numbers and are ready to be released for further processing.
  8497. * Not all MPDUs within this range are necessarily valid - the host
  8498. * must check each sequence number within this range to see if the
  8499. * corresponding MPDU is actually present.
  8500. * - PN_IE_COUNT
  8501. * Bits 23:16
  8502. * Purpose:
  8503. * Used to determine the variable number of PN information elements in this
  8504. * message
  8505. *
  8506. * PN information elements:
  8507. * - PN_IE_x-
  8508. * Purpose:
  8509. * Each PN information element contains the sequence number of the MPDU that
  8510. * has failed the target PN check.
  8511. * Value:
  8512. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8513. * that failed the PN check.
  8514. */
  8515. /* first DWORD */
  8516. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8517. #define HTT_RX_PN_IND_PEER_ID_S 8
  8518. #define HTT_RX_PN_IND_TID_M 0xff000000
  8519. #define HTT_RX_PN_IND_TID_S 24
  8520. /* second DWORD */
  8521. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8522. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8523. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8524. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8525. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8526. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8527. #define HTT_RX_PN_IND_BYTES 8
  8528. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8529. do { \
  8530. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8531. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8532. } while (0)
  8533. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8534. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8535. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8536. do { \
  8537. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8538. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8539. } while (0)
  8540. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8541. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8542. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8543. do { \
  8544. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8545. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8546. } while (0)
  8547. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8548. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8549. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8550. do { \
  8551. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8552. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8553. } while (0)
  8554. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8555. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8556. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8559. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8560. } while (0)
  8561. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8562. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8563. /*
  8564. * @brief target -> host rx offload deliver message for LL system
  8565. *
  8566. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8567. *
  8568. * @details
  8569. * In a low latency system this message is sent whenever the offload
  8570. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8571. * The DMA of the actual packets into host memory is done before sending out
  8572. * this message. This message indicates only how many MSDUs to reap. The
  8573. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8574. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8575. * DMA'd by the MAC directly into host memory these packets do not contain
  8576. * the MAC descriptors in the header portion of the packet. Instead they contain
  8577. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8578. * message, the packets are delivered directly to the NW stack without going
  8579. * through the regular reorder buffering and PN checking path since it has
  8580. * already been done in target.
  8581. *
  8582. * |31 24|23 16|15 8|7 0|
  8583. * |-----------------------------------------------------------------------|
  8584. * | Total MSDU count | reserved | msg type |
  8585. * |-----------------------------------------------------------------------|
  8586. *
  8587. * @brief target -> host rx offload deliver message for HL system
  8588. *
  8589. * @details
  8590. * In a high latency system this message is sent whenever the offload manager
  8591. * flushes out the packets it has coalesced in its coalescing buffer. The
  8592. * actual packets are also carried along with this message. When the host
  8593. * receives this message, it is expected to deliver these packets to the NW
  8594. * stack directly instead of routing them through the reorder buffering and
  8595. * PN checking path since it has already been done in target.
  8596. *
  8597. * |31 24|23 16|15 8|7 0|
  8598. * |-----------------------------------------------------------------------|
  8599. * | Total MSDU count | reserved | msg type |
  8600. * |-----------------------------------------------------------------------|
  8601. * | peer ID | MSDU length |
  8602. * |-----------------------------------------------------------------------|
  8603. * | MSDU payload | FW Desc | tid | vdev ID |
  8604. * |-----------------------------------------------------------------------|
  8605. * | MSDU payload contd. |
  8606. * |-----------------------------------------------------------------------|
  8607. * | peer ID | MSDU length |
  8608. * |-----------------------------------------------------------------------|
  8609. * | MSDU payload | FW Desc | tid | vdev ID |
  8610. * |-----------------------------------------------------------------------|
  8611. * | MSDU payload contd. |
  8612. * |-----------------------------------------------------------------------|
  8613. *
  8614. */
  8615. /* first DWORD */
  8616. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8617. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8618. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8619. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8620. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8621. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8622. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8623. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8624. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8625. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8626. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8627. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8628. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8629. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8630. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8631. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8632. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8635. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8636. } while (0)
  8637. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8638. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8639. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8640. do { \
  8641. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8642. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8643. } while (0)
  8644. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8645. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8646. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8647. do { \
  8648. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8649. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8650. } while (0)
  8651. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8652. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8653. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8654. do { \
  8655. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8656. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8657. } while (0)
  8658. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8659. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8660. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8661. do { \
  8662. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8663. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8664. } while (0)
  8665. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8666. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8667. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8668. do { \
  8669. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8670. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8671. } while (0)
  8672. /**
  8673. * @brief target -> host rx peer map/unmap message definition
  8674. *
  8675. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8676. *
  8677. * @details
  8678. * The following diagram shows the format of the rx peer map message sent
  8679. * from the target to the host. This layout assumes the target operates
  8680. * as little-endian.
  8681. *
  8682. * This message always contains a SW peer ID. The main purpose of the
  8683. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8684. * with, so that the host can use that peer ID to determine which peer
  8685. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8686. * other purposes, such as identifying during tx completions which peer
  8687. * the tx frames in question were transmitted to.
  8688. *
  8689. * In certain generations of chips, the peer map message also contains
  8690. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8691. * to identify which peer the frame needs to be forwarded to (i.e. the
  8692. * peer assocated with the Destination MAC Address within the packet),
  8693. * and particularly which vdev needs to transmit the frame (for cases
  8694. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8695. * meaning as AST_INDEX_0.
  8696. * This DA-based peer ID that is provided for certain rx frames
  8697. * (the rx frames that need to be re-transmitted as tx frames)
  8698. * is the ID that the HW uses for referring to the peer in question,
  8699. * rather than the peer ID that the SW+FW use to refer to the peer.
  8700. *
  8701. *
  8702. * |31 24|23 16|15 8|7 0|
  8703. * |-----------------------------------------------------------------------|
  8704. * | SW peer ID | VDEV ID | msg type |
  8705. * |-----------------------------------------------------------------------|
  8706. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8707. * |-----------------------------------------------------------------------|
  8708. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8709. * |-----------------------------------------------------------------------|
  8710. *
  8711. *
  8712. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8713. *
  8714. * The following diagram shows the format of the rx peer unmap message sent
  8715. * from the target to the host.
  8716. *
  8717. * |31 24|23 16|15 8|7 0|
  8718. * |-----------------------------------------------------------------------|
  8719. * | SW peer ID | VDEV ID | msg type |
  8720. * |-----------------------------------------------------------------------|
  8721. *
  8722. * The following field definitions describe the format of the rx peer map
  8723. * and peer unmap messages sent from the target to the host.
  8724. * - MSG_TYPE
  8725. * Bits 7:0
  8726. * Purpose: identifies this as an rx peer map or peer unmap message
  8727. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8728. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8729. * - VDEV_ID
  8730. * Bits 15:8
  8731. * Purpose: Indicates which virtual device the peer is associated
  8732. * with.
  8733. * Value: vdev ID (used in the host to look up the vdev object)
  8734. * - PEER_ID (a.k.a. SW_PEER_ID)
  8735. * Bits 31:16
  8736. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8737. * freeing (unmap)
  8738. * Value: (rx) peer ID
  8739. * - MAC_ADDR_L32 (peer map only)
  8740. * Bits 31:0
  8741. * Purpose: Identifies which peer node the peer ID is for.
  8742. * Value: lower 4 bytes of peer node's MAC address
  8743. * - MAC_ADDR_U16 (peer map only)
  8744. * Bits 15:0
  8745. * Purpose: Identifies which peer node the peer ID is for.
  8746. * Value: upper 2 bytes of peer node's MAC address
  8747. * - HW_PEER_ID
  8748. * Bits 31:16
  8749. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8750. * address, so for rx frames marked for rx --> tx forwarding, the
  8751. * host can determine from the HW peer ID provided as meta-data with
  8752. * the rx frame which peer the frame is supposed to be forwarded to.
  8753. * Value: ID used by the MAC HW to identify the peer
  8754. */
  8755. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8756. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8757. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8758. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8759. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8760. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8761. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8762. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8763. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8764. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8765. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8766. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8767. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8768. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8769. do { \
  8770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8771. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8772. } while (0)
  8773. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8774. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8775. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8776. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8777. do { \
  8778. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8779. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8780. } while (0)
  8781. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8782. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8783. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8784. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8785. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8786. do { \
  8787. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8788. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8789. } while (0)
  8790. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8791. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8792. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8793. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8794. #define HTT_RX_PEER_MAP_BYTES 12
  8795. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8796. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8797. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8798. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8799. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8800. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8801. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8802. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8803. #define HTT_RX_PEER_UNMAP_BYTES 4
  8804. /**
  8805. * @brief target -> host rx peer map V2 message definition
  8806. *
  8807. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8808. *
  8809. * @details
  8810. * The following diagram shows the format of the rx peer map v2 message sent
  8811. * from the target to the host. This layout assumes the target operates
  8812. * as little-endian.
  8813. *
  8814. * This message always contains a SW peer ID. The main purpose of the
  8815. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8816. * with, so that the host can use that peer ID to determine which peer
  8817. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8818. * other purposes, such as identifying during tx completions which peer
  8819. * the tx frames in question were transmitted to.
  8820. *
  8821. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8822. * is used during rx --> tx frame forwarding to identify which peer the
  8823. * frame needs to be forwarded to (i.e. the peer assocated with the
  8824. * Destination MAC Address within the packet), and particularly which vdev
  8825. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8826. * This DA-based peer ID that is provided for certain rx frames
  8827. * (the rx frames that need to be re-transmitted as tx frames)
  8828. * is the ID that the HW uses for referring to the peer in question,
  8829. * rather than the peer ID that the SW+FW use to refer to the peer.
  8830. *
  8831. * The HW peer id here is the same meaning as AST_INDEX_0.
  8832. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8833. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8834. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8835. * AST is valid.
  8836. *
  8837. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8838. * |-------------------------------------------------------------------------|
  8839. * | SW peer ID | VDEV ID | msg type |
  8840. * |-------------------------------------------------------------------------|
  8841. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8842. * |-------------------------------------------------------------------------|
  8843. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8844. * |-------------------------------------------------------------------------|
  8845. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8846. * |-------------------------------------------------------------------------|
  8847. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8848. * |-------------------------------------------------------------------------|
  8849. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8850. * |-------------------------------------------------------------------------|
  8851. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8852. * |-------------------------------------------------------------------------|
  8853. * | Reserved_2 |
  8854. * |-------------------------------------------------------------------------|
  8855. * Where:
  8856. * NH = Next Hop
  8857. * ASTVM = AST valid mask
  8858. * OA = on-chip AST valid bit
  8859. * ASTFM = AST flow mask
  8860. *
  8861. * The following field definitions describe the format of the rx peer map v2
  8862. * messages sent from the target to the host.
  8863. * - MSG_TYPE
  8864. * Bits 7:0
  8865. * Purpose: identifies this as an rx peer map v2 message
  8866. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8867. * - VDEV_ID
  8868. * Bits 15:8
  8869. * Purpose: Indicates which virtual device the peer is associated with.
  8870. * Value: vdev ID (used in the host to look up the vdev object)
  8871. * - SW_PEER_ID
  8872. * Bits 31:16
  8873. * Purpose: The peer ID (index) that WAL is allocating
  8874. * Value: (rx) peer ID
  8875. * - MAC_ADDR_L32
  8876. * Bits 31:0
  8877. * Purpose: Identifies which peer node the peer ID is for.
  8878. * Value: lower 4 bytes of peer node's MAC address
  8879. * - MAC_ADDR_U16
  8880. * Bits 15:0
  8881. * Purpose: Identifies which peer node the peer ID is for.
  8882. * Value: upper 2 bytes of peer node's MAC address
  8883. * - HW_PEER_ID / AST_INDEX_0
  8884. * Bits 31:16
  8885. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8886. * address, so for rx frames marked for rx --> tx forwarding, the
  8887. * host can determine from the HW peer ID provided as meta-data with
  8888. * the rx frame which peer the frame is supposed to be forwarded to.
  8889. * Value: ID used by the MAC HW to identify the peer
  8890. * - AST_HASH_VALUE
  8891. * Bits 15:0
  8892. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8893. * override feature.
  8894. * - NEXT_HOP
  8895. * Bit 16
  8896. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8897. * (Wireless Distribution System).
  8898. * - AST_VALID_MASK
  8899. * Bits 19:17
  8900. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8901. * - ONCHIP_AST_VALID_FLAG
  8902. * Bit 20
  8903. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8904. * is valid.
  8905. * - AST_INDEX_1
  8906. * Bits 15:0
  8907. * Purpose: indicate the second AST index for this peer
  8908. * - AST_0_FLOW_MASK
  8909. * Bits 19:16
  8910. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8911. * - AST_1_FLOW_MASK
  8912. * Bits 23:20
  8913. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8914. * - AST_2_FLOW_MASK
  8915. * Bits 27:24
  8916. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8917. * - AST_3_FLOW_MASK
  8918. * Bits 31:28
  8919. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8920. * - AST_INDEX_2
  8921. * Bits 15:0
  8922. * Purpose: indicate the third AST index for this peer
  8923. * - TID_VALID_HI_PRI
  8924. * Bits 23:16
  8925. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8926. * - TID_VALID_LOW_PRI
  8927. * Bits 31:24
  8928. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8929. * - AST_INDEX_3
  8930. * Bits 15:0
  8931. * Purpose: indicate the fourth AST index for this peer
  8932. * - ONCHIP_AST_IDX / RESERVED
  8933. * Bits 31:16
  8934. * Purpose: This field is valid only when split AST feature is enabled.
  8935. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8936. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8937. * address, this ast_idx is used for LMAC modules for RXPCU.
  8938. * Value: ID used by the LMAC HW to identify the peer
  8939. */
  8940. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8941. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8942. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8943. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8944. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8945. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8946. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8947. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8948. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8949. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8950. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8951. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8952. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8953. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8954. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8955. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8956. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8957. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8958. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8959. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8960. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8961. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8962. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8963. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8964. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8965. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8966. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8967. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8968. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8969. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8970. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8971. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8972. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8973. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8974. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8975. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8976. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8977. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8978. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8981. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8982. } while (0)
  8983. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8984. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8985. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8988. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8989. } while (0)
  8990. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8991. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8992. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8995. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8996. } while (0)
  8997. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8998. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8999. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9002. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9003. } while (0)
  9004. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9005. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9006. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9007. do { \
  9008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9009. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9010. } while (0)
  9011. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9012. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9013. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9014. do { \
  9015. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9016. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9017. } while (0)
  9018. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9019. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9020. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9023. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9024. } while (0)
  9025. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9026. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9027. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9028. do { \
  9029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9030. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9031. } while (0)
  9032. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9033. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9034. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9035. do { \
  9036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9037. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9038. } while (0)
  9039. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9040. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9041. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9042. do { \
  9043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9044. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9045. } while (0)
  9046. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9047. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9048. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9049. do { \
  9050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9051. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9052. } while (0)
  9053. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9054. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9055. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9058. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9059. } while (0)
  9060. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9061. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9062. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9063. do { \
  9064. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9065. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9066. } while (0)
  9067. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9068. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9069. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9070. do { \
  9071. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9072. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9073. } while (0)
  9074. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9075. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9076. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9077. do { \
  9078. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9079. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9080. } while (0)
  9081. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9082. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9083. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9084. do { \
  9085. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9086. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9087. } while (0)
  9088. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9089. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9090. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9091. do { \
  9092. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9093. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9094. } while (0)
  9095. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9096. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9097. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9098. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9099. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9100. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9101. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9102. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9103. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9104. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9105. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9106. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9107. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9108. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9109. /**
  9110. * @brief target -> host rx peer map V3 message definition
  9111. *
  9112. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9113. *
  9114. * @details
  9115. * The following diagram shows the format of the rx peer map v3 message sent
  9116. * from the target to the host.
  9117. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9118. * This layout assumes the target operates as little-endian.
  9119. *
  9120. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9121. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9122. * | SW peer ID | VDEV ID | msg type |
  9123. * |-----------------+--------------------+-----------------+-----------------|
  9124. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9125. * |-----------------+--------------------+-----------------+-----------------|
  9126. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9127. * |-----------------+--------+-----------+-----------------+-----------------|
  9128. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9129. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9130. * | (8bits) | | (4bits) | |
  9131. * |-----------------+--------+--+--+--+--------------------------------------|
  9132. * | RESERVED |E |O | | |
  9133. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9134. * | |V |V | | |
  9135. * |-----------------+--------------------+-----------------------------------|
  9136. * | HTT_MSDU_IDX_ | RESERVED | |
  9137. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9138. * | (8bits) | | |
  9139. * |-----------------+--------------------+-----------------------------------|
  9140. * | Reserved_2 |
  9141. * |--------------------------------------------------------------------------|
  9142. * | Reserved_3 |
  9143. * |--------------------------------------------------------------------------|
  9144. *
  9145. * Where:
  9146. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9147. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9148. * NH = Next Hop
  9149. * The following field definitions describe the format of the rx peer map v3
  9150. * messages sent from the target to the host.
  9151. * - MSG_TYPE
  9152. * Bits 7:0
  9153. * Purpose: identifies this as a peer map v3 message
  9154. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9155. * - VDEV_ID
  9156. * Bits 15:8
  9157. * Purpose: Indicates which virtual device the peer is associated with.
  9158. * - SW_PEER_ID
  9159. * Bits 31:16
  9160. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9161. * - MAC_ADDR_L32
  9162. * Bits 31:0
  9163. * Purpose: Identifies which peer node the peer ID is for.
  9164. * Value: lower 4 bytes of peer node's MAC address
  9165. * - MAC_ADDR_U16
  9166. * Bits 15:0
  9167. * Purpose: Identifies which peer node the peer ID is for.
  9168. * Value: upper 2 bytes of peer node's MAC address
  9169. * - MULTICAST_SW_PEER_ID
  9170. * Bits 31:16
  9171. * Purpose: The multicast peer ID (index)
  9172. * Value: set to HTT_INVALID_PEER if not valid
  9173. * - HW_PEER_ID / AST_INDEX
  9174. * Bits 15:0
  9175. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9176. * address, so for rx frames marked for rx --> tx forwarding, the
  9177. * host can determine from the HW peer ID provided as meta-data with
  9178. * the rx frame which peer the frame is supposed to be forwarded to.
  9179. * - CACHE_SET_NUM
  9180. * Bits 19:16
  9181. * Purpose: Cache Set Number for AST_INDEX
  9182. * Cache set number that should be used to cache the index based
  9183. * search results, for address and flow search.
  9184. * This value should be equal to LSB 4 bits of the hash value
  9185. * of match data, in case of search index points to an entry which
  9186. * may be used in content based search also. The value can be
  9187. * anything when the entry pointed by search index will not be
  9188. * used for content based search.
  9189. * - HTT_MSDU_IDX_VALID_MASK
  9190. * Bits 31:24
  9191. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9192. * - ONCHIP_AST_IDX / RESERVED
  9193. * Bits 15:0
  9194. * Purpose: This field is valid only when split AST feature is enabled.
  9195. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9196. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9197. * address, this ast_idx is used for LMAC modules for RXPCU.
  9198. * - NEXT_HOP
  9199. * Bits 16
  9200. * Purpose: Flag indicates next_hop AST entry used for WDS
  9201. * (Wireless Distribution System).
  9202. * - ONCHIP_AST_VALID
  9203. * Bits 17
  9204. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9205. * - EXT_AST_VALID
  9206. * Bits 18
  9207. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9208. * - EXT_AST_INDEX
  9209. * Bits 15:0
  9210. * Purpose: This field describes Extended AST index
  9211. * Valid if EXT_AST_VALID flag set
  9212. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9213. * Bits 31:24
  9214. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9215. */
  9216. /* dword 0 */
  9217. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9218. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9219. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9220. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9221. /* dword 1 */
  9222. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9223. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9224. /* dword 2 */
  9225. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9226. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9227. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9228. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9229. /* dword 3 */
  9230. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9231. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9232. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9233. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9234. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9235. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9236. /* dword 4 */
  9237. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9238. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9239. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9240. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9241. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9242. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9243. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9244. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9245. /* dword 5 */
  9246. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9247. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9248. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9249. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9250. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9251. do { \
  9252. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9253. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9254. } while (0)
  9255. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9256. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9257. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9258. do { \
  9259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9260. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9261. } while (0)
  9262. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9263. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9264. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9265. do { \
  9266. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9267. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9268. } while (0)
  9269. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9270. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9271. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9272. do { \
  9273. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9274. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9275. } while (0)
  9276. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9277. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9278. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9279. do { \
  9280. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9281. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9282. } while (0)
  9283. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9284. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9285. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9286. do { \
  9287. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9288. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9289. } while (0)
  9290. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9291. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9292. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9293. do { \
  9294. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9295. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9296. } while (0)
  9297. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9298. (((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)
  9299. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9300. do { \
  9301. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9302. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9303. } while (0)
  9304. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9305. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9306. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9307. do { \
  9308. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9309. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9310. } while (0)
  9311. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9312. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9313. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9314. do { \
  9315. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9316. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9317. } while (0)
  9318. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9319. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9320. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9321. do { \
  9322. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9323. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9324. } while (0)
  9325. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9326. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  9327. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  9328. do { \
  9329. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  9330. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  9331. } while (0)
  9332. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  9333. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  9334. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  9335. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  9336. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  9337. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  9338. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  9339. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  9340. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  9341. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9342. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9343. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  9344. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  9345. #define HTT_RX_PEER_MAP_V3_BYTES 32
  9346. /**
  9347. * @brief target -> host rx peer unmap V2 message definition
  9348. *
  9349. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  9350. *
  9351. * The following diagram shows the format of the rx peer unmap message sent
  9352. * from the target to the host.
  9353. *
  9354. * |31 24|23 16|15 8|7 0|
  9355. * |-----------------------------------------------------------------------|
  9356. * | SW peer ID | VDEV ID | msg type |
  9357. * |-----------------------------------------------------------------------|
  9358. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9359. * |-----------------------------------------------------------------------|
  9360. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  9361. * |-----------------------------------------------------------------------|
  9362. * | Peer Delete Duration |
  9363. * |-----------------------------------------------------------------------|
  9364. * | Reserved_0 | WDS Free Count |
  9365. * |-----------------------------------------------------------------------|
  9366. * | Reserved_1 |
  9367. * |-----------------------------------------------------------------------|
  9368. * | Reserved_2 |
  9369. * |-----------------------------------------------------------------------|
  9370. *
  9371. *
  9372. * The following field definitions describe the format of the rx peer unmap
  9373. * messages sent from the target to the host.
  9374. * - MSG_TYPE
  9375. * Bits 7:0
  9376. * Purpose: identifies this as an rx peer unmap v2 message
  9377. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  9378. * - VDEV_ID
  9379. * Bits 15:8
  9380. * Purpose: Indicates which virtual device the peer is associated
  9381. * with.
  9382. * Value: vdev ID (used in the host to look up the vdev object)
  9383. * - SW_PEER_ID
  9384. * Bits 31:16
  9385. * Purpose: The peer ID (index) that WAL is freeing
  9386. * Value: (rx) peer ID
  9387. * - MAC_ADDR_L32
  9388. * Bits 31:0
  9389. * Purpose: Identifies which peer node the peer ID is for.
  9390. * Value: lower 4 bytes of peer node's MAC address
  9391. * - MAC_ADDR_U16
  9392. * Bits 15:0
  9393. * Purpose: Identifies which peer node the peer ID is for.
  9394. * Value: upper 2 bytes of peer node's MAC address
  9395. * - NEXT_HOP
  9396. * Bits 16
  9397. * Purpose: Bit indicates next_hop AST entry used for WDS
  9398. * (Wireless Distribution System).
  9399. * - PEER_DELETE_DURATION
  9400. * Bits 31:0
  9401. * Purpose: Time taken to delete peer, in msec,
  9402. * Used for monitoring / debugging PEER delete response delay
  9403. * - PEER_WDS_FREE_COUNT
  9404. * Bits 15:0
  9405. * Purpose: Count of WDS entries deleted associated to peer deleted
  9406. */
  9407. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  9408. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  9409. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  9410. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  9411. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  9412. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  9413. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  9414. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  9415. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  9416. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  9417. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  9418. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  9419. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  9420. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  9421. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  9422. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  9423. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  9424. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  9425. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  9426. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  9427. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  9430. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  9431. } while (0)
  9432. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  9433. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  9434. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  9437. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  9438. } while (0)
  9439. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  9440. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  9441. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9442. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  9443. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  9444. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  9445. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  9446. /**
  9447. * @brief target -> host rx peer mlo map message definition
  9448. *
  9449. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  9450. *
  9451. * @details
  9452. * The following diagram shows the format of the rx mlo peer map message sent
  9453. * from the target to the host. This layout assumes the target operates
  9454. * as little-endian.
  9455. *
  9456. * MCC:
  9457. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  9458. *
  9459. * WIN:
  9460. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  9461. * It will be sent on the Assoc Link.
  9462. *
  9463. * This message always contains a MLO peer ID. The main purpose of the
  9464. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  9465. * with, so that the host can use that MLO peer ID to determine which peer
  9466. * transmitted the rx frame.
  9467. *
  9468. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  9469. * |-------------------------------------------------------------------------|
  9470. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  9471. * |-------------------------------------------------------------------------|
  9472. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9473. * |-------------------------------------------------------------------------|
  9474. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  9475. * |-------------------------------------------------------------------------|
  9476. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  9477. * |-------------------------------------------------------------------------|
  9478. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  9479. * |-------------------------------------------------------------------------|
  9480. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  9481. * |-------------------------------------------------------------------------|
  9482. * |RSVD |
  9483. * |-------------------------------------------------------------------------|
  9484. * |RSVD |
  9485. * |-------------------------------------------------------------------------|
  9486. * | htt_tlv_hdr_t |
  9487. * |-------------------------------------------------------------------------|
  9488. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9489. * |-------------------------------------------------------------------------|
  9490. * | htt_tlv_hdr_t |
  9491. * |-------------------------------------------------------------------------|
  9492. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9493. * |-------------------------------------------------------------------------|
  9494. * | htt_tlv_hdr_t |
  9495. * |-------------------------------------------------------------------------|
  9496. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9497. * |-------------------------------------------------------------------------|
  9498. *
  9499. * Where:
  9500. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  9501. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  9502. * V (valid) - 1 Bit Bit17
  9503. * CHIPID - 3 Bits
  9504. * TIDMASK - 8 Bits
  9505. * CACHE_SET_NUM - 8 Bits
  9506. *
  9507. * The following field definitions describe the format of the rx MLO peer map
  9508. * messages sent from the target to the host.
  9509. * - MSG_TYPE
  9510. * Bits 7:0
  9511. * Purpose: identifies this as an rx mlo peer map message
  9512. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  9513. *
  9514. * - MLO_PEER_ID
  9515. * Bits 23:8
  9516. * Purpose: The MLO peer ID (index).
  9517. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  9518. * Value: MLO peer ID
  9519. *
  9520. * - NUMLINK
  9521. * Bits: 26:24 (3Bits)
  9522. * Purpose: Indicate the max number of logical links supported per client.
  9523. * Value: number of logical links
  9524. *
  9525. * - PRC
  9526. * Bits: 29:27 (3Bits)
  9527. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  9528. * if there is migration of the primary chip.
  9529. * Value: Primary REO CHIPID
  9530. *
  9531. * - MAC_ADDR_L32
  9532. * Bits 31:0
  9533. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  9534. * Value: lower 4 bytes of peer node's MAC address
  9535. *
  9536. * - MAC_ADDR_U16
  9537. * Bits 15:0
  9538. * Purpose: Identifies which peer node the peer ID is for.
  9539. * Value: upper 2 bytes of peer node's MAC address
  9540. *
  9541. * - PRIMARY_TCL_AST_IDX
  9542. * Bits 15:0
  9543. * Purpose: Primary TCL AST index for this peer.
  9544. *
  9545. * - V
  9546. * 1 Bit Position 16
  9547. * Purpose: If the ast idx is valid.
  9548. *
  9549. * - CHIPID
  9550. * Bits 19:17
  9551. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  9552. *
  9553. * - TIDMASK
  9554. * Bits 27:20
  9555. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  9556. *
  9557. * - CACHE_SET_NUM
  9558. * Bits 31:28
  9559. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  9560. * Cache set number that should be used to cache the index based
  9561. * search results, for address and flow search.
  9562. * This value should be equal to LSB four bits of the hash value
  9563. * of match data, in case of search index points to an entry which
  9564. * may be used in content based search also. The value can be
  9565. * anything when the entry pointed by search index will not be
  9566. * used for content based search.
  9567. *
  9568. * - htt_tlv_hdr_t
  9569. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  9570. *
  9571. * Bits 11:0
  9572. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  9573. *
  9574. * Bits 23:12
  9575. * Purpose: Length, Length of the value that follows the header
  9576. *
  9577. * Bits 31:28
  9578. * Purpose: Reserved.
  9579. *
  9580. *
  9581. * - SW_PEER_ID
  9582. * Bits 15:0
  9583. * Purpose: The peer ID (index) that WAL is allocating
  9584. * Value: (rx) peer ID
  9585. *
  9586. * - VDEV_ID
  9587. * Bits 23:16
  9588. * Purpose: Indicates which virtual device the peer is associated with.
  9589. * Value: vdev ID (used in the host to look up the vdev object)
  9590. *
  9591. * - CHIPID
  9592. * Bits 26:24
  9593. * Purpose: Indicates which Chip id the peer is associated with.
  9594. * Value: chip ID (Provided by Host as part of QMI exchange)
  9595. */
  9596. typedef enum {
  9597. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  9598. } MLO_PEER_MAP_TLV_TAG_ID;
  9599. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  9600. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  9601. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  9602. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  9603. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  9604. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  9605. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9606. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  9607. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  9608. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  9609. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  9610. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  9611. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  9612. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  9613. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  9614. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  9615. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  9616. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  9617. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  9618. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  9619. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  9620. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  9621. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  9622. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  9623. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  9624. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  9625. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  9626. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  9627. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  9628. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  9629. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  9630. do { \
  9631. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  9632. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  9633. } while (0)
  9634. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  9635. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  9636. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  9637. do { \
  9638. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  9639. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  9640. } while (0)
  9641. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  9642. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  9643. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  9644. do { \
  9645. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  9646. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  9647. } while (0)
  9648. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  9649. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  9650. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  9651. do { \
  9652. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  9653. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  9654. } while (0)
  9655. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  9656. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  9657. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  9658. do { \
  9659. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  9660. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  9661. } while (0)
  9662. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  9663. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  9664. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  9665. do { \
  9666. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  9667. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  9668. } while (0)
  9669. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  9670. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  9671. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  9672. do { \
  9673. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  9674. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  9675. } while (0)
  9676. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  9677. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  9678. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  9679. do { \
  9680. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  9681. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  9682. } while (0)
  9683. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  9684. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  9685. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  9686. do { \
  9687. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  9688. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  9689. } while (0)
  9690. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  9691. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  9692. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  9693. do { \
  9694. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  9695. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  9696. } while (0)
  9697. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  9698. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  9699. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  9700. do { \
  9701. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  9702. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  9703. } while (0)
  9704. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  9705. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  9706. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  9707. do { \
  9708. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  9709. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  9710. } while (0)
  9711. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  9712. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  9713. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  9714. do { \
  9715. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  9716. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  9717. } while (0)
  9718. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  9719. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  9720. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9721. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  9722. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  9723. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  9724. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  9725. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  9726. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  9727. *
  9728. * The following diagram shows the format of the rx mlo peer unmap message sent
  9729. * from the target to the host.
  9730. *
  9731. * |31 24|23 16|15 8|7 0|
  9732. * |-----------------------------------------------------------------------|
  9733. * | RSVD_24_31 | MLO peer ID | msg type |
  9734. * |-----------------------------------------------------------------------|
  9735. */
  9736. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  9737. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  9738. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  9739. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  9740. /**
  9741. * @brief target -> host message specifying security parameters
  9742. *
  9743. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  9744. *
  9745. * @details
  9746. * The following diagram shows the format of the security specification
  9747. * message sent from the target to the host.
  9748. * This security specification message tells the host whether a PN check is
  9749. * necessary on rx data frames, and if so, how large the PN counter is.
  9750. * This message also tells the host about the security processing to apply
  9751. * to defragmented rx frames - specifically, whether a Message Integrity
  9752. * Check is required, and the Michael key to use.
  9753. *
  9754. * |31 24|23 16|15|14 8|7 0|
  9755. * |-----------------------------------------------------------------------|
  9756. * | peer ID | U| security type | msg type |
  9757. * |-----------------------------------------------------------------------|
  9758. * | Michael Key K0 |
  9759. * |-----------------------------------------------------------------------|
  9760. * | Michael Key K1 |
  9761. * |-----------------------------------------------------------------------|
  9762. * | WAPI RSC Low0 |
  9763. * |-----------------------------------------------------------------------|
  9764. * | WAPI RSC Low1 |
  9765. * |-----------------------------------------------------------------------|
  9766. * | WAPI RSC Hi0 |
  9767. * |-----------------------------------------------------------------------|
  9768. * | WAPI RSC Hi1 |
  9769. * |-----------------------------------------------------------------------|
  9770. *
  9771. * The following field definitions describe the format of the security
  9772. * indication message sent from the target to the host.
  9773. * - MSG_TYPE
  9774. * Bits 7:0
  9775. * Purpose: identifies this as a security specification message
  9776. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  9777. * - SEC_TYPE
  9778. * Bits 14:8
  9779. * Purpose: specifies which type of security applies to the peer
  9780. * Value: htt_sec_type enum value
  9781. * - UNICAST
  9782. * Bit 15
  9783. * Purpose: whether this security is applied to unicast or multicast data
  9784. * Value: 1 -> unicast, 0 -> multicast
  9785. * - PEER_ID
  9786. * Bits 31:16
  9787. * Purpose: The ID number for the peer the security specification is for
  9788. * Value: peer ID
  9789. * - MICHAEL_KEY_K0
  9790. * Bits 31:0
  9791. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  9792. * Value: Michael Key K0 (if security type is TKIP)
  9793. * - MICHAEL_KEY_K1
  9794. * Bits 31:0
  9795. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  9796. * Value: Michael Key K1 (if security type is TKIP)
  9797. * - WAPI_RSC_LOW0
  9798. * Bits 31:0
  9799. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  9800. * Value: WAPI RSC Low0 (if security type is WAPI)
  9801. * - WAPI_RSC_LOW1
  9802. * Bits 31:0
  9803. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  9804. * Value: WAPI RSC Low1 (if security type is WAPI)
  9805. * - WAPI_RSC_HI0
  9806. * Bits 31:0
  9807. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  9808. * Value: WAPI RSC Hi0 (if security type is WAPI)
  9809. * - WAPI_RSC_HI1
  9810. * Bits 31:0
  9811. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  9812. * Value: WAPI RSC Hi1 (if security type is WAPI)
  9813. */
  9814. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  9815. #define HTT_SEC_IND_SEC_TYPE_S 8
  9816. #define HTT_SEC_IND_UNICAST_M 0x00008000
  9817. #define HTT_SEC_IND_UNICAST_S 15
  9818. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  9819. #define HTT_SEC_IND_PEER_ID_S 16
  9820. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  9821. do { \
  9822. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  9823. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  9824. } while (0)
  9825. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  9826. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  9827. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  9828. do { \
  9829. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  9830. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  9831. } while (0)
  9832. #define HTT_SEC_IND_UNICAST_GET(word) \
  9833. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  9834. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  9835. do { \
  9836. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  9837. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  9838. } while (0)
  9839. #define HTT_SEC_IND_PEER_ID_GET(word) \
  9840. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  9841. #define HTT_SEC_IND_BYTES 28
  9842. /**
  9843. * @brief target -> host rx ADDBA / DELBA message definitions
  9844. *
  9845. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  9846. *
  9847. * @details
  9848. * The following diagram shows the format of the rx ADDBA message sent
  9849. * from the target to the host:
  9850. *
  9851. * |31 20|19 16|15 8|7 0|
  9852. * |---------------------------------------------------------------------|
  9853. * | peer ID | TID | window size | msg type |
  9854. * |---------------------------------------------------------------------|
  9855. *
  9856. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  9857. *
  9858. * The following diagram shows the format of the rx DELBA message sent
  9859. * from the target to the host:
  9860. *
  9861. * |31 20|19 16|15 10|9 8|7 0|
  9862. * |---------------------------------------------------------------------|
  9863. * | peer ID | TID | window size | IR| msg type |
  9864. * |---------------------------------------------------------------------|
  9865. *
  9866. * The following field definitions describe the format of the rx ADDBA
  9867. * and DELBA messages sent from the target to the host.
  9868. * - MSG_TYPE
  9869. * Bits 7:0
  9870. * Purpose: identifies this as an rx ADDBA or DELBA message
  9871. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  9872. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  9873. * - IR (initiator / recipient)
  9874. * Bits 9:8 (DELBA only)
  9875. * Purpose: specify whether the DELBA handshake was initiated by the
  9876. * local STA/AP, or by the peer STA/AP
  9877. * Value:
  9878. * 0 - unspecified
  9879. * 1 - initiator (a.k.a. originator)
  9880. * 2 - recipient (a.k.a. responder)
  9881. * 3 - unused / reserved
  9882. * - WIN_SIZE
  9883. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  9884. * Purpose: Specifies the length of the block ack window (max = 64).
  9885. * Value:
  9886. * block ack window length specified by the received ADDBA/DELBA
  9887. * management message.
  9888. * - TID
  9889. * Bits 19:16
  9890. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  9891. * Value:
  9892. * TID specified by the received ADDBA or DELBA management message.
  9893. * - PEER_ID
  9894. * Bits 31:20
  9895. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  9896. * Value:
  9897. * ID (hash value) used by the host for fast, direct lookup of
  9898. * host SW peer info, including rx reorder states.
  9899. */
  9900. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  9901. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  9902. #define HTT_RX_ADDBA_TID_M 0xf0000
  9903. #define HTT_RX_ADDBA_TID_S 16
  9904. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  9905. #define HTT_RX_ADDBA_PEER_ID_S 20
  9906. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  9907. do { \
  9908. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  9909. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  9910. } while (0)
  9911. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9912. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9913. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9914. do { \
  9915. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9916. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9917. } while (0)
  9918. #define HTT_RX_ADDBA_TID_GET(word) \
  9919. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9920. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9921. do { \
  9922. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9923. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9924. } while (0)
  9925. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9926. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9927. #define HTT_RX_ADDBA_BYTES 4
  9928. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9929. #define HTT_RX_DELBA_INITIATOR_S 8
  9930. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9931. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9932. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9933. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9934. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9935. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9936. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9937. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9938. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9939. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9940. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9943. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9944. } while (0)
  9945. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9946. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9947. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9950. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9951. } while (0)
  9952. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9953. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9954. #define HTT_RX_DELBA_BYTES 4
  9955. /**
  9956. * @brief tx queue group information element definition
  9957. *
  9958. * @details
  9959. * The following diagram shows the format of the tx queue group
  9960. * information element, which can be included in target --> host
  9961. * messages to specify the number of tx "credits" (tx descriptors
  9962. * for LL, or tx buffers for HL) available to a particular group
  9963. * of host-side tx queues, and which host-side tx queues belong to
  9964. * the group.
  9965. *
  9966. * |31|30 24|23 16|15|14|13 0|
  9967. * |------------------------------------------------------------------------|
  9968. * | X| reserved | tx queue grp ID | A| S| credit count |
  9969. * |------------------------------------------------------------------------|
  9970. * | vdev ID mask | AC mask |
  9971. * |------------------------------------------------------------------------|
  9972. *
  9973. * The following definitions describe the fields within the tx queue group
  9974. * information element:
  9975. * - credit_count
  9976. * Bits 13:1
  9977. * Purpose: specify how many tx credits are available to the tx queue group
  9978. * Value: An absolute or relative, positive or negative credit value
  9979. * The 'A' bit specifies whether the value is absolute or relative.
  9980. * The 'S' bit specifies whether the value is positive or negative.
  9981. * A negative value can only be relative, not absolute.
  9982. * An absolute value replaces any prior credit value the host has for
  9983. * the tx queue group in question.
  9984. * A relative value is added to the prior credit value the host has for
  9985. * the tx queue group in question.
  9986. * - sign
  9987. * Bit 14
  9988. * Purpose: specify whether the credit count is positive or negative
  9989. * Value: 0 -> positive, 1 -> negative
  9990. * - absolute
  9991. * Bit 15
  9992. * Purpose: specify whether the credit count is absolute or relative
  9993. * Value: 0 -> relative, 1 -> absolute
  9994. * - txq_group_id
  9995. * Bits 23:16
  9996. * Purpose: indicate which tx queue group's credit and/or membership are
  9997. * being specified
  9998. * Value: 0 to max_tx_queue_groups-1
  9999. * - reserved
  10000. * Bits 30:16
  10001. * Value: 0x0
  10002. * - eXtension
  10003. * Bit 31
  10004. * Purpose: specify whether another tx queue group info element follows
  10005. * Value: 0 -> no more tx queue group information elements
  10006. * 1 -> another tx queue group information element immediately follows
  10007. * - ac_mask
  10008. * Bits 15:0
  10009. * Purpose: specify which Access Categories belong to the tx queue group
  10010. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10011. * the tx queue group.
  10012. * The AC bit-mask values are obtained by left-shifting by the
  10013. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10014. * - vdev_id_mask
  10015. * Bits 31:16
  10016. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10017. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10018. * belong to the tx queue group.
  10019. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10020. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10021. */
  10022. PREPACK struct htt_txq_group {
  10023. A_UINT32
  10024. credit_count: 14,
  10025. sign: 1,
  10026. absolute: 1,
  10027. tx_queue_group_id: 8,
  10028. reserved0: 7,
  10029. extension: 1;
  10030. A_UINT32
  10031. ac_mask: 16,
  10032. vdev_id_mask: 16;
  10033. } POSTPACK;
  10034. /* first word */
  10035. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10036. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10037. #define HTT_TXQ_GROUP_SIGN_S 14
  10038. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10039. #define HTT_TXQ_GROUP_ABS_S 15
  10040. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10041. #define HTT_TXQ_GROUP_ID_S 16
  10042. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10043. #define HTT_TXQ_GROUP_EXT_S 31
  10044. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10045. /* second word */
  10046. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10047. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10048. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10049. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10050. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10053. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10054. } while (0)
  10055. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10056. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10057. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10060. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10061. } while (0)
  10062. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10063. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10064. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10067. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10068. } while (0)
  10069. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10070. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10071. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10072. do { \
  10073. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10074. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10075. } while (0)
  10076. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10077. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10078. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10079. do { \
  10080. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10081. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10082. } while (0)
  10083. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10084. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10085. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10086. do { \
  10087. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10088. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10089. } while (0)
  10090. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10091. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10092. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10093. do { \
  10094. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10095. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10096. } while (0)
  10097. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10098. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10099. /**
  10100. * @brief target -> host TX completion indication message definition
  10101. *
  10102. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10103. *
  10104. * @details
  10105. * The following diagram shows the format of the TX completion indication sent
  10106. * from the target to the host
  10107. *
  10108. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10109. * |-------------------------------------------------------------------|
  10110. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10111. * |-------------------------------------------------------------------|
  10112. * payload:| MSDU1 ID | MSDU0 ID |
  10113. * |-------------------------------------------------------------------|
  10114. * : MSDU3 ID | MSDU2 ID :
  10115. * |-------------------------------------------------------------------|
  10116. * | struct htt_tx_compl_ind_append_retries |
  10117. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10118. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10119. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10120. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10121. * |-------------------------------------------------------------------|
  10122. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10123. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10124. * | MSDU0 tx_tsf64_low |
  10125. * |-------------------------------------------------------------------|
  10126. * | MSDU0 tx_tsf64_high |
  10127. * |-------------------------------------------------------------------|
  10128. * | MSDU1 tx_tsf64_low |
  10129. * |-------------------------------------------------------------------|
  10130. * | MSDU1 tx_tsf64_high |
  10131. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10132. * | phy_timestamp |
  10133. * |-------------------------------------------------------------------|
  10134. * | rate specs (see below) |
  10135. * |-------------------------------------------------------------------|
  10136. * | seqctrl | framectrl |
  10137. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10138. * Where:
  10139. * A0 = append (a.k.a. append0)
  10140. * A1 = append1
  10141. * TP = MSDU tx power presence
  10142. * A2 = append2
  10143. * A3 = append3
  10144. * A4 = append4
  10145. *
  10146. * The following field definitions describe the format of the TX completion
  10147. * indication sent from the target to the host
  10148. * Header fields:
  10149. * - msg_type
  10150. * Bits 7:0
  10151. * Purpose: identifies this as HTT TX completion indication
  10152. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10153. * - status
  10154. * Bits 10:8
  10155. * Purpose: the TX completion status of payload fragmentations descriptors
  10156. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10157. * - tid
  10158. * Bits 14:11
  10159. * Purpose: the tid associated with those fragmentation descriptors. It is
  10160. * valid or not, depending on the tid_invalid bit.
  10161. * Value: 0 to 15
  10162. * - tid_invalid
  10163. * Bits 15:15
  10164. * Purpose: this bit indicates whether the tid field is valid or not
  10165. * Value: 0 indicates valid; 1 indicates invalid
  10166. * - num
  10167. * Bits 23:16
  10168. * Purpose: the number of payload in this indication
  10169. * Value: 1 to 255
  10170. * - append (a.k.a. append0)
  10171. * Bits 24:24
  10172. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10173. * the number of tx retries for one MSDU at the end of this message
  10174. * Value: 0 indicates no appending; 1 indicates appending
  10175. * - append1
  10176. * Bits 25:25
  10177. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10178. * contains the timestamp info for each TX msdu id in payload.
  10179. * The order of the timestamps matches the order of the MSDU IDs.
  10180. * Note that a big-endian host needs to account for the reordering
  10181. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10182. * conversion) when determining which tx timestamp corresponds to
  10183. * which MSDU ID.
  10184. * Value: 0 indicates no appending; 1 indicates appending
  10185. * - msdu_tx_power_presence
  10186. * Bits 26:26
  10187. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10188. * for each MSDU referenced by the TX_COMPL_IND message.
  10189. * The tx power is reported in 0.5 dBm units.
  10190. * The order of the per-MSDU tx power reports matches the order
  10191. * of the MSDU IDs.
  10192. * Note that a big-endian host needs to account for the reordering
  10193. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10194. * conversion) when determining which Tx Power corresponds to
  10195. * which MSDU ID.
  10196. * Value: 0 indicates MSDU tx power reports are not appended,
  10197. * 1 indicates MSDU tx power reports are appended
  10198. * - append2
  10199. * Bits 27:27
  10200. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10201. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10202. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10203. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10204. * for each MSDU, for convenience.
  10205. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10206. * this append2 bit is set).
  10207. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10208. * dB above the noise floor.
  10209. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10210. * 1 indicates MSDU ACK RSSI values are appended.
  10211. * - append3
  10212. * Bits 28:28
  10213. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10214. * contains the tx tsf info based on wlan global TSF for
  10215. * each TX msdu id in payload.
  10216. * The order of the tx tsf matches the order of the MSDU IDs.
  10217. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10218. * values to indicate the the lower 32 bits and higher 32 bits of
  10219. * the tx tsf.
  10220. * The tx_tsf64 here represents the time MSDU was acked and the
  10221. * tx_tsf64 has microseconds units.
  10222. * Value: 0 indicates no appending; 1 indicates appending
  10223. * - append4
  10224. * Bits 29:29
  10225. * Purpose: Indicate whether data frame control fields and fields required
  10226. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10227. * message. The order of the this message matches the order of
  10228. * the MSDU IDs.
  10229. * Value: 0 indicates frame control fields and fields required for
  10230. * radio tap header values are not appended,
  10231. * 1 indicates frame control fields and fields required for
  10232. * radio tap header values are appended.
  10233. * Payload fields:
  10234. * - hmsdu_id
  10235. * Bits 15:0
  10236. * Purpose: this ID is used to track the Tx buffer in host
  10237. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10238. */
  10239. PREPACK struct htt_tx_data_hdr_information {
  10240. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10241. A_UINT32 /* word 1 */
  10242. /* preamble:
  10243. * 0-OFDM,
  10244. * 1-CCk,
  10245. * 2-HT,
  10246. * 3-VHT
  10247. */
  10248. preamble: 2, /* [1:0] */
  10249. /* mcs:
  10250. * In case of HT preamble interpret
  10251. * MCS along with NSS.
  10252. * Valid values for HT are 0 to 7.
  10253. * HT mcs 0 with NSS 2 is mcs 8.
  10254. * Valid values for VHT are 0 to 9.
  10255. */
  10256. mcs: 4, /* [5:2] */
  10257. /* rate:
  10258. * This is applicable only for
  10259. * CCK and OFDM preamble type
  10260. * rate 0: OFDM 48 Mbps,
  10261. * 1: OFDM 24 Mbps,
  10262. * 2: OFDM 12 Mbps
  10263. * 3: OFDM 6 Mbps
  10264. * 4: OFDM 54 Mbps
  10265. * 5: OFDM 36 Mbps
  10266. * 6: OFDM 18 Mbps
  10267. * 7: OFDM 9 Mbps
  10268. * rate 0: CCK 11 Mbps Long
  10269. * 1: CCK 5.5 Mbps Long
  10270. * 2: CCK 2 Mbps Long
  10271. * 3: CCK 1 Mbps Long
  10272. * 4: CCK 11 Mbps Short
  10273. * 5: CCK 5.5 Mbps Short
  10274. * 6: CCK 2 Mbps Short
  10275. */
  10276. rate : 3, /* [ 8: 6] */
  10277. rssi : 8, /* [16: 9] units=dBm */
  10278. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10279. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10280. stbc : 1, /* [22] */
  10281. sgi : 1, /* [23] */
  10282. ldpc : 1, /* [24] */
  10283. beamformed: 1, /* [25] */
  10284. /* tx_retry_cnt:
  10285. * Indicates retry count of data tx frames provided by the host.
  10286. */
  10287. tx_retry_cnt: 6; /* [31:26] */
  10288. A_UINT32 /* word 2 */
  10289. framectrl:16, /* [15: 0] */
  10290. seqno:16; /* [31:16] */
  10291. } POSTPACK;
  10292. #define HTT_TX_COMPL_IND_STATUS_S 8
  10293. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10294. #define HTT_TX_COMPL_IND_TID_S 11
  10295. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10296. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10297. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10298. #define HTT_TX_COMPL_IND_NUM_S 16
  10299. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10300. #define HTT_TX_COMPL_IND_APPEND_S 24
  10301. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10302. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10303. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10304. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10305. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10306. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10307. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10308. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10309. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10310. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10311. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10312. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10313. do { \
  10314. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10315. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10316. } while (0)
  10317. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10318. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10319. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10320. do { \
  10321. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10322. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10323. } while (0)
  10324. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10325. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10326. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  10327. do { \
  10328. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  10329. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  10330. } while (0)
  10331. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  10332. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  10333. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  10334. do { \
  10335. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  10336. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  10337. } while (0)
  10338. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  10339. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  10340. HTT_TX_COMPL_IND_TID_INV_S)
  10341. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  10342. do { \
  10343. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  10344. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  10345. } while (0)
  10346. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  10347. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  10348. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  10349. do { \
  10350. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  10351. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  10352. } while (0)
  10353. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  10354. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  10355. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  10358. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  10359. } while (0)
  10360. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  10361. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  10362. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  10363. do { \
  10364. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  10365. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  10366. } while (0)
  10367. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  10368. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  10369. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  10370. do { \
  10371. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  10372. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  10373. } while (0)
  10374. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  10375. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  10376. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  10379. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  10380. } while (0)
  10381. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  10382. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  10383. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  10384. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  10385. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  10386. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  10387. #define HTT_TX_COMPL_IND_STAT_OK 0
  10388. /* DISCARD:
  10389. * current meaning:
  10390. * MSDUs were queued for transmission but filtered by HW or SW
  10391. * without any over the air attempts
  10392. * legacy meaning (HL Rome):
  10393. * MSDUs were discarded by the target FW without any over the air
  10394. * attempts due to lack of space
  10395. */
  10396. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  10397. /* NO_ACK:
  10398. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  10399. */
  10400. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  10401. /* POSTPONE:
  10402. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  10403. * be downloaded again later (in the appropriate order), when they are
  10404. * deliverable.
  10405. */
  10406. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  10407. /*
  10408. * The PEER_DEL tx completion status is used for HL cases
  10409. * where the peer the frame is for has been deleted.
  10410. * The host has already discarded its copy of the frame, but
  10411. * it still needs the tx completion to restore its credit.
  10412. */
  10413. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  10414. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  10415. #define HTT_TX_COMPL_IND_STAT_DROP 5
  10416. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  10417. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  10418. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  10419. PREPACK struct htt_tx_compl_ind_base {
  10420. A_UINT32 hdr;
  10421. A_UINT16 payload[1/*or more*/];
  10422. } POSTPACK;
  10423. PREPACK struct htt_tx_compl_ind_append_retries {
  10424. A_UINT16 msdu_id;
  10425. A_UINT8 tx_retries;
  10426. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  10427. 0: this is the last append_retries struct */
  10428. } POSTPACK;
  10429. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  10430. A_UINT32 timestamp[1/*or more*/];
  10431. } POSTPACK;
  10432. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  10433. A_UINT32 tx_tsf64_low;
  10434. A_UINT32 tx_tsf64_high;
  10435. } POSTPACK;
  10436. /* htt_tx_data_hdr_information payload extension fields: */
  10437. /* DWORD zero */
  10438. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  10439. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  10440. /* DWORD one */
  10441. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  10442. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  10443. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  10444. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  10445. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  10446. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  10447. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  10448. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  10449. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  10450. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  10451. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  10452. #define HTT_FW_TX_DATA_HDR_BW_S 19
  10453. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  10454. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  10455. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  10456. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  10457. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  10458. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  10459. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  10460. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  10461. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  10462. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  10463. /* DWORD two */
  10464. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  10465. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  10466. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  10467. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  10468. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  10471. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  10472. } while (0)
  10473. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  10474. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  10475. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  10476. do { \
  10477. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  10478. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  10479. } while (0)
  10480. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  10481. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  10482. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  10483. do { \
  10484. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  10485. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  10486. } while (0)
  10487. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  10488. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  10489. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  10490. do { \
  10491. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  10492. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  10493. } while (0)
  10494. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  10495. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  10496. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  10497. do { \
  10498. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  10499. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  10500. } while (0)
  10501. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  10502. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  10503. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  10504. do { \
  10505. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  10506. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  10507. } while (0)
  10508. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  10509. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  10510. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  10511. do { \
  10512. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  10513. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  10514. } while (0)
  10515. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  10516. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  10517. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  10520. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  10521. } while (0)
  10522. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  10523. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  10524. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  10527. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  10528. } while (0)
  10529. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  10530. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  10531. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  10532. do { \
  10533. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  10534. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  10535. } while (0)
  10536. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  10537. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  10538. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  10539. do { \
  10540. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  10541. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  10542. } while (0)
  10543. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  10544. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  10545. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  10546. do { \
  10547. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  10548. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  10549. } while (0)
  10550. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  10551. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  10552. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  10553. do { \
  10554. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  10555. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  10556. } while (0)
  10557. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  10558. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  10559. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  10560. do { \
  10561. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  10562. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  10563. } while (0)
  10564. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  10565. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  10566. /**
  10567. * @brief target -> host rate-control update indication message
  10568. *
  10569. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  10570. *
  10571. * @details
  10572. * The following diagram shows the format of the RC Update message
  10573. * sent from the target to the host, while processing the tx-completion
  10574. * of a transmitted PPDU.
  10575. *
  10576. * |31 24|23 16|15 8|7 0|
  10577. * |-------------------------------------------------------------|
  10578. * | peer ID | vdev ID | msg_type |
  10579. * |-------------------------------------------------------------|
  10580. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10581. * |-------------------------------------------------------------|
  10582. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  10583. * |-------------------------------------------------------------|
  10584. * | : |
  10585. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10586. * | : |
  10587. * |-------------------------------------------------------------|
  10588. * | : |
  10589. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10590. * | : |
  10591. * |-------------------------------------------------------------|
  10592. * : :
  10593. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10594. *
  10595. */
  10596. typedef struct {
  10597. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  10598. A_UINT32 rate_code_flags;
  10599. A_UINT32 flags; /* Encodes information such as excessive
  10600. retransmission, aggregate, some info
  10601. from .11 frame control,
  10602. STBC, LDPC, (SGI and Tx Chain Mask
  10603. are encoded in ptx_rc->flags field),
  10604. AMPDU truncation (BT/time based etc.),
  10605. RTS/CTS attempt */
  10606. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  10607. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  10608. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  10609. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  10610. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  10611. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  10612. } HTT_RC_TX_DONE_PARAMS;
  10613. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  10614. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  10615. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  10616. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  10617. #define HTT_RC_UPDATE_VDEVID_S 8
  10618. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  10619. #define HTT_RC_UPDATE_PEERID_S 16
  10620. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  10621. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  10622. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  10623. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  10624. do { \
  10625. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  10626. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  10627. } while (0)
  10628. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  10629. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  10630. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  10631. do { \
  10632. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  10633. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  10634. } while (0)
  10635. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  10636. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  10637. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  10638. do { \
  10639. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  10640. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  10641. } while (0)
  10642. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  10643. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  10644. /**
  10645. * @brief target -> host rx fragment indication message definition
  10646. *
  10647. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  10648. *
  10649. * @details
  10650. * The following field definitions describe the format of the rx fragment
  10651. * indication message sent from the target to the host.
  10652. * The rx fragment indication message shares the format of the
  10653. * rx indication message, but not all fields from the rx indication message
  10654. * are relevant to the rx fragment indication message.
  10655. *
  10656. *
  10657. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10658. * |-----------+-------------------+---------------------+-------------|
  10659. * | peer ID | |FV| ext TID | msg type |
  10660. * |-------------------------------------------------------------------|
  10661. * | | flush | flush |
  10662. * | | end | start |
  10663. * | | seq num | seq num |
  10664. * |-------------------------------------------------------------------|
  10665. * | reserved | FW rx desc bytes |
  10666. * |-------------------------------------------------------------------|
  10667. * | | FW MSDU Rx |
  10668. * | | desc B0 |
  10669. * |-------------------------------------------------------------------|
  10670. * Header fields:
  10671. * - MSG_TYPE
  10672. * Bits 7:0
  10673. * Purpose: identifies this as an rx fragment indication message
  10674. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  10675. * - EXT_TID
  10676. * Bits 12:8
  10677. * Purpose: identify the traffic ID of the rx data, including
  10678. * special "extended" TID values for multicast, broadcast, and
  10679. * non-QoS data frames
  10680. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10681. * - FLUSH_VALID (FV)
  10682. * Bit 13
  10683. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10684. * is valid
  10685. * Value:
  10686. * 1 -> flush IE is valid and needs to be processed
  10687. * 0 -> flush IE is not valid and should be ignored
  10688. * - PEER_ID
  10689. * Bits 31:16
  10690. * Purpose: Identify, by ID, which peer sent the rx data
  10691. * Value: ID of the peer who sent the rx data
  10692. * - FLUSH_SEQ_NUM_START
  10693. * Bits 5:0
  10694. * Purpose: Indicate the start of a series of MPDUs to flush
  10695. * Not all MPDUs within this series are necessarily valid - the host
  10696. * must check each sequence number within this range to see if the
  10697. * corresponding MPDU is actually present.
  10698. * This field is only valid if the FV bit is set.
  10699. * Value:
  10700. * The sequence number for the first MPDUs to check to flush.
  10701. * The sequence number is masked by 0x3f.
  10702. * - FLUSH_SEQ_NUM_END
  10703. * Bits 11:6
  10704. * Purpose: Indicate the end of a series of MPDUs to flush
  10705. * Value:
  10706. * The sequence number one larger than the sequence number of the
  10707. * last MPDU to check to flush.
  10708. * The sequence number is masked by 0x3f.
  10709. * Not all MPDUs within this series are necessarily valid - the host
  10710. * must check each sequence number within this range to see if the
  10711. * corresponding MPDU is actually present.
  10712. * This field is only valid if the FV bit is set.
  10713. * Rx descriptor fields:
  10714. * - FW_RX_DESC_BYTES
  10715. * Bits 15:0
  10716. * Purpose: Indicate how many bytes in the Rx indication are used for
  10717. * FW Rx descriptors
  10718. * Value: 1
  10719. */
  10720. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  10721. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  10722. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  10723. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  10724. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  10725. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  10726. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  10727. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  10728. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  10729. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  10730. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  10731. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  10732. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  10733. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  10734. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  10735. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  10736. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  10737. #define HTT_RX_FRAG_IND_BYTES \
  10738. (4 /* msg hdr */ + \
  10739. 4 /* flush spec */ + \
  10740. 4 /* (unused) FW rx desc bytes spec */ + \
  10741. 4 /* FW rx desc */)
  10742. /**
  10743. * @brief target -> host test message definition
  10744. *
  10745. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  10746. *
  10747. * @details
  10748. * The following field definitions describe the format of the test
  10749. * message sent from the target to the host.
  10750. * The message consists of a 4-octet header, followed by a variable
  10751. * number of 32-bit integer values, followed by a variable number
  10752. * of 8-bit character values.
  10753. *
  10754. * |31 16|15 8|7 0|
  10755. * |-----------------------------------------------------------|
  10756. * | num chars | num ints | msg type |
  10757. * |-----------------------------------------------------------|
  10758. * | int 0 |
  10759. * |-----------------------------------------------------------|
  10760. * | int 1 |
  10761. * |-----------------------------------------------------------|
  10762. * | ... |
  10763. * |-----------------------------------------------------------|
  10764. * | char 3 | char 2 | char 1 | char 0 |
  10765. * |-----------------------------------------------------------|
  10766. * | | | ... | char 4 |
  10767. * |-----------------------------------------------------------|
  10768. * - MSG_TYPE
  10769. * Bits 7:0
  10770. * Purpose: identifies this as a test message
  10771. * Value: HTT_MSG_TYPE_TEST
  10772. * - NUM_INTS
  10773. * Bits 15:8
  10774. * Purpose: indicate how many 32-bit integers follow the message header
  10775. * - NUM_CHARS
  10776. * Bits 31:16
  10777. * Purpose: indicate how many 8-bit charaters follow the series of integers
  10778. */
  10779. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  10780. #define HTT_RX_TEST_NUM_INTS_S 8
  10781. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  10782. #define HTT_RX_TEST_NUM_CHARS_S 16
  10783. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  10784. do { \
  10785. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  10786. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  10787. } while (0)
  10788. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  10789. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  10790. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  10791. do { \
  10792. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  10793. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  10794. } while (0)
  10795. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  10796. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  10797. /**
  10798. * @brief target -> host packet log message
  10799. *
  10800. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  10801. *
  10802. * @details
  10803. * The following field definitions describe the format of the packet log
  10804. * message sent from the target to the host.
  10805. * The message consists of a 4-octet header,followed by a variable number
  10806. * of 32-bit character values.
  10807. *
  10808. * |31 16|15 12|11 10|9 8|7 0|
  10809. * |------------------------------------------------------------------|
  10810. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  10811. * |------------------------------------------------------------------|
  10812. * | payload |
  10813. * |------------------------------------------------------------------|
  10814. * - MSG_TYPE
  10815. * Bits 7:0
  10816. * Purpose: identifies this as a pktlog message
  10817. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  10818. * - mac_id
  10819. * Bits 9:8
  10820. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  10821. * Value: 0-3
  10822. * - pdev_id
  10823. * Bits 11:10
  10824. * Purpose: pdev_id
  10825. * Value: 0-3
  10826. * 0 (for rings at SOC level),
  10827. * 1/2/3 PDEV -> 0/1/2
  10828. * - payload_size
  10829. * Bits 31:16
  10830. * Purpose: explicitly specify the payload size
  10831. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  10832. */
  10833. PREPACK struct htt_pktlog_msg {
  10834. A_UINT32 header;
  10835. A_UINT32 payload[1/* or more */];
  10836. } POSTPACK;
  10837. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  10838. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  10839. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  10840. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  10841. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  10842. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  10843. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  10844. do { \
  10845. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  10846. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  10847. } while (0)
  10848. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  10849. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  10850. HTT_T2H_PKTLOG_MAC_ID_S)
  10851. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  10852. do { \
  10853. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  10854. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  10855. } while (0)
  10856. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  10857. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  10858. HTT_T2H_PKTLOG_PDEV_ID_S)
  10859. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  10860. do { \
  10861. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  10862. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  10863. } while (0)
  10864. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  10865. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  10866. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  10867. /*
  10868. * Rx reorder statistics
  10869. * NB: all the fields must be defined in 4 octets size.
  10870. */
  10871. struct rx_reorder_stats {
  10872. /* Non QoS MPDUs received */
  10873. A_UINT32 deliver_non_qos;
  10874. /* MPDUs received in-order */
  10875. A_UINT32 deliver_in_order;
  10876. /* Flush due to reorder timer expired */
  10877. A_UINT32 deliver_flush_timeout;
  10878. /* Flush due to move out of window */
  10879. A_UINT32 deliver_flush_oow;
  10880. /* Flush due to DELBA */
  10881. A_UINT32 deliver_flush_delba;
  10882. /* MPDUs dropped due to FCS error */
  10883. A_UINT32 fcs_error;
  10884. /* MPDUs dropped due to monitor mode non-data packet */
  10885. A_UINT32 mgmt_ctrl;
  10886. /* Unicast-data MPDUs dropped due to invalid peer */
  10887. A_UINT32 invalid_peer;
  10888. /* MPDUs dropped due to duplication (non aggregation) */
  10889. A_UINT32 dup_non_aggr;
  10890. /* MPDUs dropped due to processed before */
  10891. A_UINT32 dup_past;
  10892. /* MPDUs dropped due to duplicate in reorder queue */
  10893. A_UINT32 dup_in_reorder;
  10894. /* Reorder timeout happened */
  10895. A_UINT32 reorder_timeout;
  10896. /* invalid bar ssn */
  10897. A_UINT32 invalid_bar_ssn;
  10898. /* reorder reset due to bar ssn */
  10899. A_UINT32 ssn_reset;
  10900. /* Flush due to delete peer */
  10901. A_UINT32 deliver_flush_delpeer;
  10902. /* Flush due to offload*/
  10903. A_UINT32 deliver_flush_offload;
  10904. /* Flush due to out of buffer*/
  10905. A_UINT32 deliver_flush_oob;
  10906. /* MPDUs dropped due to PN check fail */
  10907. A_UINT32 pn_fail;
  10908. /* MPDUs dropped due to unable to allocate memory */
  10909. A_UINT32 store_fail;
  10910. /* Number of times the tid pool alloc succeeded */
  10911. A_UINT32 tid_pool_alloc_succ;
  10912. /* Number of times the MPDU pool alloc succeeded */
  10913. A_UINT32 mpdu_pool_alloc_succ;
  10914. /* Number of times the MSDU pool alloc succeeded */
  10915. A_UINT32 msdu_pool_alloc_succ;
  10916. /* Number of times the tid pool alloc failed */
  10917. A_UINT32 tid_pool_alloc_fail;
  10918. /* Number of times the MPDU pool alloc failed */
  10919. A_UINT32 mpdu_pool_alloc_fail;
  10920. /* Number of times the MSDU pool alloc failed */
  10921. A_UINT32 msdu_pool_alloc_fail;
  10922. /* Number of times the tid pool freed */
  10923. A_UINT32 tid_pool_free;
  10924. /* Number of times the MPDU pool freed */
  10925. A_UINT32 mpdu_pool_free;
  10926. /* Number of times the MSDU pool freed */
  10927. A_UINT32 msdu_pool_free;
  10928. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10929. A_UINT32 msdu_queued;
  10930. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10931. A_UINT32 msdu_recycled;
  10932. /* Number of MPDUs with invalid peer but A2 found in AST */
  10933. A_UINT32 invalid_peer_a2_in_ast;
  10934. /* Number of MPDUs with invalid peer but A3 found in AST */
  10935. A_UINT32 invalid_peer_a3_in_ast;
  10936. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10937. A_UINT32 invalid_peer_bmc_mpdus;
  10938. /* Number of MSDUs with err attention word */
  10939. A_UINT32 rxdesc_err_att;
  10940. /* Number of MSDUs with flag of peer_idx_invalid */
  10941. A_UINT32 rxdesc_err_peer_idx_inv;
  10942. /* Number of MSDUs with flag of peer_idx_timeout */
  10943. A_UINT32 rxdesc_err_peer_idx_to;
  10944. /* Number of MSDUs with flag of overflow */
  10945. A_UINT32 rxdesc_err_ov;
  10946. /* Number of MSDUs with flag of msdu_length_err */
  10947. A_UINT32 rxdesc_err_msdu_len;
  10948. /* Number of MSDUs with flag of mpdu_length_err */
  10949. A_UINT32 rxdesc_err_mpdu_len;
  10950. /* Number of MSDUs with flag of tkip_mic_err */
  10951. A_UINT32 rxdesc_err_tkip_mic;
  10952. /* Number of MSDUs with flag of decrypt_err */
  10953. A_UINT32 rxdesc_err_decrypt;
  10954. /* Number of MSDUs with flag of fcs_err */
  10955. A_UINT32 rxdesc_err_fcs;
  10956. /* Number of Unicast (bc_mc bit is not set in attention word)
  10957. * frames with invalid peer handler
  10958. */
  10959. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10960. /* Number of unicast frame directly (direct bit is set in attention word)
  10961. * to DUT with invalid peer handler
  10962. */
  10963. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10964. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10965. * frames with invalid peer handler
  10966. */
  10967. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10968. /* Number of MSDUs dropped due to no first MSDU flag */
  10969. A_UINT32 rxdesc_no_1st_msdu;
  10970. /* Number of MSDUs droped due to ring overflow */
  10971. A_UINT32 msdu_drop_ring_ov;
  10972. /* Number of MSDUs dropped due to FC mismatch */
  10973. A_UINT32 msdu_drop_fc_mismatch;
  10974. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10975. A_UINT32 msdu_drop_mgmt_remote_ring;
  10976. /* Number of MSDUs dropped due to errors not reported in attention word */
  10977. A_UINT32 msdu_drop_misc;
  10978. /* Number of MSDUs go to offload before reorder */
  10979. A_UINT32 offload_msdu_wal;
  10980. /* Number of data frame dropped by offload after reorder */
  10981. A_UINT32 offload_msdu_reorder;
  10982. /* Number of MPDUs with sequence number in the past and within the BA window */
  10983. A_UINT32 dup_past_within_window;
  10984. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10985. A_UINT32 dup_past_outside_window;
  10986. /* Number of MSDUs with decrypt/MIC error */
  10987. A_UINT32 rxdesc_err_decrypt_mic;
  10988. /* Number of data MSDUs received on both local and remote rings */
  10989. A_UINT32 data_msdus_on_both_rings;
  10990. /* MPDUs never filled */
  10991. A_UINT32 holes_not_filled;
  10992. };
  10993. /*
  10994. * Rx Remote buffer statistics
  10995. * NB: all the fields must be defined in 4 octets size.
  10996. */
  10997. struct rx_remote_buffer_mgmt_stats {
  10998. /* Total number of MSDUs reaped for Rx processing */
  10999. A_UINT32 remote_reaped;
  11000. /* MSDUs recycled within firmware */
  11001. A_UINT32 remote_recycled;
  11002. /* MSDUs stored by Data Rx */
  11003. A_UINT32 data_rx_msdus_stored;
  11004. /* Number of HTT indications from WAL Rx MSDU */
  11005. A_UINT32 wal_rx_ind;
  11006. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11007. A_UINT32 wal_rx_ind_unconsumed;
  11008. /* Number of HTT indications from Data Rx MSDU */
  11009. A_UINT32 data_rx_ind;
  11010. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11011. A_UINT32 data_rx_ind_unconsumed;
  11012. /* Number of HTT indications from ATHBUF */
  11013. A_UINT32 athbuf_rx_ind;
  11014. /* Number of remote buffers requested for refill */
  11015. A_UINT32 refill_buf_req;
  11016. /* Number of remote buffers filled by the host */
  11017. A_UINT32 refill_buf_rsp;
  11018. /* Number of times MAC hw_index = f/w write_index */
  11019. A_INT32 mac_no_bufs;
  11020. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11021. A_INT32 fw_indices_equal;
  11022. /* Number of times f/w finds no buffers to post */
  11023. A_INT32 host_no_bufs;
  11024. };
  11025. /*
  11026. * TXBF MU/SU packets and NDPA statistics
  11027. * NB: all the fields must be defined in 4 octets size.
  11028. */
  11029. struct rx_txbf_musu_ndpa_pkts_stats {
  11030. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11031. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11032. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11033. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11034. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11035. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11036. };
  11037. /*
  11038. * htt_dbg_stats_status -
  11039. * present - The requested stats have been delivered in full.
  11040. * This indicates that either the stats information was contained
  11041. * in its entirety within this message, or else this message
  11042. * completes the delivery of the requested stats info that was
  11043. * partially delivered through earlier STATS_CONF messages.
  11044. * partial - The requested stats have been delivered in part.
  11045. * One or more subsequent STATS_CONF messages with the same
  11046. * cookie value will be sent to deliver the remainder of the
  11047. * information.
  11048. * error - The requested stats could not be delivered, for example due
  11049. * to a shortage of memory to construct a message holding the
  11050. * requested stats.
  11051. * invalid - The requested stat type is either not recognized, or the
  11052. * target is configured to not gather the stats type in question.
  11053. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11054. * series_done - This special value indicates that no further stats info
  11055. * elements are present within a series of stats info elems
  11056. * (within a stats upload confirmation message).
  11057. */
  11058. enum htt_dbg_stats_status {
  11059. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11060. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11061. HTT_DBG_STATS_STATUS_ERROR = 2,
  11062. HTT_DBG_STATS_STATUS_INVALID = 3,
  11063. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11064. };
  11065. /**
  11066. * @brief target -> host statistics upload
  11067. *
  11068. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11069. *
  11070. * @details
  11071. * The following field definitions describe the format of the HTT target
  11072. * to host stats upload confirmation message.
  11073. * The message contains a cookie echoed from the HTT host->target stats
  11074. * upload request, which identifies which request the confirmation is
  11075. * for, and a series of tag-length-value stats information elements.
  11076. * The tag-length header for each stats info element also includes a
  11077. * status field, to indicate whether the request for the stat type in
  11078. * question was fully met, partially met, unable to be met, or invalid
  11079. * (if the stat type in question is disabled in the target).
  11080. * A special value of all 1's in this status field is used to indicate
  11081. * the end of the series of stats info elements.
  11082. *
  11083. *
  11084. * |31 16|15 8|7 5|4 0|
  11085. * |------------------------------------------------------------|
  11086. * | reserved | msg type |
  11087. * |------------------------------------------------------------|
  11088. * | cookie LSBs |
  11089. * |------------------------------------------------------------|
  11090. * | cookie MSBs |
  11091. * |------------------------------------------------------------|
  11092. * | stats entry length | reserved | S |stat type|
  11093. * |------------------------------------------------------------|
  11094. * | |
  11095. * | type-specific stats info |
  11096. * | |
  11097. * |------------------------------------------------------------|
  11098. * | stats entry length | reserved | S |stat type|
  11099. * |------------------------------------------------------------|
  11100. * | |
  11101. * | type-specific stats info |
  11102. * | |
  11103. * |------------------------------------------------------------|
  11104. * | n/a | reserved | 111 | n/a |
  11105. * |------------------------------------------------------------|
  11106. * Header fields:
  11107. * - MSG_TYPE
  11108. * Bits 7:0
  11109. * Purpose: identifies this is a statistics upload confirmation message
  11110. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11111. * - COOKIE_LSBS
  11112. * Bits 31:0
  11113. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11114. * message with its preceding host->target stats request message.
  11115. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11116. * - COOKIE_MSBS
  11117. * Bits 31:0
  11118. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11119. * message with its preceding host->target stats request message.
  11120. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11121. *
  11122. * Stats Information Element tag-length header fields:
  11123. * - STAT_TYPE
  11124. * Bits 4:0
  11125. * Purpose: identifies the type of statistics info held in the
  11126. * following information element
  11127. * Value: htt_dbg_stats_type
  11128. * - STATUS
  11129. * Bits 7:5
  11130. * Purpose: indicate whether the requested stats are present
  11131. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11132. * the completion of the stats entry series
  11133. * - LENGTH
  11134. * Bits 31:16
  11135. * Purpose: indicate the stats information size
  11136. * Value: This field specifies the number of bytes of stats information
  11137. * that follows the element tag-length header.
  11138. * It is expected but not required that this length is a multiple of
  11139. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11140. * subsequent stats entry header will begin on a 4-byte aligned
  11141. * boundary.
  11142. */
  11143. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11144. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11145. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11146. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11147. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11148. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11149. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11150. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11151. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11152. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11153. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11154. do { \
  11155. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11156. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11157. } while (0)
  11158. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11159. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11160. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11161. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11164. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11165. } while (0)
  11166. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11167. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11168. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11169. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11172. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11173. } while (0)
  11174. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11175. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11176. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11177. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11178. #define HTT_MAX_AGGR 64
  11179. #define HTT_HL_MAX_AGGR 18
  11180. /**
  11181. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11182. *
  11183. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11184. *
  11185. * @details
  11186. * The following field definitions describe the format of the HTT host
  11187. * to target frag_desc/msdu_ext bank configuration message.
  11188. * The message contains the based address and the min and max id of the
  11189. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11190. * MSDU_EXT/FRAG_DESC.
  11191. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11192. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11193. * the hardware does the mapping/translation.
  11194. *
  11195. * Total banks that can be configured is configured to 16.
  11196. *
  11197. * This should be called before any TX has be initiated by the HTT
  11198. *
  11199. * |31 16|15 8|7 5|4 0|
  11200. * |------------------------------------------------------------|
  11201. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11202. * |------------------------------------------------------------|
  11203. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11204. #if HTT_PADDR64
  11205. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11206. #endif
  11207. * |------------------------------------------------------------|
  11208. * | ... |
  11209. * |------------------------------------------------------------|
  11210. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11211. #if HTT_PADDR64
  11212. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11213. #endif
  11214. * |------------------------------------------------------------|
  11215. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11216. * |------------------------------------------------------------|
  11217. * | ... |
  11218. * |------------------------------------------------------------|
  11219. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11220. * |------------------------------------------------------------|
  11221. * Header fields:
  11222. * - MSG_TYPE
  11223. * Bits 7:0
  11224. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11225. * for systems with 64-bit format for bus addresses:
  11226. * - BANKx_BASE_ADDRESS_LO
  11227. * Bits 31:0
  11228. * Purpose: Provide a mechanism to specify the base address of the
  11229. * MSDU_EXT bank physical/bus address.
  11230. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11231. * - BANKx_BASE_ADDRESS_HI
  11232. * Bits 31:0
  11233. * Purpose: Provide a mechanism to specify the base address of the
  11234. * MSDU_EXT bank physical/bus address.
  11235. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11236. * for systems with 32-bit format for bus addresses:
  11237. * - BANKx_BASE_ADDRESS
  11238. * Bits 31:0
  11239. * Purpose: Provide a mechanism to specify the base address of the
  11240. * MSDU_EXT bank physical/bus address.
  11241. * Value: MSDU_EXT bank physical / bus address
  11242. * - BANKx_MIN_ID
  11243. * Bits 15:0
  11244. * Purpose: Provide a mechanism to specify the min index that needs to
  11245. * mapped.
  11246. * - BANKx_MAX_ID
  11247. * Bits 31:16
  11248. * Purpose: Provide a mechanism to specify the max index that needs to
  11249. * mapped.
  11250. *
  11251. */
  11252. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11253. * safe value.
  11254. * @note MAX supported banks is 16.
  11255. */
  11256. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11257. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11258. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11259. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11260. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11261. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11262. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11263. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11264. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11265. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11266. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11267. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11268. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11269. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11270. do { \
  11271. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11272. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11273. } while (0)
  11274. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11275. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11276. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11277. do { \
  11278. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11279. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11280. } while (0)
  11281. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11282. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11283. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11284. do { \
  11285. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11286. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11287. } while (0)
  11288. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11289. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11290. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11291. do { \
  11292. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11293. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11294. } while (0)
  11295. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11296. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11297. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11298. do { \
  11299. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11300. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11301. } while (0)
  11302. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11303. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11304. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11305. do { \
  11306. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11307. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11308. } while (0)
  11309. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11310. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11311. /*
  11312. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11313. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11314. * addresses are stored in a XXX-bit field.
  11315. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11316. * htt_tx_frag_desc64_bank_cfg_t structs.
  11317. */
  11318. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11319. _paddr_bits_, \
  11320. _paddr__bank_base_address_) \
  11321. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11322. /** word 0 \
  11323. * msg_type: 8, \
  11324. * pdev_id: 2, \
  11325. * swap: 1, \
  11326. * reserved0: 5, \
  11327. * num_banks: 8, \
  11328. * desc_size: 8; \
  11329. */ \
  11330. A_UINT32 word0; \
  11331. /* \
  11332. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  11333. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  11334. * the second A_UINT32). \
  11335. */ \
  11336. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11337. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11338. } POSTPACK
  11339. /* define htt_tx_frag_desc32_bank_cfg_t */
  11340. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  11341. /* define htt_tx_frag_desc64_bank_cfg_t */
  11342. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  11343. /*
  11344. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  11345. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  11346. */
  11347. #if HTT_PADDR64
  11348. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  11349. #else
  11350. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  11351. #endif
  11352. /**
  11353. * @brief target -> host HTT TX Credit total count update message definition
  11354. *
  11355. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  11356. *
  11357. *|31 16|15|14 9| 8 |7 0 |
  11358. *|---------------------+--+----------+-------+----------|
  11359. *|cur htt credit delta | Q| reserved | sign | msg type |
  11360. *|------------------------------------------------------|
  11361. *
  11362. * Header fields:
  11363. * - MSG_TYPE
  11364. * Bits 7:0
  11365. * Purpose: identifies this as a htt tx credit delta update message
  11366. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  11367. * - SIGN
  11368. * Bits 8
  11369. * identifies whether credit delta is positive or negative
  11370. * Value:
  11371. * - 0x0: credit delta is positive, rebalance in some buffers
  11372. * - 0x1: credit delta is negative, rebalance out some buffers
  11373. * - reserved
  11374. * Bits 14:9
  11375. * Value: 0x0
  11376. * - TXQ_GRP
  11377. * Bit 15
  11378. * Purpose: indicates whether any tx queue group information elements
  11379. * are appended to the tx credit update message
  11380. * Value: 0 -> no tx queue group information element is present
  11381. * 1 -> a tx queue group information element immediately follows
  11382. * - DELTA_COUNT
  11383. * Bits 31:16
  11384. * Purpose: Specify current htt credit delta absolute count
  11385. */
  11386. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  11387. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  11388. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  11389. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  11390. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  11391. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  11392. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  11393. do { \
  11394. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  11395. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  11396. } while (0)
  11397. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  11398. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  11399. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  11400. do { \
  11401. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  11402. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  11403. } while (0)
  11404. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  11405. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  11406. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  11407. do { \
  11408. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  11409. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  11410. } while (0)
  11411. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  11412. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  11413. #define HTT_TX_CREDIT_MSG_BYTES 4
  11414. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  11415. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  11416. /**
  11417. * @brief HTT WDI_IPA Operation Response Message
  11418. *
  11419. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  11420. *
  11421. * @details
  11422. * HTT WDI_IPA Operation Response message is sent by target
  11423. * to host confirming suspend or resume operation.
  11424. * |31 24|23 16|15 8|7 0|
  11425. * |----------------+----------------+----------------+----------------|
  11426. * | op_code | Rsvd | msg_type |
  11427. * |-------------------------------------------------------------------|
  11428. * | Rsvd | Response len |
  11429. * |-------------------------------------------------------------------|
  11430. * | |
  11431. * | Response-type specific info |
  11432. * | |
  11433. * | |
  11434. * |-------------------------------------------------------------------|
  11435. * Header fields:
  11436. * - MSG_TYPE
  11437. * Bits 7:0
  11438. * Purpose: Identifies this as WDI_IPA Operation Response message
  11439. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  11440. * - OP_CODE
  11441. * Bits 31:16
  11442. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  11443. * value: = enum htt_wdi_ipa_op_code
  11444. * - RSP_LEN
  11445. * Bits 16:0
  11446. * Purpose: length for the response-type specific info
  11447. * value: = length in bytes for response-type specific info
  11448. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  11449. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  11450. */
  11451. PREPACK struct htt_wdi_ipa_op_response_t
  11452. {
  11453. /* DWORD 0: flags and meta-data */
  11454. A_UINT32
  11455. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11456. reserved1: 8,
  11457. op_code: 16;
  11458. A_UINT32
  11459. rsp_len: 16,
  11460. reserved2: 16;
  11461. } POSTPACK;
  11462. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  11463. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  11464. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  11465. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  11466. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  11467. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  11468. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  11469. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  11472. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  11473. } while (0)
  11474. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  11475. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  11476. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  11477. do { \
  11478. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  11479. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  11480. } while (0)
  11481. enum htt_phy_mode {
  11482. htt_phy_mode_11a = 0,
  11483. htt_phy_mode_11g = 1,
  11484. htt_phy_mode_11b = 2,
  11485. htt_phy_mode_11g_only = 3,
  11486. htt_phy_mode_11na_ht20 = 4,
  11487. htt_phy_mode_11ng_ht20 = 5,
  11488. htt_phy_mode_11na_ht40 = 6,
  11489. htt_phy_mode_11ng_ht40 = 7,
  11490. htt_phy_mode_11ac_vht20 = 8,
  11491. htt_phy_mode_11ac_vht40 = 9,
  11492. htt_phy_mode_11ac_vht80 = 10,
  11493. htt_phy_mode_11ac_vht20_2g = 11,
  11494. htt_phy_mode_11ac_vht40_2g = 12,
  11495. htt_phy_mode_11ac_vht80_2g = 13,
  11496. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  11497. htt_phy_mode_11ac_vht160 = 15,
  11498. htt_phy_mode_max,
  11499. };
  11500. /**
  11501. * @brief target -> host HTT channel change indication
  11502. *
  11503. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  11504. *
  11505. * @details
  11506. * Specify when a channel change occurs.
  11507. * This allows the host to precisely determine which rx frames arrived
  11508. * on the old channel and which rx frames arrived on the new channel.
  11509. *
  11510. *|31 |7 0 |
  11511. *|-------------------------------------------+----------|
  11512. *| reserved | msg type |
  11513. *|------------------------------------------------------|
  11514. *| primary_chan_center_freq_mhz |
  11515. *|------------------------------------------------------|
  11516. *| contiguous_chan1_center_freq_mhz |
  11517. *|------------------------------------------------------|
  11518. *| contiguous_chan2_center_freq_mhz |
  11519. *|------------------------------------------------------|
  11520. *| phy_mode |
  11521. *|------------------------------------------------------|
  11522. *
  11523. * Header fields:
  11524. * - MSG_TYPE
  11525. * Bits 7:0
  11526. * Purpose: identifies this as a htt channel change indication message
  11527. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  11528. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  11529. * Bits 31:0
  11530. * Purpose: identify the (center of the) new 20 MHz primary channel
  11531. * Value: center frequency of the 20 MHz primary channel, in MHz units
  11532. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  11533. * Bits 31:0
  11534. * Purpose: identify the (center of the) contiguous frequency range
  11535. * comprising the new channel.
  11536. * For example, if the new channel is a 80 MHz channel extending
  11537. * 60 MHz beyond the primary channel, this field would be 30 larger
  11538. * than the primary channel center frequency field.
  11539. * Value: center frequency of the contiguous frequency range comprising
  11540. * the full channel in MHz units
  11541. * (80+80 channels also use the CONTIG_CHAN2 field)
  11542. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  11543. * Bits 31:0
  11544. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  11545. * within a VHT 80+80 channel.
  11546. * This field is only relevant for VHT 80+80 channels.
  11547. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  11548. * channel (arbitrary value for cases besides VHT 80+80)
  11549. * - PHY_MODE
  11550. * Bits 31:0
  11551. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  11552. * and band
  11553. * Value: htt_phy_mode enum value
  11554. */
  11555. PREPACK struct htt_chan_change_t
  11556. {
  11557. /* DWORD 0: flags and meta-data */
  11558. A_UINT32
  11559. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11560. reserved1: 24;
  11561. A_UINT32 primary_chan_center_freq_mhz;
  11562. A_UINT32 contig_chan1_center_freq_mhz;
  11563. A_UINT32 contig_chan2_center_freq_mhz;
  11564. A_UINT32 phy_mode;
  11565. } POSTPACK;
  11566. /*
  11567. * Due to historical / backwards-compatibility reasons, maintain the
  11568. * below htt_chan_change_msg struct definition, which needs to be
  11569. * consistent with the above htt_chan_change_t struct definition
  11570. * (aside from the htt_chan_change_t definition including the msg_type
  11571. * dword within the message, and the htt_chan_change_msg only containing
  11572. * the payload of the message that follows the msg_type dword).
  11573. */
  11574. PREPACK struct htt_chan_change_msg {
  11575. A_UINT32 chan_mhz; /* frequency in mhz */
  11576. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  11577. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11578. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11579. } POSTPACK;
  11580. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  11581. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  11582. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  11583. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  11584. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  11585. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  11586. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  11587. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  11588. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  11589. do { \
  11590. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  11591. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  11592. } while (0)
  11593. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  11594. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  11595. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  11596. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  11597. do { \
  11598. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  11599. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  11600. } while (0)
  11601. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  11602. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  11603. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  11604. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  11605. do { \
  11606. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  11607. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  11608. } while (0)
  11609. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  11610. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  11611. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  11612. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  11613. do { \
  11614. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  11615. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  11616. } while (0)
  11617. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  11618. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  11619. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  11620. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  11621. /**
  11622. * @brief rx offload packet error message
  11623. *
  11624. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  11625. *
  11626. * @details
  11627. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  11628. * of target payload like mic err.
  11629. *
  11630. * |31 24|23 16|15 8|7 0|
  11631. * |----------------+----------------+----------------+----------------|
  11632. * | tid | vdev_id | msg_sub_type | msg_type |
  11633. * |-------------------------------------------------------------------|
  11634. * : (sub-type dependent content) :
  11635. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11636. * Header fields:
  11637. * - msg_type
  11638. * Bits 7:0
  11639. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  11640. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  11641. * - msg_sub_type
  11642. * Bits 15:8
  11643. * Purpose: Identifies which type of rx error is reported by this message
  11644. * value: htt_rx_ofld_pkt_err_type
  11645. * - vdev_id
  11646. * Bits 23:16
  11647. * Purpose: Identifies which vdev received the erroneous rx frame
  11648. * value:
  11649. * - tid
  11650. * Bits 31:24
  11651. * Purpose: Identifies the traffic type of the rx frame
  11652. * value:
  11653. *
  11654. * - The payload fields used if the sub-type == MIC error are shown below.
  11655. * Note - MIC err is per MSDU, while PN is per MPDU.
  11656. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  11657. * with MIC err in A-MSDU case, so FW will send only one HTT message
  11658. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  11659. * instead of sending separate HTT messages for each wrong MSDU within
  11660. * the MPDU.
  11661. *
  11662. * |31 24|23 16|15 8|7 0|
  11663. * |----------------+----------------+----------------+----------------|
  11664. * | Rsvd | key_id | peer_id |
  11665. * |-------------------------------------------------------------------|
  11666. * | receiver MAC addr 31:0 |
  11667. * |-------------------------------------------------------------------|
  11668. * | Rsvd | receiver MAC addr 47:32 |
  11669. * |-------------------------------------------------------------------|
  11670. * | transmitter MAC addr 31:0 |
  11671. * |-------------------------------------------------------------------|
  11672. * | Rsvd | transmitter MAC addr 47:32 |
  11673. * |-------------------------------------------------------------------|
  11674. * | PN 31:0 |
  11675. * |-------------------------------------------------------------------|
  11676. * | Rsvd | PN 47:32 |
  11677. * |-------------------------------------------------------------------|
  11678. * - peer_id
  11679. * Bits 15:0
  11680. * Purpose: identifies which peer is frame is from
  11681. * value:
  11682. * - key_id
  11683. * Bits 23:16
  11684. * Purpose: identifies key_id of rx frame
  11685. * value:
  11686. * - RA_31_0 (receiver MAC addr 31:0)
  11687. * Bits 31:0
  11688. * Purpose: identifies by MAC address which vdev received the frame
  11689. * value: MAC address lower 4 bytes
  11690. * - RA_47_32 (receiver MAC addr 47:32)
  11691. * Bits 15:0
  11692. * Purpose: identifies by MAC address which vdev received the frame
  11693. * value: MAC address upper 2 bytes
  11694. * - TA_31_0 (transmitter MAC addr 31:0)
  11695. * Bits 31:0
  11696. * Purpose: identifies by MAC address which peer transmitted the frame
  11697. * value: MAC address lower 4 bytes
  11698. * - TA_47_32 (transmitter MAC addr 47:32)
  11699. * Bits 15:0
  11700. * Purpose: identifies by MAC address which peer transmitted the frame
  11701. * value: MAC address upper 2 bytes
  11702. * - PN_31_0
  11703. * Bits 31:0
  11704. * Purpose: Identifies pn of rx frame
  11705. * value: PN lower 4 bytes
  11706. * - PN_47_32
  11707. * Bits 15:0
  11708. * Purpose: Identifies pn of rx frame
  11709. * value:
  11710. * TKIP or CCMP: PN upper 2 bytes
  11711. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  11712. */
  11713. enum htt_rx_ofld_pkt_err_type {
  11714. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  11715. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  11716. };
  11717. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  11718. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  11719. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  11720. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  11721. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  11722. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  11723. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  11724. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  11725. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  11726. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  11727. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  11728. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  11729. do { \
  11730. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  11731. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  11732. } while (0)
  11733. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  11734. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  11735. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  11736. do { \
  11737. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  11738. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  11739. } while (0)
  11740. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  11741. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  11742. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  11743. do { \
  11744. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  11745. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  11746. } while (0)
  11747. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  11748. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  11749. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  11750. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  11751. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  11752. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  11753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  11754. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  11755. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  11756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  11757. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  11758. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  11759. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  11760. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  11761. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  11762. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  11763. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  11764. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  11765. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  11766. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  11767. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  11768. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  11769. do { \
  11770. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  11771. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  11772. } while (0)
  11773. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  11774. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  11775. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  11776. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  11777. do { \
  11778. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  11779. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  11780. } while (0)
  11781. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  11782. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  11783. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  11784. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  11785. do { \
  11786. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  11787. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  11788. } while (0)
  11789. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  11790. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  11791. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  11792. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  11793. do { \
  11794. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  11795. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  11796. } while (0)
  11797. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  11798. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  11799. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  11800. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  11801. do { \
  11802. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  11803. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  11804. } while (0)
  11805. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  11806. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  11807. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  11808. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  11809. do { \
  11810. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  11811. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  11812. } while (0)
  11813. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  11814. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  11815. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  11816. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  11817. do { \
  11818. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  11819. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  11820. } while (0)
  11821. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  11822. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  11823. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  11824. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  11827. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  11828. } while (0)
  11829. /**
  11830. * @brief target -> host peer rate report message
  11831. *
  11832. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  11833. *
  11834. * @details
  11835. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  11836. * justified rate of all the peers.
  11837. *
  11838. * |31 24|23 16|15 8|7 0|
  11839. * |----------------+----------------+----------------+----------------|
  11840. * | peer_count | | msg_type |
  11841. * |-------------------------------------------------------------------|
  11842. * : Payload (variant number of peer rate report) :
  11843. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11844. * Header fields:
  11845. * - msg_type
  11846. * Bits 7:0
  11847. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  11848. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  11849. * - reserved
  11850. * Bits 15:8
  11851. * Purpose:
  11852. * value:
  11853. * - peer_count
  11854. * Bits 31:16
  11855. * Purpose: Specify how many peer rate report elements are present in the payload.
  11856. * value:
  11857. *
  11858. * Payload:
  11859. * There are variant number of peer rate report follow the first 32 bits.
  11860. * The peer rate report is defined as follows.
  11861. *
  11862. * |31 20|19 16|15 0|
  11863. * |-----------------------+---------+---------------------------------|-
  11864. * | reserved | phy | peer_id | \
  11865. * |-------------------------------------------------------------------| -> report #0
  11866. * | rate | /
  11867. * |-----------------------+---------+---------------------------------|-
  11868. * | reserved | phy | peer_id | \
  11869. * |-------------------------------------------------------------------| -> report #1
  11870. * | rate | /
  11871. * |-----------------------+---------+---------------------------------|-
  11872. * | reserved | phy | peer_id | \
  11873. * |-------------------------------------------------------------------| -> report #2
  11874. * | rate | /
  11875. * |-------------------------------------------------------------------|-
  11876. * : :
  11877. * : :
  11878. * : :
  11879. * :-------------------------------------------------------------------:
  11880. *
  11881. * - peer_id
  11882. * Bits 15:0
  11883. * Purpose: identify the peer
  11884. * value:
  11885. * - phy
  11886. * Bits 19:16
  11887. * Purpose: identify which phy is in use
  11888. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  11889. * Please see enum htt_peer_report_phy_type for detail.
  11890. * - reserved
  11891. * Bits 31:20
  11892. * Purpose:
  11893. * value:
  11894. * - rate
  11895. * Bits 31:0
  11896. * Purpose: represent the justified rate of the peer specified by peer_id
  11897. * value:
  11898. */
  11899. enum htt_peer_rate_report_phy_type {
  11900. HTT_PEER_RATE_REPORT_11B = 0,
  11901. HTT_PEER_RATE_REPORT_11A_G,
  11902. HTT_PEER_RATE_REPORT_11N,
  11903. HTT_PEER_RATE_REPORT_11AC,
  11904. };
  11905. #define HTT_PEER_RATE_REPORT_SIZE 8
  11906. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  11907. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  11908. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  11909. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  11910. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  11911. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11912. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11913. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11914. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11915. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11916. do { \
  11917. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11918. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11919. } while (0)
  11920. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11921. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11922. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11923. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11924. do { \
  11925. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11926. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11927. } while (0)
  11928. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11929. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11930. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11931. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11932. do { \
  11933. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11934. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11935. } while (0)
  11936. /**
  11937. * @brief target -> host flow pool map message
  11938. *
  11939. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11940. *
  11941. * @details
  11942. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11943. * a flow of descriptors.
  11944. *
  11945. * This message is in TLV format and indicates the parameters to be setup a
  11946. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11947. * receive descriptors from a specified pool.
  11948. *
  11949. * The message would appear as follows:
  11950. *
  11951. * |31 24|23 16|15 8|7 0|
  11952. * |----------------+----------------+----------------+----------------|
  11953. * header | reserved | num_flows | msg_type |
  11954. * |-------------------------------------------------------------------|
  11955. * | |
  11956. * : payload :
  11957. * | |
  11958. * |-------------------------------------------------------------------|
  11959. *
  11960. * The header field is one DWORD long and is interpreted as follows:
  11961. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11962. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11963. * this message
  11964. * b'16-31 - reserved: These bits are reserved for future use
  11965. *
  11966. * Payload:
  11967. * The payload would contain multiple objects of the following structure. Each
  11968. * object represents a flow.
  11969. *
  11970. * |31 24|23 16|15 8|7 0|
  11971. * |----------------+----------------+----------------+----------------|
  11972. * header | reserved | num_flows | msg_type |
  11973. * |-------------------------------------------------------------------|
  11974. * payload0| flow_type |
  11975. * |-------------------------------------------------------------------|
  11976. * | flow_id |
  11977. * |-------------------------------------------------------------------|
  11978. * | reserved0 | flow_pool_id |
  11979. * |-------------------------------------------------------------------|
  11980. * | reserved1 | flow_pool_size |
  11981. * |-------------------------------------------------------------------|
  11982. * | reserved2 |
  11983. * |-------------------------------------------------------------------|
  11984. * payload1| flow_type |
  11985. * |-------------------------------------------------------------------|
  11986. * | flow_id |
  11987. * |-------------------------------------------------------------------|
  11988. * | reserved0 | flow_pool_id |
  11989. * |-------------------------------------------------------------------|
  11990. * | reserved1 | flow_pool_size |
  11991. * |-------------------------------------------------------------------|
  11992. * | reserved2 |
  11993. * |-------------------------------------------------------------------|
  11994. * | . |
  11995. * | . |
  11996. * | . |
  11997. * |-------------------------------------------------------------------|
  11998. *
  11999. * Each payload is 5 DWORDS long and is interpreted as follows:
  12000. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12001. * this flow is associated. It can be VDEV, peer,
  12002. * or tid (AC). Based on enum htt_flow_type.
  12003. *
  12004. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12005. * object. For flow_type vdev it is set to the
  12006. * vdevid, for peer it is peerid and for tid, it is
  12007. * tid_num.
  12008. *
  12009. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12010. * in the host for this flow
  12011. * b'16:31 - reserved0: This field in reserved for the future. In case
  12012. * we have a hierarchical implementation (HCM) of
  12013. * pools, it can be used to indicate the ID of the
  12014. * parent-pool.
  12015. *
  12016. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12017. * Descriptors for this flow will be
  12018. * allocated from this pool in the host.
  12019. * b'16:31 - reserved1: This field in reserved for the future. In case
  12020. * we have a hierarchical implementation of pools,
  12021. * it can be used to indicate the max number of
  12022. * descriptors in the pool. The b'0:15 can be used
  12023. * to indicate min number of descriptors in the
  12024. * HCM scheme.
  12025. *
  12026. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12027. * we have a hierarchical implementation of pools,
  12028. * b'0:15 can be used to indicate the
  12029. * priority-based borrowing (PBB) threshold of
  12030. * the flow's pool. The b'16:31 are still left
  12031. * reserved.
  12032. */
  12033. enum htt_flow_type {
  12034. FLOW_TYPE_VDEV = 0,
  12035. /* Insert new flow types above this line */
  12036. };
  12037. PREPACK struct htt_flow_pool_map_payload_t {
  12038. A_UINT32 flow_type;
  12039. A_UINT32 flow_id;
  12040. A_UINT32 flow_pool_id:16,
  12041. reserved0:16;
  12042. A_UINT32 flow_pool_size:16,
  12043. reserved1:16;
  12044. A_UINT32 reserved2;
  12045. } POSTPACK;
  12046. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12047. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12048. (sizeof(struct htt_flow_pool_map_payload_t))
  12049. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12050. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12051. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12052. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12053. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12054. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12055. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12056. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12057. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12058. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12059. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12060. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12061. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12062. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12063. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12064. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12065. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12066. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12067. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12068. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12069. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12070. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12071. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12074. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12075. } while (0)
  12076. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12079. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12080. } while (0)
  12081. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12082. do { \
  12083. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12084. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12085. } while (0)
  12086. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12087. do { \
  12088. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12089. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12090. } while (0)
  12091. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12092. do { \
  12093. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12094. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12095. } while (0)
  12096. /**
  12097. * @brief target -> host flow pool unmap message
  12098. *
  12099. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12100. *
  12101. * @details
  12102. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12103. * down a flow of descriptors.
  12104. * This message indicates that for the flow (whose ID is provided) is wanting
  12105. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12106. * pool of descriptors from where descriptors are being allocated for this
  12107. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12108. * be unmapped by the host.
  12109. *
  12110. * The message would appear as follows:
  12111. *
  12112. * |31 24|23 16|15 8|7 0|
  12113. * |----------------+----------------+----------------+----------------|
  12114. * | reserved0 | msg_type |
  12115. * |-------------------------------------------------------------------|
  12116. * | flow_type |
  12117. * |-------------------------------------------------------------------|
  12118. * | flow_id |
  12119. * |-------------------------------------------------------------------|
  12120. * | reserved1 | flow_pool_id |
  12121. * |-------------------------------------------------------------------|
  12122. *
  12123. * The message is interpreted as follows:
  12124. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12125. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12126. * b'8:31 - reserved0: Reserved for future use
  12127. *
  12128. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12129. * this flow is associated. It can be VDEV, peer,
  12130. * or tid (AC). Based on enum htt_flow_type.
  12131. *
  12132. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12133. * object. For flow_type vdev it is set to the
  12134. * vdevid, for peer it is peerid and for tid, it is
  12135. * tid_num.
  12136. *
  12137. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12138. * used in the host for this flow
  12139. * b'16:31 - reserved0: This field in reserved for the future.
  12140. *
  12141. */
  12142. PREPACK struct htt_flow_pool_unmap_t {
  12143. A_UINT32 msg_type:8,
  12144. reserved0:24;
  12145. A_UINT32 flow_type;
  12146. A_UINT32 flow_id;
  12147. A_UINT32 flow_pool_id:16,
  12148. reserved1:16;
  12149. } POSTPACK;
  12150. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12151. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12152. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12153. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12154. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12155. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12156. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12157. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12158. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12159. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12160. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12161. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12162. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12163. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12164. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12165. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12166. do { \
  12167. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12168. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12169. } while (0)
  12170. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12171. do { \
  12172. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12173. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12174. } while (0)
  12175. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12176. do { \
  12177. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12178. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12179. } while (0)
  12180. /**
  12181. * @brief target -> host SRING setup done message
  12182. *
  12183. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12184. *
  12185. * @details
  12186. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12187. * SRNG ring setup is done
  12188. *
  12189. * This message indicates whether the last setup operation is successful.
  12190. * It will be sent to host when host set respose_required bit in
  12191. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12192. * The message would appear as follows:
  12193. *
  12194. * |31 24|23 16|15 8|7 0|
  12195. * |--------------- +----------------+----------------+----------------|
  12196. * | setup_status | ring_id | pdev_id | msg_type |
  12197. * |-------------------------------------------------------------------|
  12198. *
  12199. * The message is interpreted as follows:
  12200. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12201. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12202. * b'8:15 - pdev_id:
  12203. * 0 (for rings at SOC/UMAC level),
  12204. * 1/2/3 mac id (for rings at LMAC level)
  12205. * b'16:23 - ring_id: Identify the ring which is set up
  12206. * More details can be got from enum htt_srng_ring_id
  12207. * b'24:31 - setup_status: Indicate status of setup operation
  12208. * Refer to htt_ring_setup_status
  12209. */
  12210. PREPACK struct htt_sring_setup_done_t {
  12211. A_UINT32 msg_type: 8,
  12212. pdev_id: 8,
  12213. ring_id: 8,
  12214. setup_status: 8;
  12215. } POSTPACK;
  12216. enum htt_ring_setup_status {
  12217. htt_ring_setup_status_ok = 0,
  12218. htt_ring_setup_status_error,
  12219. };
  12220. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12221. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12222. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12223. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12224. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12225. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12226. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12227. do { \
  12228. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12229. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12230. } while (0)
  12231. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12232. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12233. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12234. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12235. HTT_SRING_SETUP_DONE_RING_ID_S)
  12236. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12237. do { \
  12238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12239. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12240. } while (0)
  12241. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12242. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12243. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12244. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12245. HTT_SRING_SETUP_DONE_STATUS_S)
  12246. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12247. do { \
  12248. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12249. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12250. } while (0)
  12251. /**
  12252. * @brief target -> flow map flow info
  12253. *
  12254. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12255. *
  12256. * @details
  12257. * HTT TX map flow entry with tqm flow pointer
  12258. * Sent from firmware to host to add tqm flow pointer in corresponding
  12259. * flow search entry. Flow metadata is replayed back to host as part of this
  12260. * struct to enable host to find the specific flow search entry
  12261. *
  12262. * The message would appear as follows:
  12263. *
  12264. * |31 28|27 18|17 14|13 8|7 0|
  12265. * |-------+------------------------------------------+----------------|
  12266. * | rsvd0 | fse_hsh_idx | msg_type |
  12267. * |-------------------------------------------------------------------|
  12268. * | rsvd1 | tid | peer_id |
  12269. * |-------------------------------------------------------------------|
  12270. * | tqm_flow_pntr_lo |
  12271. * |-------------------------------------------------------------------|
  12272. * | tqm_flow_pntr_hi |
  12273. * |-------------------------------------------------------------------|
  12274. * | fse_meta_data |
  12275. * |-------------------------------------------------------------------|
  12276. *
  12277. * The message is interpreted as follows:
  12278. *
  12279. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12280. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12281. *
  12282. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12283. * for this flow entry
  12284. *
  12285. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12286. *
  12287. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12288. *
  12289. * dword1 - b'14:17 - tid
  12290. *
  12291. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12292. *
  12293. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12294. *
  12295. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12296. *
  12297. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12298. * given by host
  12299. */
  12300. PREPACK struct htt_tx_map_flow_info {
  12301. A_UINT32
  12302. msg_type: 8,
  12303. fse_hsh_idx: 20,
  12304. rsvd0: 4;
  12305. A_UINT32
  12306. peer_id: 14,
  12307. tid: 4,
  12308. rsvd1: 14;
  12309. A_UINT32 tqm_flow_pntr_lo;
  12310. A_UINT32 tqm_flow_pntr_hi;
  12311. struct htt_tx_flow_metadata fse_meta_data;
  12312. } POSTPACK;
  12313. /* DWORD 0 */
  12314. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12315. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12316. /* DWORD 1 */
  12317. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12318. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12319. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12320. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12321. /* DWORD 0 */
  12322. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12323. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12324. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12325. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12326. do { \
  12327. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  12328. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  12329. } while (0)
  12330. /* DWORD 1 */
  12331. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  12332. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  12333. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  12334. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  12335. do { \
  12336. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  12337. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  12338. } while (0)
  12339. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  12340. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  12341. HTT_TX_MAP_FLOW_INFO_TID_S)
  12342. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  12343. do { \
  12344. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  12345. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  12346. } while (0)
  12347. /*
  12348. * htt_dbg_ext_stats_status -
  12349. * present - The requested stats have been delivered in full.
  12350. * This indicates that either the stats information was contained
  12351. * in its entirety within this message, or else this message
  12352. * completes the delivery of the requested stats info that was
  12353. * partially delivered through earlier STATS_CONF messages.
  12354. * partial - The requested stats have been delivered in part.
  12355. * One or more subsequent STATS_CONF messages with the same
  12356. * cookie value will be sent to deliver the remainder of the
  12357. * information.
  12358. * error - The requested stats could not be delivered, for example due
  12359. * to a shortage of memory to construct a message holding the
  12360. * requested stats.
  12361. * invalid - The requested stat type is either not recognized, or the
  12362. * target is configured to not gather the stats type in question.
  12363. */
  12364. enum htt_dbg_ext_stats_status {
  12365. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  12366. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  12367. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  12368. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  12369. };
  12370. /**
  12371. * @brief target -> host ppdu stats upload
  12372. *
  12373. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  12374. *
  12375. * @details
  12376. * The following field definitions describe the format of the HTT target
  12377. * to host ppdu stats indication message.
  12378. *
  12379. *
  12380. * |31 16|15 12|11 10|9 8|7 0 |
  12381. * |----------------------------------------------------------------------|
  12382. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  12383. * |----------------------------------------------------------------------|
  12384. * | ppdu_id |
  12385. * |----------------------------------------------------------------------|
  12386. * | Timestamp in us |
  12387. * |----------------------------------------------------------------------|
  12388. * | reserved |
  12389. * |----------------------------------------------------------------------|
  12390. * | type-specific stats info |
  12391. * | (see htt_ppdu_stats.h) |
  12392. * |----------------------------------------------------------------------|
  12393. * Header fields:
  12394. * - MSG_TYPE
  12395. * Bits 7:0
  12396. * Purpose: Identifies this is a PPDU STATS indication
  12397. * message.
  12398. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  12399. * - mac_id
  12400. * Bits 9:8
  12401. * Purpose: mac_id of this ppdu_id
  12402. * Value: 0-3
  12403. * - pdev_id
  12404. * Bits 11:10
  12405. * Purpose: pdev_id of this ppdu_id
  12406. * Value: 0-3
  12407. * 0 (for rings at SOC level),
  12408. * 1/2/3 PDEV -> 0/1/2
  12409. * - payload_size
  12410. * Bits 31:16
  12411. * Purpose: total tlv size
  12412. * Value: payload_size in bytes
  12413. */
  12414. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  12415. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  12416. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  12417. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  12418. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  12419. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  12420. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  12421. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  12422. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  12423. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  12424. do { \
  12425. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  12426. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  12427. } while (0)
  12428. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  12429. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  12430. HTT_T2H_PPDU_STATS_MAC_ID_S)
  12431. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  12432. do { \
  12433. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  12434. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  12435. } while (0)
  12436. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  12437. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  12438. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  12439. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  12440. do { \
  12441. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  12442. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  12443. } while (0)
  12444. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  12445. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  12446. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  12447. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  12448. do { \
  12449. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  12450. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  12451. } while (0)
  12452. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  12453. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  12454. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  12455. /* htt_t2h_ppdu_stats_ind_hdr_t
  12456. * This struct contains the fields within the header of the
  12457. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  12458. * stats info.
  12459. * This struct assumes little-endian layout, and thus is only
  12460. * suitable for use within processors known to be little-endian
  12461. * (such as the target).
  12462. * In contrast, the above macros provide endian-portable methods
  12463. * to get and set the bitfields within this PPDU_STATS_IND header.
  12464. */
  12465. typedef struct {
  12466. A_UINT32 msg_type: 8, /* bits 7:0 */
  12467. mac_id: 2, /* bits 9:8 */
  12468. pdev_id: 2, /* bits 11:10 */
  12469. reserved1: 4, /* bits 15:12 */
  12470. payload_size: 16; /* bits 31:16 */
  12471. A_UINT32 ppdu_id;
  12472. A_UINT32 timestamp_us;
  12473. A_UINT32 reserved2;
  12474. } htt_t2h_ppdu_stats_ind_hdr_t;
  12475. /**
  12476. * @brief target -> host extended statistics upload
  12477. *
  12478. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  12479. *
  12480. * @details
  12481. * The following field definitions describe the format of the HTT target
  12482. * to host stats upload confirmation message.
  12483. * The message contains a cookie echoed from the HTT host->target stats
  12484. * upload request, which identifies which request the confirmation is
  12485. * for, and a single stats can span over multiple HTT stats indication
  12486. * due to the HTT message size limitation so every HTT ext stats indication
  12487. * will have tag-length-value stats information elements.
  12488. * The tag-length header for each HTT stats IND message also includes a
  12489. * status field, to indicate whether the request for the stat type in
  12490. * question was fully met, partially met, unable to be met, or invalid
  12491. * (if the stat type in question is disabled in the target).
  12492. * A Done bit 1's indicate the end of the of stats info elements.
  12493. *
  12494. *
  12495. * |31 16|15 12|11|10 8|7 5|4 0|
  12496. * |--------------------------------------------------------------|
  12497. * | reserved | msg type |
  12498. * |--------------------------------------------------------------|
  12499. * | cookie LSBs |
  12500. * |--------------------------------------------------------------|
  12501. * | cookie MSBs |
  12502. * |--------------------------------------------------------------|
  12503. * | stats entry length | rsvd | D| S | stat type |
  12504. * |--------------------------------------------------------------|
  12505. * | type-specific stats info |
  12506. * | (see htt_stats.h) |
  12507. * |--------------------------------------------------------------|
  12508. * Header fields:
  12509. * - MSG_TYPE
  12510. * Bits 7:0
  12511. * Purpose: Identifies this is a extended statistics upload confirmation
  12512. * message.
  12513. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  12514. * - COOKIE_LSBS
  12515. * Bits 31:0
  12516. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12517. * message with its preceding host->target stats request message.
  12518. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12519. * - COOKIE_MSBS
  12520. * Bits 31:0
  12521. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12522. * message with its preceding host->target stats request message.
  12523. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12524. *
  12525. * Stats Information Element tag-length header fields:
  12526. * - STAT_TYPE
  12527. * Bits 7:0
  12528. * Purpose: identifies the type of statistics info held in the
  12529. * following information element
  12530. * Value: htt_dbg_ext_stats_type
  12531. * - STATUS
  12532. * Bits 10:8
  12533. * Purpose: indicate whether the requested stats are present
  12534. * Value: htt_dbg_ext_stats_status
  12535. * - DONE
  12536. * Bits 11
  12537. * Purpose:
  12538. * Indicates the completion of the stats entry, this will be the last
  12539. * stats conf HTT segment for the requested stats type.
  12540. * Value:
  12541. * 0 -> the stats retrieval is ongoing
  12542. * 1 -> the stats retrieval is complete
  12543. * - LENGTH
  12544. * Bits 31:16
  12545. * Purpose: indicate the stats information size
  12546. * Value: This field specifies the number of bytes of stats information
  12547. * that follows the element tag-length header.
  12548. * It is expected but not required that this length is a multiple of
  12549. * 4 bytes.
  12550. */
  12551. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  12552. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  12553. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  12554. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  12555. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  12556. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  12557. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  12558. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  12559. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  12560. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12561. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  12562. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  12563. do { \
  12564. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  12565. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  12566. } while (0)
  12567. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  12568. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  12569. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  12570. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  12571. do { \
  12572. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  12573. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  12574. } while (0)
  12575. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  12576. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  12577. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  12578. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  12579. do { \
  12580. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  12581. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  12582. } while (0)
  12583. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  12584. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  12585. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  12586. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12587. do { \
  12588. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  12589. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  12590. } while (0)
  12591. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  12592. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  12593. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  12594. typedef enum {
  12595. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  12596. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  12597. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  12598. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  12599. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  12600. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  12601. /* Reserved from 128 - 255 for target internal use.*/
  12602. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  12603. } HTT_PEER_TYPE;
  12604. /** macro to convert MAC address from char array to HTT word format */
  12605. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  12606. (phtt_mac_addr)->mac_addr31to0 = \
  12607. (((c_macaddr)[0] << 0) | \
  12608. ((c_macaddr)[1] << 8) | \
  12609. ((c_macaddr)[2] << 16) | \
  12610. ((c_macaddr)[3] << 24)); \
  12611. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  12612. } while (0)
  12613. /**
  12614. * @brief target -> host monitor mac header indication message
  12615. *
  12616. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  12617. *
  12618. * @details
  12619. * The following diagram shows the format of the monitor mac header message
  12620. * sent from the target to the host.
  12621. * This message is primarily sent when promiscuous rx mode is enabled.
  12622. * One message is sent per rx PPDU.
  12623. *
  12624. * |31 24|23 16|15 8|7 0|
  12625. * |-------------------------------------------------------------|
  12626. * | peer_id | reserved0 | msg_type |
  12627. * |-------------------------------------------------------------|
  12628. * | reserved1 | num_mpdu |
  12629. * |-------------------------------------------------------------|
  12630. * | struct hw_rx_desc |
  12631. * | (see wal_rx_desc.h) |
  12632. * |-------------------------------------------------------------|
  12633. * | struct ieee80211_frame_addr4 |
  12634. * | (see ieee80211_defs.h) |
  12635. * |-------------------------------------------------------------|
  12636. * | struct ieee80211_frame_addr4 |
  12637. * | (see ieee80211_defs.h) |
  12638. * |-------------------------------------------------------------|
  12639. * | ...... |
  12640. * |-------------------------------------------------------------|
  12641. *
  12642. * Header fields:
  12643. * - msg_type
  12644. * Bits 7:0
  12645. * Purpose: Identifies this is a monitor mac header indication message.
  12646. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  12647. * - peer_id
  12648. * Bits 31:16
  12649. * Purpose: Software peer id given by host during association,
  12650. * During promiscuous mode, the peer ID will be invalid (0xFF)
  12651. * for rx PPDUs received from unassociated peers.
  12652. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  12653. * - num_mpdu
  12654. * Bits 15:0
  12655. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  12656. * delivered within the message.
  12657. * Value: 1 to 32
  12658. * num_mpdu is limited to a maximum value of 32, due to buffer
  12659. * size limits. For PPDUs with more than 32 MPDUs, only the
  12660. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  12661. * the PPDU will be provided.
  12662. */
  12663. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  12664. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  12665. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  12666. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  12667. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  12668. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  12669. do { \
  12670. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  12671. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  12672. } while (0)
  12673. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  12674. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  12675. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  12676. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  12677. do { \
  12678. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  12679. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  12680. } while (0)
  12681. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  12682. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  12683. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  12684. /**
  12685. * @brief target -> host flow pool resize Message
  12686. *
  12687. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  12688. *
  12689. * @details
  12690. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  12691. * the flow pool associated with the specified ID is resized
  12692. *
  12693. * The message would appear as follows:
  12694. *
  12695. * |31 16|15 8|7 0|
  12696. * |---------------------------------+----------------+----------------|
  12697. * | reserved0 | Msg type |
  12698. * |-------------------------------------------------------------------|
  12699. * | flow pool new size | flow pool ID |
  12700. * |-------------------------------------------------------------------|
  12701. *
  12702. * The message is interpreted as follows:
  12703. * b'0:7 - msg_type: This will be set to 0x21
  12704. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  12705. *
  12706. * b'0:15 - flow pool ID: Existing flow pool ID
  12707. *
  12708. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  12709. *
  12710. */
  12711. PREPACK struct htt_flow_pool_resize_t {
  12712. A_UINT32 msg_type:8,
  12713. reserved0:24;
  12714. A_UINT32 flow_pool_id:16,
  12715. flow_pool_new_size:16;
  12716. } POSTPACK;
  12717. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  12718. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  12719. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  12720. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  12721. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  12722. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  12723. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  12724. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  12725. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  12726. do { \
  12727. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  12728. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  12729. } while (0)
  12730. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  12731. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  12732. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  12733. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  12734. do { \
  12735. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  12736. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  12737. } while (0)
  12738. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  12739. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  12740. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  12741. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  12742. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  12743. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  12744. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  12745. /*
  12746. * The read and write indices point to the data within the host buffer.
  12747. * Because the first 4 bytes of the host buffer is used for the read index and
  12748. * the next 4 bytes for the write index, the data itself starts at offset 8.
  12749. * The read index and write index are the byte offsets from the base of the
  12750. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  12751. * Refer the ASCII text picture below.
  12752. */
  12753. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  12754. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  12755. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  12756. /*
  12757. ***************************************************************************
  12758. *
  12759. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12760. *
  12761. ***************************************************************************
  12762. *
  12763. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  12764. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  12765. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  12766. * written into the Host memory region mentioned below.
  12767. *
  12768. * Read index is updated by the Host. At any point of time, the read index will
  12769. * indicate the index that will next be read by the Host. The read index is
  12770. * in units of bytes offset from the base of the meta-data buffer.
  12771. *
  12772. * Write index is updated by the FW. At any point of time, the write index will
  12773. * indicate from where the FW can start writing any new data. The write index is
  12774. * in units of bytes offset from the base of the meta-data buffer.
  12775. *
  12776. * If the Host is not fast enough in reading the CFR data, any new capture data
  12777. * would be dropped if there is no space left to write the new captures.
  12778. *
  12779. * The last 4 bytes of the memory region will have the magic pattern
  12780. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  12781. * not overrun the host buffer.
  12782. *
  12783. * ,--------------------. read and write indices store the
  12784. * | | byte offset from the base of the
  12785. * | ,--------+--------. meta-data buffer to the next
  12786. * | | | | location within the data buffer
  12787. * | | v v that will be read / written
  12788. * ************************************************************************
  12789. * * Read * Write * * Magic *
  12790. * * index * index * CFR data1 ...... CFR data N * pattern *
  12791. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  12792. * ************************************************************************
  12793. * |<---------- data buffer ---------->|
  12794. *
  12795. * |<----------------- meta-data buffer allocated in Host ----------------|
  12796. *
  12797. * Note:
  12798. * - Considering the 4 bytes needed to store the Read index (R) and the
  12799. * Write index (W), the initial value is as follows:
  12800. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  12801. * - Buffer empty condition:
  12802. * R = W
  12803. *
  12804. * Regarding CFR data format:
  12805. * --------------------------
  12806. *
  12807. * Each CFR tone is stored in HW as 16-bits with the following format:
  12808. * {bits[15:12], bits[11:6], bits[5:0]} =
  12809. * {unsigned exponent (4 bits),
  12810. * signed mantissa_real (6 bits),
  12811. * signed mantissa_imag (6 bits)}
  12812. *
  12813. * CFR_real = mantissa_real * 2^(exponent-5)
  12814. * CFR_imag = mantissa_imag * 2^(exponent-5)
  12815. *
  12816. *
  12817. * The CFR data is written to the 16-bit unsigned output array (buff) in
  12818. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  12819. *
  12820. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  12821. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  12822. * .
  12823. * .
  12824. * .
  12825. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  12826. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  12827. */
  12828. /* Bandwidth of peer CFR captures */
  12829. typedef enum {
  12830. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  12831. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  12832. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  12833. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  12834. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  12835. HTT_PEER_CFR_CAPTURE_BW_MAX,
  12836. } HTT_PEER_CFR_CAPTURE_BW;
  12837. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  12838. * was captured
  12839. */
  12840. typedef enum {
  12841. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  12842. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  12843. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  12844. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  12845. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  12846. } HTT_PEER_CFR_CAPTURE_MODE;
  12847. typedef enum {
  12848. /* This message type is currently used for the below purpose:
  12849. *
  12850. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  12851. * wmi_peer_cfr_capture_cmd.
  12852. * If payload_present bit is set to 0 then the associated memory region
  12853. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  12854. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  12855. * message; the CFR dump will be present at the end of the message,
  12856. * after the chan_phy_mode.
  12857. */
  12858. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  12859. /* Always keep this last */
  12860. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  12861. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  12862. /**
  12863. * @brief target -> host CFR dump completion indication message definition
  12864. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  12865. *
  12866. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  12867. *
  12868. * @details
  12869. * The following diagram shows the format of the Channel Frequency Response
  12870. * (CFR) dump completion indication. This inidcation is sent to the Host when
  12871. * the channel capture of a peer is copied by Firmware into the Host memory
  12872. *
  12873. * **************************************************************************
  12874. *
  12875. * Message format when the CFR capture message type is
  12876. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12877. *
  12878. * **************************************************************************
  12879. *
  12880. * |31 16|15 |8|7 0|
  12881. * |----------------------------------------------------------------|
  12882. * header: | reserved |P| msg_type |
  12883. * word 0 | | | |
  12884. * |----------------------------------------------------------------|
  12885. * payload: | cfr_capture_msg_type |
  12886. * word 1 | |
  12887. * |----------------------------------------------------------------|
  12888. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  12889. * word 2 | | | | | | | | |
  12890. * |----------------------------------------------------------------|
  12891. * | mac_addr31to0 |
  12892. * word 3 | |
  12893. * |----------------------------------------------------------------|
  12894. * | unused / reserved | mac_addr47to32 |
  12895. * word 4 | | |
  12896. * |----------------------------------------------------------------|
  12897. * | index |
  12898. * word 5 | |
  12899. * |----------------------------------------------------------------|
  12900. * | length |
  12901. * word 6 | |
  12902. * |----------------------------------------------------------------|
  12903. * | timestamp |
  12904. * word 7 | |
  12905. * |----------------------------------------------------------------|
  12906. * | counter |
  12907. * word 8 | |
  12908. * |----------------------------------------------------------------|
  12909. * | chan_mhz |
  12910. * word 9 | |
  12911. * |----------------------------------------------------------------|
  12912. * | band_center_freq1 |
  12913. * word 10 | |
  12914. * |----------------------------------------------------------------|
  12915. * | band_center_freq2 |
  12916. * word 11 | |
  12917. * |----------------------------------------------------------------|
  12918. * | chan_phy_mode |
  12919. * word 12 | |
  12920. * |----------------------------------------------------------------|
  12921. * where,
  12922. * P - payload present bit (payload_present explained below)
  12923. * req_id - memory request id (mem_req_id explained below)
  12924. * S - status field (status explained below)
  12925. * capbw - capture bandwidth (capture_bw explained below)
  12926. * mode - mode of capture (mode explained below)
  12927. * sts - space time streams (sts_count explained below)
  12928. * chbw - channel bandwidth (channel_bw explained below)
  12929. * captype - capture type (cap_type explained below)
  12930. *
  12931. * The following field definitions describe the format of the CFR dump
  12932. * completion indication sent from the target to the host
  12933. *
  12934. * Header fields:
  12935. *
  12936. * Word 0
  12937. * - msg_type
  12938. * Bits 7:0
  12939. * Purpose: Identifies this as CFR TX completion indication
  12940. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12941. * - payload_present
  12942. * Bit 8
  12943. * Purpose: Identifies how CFR data is sent to host
  12944. * Value: 0 - If CFR Payload is written to host memory
  12945. * 1 - If CFR Payload is sent as part of HTT message
  12946. * (This is the requirement for SDIO/USB where it is
  12947. * not possible to write CFR data to host memory)
  12948. * - reserved
  12949. * Bits 31:9
  12950. * Purpose: Reserved
  12951. * Value: 0
  12952. *
  12953. * Payload fields:
  12954. *
  12955. * Word 1
  12956. * - cfr_capture_msg_type
  12957. * Bits 31:0
  12958. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12959. * to specify the format used for the remainder of the message
  12960. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12961. * (currently only MSG_TYPE_1 is defined)
  12962. *
  12963. * Word 2
  12964. * - mem_req_id
  12965. * Bits 6:0
  12966. * Purpose: Contain the mem request id of the region where the CFR capture
  12967. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12968. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12969. this value is invalid)
  12970. * - status
  12971. * Bit 7
  12972. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12973. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12974. * - capture_bw
  12975. * Bits 10:8
  12976. * Purpose: Carry the bandwidth of the CFR capture
  12977. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12978. * - mode
  12979. * Bits 13:11
  12980. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12981. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12982. * - sts_count
  12983. * Bits 16:14
  12984. * Purpose: Carry the number of space time streams
  12985. * Value: Number of space time streams
  12986. * - channel_bw
  12987. * Bits 19:17
  12988. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12989. * measurement
  12990. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12991. * - cap_type
  12992. * Bits 23:20
  12993. * Purpose: Carry the type of the capture
  12994. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12995. * - vdev_id
  12996. * Bits 31:24
  12997. * Purpose: Carry the virtual device id
  12998. * Value: vdev ID
  12999. *
  13000. * Word 3
  13001. * - mac_addr31to0
  13002. * Bits 31:0
  13003. * Purpose: Contain the bits 31:0 of the peer MAC address
  13004. * Value: Bits 31:0 of the peer MAC address
  13005. *
  13006. * Word 4
  13007. * - mac_addr47to32
  13008. * Bits 15:0
  13009. * Purpose: Contain the bits 47:32 of the peer MAC address
  13010. * Value: Bits 47:32 of the peer MAC address
  13011. *
  13012. * Word 5
  13013. * - index
  13014. * Bits 31:0
  13015. * Purpose: Contain the index at which this CFR dump was written in the Host
  13016. * allocated memory. This index is the number of bytes from the base address.
  13017. * Value: Index position
  13018. *
  13019. * Word 6
  13020. * - length
  13021. * Bits 31:0
  13022. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13023. * Value: Length of the CFR capture of the peer
  13024. *
  13025. * Word 7
  13026. * - timestamp
  13027. * Bits 31:0
  13028. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13029. * clock used for this timestamp is private to the target and not visible to
  13030. * the host i.e., Host can interpret only the relative timestamp deltas from
  13031. * one message to the next, but can't interpret the absolute timestamp from a
  13032. * single message.
  13033. * Value: Timestamp in microseconds
  13034. *
  13035. * Word 8
  13036. * - counter
  13037. * Bits 31:0
  13038. * Purpose: Carry the count of the current CFR capture from FW. This is
  13039. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13040. * in host memory)
  13041. * Value: Count of the current CFR capture
  13042. *
  13043. * Word 9
  13044. * - chan_mhz
  13045. * Bits 31:0
  13046. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13047. * Value: Primary 20 channel frequency
  13048. *
  13049. * Word 10
  13050. * - band_center_freq1
  13051. * Bits 31:0
  13052. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13053. * Value: Center frequency 1 in MHz
  13054. *
  13055. * Word 11
  13056. * - band_center_freq2
  13057. * Bits 31:0
  13058. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13059. * the VDEV
  13060. * 80plus80 mode
  13061. * Value: Center frequency 2 in MHz
  13062. *
  13063. * Word 12
  13064. * - chan_phy_mode
  13065. * Bits 31:0
  13066. * Purpose: Carry the phy mode of the channel, of the VDEV
  13067. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13068. */
  13069. PREPACK struct htt_cfr_dump_ind_type_1 {
  13070. A_UINT32 mem_req_id:7,
  13071. status:1,
  13072. capture_bw:3,
  13073. mode:3,
  13074. sts_count:3,
  13075. channel_bw:3,
  13076. cap_type:4,
  13077. vdev_id:8;
  13078. htt_mac_addr addr;
  13079. A_UINT32 index;
  13080. A_UINT32 length;
  13081. A_UINT32 timestamp;
  13082. A_UINT32 counter;
  13083. struct htt_chan_change_msg chan;
  13084. } POSTPACK;
  13085. PREPACK struct htt_cfr_dump_compl_ind {
  13086. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13087. union {
  13088. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13089. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13090. /* If there is a need to change the memory layout and its associated
  13091. * HTT indication format, a new CFR capture message type can be
  13092. * introduced and added into this union.
  13093. */
  13094. };
  13095. } POSTPACK;
  13096. /*
  13097. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13098. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13099. */
  13100. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13101. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13102. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13103. do { \
  13104. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13105. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13106. } while(0)
  13107. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13108. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13109. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13110. /*
  13111. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13112. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13113. */
  13114. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13115. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13116. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13117. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13119. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13120. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13121. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13122. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13123. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13124. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13125. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13126. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13127. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13128. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13129. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13130. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13131. do { \
  13132. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13133. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13134. } while (0)
  13135. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13136. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13137. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13138. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13139. do { \
  13140. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13141. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13142. } while (0)
  13143. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13144. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13145. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13146. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13147. do { \
  13148. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13149. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13150. } while (0)
  13151. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13152. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13153. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13154. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13155. do { \
  13156. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13157. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13158. } while (0)
  13159. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13160. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13161. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13162. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13163. do { \
  13164. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13165. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13166. } while (0)
  13167. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13168. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13169. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13170. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13171. do { \
  13172. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13173. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13174. } while (0)
  13175. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13176. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13177. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13178. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13179. do { \
  13180. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13181. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13182. } while (0)
  13183. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13184. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13185. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13186. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13187. do { \
  13188. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13189. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13190. } while (0)
  13191. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13192. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13193. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13194. /**
  13195. * @brief target -> host peer (PPDU) stats message
  13196. *
  13197. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13198. *
  13199. * @details
  13200. * This message is generated by FW when FW is sending stats to host
  13201. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13202. * This message is sent autonomously by the target rather than upon request
  13203. * by the host.
  13204. * The following field definitions describe the format of the HTT target
  13205. * to host peer stats indication message.
  13206. *
  13207. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13208. * or more PPDU stats records.
  13209. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13210. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13211. * then the message would start with the
  13212. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13213. * below.
  13214. *
  13215. * |31 16|15|14|13 11|10 9|8|7 0|
  13216. * |-------------------------------------------------------------|
  13217. * | reserved |MSG_TYPE |
  13218. * |-------------------------------------------------------------|
  13219. * rec 0 | TLV header |
  13220. * rec 0 |-------------------------------------------------------------|
  13221. * rec 0 | ppdu successful bytes |
  13222. * rec 0 |-------------------------------------------------------------|
  13223. * rec 0 | ppdu retry bytes |
  13224. * rec 0 |-------------------------------------------------------------|
  13225. * rec 0 | ppdu failed bytes |
  13226. * rec 0 |-------------------------------------------------------------|
  13227. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13228. * rec 0 |-------------------------------------------------------------|
  13229. * rec 0 | retried MSDUs | successful MSDUs |
  13230. * rec 0 |-------------------------------------------------------------|
  13231. * rec 0 | TX duration | failed MSDUs |
  13232. * rec 0 |-------------------------------------------------------------|
  13233. * ...
  13234. * |-------------------------------------------------------------|
  13235. * rec N | TLV header |
  13236. * rec N |-------------------------------------------------------------|
  13237. * rec N | ppdu successful bytes |
  13238. * rec N |-------------------------------------------------------------|
  13239. * rec N | ppdu retry bytes |
  13240. * rec N |-------------------------------------------------------------|
  13241. * rec N | ppdu failed bytes |
  13242. * rec N |-------------------------------------------------------------|
  13243. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13244. * rec N |-------------------------------------------------------------|
  13245. * rec N | retried MSDUs | successful MSDUs |
  13246. * rec N |-------------------------------------------------------------|
  13247. * rec N | TX duration | failed MSDUs |
  13248. * rec N |-------------------------------------------------------------|
  13249. *
  13250. * where:
  13251. * A = is A-MPDU flag
  13252. * BA = block-ack failure flags
  13253. * BW = bandwidth spec
  13254. * SG = SGI enabled spec
  13255. * S = skipped rate ctrl
  13256. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13257. *
  13258. * Header
  13259. * ------
  13260. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13261. * dword0 - b'8:31 - reserved : Reserved for future use
  13262. *
  13263. * payload include below peer_stats information
  13264. * --------------------------------------------
  13265. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13266. * @tx_success_bytes : total successful bytes in the PPDU.
  13267. * @tx_retry_bytes : total retried bytes in the PPDU.
  13268. * @tx_failed_bytes : total failed bytes in the PPDU.
  13269. * @tx_ratecode : rate code used for the PPDU.
  13270. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13271. * @ba_ack_failed : BA/ACK failed for this PPDU
  13272. * b00 -> BA received
  13273. * b01 -> BA failed once
  13274. * b10 -> BA failed twice, when HW retry is enabled.
  13275. * @bw : BW
  13276. * b00 -> 20 MHz
  13277. * b01 -> 40 MHz
  13278. * b10 -> 80 MHz
  13279. * b11 -> 160 MHz (or 80+80)
  13280. * @sg : SGI enabled
  13281. * @s : skipped ratectrl
  13282. * @peer_id : peer id
  13283. * @tx_success_msdus : successful MSDUs
  13284. * @tx_retry_msdus : retried MSDUs
  13285. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13286. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13287. */
  13288. /**
  13289. * @brief target -> host backpressure event
  13290. *
  13291. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13292. *
  13293. * @details
  13294. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13295. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13296. * This message will only be sent if the backpressure condition has existed
  13297. * continuously for an initial period (100 ms).
  13298. * Repeat messages with updated information will be sent after each
  13299. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13300. * This message indicates the ring id along with current head and tail index
  13301. * locations (i.e. write and read indices).
  13302. * The backpressure time indicates the time in ms for which continous
  13303. * backpressure has been observed in the ring.
  13304. *
  13305. * The message format is as follows:
  13306. *
  13307. * |31 24|23 16|15 8|7 0|
  13308. * |----------------+----------------+----------------+----------------|
  13309. * | ring_id | ring_type | pdev_id | msg_type |
  13310. * |-------------------------------------------------------------------|
  13311. * | tail_idx | head_idx |
  13312. * |-------------------------------------------------------------------|
  13313. * | backpressure_time_ms |
  13314. * |-------------------------------------------------------------------|
  13315. *
  13316. * The message is interpreted as follows:
  13317. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13318. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13319. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13320. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13321. the msg is for LMAC ring.
  13322. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13323. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13324. * htt_backpressure_lmac_ring_id. This represents
  13325. * the ring id for which continous backpressure is seen
  13326. *
  13327. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  13328. * the ring indicated by the ring_id
  13329. *
  13330. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  13331. * the ring indicated by the ring id
  13332. *
  13333. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  13334. * backpressure has been seen in the ring
  13335. * indicated by the ring_id.
  13336. * Units = milliseconds
  13337. */
  13338. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  13339. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  13340. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  13341. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  13342. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  13343. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  13344. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  13345. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  13346. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  13347. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  13348. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  13349. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  13350. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  13351. do { \
  13352. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  13353. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  13354. } while (0)
  13355. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  13356. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  13357. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  13358. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  13361. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  13362. } while (0)
  13363. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  13364. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  13365. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  13366. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  13367. do { \
  13368. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  13369. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  13370. } while (0)
  13371. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  13372. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  13373. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  13374. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  13375. do { \
  13376. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  13377. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  13378. } while (0)
  13379. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  13380. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  13381. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  13382. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  13383. do { \
  13384. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  13385. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  13386. } while (0)
  13387. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  13388. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  13389. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  13390. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  13391. do { \
  13392. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  13393. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  13394. } while (0)
  13395. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  13396. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  13397. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  13398. enum htt_backpressure_ring_type {
  13399. HTT_SW_RING_TYPE_UMAC,
  13400. HTT_SW_RING_TYPE_LMAC,
  13401. HTT_SW_RING_TYPE_MAX,
  13402. };
  13403. /* Ring id for which the message is sent to host */
  13404. enum htt_backpressure_umac_ringid {
  13405. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  13406. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  13407. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  13408. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  13409. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  13410. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  13411. HTT_SW_RING_IDX_REO_REO2FW_RING,
  13412. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  13413. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  13414. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  13415. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  13416. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  13417. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  13418. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  13419. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  13420. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  13421. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  13422. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  13423. HTT_SW_UMAC_RING_IDX_MAX,
  13424. };
  13425. enum htt_backpressure_lmac_ringid {
  13426. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  13427. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  13428. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  13429. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  13430. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  13431. HTT_SW_RING_IDX_RXDMA2FW_RING,
  13432. HTT_SW_RING_IDX_RXDMA2SW_RING,
  13433. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  13434. HTT_SW_RING_IDX_RXDMA2REO_RING,
  13435. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  13436. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  13437. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  13438. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  13439. HTT_SW_LMAC_RING_IDX_MAX,
  13440. };
  13441. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  13442. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  13443. pdev_id: 8,
  13444. ring_type: 8, /* htt_backpressure_ring_type */
  13445. /*
  13446. * ring_id holds an enum value from either
  13447. * htt_backpressure_umac_ringid or
  13448. * htt_backpressure_lmac_ringid, based on
  13449. * the ring_type setting.
  13450. */
  13451. ring_id: 8;
  13452. A_UINT16 head_idx;
  13453. A_UINT16 tail_idx;
  13454. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  13455. } POSTPACK;
  13456. /*
  13457. * Defines two 32 bit words that can be used by the target to indicate a per
  13458. * user RU allocation and rate information.
  13459. *
  13460. * This information is currently provided in the "sw_response_reference_ptr"
  13461. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  13462. * "rx_ppdu_end_user_stats" TLV.
  13463. *
  13464. * VALID:
  13465. * The consumer of these words must explicitly check the valid bit,
  13466. * and only attempt interpretation of any of the remaining fields if
  13467. * the valid bit is set to 1.
  13468. *
  13469. * VERSION:
  13470. * The consumer of these words must also explicitly check the version bit,
  13471. * and only use the V0 definition if the VERSION field is set to 0.
  13472. *
  13473. * Version 1 is currently undefined, with the exception of the VALID and
  13474. * VERSION fields.
  13475. *
  13476. * Version 0:
  13477. *
  13478. * The fields below are duplicated per BW.
  13479. *
  13480. * The consumer must determine which BW field to use, based on the UL OFDMA
  13481. * PPDU BW indicated by HW.
  13482. *
  13483. * RU_START: RU26 start index for the user.
  13484. * Note that this is always using the RU26 index, regardless
  13485. * of the actual RU assigned to the user
  13486. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  13487. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  13488. *
  13489. * For example, 20MHz (the value in the top row is RU_START)
  13490. *
  13491. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  13492. * RU Size 1 (52): | | | | | |
  13493. * RU Size 2 (106): | | | |
  13494. * RU Size 3 (242): | |
  13495. *
  13496. * RU_SIZE: Indicates the RU size, as defined by enum
  13497. * htt_ul_ofdma_user_info_ru_size.
  13498. *
  13499. * LDPC: LDPC enabled (if 0, BCC is used)
  13500. *
  13501. * DCM: DCM enabled
  13502. *
  13503. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  13504. * |---------------------------------+--------------------------------|
  13505. * |Ver|Valid| FW internal |
  13506. * |---------------------------------+--------------------------------|
  13507. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  13508. * |---------------------------------+--------------------------------|
  13509. */
  13510. enum htt_ul_ofdma_user_info_ru_size {
  13511. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  13512. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  13513. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  13514. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  13515. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  13516. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  13517. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  13518. };
  13519. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  13520. struct htt_ul_ofdma_user_info_v0 {
  13521. A_UINT32 word0;
  13522. A_UINT32 word1;
  13523. };
  13524. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  13525. A_UINT32 w0_fw_rsvd:30; \
  13526. A_UINT32 w0_valid:1; \
  13527. A_UINT32 w0_version:1;
  13528. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  13529. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13530. };
  13531. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  13532. A_UINT32 w1_nss:3; \
  13533. A_UINT32 w1_mcs:4; \
  13534. A_UINT32 w1_ldpc:1; \
  13535. A_UINT32 w1_dcm:1; \
  13536. A_UINT32 w1_ru_start:7; \
  13537. A_UINT32 w1_ru_size:3; \
  13538. A_UINT32 w1_trig_type:4; \
  13539. A_UINT32 w1_unused:9;
  13540. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  13541. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13542. };
  13543. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  13544. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  13545. union {
  13546. A_UINT32 word0;
  13547. struct {
  13548. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13549. };
  13550. };
  13551. union {
  13552. A_UINT32 word1;
  13553. struct {
  13554. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13555. };
  13556. };
  13557. } POSTPACK;
  13558. enum HTT_UL_OFDMA_TRIG_TYPE {
  13559. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  13560. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  13561. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  13562. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  13563. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  13564. };
  13565. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  13566. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  13567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  13568. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  13569. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  13570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  13571. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  13572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  13573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  13574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  13575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  13576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  13577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  13578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  13579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  13580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  13581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  13582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  13583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  13584. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  13585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  13586. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  13587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  13588. /*--- word 0 ---*/
  13589. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  13590. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  13591. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  13592. do { \
  13593. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  13594. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  13595. } while (0)
  13596. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  13597. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  13598. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  13599. do { \
  13600. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  13601. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  13602. } while (0)
  13603. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  13604. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  13605. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  13606. do { \
  13607. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  13608. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  13609. } while (0)
  13610. /*--- word 1 ---*/
  13611. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  13612. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  13613. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  13614. do { \
  13615. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  13616. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  13617. } while (0)
  13618. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  13619. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  13620. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  13621. do { \
  13622. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  13623. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  13624. } while (0)
  13625. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  13626. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  13627. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  13628. do { \
  13629. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  13630. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  13631. } while (0)
  13632. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  13633. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  13634. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  13635. do { \
  13636. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  13637. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  13638. } while (0)
  13639. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  13640. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  13641. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  13642. do { \
  13643. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  13644. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  13645. } while (0)
  13646. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  13647. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  13648. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  13649. do { \
  13650. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  13651. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  13652. } while (0)
  13653. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  13654. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  13655. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  13656. do { \
  13657. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  13658. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  13659. } while (0)
  13660. /**
  13661. * @brief target -> host channel calibration data message
  13662. *
  13663. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  13664. *
  13665. * @brief host -> target channel calibration data message
  13666. *
  13667. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  13668. *
  13669. * @details
  13670. * The following field definitions describe the format of the channel
  13671. * calibration data message sent from the target to the host when
  13672. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  13673. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  13674. * The message is defined as htt_chan_caldata_msg followed by a variable
  13675. * number of 32-bit character values.
  13676. *
  13677. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  13678. * |------------------------------------------------------------------|
  13679. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  13680. * |------------------------------------------------------------------|
  13681. * | payload size | mhz |
  13682. * |------------------------------------------------------------------|
  13683. * | center frequency 2 | center frequency 1 |
  13684. * |------------------------------------------------------------------|
  13685. * | check sum |
  13686. * |------------------------------------------------------------------|
  13687. * | payload |
  13688. * |------------------------------------------------------------------|
  13689. * message info field:
  13690. * - MSG_TYPE
  13691. * Bits 7:0
  13692. * Purpose: identifies this as a channel calibration data message
  13693. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  13694. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  13695. * - SUB_TYPE
  13696. * Bits 11:8
  13697. * Purpose: T2H: indicates whether target is providing chan cal data
  13698. * to the host to store, or requesting that the host
  13699. * download previously-stored data.
  13700. * H2T: indicates whether the host is providing the requested
  13701. * channel cal data, or if it is rejecting the data
  13702. * request because it does not have the requested data.
  13703. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  13704. * - CHKSUM_VALID
  13705. * Bit 12
  13706. * Purpose: indicates if the checksum field is valid
  13707. * value:
  13708. * - FRAG
  13709. * Bit 19:16
  13710. * Purpose: indicates the fragment index for message
  13711. * value: 0 for first fragment, 1 for second fragment, ...
  13712. * - APPEND
  13713. * Bit 20
  13714. * Purpose: indicates if this is the last fragment
  13715. * value: 0 = final fragment, 1 = more fragments will be appended
  13716. *
  13717. * channel and payload size field
  13718. * - MHZ
  13719. * Bits 15:0
  13720. * Purpose: indicates the channel primary frequency
  13721. * Value:
  13722. * - PAYLOAD_SIZE
  13723. * Bits 31:16
  13724. * Purpose: indicates the bytes of calibration data in payload
  13725. * Value:
  13726. *
  13727. * center frequency field
  13728. * - CENTER FREQUENCY 1
  13729. * Bits 15:0
  13730. * Purpose: indicates the channel center frequency
  13731. * Value: channel center frequency, in MHz units
  13732. * - CENTER FREQUENCY 2
  13733. * Bits 31:16
  13734. * Purpose: indicates the secondary channel center frequency,
  13735. * only for 11acvht 80plus80 mode
  13736. * Value: secondary channel center frequeny, in MHz units, if applicable
  13737. *
  13738. * checksum field
  13739. * - CHECK_SUM
  13740. * Bits 31:0
  13741. * Purpose: check the payload data, it is just for this fragment.
  13742. * This is intended for the target to check that the channel
  13743. * calibration data returned by the host is the unmodified data
  13744. * that was previously provided to the host by the target.
  13745. * value: checksum of fragment payload
  13746. */
  13747. PREPACK struct htt_chan_caldata_msg {
  13748. /* DWORD 0: message info */
  13749. A_UINT32
  13750. msg_type: 8,
  13751. sub_type: 4 ,
  13752. chksum_valid: 1, /** 1:valid, 0:invalid */
  13753. reserved1: 3,
  13754. frag_idx: 4, /** fragment index for calibration data */
  13755. appending: 1, /** 0: no fragment appending,
  13756. * 1: extra fragment appending */
  13757. reserved2: 11;
  13758. /* DWORD 1: channel and payload size */
  13759. A_UINT32
  13760. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  13761. payload_size: 16; /** unit: bytes */
  13762. /* DWORD 2: center frequency */
  13763. A_UINT32
  13764. band_center_freq1: 16, /** Center frequency 1 in MHz */
  13765. band_center_freq2: 16; /** Center frequency 2 in MHz,
  13766. * valid only for 11acvht 80plus80 mode */
  13767. /* DWORD 3: check sum */
  13768. A_UINT32 chksum;
  13769. /* variable length for calibration data */
  13770. A_UINT32 payload[1/* or more */];
  13771. } POSTPACK;
  13772. /* T2H SUBTYPE */
  13773. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  13774. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  13775. /* H2T SUBTYPE */
  13776. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  13777. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  13778. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  13779. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  13780. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  13781. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  13782. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  13783. do { \
  13784. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  13785. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  13786. } while (0)
  13787. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  13788. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  13789. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  13790. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  13791. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  13792. do { \
  13793. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  13794. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  13795. } while (0)
  13796. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  13797. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  13798. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  13799. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  13800. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  13801. do { \
  13802. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  13803. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  13804. } while (0)
  13805. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  13806. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  13807. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  13808. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  13809. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  13810. do { \
  13811. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  13812. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  13813. } while (0)
  13814. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  13815. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  13816. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  13817. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  13818. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  13819. do { \
  13820. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  13821. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  13822. } while (0)
  13823. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  13824. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  13825. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  13826. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  13827. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  13828. do { \
  13829. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  13830. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  13831. } while (0)
  13832. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  13833. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  13834. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  13835. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  13836. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  13837. do { \
  13838. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  13839. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  13840. } while (0)
  13841. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  13842. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  13843. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  13844. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  13845. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  13846. do { \
  13847. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  13848. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  13849. } while (0)
  13850. /**
  13851. * @brief target -> host FSE CMEM based send
  13852. *
  13853. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  13854. *
  13855. * @details
  13856. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  13857. * FSE placement in CMEM is enabled.
  13858. *
  13859. * This message sends the non-secure CMEM base address.
  13860. * It will be sent to host in response to message
  13861. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  13862. * The message would appear as follows:
  13863. *
  13864. * |31 24|23 16|15 8|7 0|
  13865. * |----------------+----------------+----------------+----------------|
  13866. * | reserved | num_entries | msg_type |
  13867. * |----------------+----------------+----------------+----------------|
  13868. * | base_address_lo |
  13869. * |----------------+----------------+----------------+----------------|
  13870. * | base_address_hi |
  13871. * |-------------------------------------------------------------------|
  13872. *
  13873. * The message is interpreted as follows:
  13874. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  13875. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  13876. * b'8:15 - number_entries: Indicated the number of entries
  13877. * programmed.
  13878. * b'16:31 - reserved.
  13879. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  13880. * CMEM base address
  13881. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  13882. * CMEM base address
  13883. */
  13884. PREPACK struct htt_cmem_base_send_t {
  13885. A_UINT32 msg_type: 8,
  13886. num_entries: 8,
  13887. reserved: 16;
  13888. A_UINT32 base_address_lo;
  13889. A_UINT32 base_address_hi;
  13890. } POSTPACK;
  13891. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  13892. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  13893. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  13894. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  13895. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  13896. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  13897. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  13898. do { \
  13899. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  13900. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13901. } while (0)
  13902. /**
  13903. * @brief - HTT PPDU ID format
  13904. *
  13905. * @details
  13906. * The following field definitions describe the format of the PPDU ID.
  13907. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  13908. *
  13909. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  13910. * +--------------------------------------------------------------------------
  13911. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13912. * +--------------------------------------------------------------------------
  13913. *
  13914. * sch id :Schedule command id
  13915. * Bits [11 : 0] : monotonically increasing counter to track the
  13916. * PPDU posted to a specific transmit queue.
  13917. *
  13918. * hwq_id: Hardware Queue ID.
  13919. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13920. *
  13921. * mac_id: MAC ID
  13922. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13923. *
  13924. * seq_idx: Sequence index.
  13925. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13926. * a particular TXOP.
  13927. *
  13928. * tqm_cmd: HWSCH/TQM flag.
  13929. * Bit [23] : Always set to 0.
  13930. *
  13931. * seq_cmd_type: Sequence command type.
  13932. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13933. * Refer to enum HTT_STATS_FTYPE for values.
  13934. */
  13935. PREPACK struct htt_ppdu_id {
  13936. A_UINT32
  13937. sch_id: 12,
  13938. hwq_id: 5,
  13939. mac_id: 2,
  13940. seq_idx: 2,
  13941. reserved1: 2,
  13942. tqm_cmd: 1,
  13943. seq_cmd_type: 6,
  13944. reserved2: 2;
  13945. } POSTPACK;
  13946. #define HTT_PPDU_ID_SCH_ID_S 0
  13947. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13948. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13949. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13950. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13951. do { \
  13952. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13953. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13954. } while (0)
  13955. #define HTT_PPDU_ID_HWQ_ID_S 12
  13956. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13957. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13958. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13959. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13960. do { \
  13961. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13962. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13963. } while (0)
  13964. #define HTT_PPDU_ID_MAC_ID_S 17
  13965. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13966. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13967. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13968. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13969. do { \
  13970. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13971. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13972. } while (0)
  13973. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13974. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13975. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13976. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13977. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13978. do { \
  13979. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13980. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13981. } while (0)
  13982. #define HTT_PPDU_ID_TQM_CMD_S 23
  13983. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13984. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13985. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13986. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13987. do { \
  13988. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13989. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13990. } while (0)
  13991. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13992. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13993. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13994. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13995. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13996. do { \
  13997. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13998. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13999. } while (0)
  14000. /**
  14001. * @brief target -> RX PEER METADATA V0 format
  14002. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14003. * message from target, and will confirm to the target which peer metadata
  14004. * version to use in the wmi_init message.
  14005. *
  14006. * The following diagram shows the format of the RX PEER METADATA.
  14007. *
  14008. * |31 24|23 16|15 8|7 0|
  14009. * |-----------------------------------------------------------------------|
  14010. * | Reserved | VDEV ID | PEER ID |
  14011. * |-----------------------------------------------------------------------|
  14012. */
  14013. PREPACK struct htt_rx_peer_metadata_v0 {
  14014. A_UINT32
  14015. peer_id: 16,
  14016. vdev_id: 8,
  14017. reserved1: 8;
  14018. } POSTPACK;
  14019. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14020. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14021. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14022. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14023. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14024. do { \
  14025. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14026. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14027. } while (0)
  14028. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14029. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14030. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14031. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14032. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14033. do { \
  14034. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14035. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14036. } while (0)
  14037. /**
  14038. * @brief target -> RX PEER METADATA V1 format
  14039. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14040. * message from target, and will confirm to the target which peer metadata
  14041. * version to use in the wmi_init message.
  14042. *
  14043. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14044. *
  14045. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14046. * |-----------------------------------------------------------------------|
  14047. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14048. * |-----------------------------------------------------------------------|
  14049. */
  14050. PREPACK struct htt_rx_peer_metadata_v1 {
  14051. A_UINT32
  14052. peer_id: 13,
  14053. ml_peer_valid: 1,
  14054. reserved1: 2,
  14055. vdev_id: 8,
  14056. lmac_id: 2,
  14057. chip_id: 3,
  14058. reserved2: 3;
  14059. } POSTPACK;
  14060. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14061. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14062. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14063. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14064. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14065. do { \
  14066. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14067. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14068. } while (0)
  14069. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14070. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14071. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14072. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14073. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14074. do { \
  14075. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14076. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14077. } while (0)
  14078. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14079. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14080. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14081. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14082. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14083. do { \
  14084. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14085. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14086. } while (0)
  14087. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14088. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14089. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14090. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14091. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14092. do { \
  14093. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14094. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14095. } while (0)
  14096. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14097. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14098. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14099. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14100. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14101. do { \
  14102. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14103. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14104. } while (0)
  14105. /*
  14106. * In some systems, the host SW wants to specify priorities between
  14107. * different MSDU / flow queues within the same peer-TID.
  14108. * The below enums are used for the host to identify to the target
  14109. * which MSDU queue's priority it wants to adjust.
  14110. */
  14111. /*
  14112. * The MSDUQ index describe index of TCL HW, where each index is
  14113. * used for queuing particular types of MSDUs.
  14114. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14115. */
  14116. enum HTT_MSDUQ_INDEX {
  14117. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14118. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14119. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14120. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14121. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14122. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14123. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14124. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14125. HTT_MSDUQ_MAX_INDEX,
  14126. };
  14127. /* MSDU qtype definition */
  14128. enum HTT_MSDU_QTYPE {
  14129. /*
  14130. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14131. * relative priority. Instead, the relative priority of CRIT_0 versus
  14132. * CRIT_1 is controlled by the FW, through the configuration parameters
  14133. * it applies to the queues.
  14134. */
  14135. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14136. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14137. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14138. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14139. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14140. /* New MSDU_QTYPE should be added above this line */
  14141. /*
  14142. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14143. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14144. * any host/target message definitions. The QTYPE_MAX value can
  14145. * only be used internally within the host or within the target.
  14146. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14147. * it must regard the unexpected value as a default qtype value,
  14148. * or ignore it.
  14149. */
  14150. HTT_MSDU_QTYPE_MAX,
  14151. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14152. };
  14153. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14154. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14155. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14156. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14157. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14158. };
  14159. /**
  14160. * @brief target -> host mlo timestamp offset indication
  14161. *
  14162. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14163. *
  14164. * @details
  14165. * The following field definitions describe the format of the HTT target
  14166. * to host mlo timestamp offset indication message.
  14167. *
  14168. *
  14169. * |31 16|15 12|11 10|9 8|7 0 |
  14170. * |----------------------------------------------------------------------|
  14171. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14172. * |----------------------------------------------------------------------|
  14173. * | Sync time stamp lo in us |
  14174. * |----------------------------------------------------------------------|
  14175. * | Sync time stamp hi in us |
  14176. * |----------------------------------------------------------------------|
  14177. * | mlo time stamp offset lo in us |
  14178. * |----------------------------------------------------------------------|
  14179. * | mlo time stamp offset hi in us |
  14180. * |----------------------------------------------------------------------|
  14181. * | mlo time stamp offset clocks in clock ticks |
  14182. * |----------------------------------------------------------------------|
  14183. * |31 26|25 16|15 0 |
  14184. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14185. * | | compensation in clks | |
  14186. * |----------------------------------------------------------------------|
  14187. * |31 22|21 0 |
  14188. * | rsvd 3 | mlo time stamp comp timer period |
  14189. * |----------------------------------------------------------------------|
  14190. * The message is interpreted as follows:
  14191. *
  14192. * dword0 - b'0:7 - msg_type: This will be set to
  14193. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14194. * value: 0x28
  14195. *
  14196. * dword0 - b'9:8 - pdev_id
  14197. *
  14198. * dword0 - b'11:10 - chip_id
  14199. *
  14200. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14201. *
  14202. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14203. *
  14204. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14205. * which last sync interrupt was received
  14206. *
  14207. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14208. * which last sync interrupt was received
  14209. *
  14210. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14211. *
  14212. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14213. *
  14214. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14215. *
  14216. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14217. *
  14218. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14219. * for sub us resolution
  14220. *
  14221. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14222. *
  14223. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14224. * is applied, in us
  14225. *
  14226. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14227. */
  14228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14229. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14242. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14243. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14244. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14245. do { \
  14246. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14247. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14248. } while (0)
  14249. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14250. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14251. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14252. do { \
  14253. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14254. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14255. } while (0)
  14256. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14257. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14258. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14259. do { \
  14260. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14261. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14262. } while (0)
  14263. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14264. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14265. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14266. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14267. do { \
  14268. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14269. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14270. } while (0)
  14271. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14272. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14273. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14274. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14275. do { \
  14276. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14277. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14278. } while (0)
  14279. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14280. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14281. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14282. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14283. do { \
  14284. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14285. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14286. } while (0)
  14287. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14288. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14289. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14290. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14291. do { \
  14292. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14293. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14294. } while (0)
  14295. typedef struct {
  14296. A_UINT32 msg_type: 8, /* bits 7:0 */
  14297. pdev_id: 2, /* bits 9:8 */
  14298. chip_id: 2, /* bits 11:10 */
  14299. reserved1: 4, /* bits 15:12 */
  14300. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14301. A_UINT32 sync_timestamp_lo_us;
  14302. A_UINT32 sync_timestamp_hi_us;
  14303. A_UINT32 mlo_timestamp_offset_lo_us;
  14304. A_UINT32 mlo_timestamp_offset_hi_us;
  14305. A_UINT32 mlo_timestamp_offset_clks;
  14306. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14307. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14308. reserved2: 6; /* bits 31:26 */
  14309. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14310. reserved3: 10; /* bits 31:22 */
  14311. } htt_t2h_mlo_offset_ind_t;
  14312. /*
  14313. * @brief target -> host VDEV TX RX STATS
  14314. *
  14315. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14316. *
  14317. * @details
  14318. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14319. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  14320. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  14321. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  14322. * periodically by target even in the absence of any further HTT request
  14323. * messages from host.
  14324. *
  14325. * The message is formatted as follows:
  14326. *
  14327. * |31 16|15 8|7 0|
  14328. * |---------------------------------+----------------+----------------|
  14329. * | payload_size | pdev_id | msg_type |
  14330. * |---------------------------------+----------------+----------------|
  14331. * | reserved0 |
  14332. * |-------------------------------------------------------------------|
  14333. * | reserved1 |
  14334. * |-------------------------------------------------------------------|
  14335. * | reserved2 |
  14336. * |-------------------------------------------------------------------|
  14337. * | |
  14338. * | VDEV specific Tx Rx stats info |
  14339. * | |
  14340. * |-------------------------------------------------------------------|
  14341. *
  14342. * The message is interpreted as follows:
  14343. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  14344. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  14345. * b'8:15 - pdev_id
  14346. * b'16:31 - size in bytes of the payload that follows the 16-byte
  14347. * message header fields (msg_type through reserved2)
  14348. * dword1 - b'0:31 - reserved0.
  14349. * dword2 - b'0:31 - reserved1.
  14350. * dword3 - b'0:31 - reserved2.
  14351. */
  14352. typedef struct {
  14353. A_UINT32 msg_type: 8,
  14354. pdev_id: 8,
  14355. payload_size: 16;
  14356. A_UINT32 reserved0;
  14357. A_UINT32 reserved1;
  14358. A_UINT32 reserved2;
  14359. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  14360. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  14361. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  14362. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  14363. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  14364. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  14365. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  14366. do { \
  14367. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  14368. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  14369. } while (0)
  14370. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  14371. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  14372. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  14373. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  14374. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  14375. do { \
  14376. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  14377. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  14378. } while (0)
  14379. /* SOC related stats */
  14380. typedef struct {
  14381. htt_tlv_hdr_t tlv_hdr;
  14382. /* When TQM is not able to find the peers during Tx, then it drops the packets
  14383. * This can be due to either the peer is deleted or deletion is ongoing
  14384. * */
  14385. A_UINT32 inv_peers_msdu_drop_count_lo;
  14386. A_UINT32 inv_peers_msdu_drop_count_hi;
  14387. } htt_t2h_soc_txrx_stats_common_tlv;
  14388. /* VDEV HW Tx/Rx stats */
  14389. typedef struct {
  14390. htt_tlv_hdr_t tlv_hdr;
  14391. A_UINT32 vdev_id;
  14392. /* Rx msdu byte cnt */
  14393. A_UINT32 rx_msdu_byte_cnt_lo;
  14394. A_UINT32 rx_msdu_byte_cnt_hi;
  14395. /* Rx msdu cnt */
  14396. A_UINT32 rx_msdu_cnt_lo;
  14397. A_UINT32 rx_msdu_cnt_hi;
  14398. /* tx msdu byte cnt */
  14399. A_UINT32 tx_msdu_byte_cnt_lo;
  14400. A_UINT32 tx_msdu_byte_cnt_hi;
  14401. /* tx msdu cnt */
  14402. A_UINT32 tx_msdu_cnt_lo;
  14403. A_UINT32 tx_msdu_cnt_hi;
  14404. /* tx excessive retry discarded msdu cnt*/
  14405. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  14406. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  14407. /* TX congestion ctrl msdu drop cnt */
  14408. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  14409. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  14410. /* discarded tx msdus cnt coz of time to live expiry */
  14411. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  14412. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  14413. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  14414. #endif