htt.h 719 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864
  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_MAX_TAG,
  626. } htt_tlv_tag_t;
  627. #define HTT_STATS_TLV_TAG_M 0x00000fff
  628. #define HTT_STATS_TLV_TAG_S 0
  629. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  630. #define HTT_STATS_TLV_LENGTH_S 12
  631. #define HTT_STATS_TLV_TAG_GET(_var) \
  632. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  633. HTT_STATS_TLV_TAG_S)
  634. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  635. do { \
  636. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  637. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  638. } while (0)
  639. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  640. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  641. HTT_STATS_TLV_LENGTH_S)
  642. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  643. do { \
  644. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  645. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  646. } while (0)
  647. /*=== host -> target messages ===============================================*/
  648. enum htt_h2t_msg_type {
  649. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  650. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  651. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  652. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  653. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  654. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  655. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  656. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  657. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  658. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  659. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  660. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  661. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  662. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  663. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  664. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  665. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  666. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  667. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  668. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  669. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  670. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  671. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  672. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  673. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  674. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  675. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  676. /* keep this last */
  677. HTT_H2T_NUM_MSGS
  678. };
  679. /*
  680. * HTT host to target message type -
  681. * stored in bits 7:0 of the first word of the message
  682. */
  683. #define HTT_H2T_MSG_TYPE_M 0xff
  684. #define HTT_H2T_MSG_TYPE_S 0
  685. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  686. do { \
  687. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  688. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  689. } while (0)
  690. #define HTT_H2T_MSG_TYPE_GET(word) \
  691. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  692. /**
  693. * @brief host -> target version number request message definition
  694. *
  695. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  696. *
  697. *
  698. * |31 24|23 16|15 8|7 0|
  699. * |----------------+----------------+----------------+----------------|
  700. * | reserved | msg type |
  701. * |-------------------------------------------------------------------|
  702. * : option request TLV (optional) |
  703. * :...................................................................:
  704. *
  705. * The VER_REQ message may consist of a single 4-byte word, or may be
  706. * extended with TLVs that specify which HTT options the host is requesting
  707. * from the target.
  708. * The following option TLVs may be appended to the VER_REQ message:
  709. * - HL_SUPPRESS_TX_COMPL_IND
  710. * - HL_MAX_TX_QUEUE_GROUPS
  711. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  712. * may be appended to the VER_REQ message (but only one TLV of each type).
  713. *
  714. * Header fields:
  715. * - MSG_TYPE
  716. * Bits 7:0
  717. * Purpose: identifies this as a version number request message
  718. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  719. */
  720. #define HTT_VER_REQ_BYTES 4
  721. /* TBDXXX: figure out a reasonable number */
  722. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  723. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  724. /**
  725. * @brief HTT tx MSDU descriptor
  726. *
  727. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  728. *
  729. * @details
  730. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  731. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  732. * the target firmware needs for the FW's tx processing, particularly
  733. * for creating the HW msdu descriptor.
  734. * The same HTT tx descriptor is used for HL and LL systems, though
  735. * a few fields within the tx descriptor are used only by LL or
  736. * only by HL.
  737. * The HTT tx descriptor is defined in two manners: by a struct with
  738. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  739. * definitions.
  740. * The target should use the struct def, for simplicitly and clarity,
  741. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  742. * neutral. Specifically, the host shall use the get/set macros built
  743. * around the mask + shift defs.
  744. */
  745. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  746. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  747. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  748. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  749. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  750. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  751. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  752. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  753. #define HTT_TX_VDEV_ID_WORD 0
  754. #define HTT_TX_VDEV_ID_MASK 0x3f
  755. #define HTT_TX_VDEV_ID_SHIFT 16
  756. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  757. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  758. #define HTT_TX_MSDU_LEN_DWORD 1
  759. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  760. /*
  761. * HTT_VAR_PADDR macros
  762. * Allow physical / bus addresses to be either a single 32-bit value,
  763. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  764. */
  765. #define HTT_VAR_PADDR32(var_name) \
  766. A_UINT32 var_name
  767. #define HTT_VAR_PADDR64_LE(var_name) \
  768. struct { \
  769. /* little-endian: lo precedes hi */ \
  770. A_UINT32 lo; \
  771. A_UINT32 hi; \
  772. } var_name
  773. /*
  774. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  775. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  776. * addresses are stored in a XXX-bit field.
  777. * This macro is used to define both htt_tx_msdu_desc32_t and
  778. * htt_tx_msdu_desc64_t structs.
  779. */
  780. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  781. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  782. { \
  783. /* DWORD 0: flags and meta-data */ \
  784. A_UINT32 \
  785. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  786. \
  787. /* pkt_subtype - \
  788. * Detailed specification of the tx frame contents, extending the \
  789. * general specification provided by pkt_type. \
  790. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  791. * pkt_type | pkt_subtype \
  792. * ============================================================== \
  793. * 802.3 | bit 0:3 - Reserved \
  794. * | bit 4: 0x0 - Copy-Engine Classification Results \
  795. * | not appended to the HTT message \
  796. * | 0x1 - Copy-Engine Classification Results \
  797. * | appended to the HTT message in the \
  798. * | format: \
  799. * | [HTT tx desc, frame header, \
  800. * | CE classification results] \
  801. * | The CE classification results begin \
  802. * | at the next 4-byte boundary after \
  803. * | the frame header. \
  804. * ------------+------------------------------------------------- \
  805. * Eth2 | bit 0:3 - Reserved \
  806. * | bit 4: 0x0 - Copy-Engine Classification Results \
  807. * | not appended to the HTT message \
  808. * | 0x1 - Copy-Engine Classification Results \
  809. * | appended to the HTT message. \
  810. * | See the above specification of the \
  811. * | CE classification results location. \
  812. * ------------+------------------------------------------------- \
  813. * native WiFi | bit 0:3 - Reserved \
  814. * | bit 4: 0x0 - Copy-Engine Classification Results \
  815. * | not appended to the HTT message \
  816. * | 0x1 - Copy-Engine Classification Results \
  817. * | appended to the HTT message. \
  818. * | See the above specification of the \
  819. * | CE classification results location. \
  820. * ------------+------------------------------------------------- \
  821. * mgmt | 0x0 - 802.11 MAC header absent \
  822. * | 0x1 - 802.11 MAC header present \
  823. * ------------+------------------------------------------------- \
  824. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  825. * | 0x1 - 802.11 MAC header present \
  826. * | bit 1: 0x0 - allow aggregation \
  827. * | 0x1 - don't allow aggregation \
  828. * | bit 2: 0x0 - perform encryption \
  829. * | 0x1 - don't perform encryption \
  830. * | bit 3: 0x0 - perform tx classification / queuing \
  831. * | 0x1 - don't perform tx classification; \
  832. * | insert the frame into the "misc" \
  833. * | tx queue \
  834. * | bit 4: 0x0 - Copy-Engine Classification Results \
  835. * | not appended to the HTT message \
  836. * | 0x1 - Copy-Engine Classification Results \
  837. * | appended to the HTT message. \
  838. * | See the above specification of the \
  839. * | CE classification results location. \
  840. */ \
  841. pkt_subtype: 5, \
  842. \
  843. /* pkt_type - \
  844. * General specification of the tx frame contents. \
  845. * The htt_pkt_type enum should be used to specify and check the \
  846. * value of this field. \
  847. */ \
  848. pkt_type: 3, \
  849. \
  850. /* vdev_id - \
  851. * ID for the vdev that is sending this tx frame. \
  852. * For certain non-standard packet types, e.g. pkt_type == raw \
  853. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  854. * This field is used primarily for determining where to queue \
  855. * broadcast and multicast frames. \
  856. */ \
  857. vdev_id: 6, \
  858. /* ext_tid - \
  859. * The extended traffic ID. \
  860. * If the TID is unknown, the extended TID is set to \
  861. * HTT_TX_EXT_TID_INVALID. \
  862. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  863. * value of the QoS TID. \
  864. * If the tx frame is non-QoS data, then the extended TID is set to \
  865. * HTT_TX_EXT_TID_NON_QOS. \
  866. * If the tx frame is multicast or broadcast, then the extended TID \
  867. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  868. */ \
  869. ext_tid: 5, \
  870. \
  871. /* postponed - \
  872. * This flag indicates whether the tx frame has been downloaded to \
  873. * the target before but discarded by the target, and now is being \
  874. * downloaded again; or if this is a new frame that is being \
  875. * downloaded for the first time. \
  876. * This flag allows the target to determine the correct order for \
  877. * transmitting new vs. old frames. \
  878. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  879. * This flag only applies to HL systems, since in LL systems, \
  880. * the tx flow control is handled entirely within the target. \
  881. */ \
  882. postponed: 1, \
  883. \
  884. /* extension - \
  885. * This flag indicates whether a HTT tx MSDU extension descriptor \
  886. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  887. * \
  888. * 0x0 - no extension MSDU descriptor is present \
  889. * 0x1 - an extension MSDU descriptor immediately follows the \
  890. * regular MSDU descriptor \
  891. */ \
  892. extension: 1, \
  893. \
  894. /* cksum_offload - \
  895. * This flag indicates whether checksum offload is enabled or not \
  896. * for this frame. Target FW use this flag to turn on HW checksumming \
  897. * 0x0 - No checksum offload \
  898. * 0x1 - L3 header checksum only \
  899. * 0x2 - L4 checksum only \
  900. * 0x3 - L3 header checksum + L4 checksum \
  901. */ \
  902. cksum_offload: 2, \
  903. \
  904. /* tx_comp_req - \
  905. * This flag indicates whether Tx Completion \
  906. * from fw is required or not. \
  907. * This flag is only relevant if tx completion is not \
  908. * universally enabled. \
  909. * For all LL systems, tx completion is mandatory, \
  910. * so this flag will be irrelevant. \
  911. * For HL systems tx completion is optional, but HL systems in which \
  912. * the bus throughput exceeds the WLAN throughput will \
  913. * probably want to always use tx completion, and thus \
  914. * would not check this flag. \
  915. * This flag is required when tx completions are not used universally, \
  916. * but are still required for certain tx frames for which \
  917. * an OTA delivery acknowledgment is needed by the host. \
  918. * In practice, this would be for HL systems in which the \
  919. * bus throughput is less than the WLAN throughput. \
  920. * \
  921. * 0x0 - Tx Completion Indication from Fw not required \
  922. * 0x1 - Tx Completion Indication from Fw is required \
  923. */ \
  924. tx_compl_req: 1; \
  925. \
  926. \
  927. /* DWORD 1: MSDU length and ID */ \
  928. A_UINT32 \
  929. len: 16, /* MSDU length, in bytes */ \
  930. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  931. * and this id is used to calculate fragmentation \
  932. * descriptor pointer inside the target based on \
  933. * the base address, configured inside the target. \
  934. */ \
  935. \
  936. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  937. /* frags_desc_ptr - \
  938. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  939. * where the tx frame's fragments reside in memory. \
  940. * This field only applies to LL systems, since in HL systems the \
  941. * (degenerate single-fragment) fragmentation descriptor is created \
  942. * within the target. \
  943. */ \
  944. _paddr__frags_desc_ptr_; \
  945. \
  946. /* DWORD 3 (or 4): peerid, chanfreq */ \
  947. /* \
  948. * Peer ID : Target can use this value to know which peer-id packet \
  949. * destined to. \
  950. * It's intended to be specified by host in case of NAWDS. \
  951. */ \
  952. A_UINT16 peerid; \
  953. \
  954. /* \
  955. * Channel frequency: This identifies the desired channel \
  956. * frequency (in mhz) for tx frames. This is used by FW to help \
  957. * determine when it is safe to transmit or drop frames for \
  958. * off-channel operation. \
  959. * The default value of zero indicates to FW that the corresponding \
  960. * VDEV's home channel (if there is one) is the desired channel \
  961. * frequency. \
  962. */ \
  963. A_UINT16 chanfreq; \
  964. \
  965. /* Reason reserved is commented is increasing the htt structure size \
  966. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  967. * A_UINT32 reserved_dword3_bits0_31; \
  968. */ \
  969. } POSTPACK
  970. /* define a htt_tx_msdu_desc32_t type */
  971. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  972. /* define a htt_tx_msdu_desc64_t type */
  973. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  974. /*
  975. * Make htt_tx_msdu_desc_t be an alias for either
  976. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  977. */
  978. #if HTT_PADDR64
  979. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  980. #else
  981. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  982. #endif
  983. /* decriptor information for Management frame*/
  984. /*
  985. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  986. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  987. */
  988. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  989. extern A_UINT32 mgmt_hdr_len;
  990. PREPACK struct htt_mgmt_tx_desc_t {
  991. A_UINT32 msg_type;
  992. #if HTT_PADDR64
  993. A_UINT64 frag_paddr; /* DMAble address of the data */
  994. #else
  995. A_UINT32 frag_paddr; /* DMAble address of the data */
  996. #endif
  997. A_UINT32 desc_id; /* returned to host during completion
  998. * to free the meory*/
  999. A_UINT32 len; /* Fragment length */
  1000. A_UINT32 vdev_id; /* virtual device ID*/
  1001. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1002. } POSTPACK;
  1003. PREPACK struct htt_mgmt_tx_compl_ind {
  1004. A_UINT32 desc_id;
  1005. A_UINT32 status;
  1006. } POSTPACK;
  1007. /*
  1008. * This SDU header size comes from the summation of the following:
  1009. * 1. Max of:
  1010. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1011. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1012. * b. 802.11 header, for raw frames: 36 bytes
  1013. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1014. * QoS header, HT header)
  1015. * c. 802.3 header, for ethernet frames: 14 bytes
  1016. * (destination address, source address, ethertype / length)
  1017. * 2. Max of:
  1018. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1019. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1020. * 3. 802.1Q VLAN header: 4 bytes
  1021. * 4. LLC/SNAP header: 8 bytes
  1022. */
  1023. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1024. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1025. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1026. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1027. A_COMPILE_TIME_ASSERT(
  1028. htt_encap_hdr_size_max_check_nwifi,
  1029. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1030. A_COMPILE_TIME_ASSERT(
  1031. htt_encap_hdr_size_max_check_enet,
  1032. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1033. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1034. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1035. #define HTT_TX_HDR_SIZE_802_1Q 4
  1036. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1037. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1038. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1039. HTT_TX_HDR_SIZE_802_1Q + \
  1040. HTT_TX_HDR_SIZE_LLC_SNAP)
  1041. #define HTT_HL_TX_FRM_HDR_LEN \
  1042. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1043. #define HTT_LL_TX_FRM_HDR_LEN \
  1044. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1045. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1046. /* dword 0 */
  1047. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1048. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1049. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1050. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1051. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1052. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1053. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1054. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1055. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1056. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1057. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1058. #define HTT_TX_DESC_PKT_TYPE_S 13
  1059. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1060. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1061. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1062. #define HTT_TX_DESC_VDEV_ID_S 16
  1063. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1064. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1065. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1066. #define HTT_TX_DESC_EXT_TID_S 22
  1067. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1068. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1069. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1070. #define HTT_TX_DESC_POSTPONED_S 27
  1071. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1072. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1073. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1074. #define HTT_TX_DESC_EXTENSION_S 28
  1075. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1076. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1077. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1078. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1079. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1080. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1081. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1082. #define HTT_TX_DESC_TX_COMP_S 31
  1083. /* dword 1 */
  1084. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1085. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1086. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1087. #define HTT_TX_DESC_FRM_LEN_S 0
  1088. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1089. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1090. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1091. #define HTT_TX_DESC_FRM_ID_S 16
  1092. /* dword 2 */
  1093. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1094. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1095. /* for systems using 64-bit format for bus addresses */
  1096. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1097. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1098. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1099. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1100. /* for systems using 32-bit format for bus addresses */
  1101. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1102. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1103. /* dword 3 */
  1104. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1105. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1106. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1107. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1108. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1109. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1110. #if HTT_PADDR64
  1111. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1112. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1113. #else
  1114. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1115. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1116. #endif
  1117. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1118. #define HTT_TX_DESC_PEER_ID_S 0
  1119. /*
  1120. * TEMPORARY:
  1121. * The original definitions for the PEER_ID fields contained typos
  1122. * (with _DESC_PADDR appended to this PEER_ID field name).
  1123. * Retain deprecated original names for PEER_ID fields until all code that
  1124. * refers to them has been updated.
  1125. */
  1126. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1127. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1128. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1129. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1130. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1131. HTT_TX_DESC_PEER_ID_M
  1132. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1133. HTT_TX_DESC_PEER_ID_S
  1134. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1135. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1136. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1137. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1138. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1139. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1140. #if HTT_PADDR64
  1141. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1142. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1143. #else
  1144. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1145. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1146. #endif
  1147. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1148. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1149. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1150. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1151. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1152. do { \
  1153. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1154. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1155. } while (0)
  1156. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1157. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1158. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1159. do { \
  1160. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1161. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1162. } while (0)
  1163. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1164. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1165. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1166. do { \
  1167. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1168. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1169. } while (0)
  1170. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1171. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1172. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1173. do { \
  1174. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1175. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1176. } while (0)
  1177. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1178. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1179. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1180. do { \
  1181. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1182. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1183. } while (0)
  1184. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1185. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1186. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1187. do { \
  1188. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1189. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1190. } while (0)
  1191. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1192. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1193. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1194. do { \
  1195. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1196. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1197. } while (0)
  1198. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1199. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1200. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1201. do { \
  1202. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1203. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1204. } while (0)
  1205. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1206. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1207. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1208. do { \
  1209. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1210. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1211. } while (0)
  1212. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1213. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1214. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1215. do { \
  1216. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1217. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1218. } while (0)
  1219. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1220. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1221. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1222. do { \
  1223. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1224. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1225. } while (0)
  1226. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1227. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1228. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1229. do { \
  1230. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1231. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1232. } while (0)
  1233. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1234. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1235. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1236. do { \
  1237. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1238. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1239. } while (0)
  1240. /* enums used in the HTT tx MSDU extension descriptor */
  1241. enum {
  1242. htt_tx_guard_interval_regular = 0,
  1243. htt_tx_guard_interval_short = 1,
  1244. };
  1245. enum {
  1246. htt_tx_preamble_type_ofdm = 0,
  1247. htt_tx_preamble_type_cck = 1,
  1248. htt_tx_preamble_type_ht = 2,
  1249. htt_tx_preamble_type_vht = 3,
  1250. };
  1251. enum {
  1252. htt_tx_bandwidth_5MHz = 0,
  1253. htt_tx_bandwidth_10MHz = 1,
  1254. htt_tx_bandwidth_20MHz = 2,
  1255. htt_tx_bandwidth_40MHz = 3,
  1256. htt_tx_bandwidth_80MHz = 4,
  1257. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1258. };
  1259. /**
  1260. * @brief HTT tx MSDU extension descriptor
  1261. * @details
  1262. * If the target supports HTT tx MSDU extension descriptors, the host has
  1263. * the option of appending the following struct following the regular
  1264. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1265. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1266. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1267. * tx specs for each frame.
  1268. */
  1269. PREPACK struct htt_tx_msdu_desc_ext_t {
  1270. /* DWORD 0: flags */
  1271. A_UINT32
  1272. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1273. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1274. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1275. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1276. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1277. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1278. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1279. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1280. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1281. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1282. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1283. /* DWORD 1: tx power, tx rate, tx BW */
  1284. A_UINT32
  1285. /* pwr -
  1286. * Specify what power the tx frame needs to be transmitted at.
  1287. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1288. * The value needs to be appropriately sign-extended when extracting
  1289. * the value from the message and storing it in a variable that is
  1290. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1291. * automatically handles this sign-extension.)
  1292. * If the transmission uses multiple tx chains, this power spec is
  1293. * the total transmit power, assuming incoherent combination of
  1294. * per-chain power to produce the total power.
  1295. */
  1296. pwr: 8,
  1297. /* mcs_mask -
  1298. * Specify the allowable values for MCS index (modulation and coding)
  1299. * to use for transmitting the frame.
  1300. *
  1301. * For HT / VHT preamble types, this mask directly corresponds to
  1302. * the HT or VHT MCS indices that are allowed. For each bit N set
  1303. * within the mask, MCS index N is allowed for transmitting the frame.
  1304. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1305. * rates versus OFDM rates, so the host has the option of specifying
  1306. * that the target must transmit the frame with CCK or OFDM rates
  1307. * (not HT or VHT), but leaving the decision to the target whether
  1308. * to use CCK or OFDM.
  1309. *
  1310. * For CCK and OFDM, the bits within this mask are interpreted as
  1311. * follows:
  1312. * bit 0 -> CCK 1 Mbps rate is allowed
  1313. * bit 1 -> CCK 2 Mbps rate is allowed
  1314. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1315. * bit 3 -> CCK 11 Mbps rate is allowed
  1316. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1317. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1318. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1319. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1320. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1321. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1322. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1323. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1324. *
  1325. * The MCS index specification needs to be compatible with the
  1326. * bandwidth mask specification. For example, a MCS index == 9
  1327. * specification is inconsistent with a preamble type == VHT,
  1328. * Nss == 1, and channel bandwidth == 20 MHz.
  1329. *
  1330. * Furthermore, the host has only a limited ability to specify to
  1331. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1332. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1333. */
  1334. mcs_mask: 12,
  1335. /* nss_mask -
  1336. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1337. * Each bit in this mask corresponds to a Nss value:
  1338. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1339. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1340. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1341. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1342. * The values in the Nss mask must be suitable for the recipient, e.g.
  1343. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1344. * recipient which only supports 2x2 MIMO.
  1345. */
  1346. nss_mask: 4,
  1347. /* guard_interval -
  1348. * Specify a htt_tx_guard_interval enum value to indicate whether
  1349. * the transmission should use a regular guard interval or a
  1350. * short guard interval.
  1351. */
  1352. guard_interval: 1,
  1353. /* preamble_type_mask -
  1354. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1355. * may choose from for transmitting this frame.
  1356. * The bits in this mask correspond to the values in the
  1357. * htt_tx_preamble_type enum. For example, to allow the target
  1358. * to transmit the frame as either CCK or OFDM, this field would
  1359. * be set to
  1360. * (1 << htt_tx_preamble_type_ofdm) |
  1361. * (1 << htt_tx_preamble_type_cck)
  1362. */
  1363. preamble_type_mask: 4,
  1364. reserved1_31_29: 3; /* unused, set to 0x0 */
  1365. /* DWORD 2: tx chain mask, tx retries */
  1366. A_UINT32
  1367. /* chain_mask - specify which chains to transmit from */
  1368. chain_mask: 4,
  1369. /* retry_limit -
  1370. * Specify the maximum number of transmissions, including the
  1371. * initial transmission, to attempt before giving up if no ack
  1372. * is received.
  1373. * If the tx rate is specified, then all retries shall use the
  1374. * same rate as the initial transmission.
  1375. * If no tx rate is specified, the target can choose whether to
  1376. * retain the original rate during the retransmissions, or to
  1377. * fall back to a more robust rate.
  1378. */
  1379. retry_limit: 4,
  1380. /* bandwidth_mask -
  1381. * Specify what channel widths may be used for the transmission.
  1382. * A value of zero indicates "don't care" - the target may choose
  1383. * the transmission bandwidth.
  1384. * The bits within this mask correspond to the htt_tx_bandwidth
  1385. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1386. * The bandwidth_mask must be consistent with the preamble_type_mask
  1387. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1388. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1389. */
  1390. bandwidth_mask: 6,
  1391. reserved2_31_14: 18; /* unused, set to 0x0 */
  1392. /* DWORD 3: tx expiry time (TSF) LSBs */
  1393. A_UINT32 expire_tsf_lo;
  1394. /* DWORD 4: tx expiry time (TSF) MSBs */
  1395. A_UINT32 expire_tsf_hi;
  1396. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1397. } POSTPACK;
  1398. /* DWORD 0 */
  1399. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1400. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1401. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1402. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1403. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1404. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1405. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1406. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1407. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1408. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1409. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1419. /* DWORD 1 */
  1420. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1421. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1422. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1423. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1424. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1425. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1426. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1427. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1428. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1429. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1430. /* DWORD 2 */
  1431. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1432. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1433. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1434. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1435. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1436. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1437. /* DWORD 0 */
  1438. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1439. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1440. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1441. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1442. do { \
  1443. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1444. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1445. } while (0)
  1446. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1447. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1448. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1449. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1450. do { \
  1451. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1452. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1453. } while (0)
  1454. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1455. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1456. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1457. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1458. do { \
  1459. HTT_CHECK_SET_VAL( \
  1460. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1461. ((_var) |= ((_val) \
  1462. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1463. } while (0)
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1465. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1466. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1467. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1468. do { \
  1469. HTT_CHECK_SET_VAL( \
  1470. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1471. ((_var) |= ((_val) \
  1472. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1473. } while (0)
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1475. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1476. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1478. do { \
  1479. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1480. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1481. } while (0)
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1483. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1484. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1486. do { \
  1487. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1488. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1489. } while (0)
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1491. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1492. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1494. do { \
  1495. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1496. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1497. } while (0)
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1499. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1500. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1502. do { \
  1503. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1504. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1505. } while (0)
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1507. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1508. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1510. do { \
  1511. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1512. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1513. } while (0)
  1514. /* DWORD 1 */
  1515. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1516. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1517. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1518. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1519. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1520. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1521. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1522. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1523. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1524. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1525. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1526. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1527. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1528. do { \
  1529. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1530. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1531. } while (0)
  1532. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1533. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1534. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1535. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1536. do { \
  1537. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1538. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1539. } while (0)
  1540. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1541. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1542. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1543. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1544. do { \
  1545. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1546. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1547. } while (0)
  1548. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1549. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1550. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1551. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1552. do { \
  1553. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1554. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1555. } while (0)
  1556. /* DWORD 2 */
  1557. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1558. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1559. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1560. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1561. do { \
  1562. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1563. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1564. } while (0)
  1565. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1566. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1567. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1568. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1569. do { \
  1570. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1571. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1572. } while (0)
  1573. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1574. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1575. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1576. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1577. do { \
  1578. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1579. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1580. } while (0)
  1581. typedef enum {
  1582. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1583. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1584. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1585. } htt_11ax_ltf_subtype_t;
  1586. typedef enum {
  1587. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1588. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1589. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1590. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1591. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1592. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1593. } htt_tx_ext2_preamble_type_t;
  1594. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1596. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1597. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1598. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1599. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1600. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1606. /**
  1607. * @brief HTT tx MSDU extension descriptor v2
  1608. * @details
  1609. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1610. * is received as tcl_exit_base->host_meta_info in firmware.
  1611. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1612. * are already part of tcl_exit_base.
  1613. */
  1614. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1615. /* DWORD 0: flags */
  1616. A_UINT32
  1617. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1618. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1619. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1620. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1621. valid_retries : 1, /* if set, tx retries spec is valid */
  1622. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1623. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1624. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1625. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1626. valid_key_flags : 1, /* if set, key flags is valid */
  1627. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1628. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1629. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1630. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1631. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1632. 1 = ENCRYPT,
  1633. 2 ~ 3 - Reserved */
  1634. /* retry_limit -
  1635. * Specify the maximum number of transmissions, including the
  1636. * initial transmission, to attempt before giving up if no ack
  1637. * is received.
  1638. * If the tx rate is specified, then all retries shall use the
  1639. * same rate as the initial transmission.
  1640. * If no tx rate is specified, the target can choose whether to
  1641. * retain the original rate during the retransmissions, or to
  1642. * fall back to a more robust rate.
  1643. */
  1644. retry_limit : 4,
  1645. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1646. * Valid only for 11ax preamble types HE_SU
  1647. * and HE_EXT_SU
  1648. */
  1649. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1650. * Valid only for 11ax preamble types HE_SU
  1651. * and HE_EXT_SU
  1652. */
  1653. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1654. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1655. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1656. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1657. */
  1658. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1659. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1660. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1661. * Use cases:
  1662. * Any time firmware uses TQM-BYPASS for Data
  1663. * TID, firmware expect host to set this bit.
  1664. */
  1665. /* DWORD 1: tx power, tx rate */
  1666. A_UINT32
  1667. power : 8, /* unit of the power field is 0.5 dbm
  1668. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1669. * signed value ranging from -64dbm to 63.5 dbm
  1670. */
  1671. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1672. * Setting more than one MCS isn't currently
  1673. * supported by the target (but is supported
  1674. * in the interface in case in the future
  1675. * the target supports specifications of
  1676. * a limited set of MCS values.
  1677. */
  1678. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1679. * Setting more than one Nss isn't currently
  1680. * supported by the target (but is supported
  1681. * in the interface in case in the future
  1682. * the target supports specifications of
  1683. * a limited set of Nss values.
  1684. */
  1685. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1686. update_peer_cache : 1; /* When set these custom values will be
  1687. * used for all packets, until the next
  1688. * update via this ext header.
  1689. * This is to make sure not all packets
  1690. * need to include this header.
  1691. */
  1692. /* DWORD 2: tx chain mask, tx retries */
  1693. A_UINT32
  1694. /* chain_mask - specify which chains to transmit from */
  1695. chain_mask : 8,
  1696. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1697. * TODO: Update Enum values for key_flags
  1698. */
  1699. /*
  1700. * Channel frequency: This identifies the desired channel
  1701. * frequency (in MHz) for tx frames. This is used by FW to help
  1702. * determine when it is safe to transmit or drop frames for
  1703. * off-channel operation.
  1704. * The default value of zero indicates to FW that the corresponding
  1705. * VDEV's home channel (if there is one) is the desired channel
  1706. * frequency.
  1707. */
  1708. chanfreq : 16;
  1709. /* DWORD 3: tx expiry time (TSF) LSBs */
  1710. A_UINT32 expire_tsf_lo;
  1711. /* DWORD 4: tx expiry time (TSF) MSBs */
  1712. A_UINT32 expire_tsf_hi;
  1713. /* DWORD 5: flags to control routing / processing of the MSDU */
  1714. A_UINT32
  1715. /* learning_frame
  1716. * When this flag is set, this frame will be dropped by FW
  1717. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1718. */
  1719. learning_frame : 1,
  1720. /* send_as_standalone
  1721. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1722. * i.e. with no A-MSDU or A-MPDU aggregation.
  1723. * The scope is extended to other use-cases.
  1724. */
  1725. send_as_standalone : 1,
  1726. /* is_host_opaque_valid
  1727. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1728. * with valid information.
  1729. */
  1730. is_host_opaque_valid : 1,
  1731. rsvd0 : 29;
  1732. /* DWORD 6 : Host opaque cookie for special frames */
  1733. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1734. rsvd1 : 16;
  1735. /*
  1736. * This structure can be expanded further up to 40 bytes
  1737. * by adding further DWORDs as needed.
  1738. */
  1739. } POSTPACK;
  1740. /* DWORD 0 */
  1741. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1742. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1743. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1744. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1745. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1746. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1747. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1749. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1750. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1767. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1768. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1769. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1770. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1771. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1772. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1773. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1774. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1775. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1776. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1777. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1778. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1779. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1780. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1781. /* DWORD 1 */
  1782. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1783. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1784. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1785. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1786. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1787. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1788. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1789. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1790. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1791. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1792. /* DWORD 2 */
  1793. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1794. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1795. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1796. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1797. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1798. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1799. /* DWORD 5 */
  1800. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1801. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1802. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1803. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1804. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1805. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1806. /* DWORD 6 */
  1807. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1808. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1809. /* DWORD 0 */
  1810. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1817. } while (0)
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1825. } while (0)
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1827. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1828. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1833. } while (0)
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1835. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1836. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1838. do { \
  1839. HTT_CHECK_SET_VAL( \
  1840. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1841. ((_var) |= ((_val) \
  1842. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1843. } while (0)
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1845. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1846. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1848. do { \
  1849. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1850. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1851. } while (0)
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1853. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1854. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1856. do { \
  1857. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1858. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1859. } while (0)
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1861. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1862. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL( \
  1866. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1867. ((_var) |= ((_val) \
  1868. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1869. } while (0)
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1871. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1872. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1874. do { \
  1875. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1876. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1877. } while (0)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1879. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1880. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1882. do { \
  1883. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1884. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1885. } while (0)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1887. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1888. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1890. do { \
  1891. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1892. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1893. } while (0)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1895. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1896. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1898. do { \
  1899. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1900. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1901. } while (0)
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1903. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1904. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1906. do { \
  1907. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1908. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1909. } while (0)
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1911. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1912. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1914. do { \
  1915. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1916. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1917. } while (0)
  1918. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1919. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1920. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1921. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1922. do { \
  1923. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1924. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1925. } while (0)
  1926. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1927. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1928. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1929. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1930. do { \
  1931. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1932. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1933. } while (0)
  1934. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1935. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1936. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1937. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1938. do { \
  1939. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1940. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1941. } while (0)
  1942. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1943. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1944. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1945. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1948. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1973. } while (0)
  1974. /* DWORD 1 */
  1975. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1979. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1980. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1981. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1982. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1983. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1984. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1990. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1991. } while (0)
  1992. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1998. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1999. } while (0)
  2000. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2001. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2002. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2003. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2007. } while (0)
  2008. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2009. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2010. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2011. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2015. } while (0)
  2016. /* DWORD 2 */
  2017. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2018. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2019. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2020. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2024. } while (0)
  2025. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2026. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2027. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2028. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2032. } while (0)
  2033. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2034. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2035. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2036. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2040. } while (0)
  2041. /* DWORD 5 */
  2042. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2043. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2044. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2045. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2046. do { \
  2047. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2048. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2049. } while (0)
  2050. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2051. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2052. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2053. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2054. do { \
  2055. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2056. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2057. } while (0)
  2058. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2059. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2060. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2061. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2062. do { \
  2063. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2064. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2065. } while (0)
  2066. /* DWORD 6 */
  2067. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2074. } while (0)
  2075. typedef enum {
  2076. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2077. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2078. } htt_tcl_metadata_type;
  2079. /**
  2080. * @brief HTT TCL command number format
  2081. * @details
  2082. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2083. * available to firmware as tcl_exit_base->tcl_status_number.
  2084. * For regular / multicast packets host will send vdev and mac id and for
  2085. * NAWDS packets, host will send peer id.
  2086. * A_UINT32 is used to avoid endianness conversion problems.
  2087. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2088. */
  2089. typedef struct {
  2090. A_UINT32
  2091. type: 1, /* vdev_id based or peer_id based */
  2092. rsvd: 31;
  2093. } htt_tx_tcl_vdev_or_peer_t;
  2094. typedef struct {
  2095. A_UINT32
  2096. type: 1, /* vdev_id based or peer_id based */
  2097. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2098. vdev_id: 8,
  2099. pdev_id: 2,
  2100. host_inspected:1,
  2101. rsvd: 19;
  2102. } htt_tx_tcl_vdev_metadata;
  2103. typedef struct {
  2104. A_UINT32
  2105. type: 1, /* vdev_id based or peer_id based */
  2106. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2107. peer_id: 14,
  2108. rsvd: 16;
  2109. } htt_tx_tcl_peer_metadata;
  2110. PREPACK struct htt_tx_tcl_metadata {
  2111. union {
  2112. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2113. htt_tx_tcl_vdev_metadata vdev_meta;
  2114. htt_tx_tcl_peer_metadata peer_meta;
  2115. };
  2116. } POSTPACK;
  2117. /* DWORD 0 */
  2118. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2119. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2120. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2121. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2122. /* VDEV metadata */
  2123. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2124. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2125. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2126. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2127. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2128. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2129. /* PEER metadata */
  2130. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2131. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2132. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2133. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2134. HTT_TX_TCL_METADATA_TYPE_S)
  2135. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2139. } while (0)
  2140. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2141. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2142. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2143. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2146. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2147. } while (0)
  2148. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2149. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2150. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2151. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2155. } while (0)
  2156. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2157. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2158. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2159. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2163. } while (0)
  2164. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2165. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2166. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2167. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2171. } while (0)
  2172. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2173. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2174. HTT_TX_TCL_METADATA_PEER_ID_S)
  2175. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2179. } while (0)
  2180. typedef enum {
  2181. HTT_TX_FW2WBM_TX_STATUS_OK,
  2182. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2183. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2184. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2185. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2186. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2187. HTT_TX_FW2WBM_TX_STATUS_MAX
  2188. } htt_tx_fw2wbm_tx_status_t;
  2189. typedef enum {
  2190. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2191. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2192. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2193. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2194. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2195. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2196. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2197. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2198. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2199. } htt_tx_fw2wbm_reinject_reason_t;
  2200. /**
  2201. * @brief HTT TX WBM Completion from firmware to host
  2202. * @details
  2203. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2204. * DWORD 3 and 4 for software based completions (Exception frames and
  2205. * TQM bypass frames)
  2206. * For software based completions, wbm_release_ring->release_source_module will
  2207. * be set to release_source_fw
  2208. */
  2209. PREPACK struct htt_tx_wbm_completion {
  2210. A_UINT32
  2211. sch_cmd_id: 24,
  2212. exception_frame: 1, /* If set, this packet was queued via exception path */
  2213. rsvd0_31_25: 7;
  2214. A_UINT32
  2215. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2216. * reception of an ACK or BA, this field indicates
  2217. * the RSSI of the received ACK or BA frame.
  2218. * When the frame is removed as result of a direct
  2219. * remove command from the SW, this field is set
  2220. * to 0x0 (which is never a valid value when real
  2221. * RSSI is available).
  2222. * Units: dB w.r.t noise floor
  2223. */
  2224. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2225. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2226. rsvd1_31_16: 16;
  2227. } POSTPACK;
  2228. /* DWORD 0 */
  2229. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2230. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2231. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2232. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2233. /* DWORD 1 */
  2234. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2235. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2236. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2237. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2238. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2239. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2240. /* DWORD 0 */
  2241. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2242. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2243. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2244. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2247. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2248. } while (0)
  2249. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2250. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2251. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2252. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2256. } while (0)
  2257. /* DWORD 1 */
  2258. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2259. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2260. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2261. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2265. } while (0)
  2266. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2267. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2268. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2269. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2273. } while (0)
  2274. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2276. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2277. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2281. } while (0)
  2282. /**
  2283. * @brief HTT TX WBM Completion from firmware to host
  2284. * @details
  2285. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2286. * (WBM) offload HW.
  2287. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2288. * For software based completions, release_source_module will
  2289. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2290. * struct wbm_release_ring and then switch to this after looking at
  2291. * release_source_module.
  2292. */
  2293. PREPACK struct htt_tx_wbm_completion_v2 {
  2294. A_UINT32
  2295. used_by_hw0; /* Refer to struct wbm_release_ring */
  2296. A_UINT32
  2297. used_by_hw1; /* Refer to struct wbm_release_ring */
  2298. A_UINT32
  2299. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2300. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2301. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2302. exception_frame: 1,
  2303. rsvd0: 12, /* For future use */
  2304. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2305. rsvd1: 1; /* For future use */
  2306. A_UINT32
  2307. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2308. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2309. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2310. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2311. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2312. */
  2313. A_UINT32
  2314. data1: 32;
  2315. A_UINT32
  2316. data2: 32;
  2317. A_UINT32
  2318. used_by_hw3; /* Refer to struct wbm_release_ring */
  2319. } POSTPACK;
  2320. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2321. /* DWORD 3 */
  2322. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2323. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2324. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2325. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2326. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2327. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2328. /* DWORD 3 */
  2329. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2330. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2331. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2332. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2333. do { \
  2334. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2335. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2336. } while (0)
  2337. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2338. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2339. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2340. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2343. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2344. } while (0)
  2345. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2346. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2347. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2348. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2352. } while (0)
  2353. /**
  2354. * @brief HTT TX WBM transmit status from firmware to host
  2355. * @details
  2356. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2357. * (WBM) offload HW.
  2358. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2359. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2360. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2361. */
  2362. PREPACK struct htt_tx_wbm_transmit_status {
  2363. A_UINT32
  2364. sch_cmd_id: 24,
  2365. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2366. * reception of an ACK or BA, this field indicates
  2367. * the RSSI of the received ACK or BA frame.
  2368. * When the frame is removed as result of a direct
  2369. * remove command from the SW, this field is set
  2370. * to 0x0 (which is never a valid value when real
  2371. * RSSI is available).
  2372. * Units: dB w.r.t noise floor
  2373. */
  2374. A_UINT32
  2375. sw_peer_id: 16,
  2376. tid_num: 5,
  2377. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2378. * and tid_num fields contain valid data.
  2379. * If this "valid" flag is not set, the
  2380. * sw_peer_id and tid_num fields must be ignored.
  2381. */
  2382. mcast: 1,
  2383. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2384. * contains valid data.
  2385. */
  2386. reserved0: 8;
  2387. A_UINT32
  2388. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2389. * packets in the wbm completion path
  2390. */
  2391. } POSTPACK;
  2392. /* DWORD 4 */
  2393. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2394. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2395. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2396. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2397. /* DWORD 5 */
  2398. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2399. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2400. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2401. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2402. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2403. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2404. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2405. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2406. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2407. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2408. /* DWORD 4 */
  2409. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2410. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2411. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2412. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2413. do { \
  2414. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2415. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2416. } while (0)
  2417. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2418. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2419. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2420. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2424. } while (0)
  2425. /* DWORD 5 */
  2426. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2427. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2428. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2429. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2430. do { \
  2431. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2432. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2433. } while (0)
  2434. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2435. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2436. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2437. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2440. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2441. } while (0)
  2442. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2443. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2444. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2445. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2448. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2449. } while (0)
  2450. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2451. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2452. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2453. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2457. } while (0)
  2458. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2459. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2460. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2461. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2464. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2465. } while (0)
  2466. /**
  2467. * @brief HTT TX WBM reinject status from firmware to host
  2468. * @details
  2469. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2470. * (WBM) offload HW.
  2471. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2472. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2473. */
  2474. PREPACK struct htt_tx_wbm_reinject_status {
  2475. A_UINT32
  2476. reserved0: 32;
  2477. A_UINT32
  2478. reserved1: 32;
  2479. A_UINT32
  2480. reserved2: 32;
  2481. } POSTPACK;
  2482. /**
  2483. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2484. * @details
  2485. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2486. * (WBM) offload HW.
  2487. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2488. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2489. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2490. * STA side.
  2491. */
  2492. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2493. A_UINT32
  2494. mec_sa_addr_31_0;
  2495. A_UINT32
  2496. mec_sa_addr_47_32: 16,
  2497. sa_ast_index: 16;
  2498. A_UINT32
  2499. vdev_id: 8,
  2500. reserved0: 24;
  2501. } POSTPACK;
  2502. /* DWORD 4 - mec_sa_addr_31_0 */
  2503. /* DWORD 5 */
  2504. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2505. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2506. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2507. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2508. /* DWORD 6 */
  2509. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2510. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2511. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2512. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2513. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2514. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2515. do { \
  2516. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2517. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2518. } while (0)
  2519. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2520. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2521. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2522. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2523. do { \
  2524. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2525. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2526. } while (0)
  2527. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2528. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2529. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2530. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2531. do { \
  2532. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2533. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2534. } while (0)
  2535. typedef enum {
  2536. TX_FLOW_PRIORITY_BE,
  2537. TX_FLOW_PRIORITY_HIGH,
  2538. TX_FLOW_PRIORITY_LOW,
  2539. } htt_tx_flow_priority_t;
  2540. typedef enum {
  2541. TX_FLOW_LATENCY_SENSITIVE,
  2542. TX_FLOW_LATENCY_INSENSITIVE,
  2543. } htt_tx_flow_latency_t;
  2544. typedef enum {
  2545. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2546. TX_FLOW_INTERACTIVE_TRAFFIC,
  2547. TX_FLOW_PERIODIC_TRAFFIC,
  2548. TX_FLOW_BURSTY_TRAFFIC,
  2549. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2550. } htt_tx_flow_traffic_pattern_t;
  2551. /**
  2552. * @brief HTT TX Flow search metadata format
  2553. * @details
  2554. * Host will set this metadata in flow table's flow search entry along with
  2555. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2556. * firmware and TQM ring if the flow search entry wins.
  2557. * This metadata is available to firmware in that first MSDU's
  2558. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2559. * to one of the available flows for specific tid and returns the tqm flow
  2560. * pointer as part of htt_tx_map_flow_info message.
  2561. */
  2562. PREPACK struct htt_tx_flow_metadata {
  2563. A_UINT32
  2564. rsvd0_1_0: 2,
  2565. tid: 4,
  2566. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2567. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2568. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2569. * Else choose final tid based on latency, priority.
  2570. */
  2571. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2572. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2573. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2574. } POSTPACK;
  2575. /* DWORD 0 */
  2576. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2577. #define HTT_TX_FLOW_METADATA_TID_S 2
  2578. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2579. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2580. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2581. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2582. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2583. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2584. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2585. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2586. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2587. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2588. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2589. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2590. /* DWORD 0 */
  2591. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2592. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2593. HTT_TX_FLOW_METADATA_TID_S)
  2594. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2595. do { \
  2596. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2597. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2598. } while (0)
  2599. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2600. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2601. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2602. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2603. do { \
  2604. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2605. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2606. } while (0)
  2607. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2608. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2609. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2610. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2611. do { \
  2612. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2613. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2614. } while (0)
  2615. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2616. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2617. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2618. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2619. do { \
  2620. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2621. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2622. } while (0)
  2623. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2624. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2625. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2626. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2627. do { \
  2628. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2629. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2630. } while (0)
  2631. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2632. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2633. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2634. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2635. do { \
  2636. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2637. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2638. } while (0)
  2639. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2640. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2641. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2642. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2643. do { \
  2644. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2645. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2646. } while (0)
  2647. /**
  2648. * @brief host -> target ADD WDS Entry
  2649. *
  2650. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2651. *
  2652. * @brief host -> target DELETE WDS Entry
  2653. *
  2654. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2655. *
  2656. * @details
  2657. * HTT wds entry from source port learning
  2658. * Host will learn wds entries from rx and send this message to firmware
  2659. * to enable firmware to configure/delete AST entries for wds clients.
  2660. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2661. * and when SA's entry is deleted, firmware removes this AST entry
  2662. *
  2663. * The message would appear as follows:
  2664. *
  2665. * |31 30|29 |17 16|15 8|7 0|
  2666. * |----------------+----------------+----------------+----------------|
  2667. * | rsvd0 |PDVID| vdev_id | msg_type |
  2668. * |-------------------------------------------------------------------|
  2669. * | sa_addr_31_0 |
  2670. * |-------------------------------------------------------------------|
  2671. * | | ta_peer_id | sa_addr_47_32 |
  2672. * |-------------------------------------------------------------------|
  2673. * Where PDVID = pdev_id
  2674. *
  2675. * The message is interpreted as follows:
  2676. *
  2677. * dword0 - b'0:7 - msg_type: This will be set to
  2678. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2679. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2680. *
  2681. * dword0 - b'8:15 - vdev_id
  2682. *
  2683. * dword0 - b'16:17 - pdev_id
  2684. *
  2685. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2686. *
  2687. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2688. *
  2689. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2690. *
  2691. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2692. */
  2693. PREPACK struct htt_wds_entry {
  2694. A_UINT32
  2695. msg_type: 8,
  2696. vdev_id: 8,
  2697. pdev_id: 2,
  2698. rsvd0: 14;
  2699. A_UINT32 sa_addr_31_0;
  2700. A_UINT32
  2701. sa_addr_47_32: 16,
  2702. ta_peer_id: 14,
  2703. rsvd2: 2;
  2704. } POSTPACK;
  2705. /* DWORD 0 */
  2706. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2707. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2708. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2709. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2710. /* DWORD 2 */
  2711. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2712. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2713. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2714. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2715. /* DWORD 0 */
  2716. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2717. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2718. HTT_WDS_ENTRY_VDEV_ID_S)
  2719. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2722. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2723. } while (0)
  2724. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2725. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2726. HTT_WDS_ENTRY_PDEV_ID_S)
  2727. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2728. do { \
  2729. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2730. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2731. } while (0)
  2732. /* DWORD 2 */
  2733. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2734. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2735. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2736. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2737. do { \
  2738. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2739. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2740. } while (0)
  2741. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2742. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2743. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2744. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2747. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2748. } while (0)
  2749. /**
  2750. * @brief MAC DMA rx ring setup specification
  2751. *
  2752. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2753. *
  2754. * @details
  2755. * To allow for dynamic rx ring reconfiguration and to avoid race
  2756. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2757. * it uses. Instead, it sends this message to the target, indicating how
  2758. * the rx ring used by the host should be set up and maintained.
  2759. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2760. * specifications.
  2761. *
  2762. * |31 16|15 8|7 0|
  2763. * |---------------------------------------------------------------|
  2764. * header: | reserved | num rings | msg type |
  2765. * |---------------------------------------------------------------|
  2766. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2767. #if HTT_PADDR64
  2768. * | FW_IDX shadow register physical address (bits 63:32) |
  2769. #endif
  2770. * |---------------------------------------------------------------|
  2771. * | rx ring base physical address (bits 31:0) |
  2772. #if HTT_PADDR64
  2773. * | rx ring base physical address (bits 63:32) |
  2774. #endif
  2775. * |---------------------------------------------------------------|
  2776. * | rx ring buffer size | rx ring length |
  2777. * |---------------------------------------------------------------|
  2778. * | FW_IDX initial value | enabled flags |
  2779. * |---------------------------------------------------------------|
  2780. * | MSDU payload offset | 802.11 header offset |
  2781. * |---------------------------------------------------------------|
  2782. * | PPDU end offset | PPDU start offset |
  2783. * |---------------------------------------------------------------|
  2784. * | MPDU end offset | MPDU start offset |
  2785. * |---------------------------------------------------------------|
  2786. * | MSDU end offset | MSDU start offset |
  2787. * |---------------------------------------------------------------|
  2788. * | frag info offset | rx attention offset |
  2789. * |---------------------------------------------------------------|
  2790. * payload 2, if present, has the same format as payload 1
  2791. * Header fields:
  2792. * - MSG_TYPE
  2793. * Bits 7:0
  2794. * Purpose: identifies this as an rx ring configuration message
  2795. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2796. * - NUM_RINGS
  2797. * Bits 15:8
  2798. * Purpose: indicates whether the host is setting up one rx ring or two
  2799. * Value: 1 or 2
  2800. * Payload:
  2801. * for systems using 64-bit format for bus addresses:
  2802. * - IDX_SHADOW_REG_PADDR_LO
  2803. * Bits 31:0
  2804. * Value: lower 4 bytes of physical address of the host's
  2805. * FW_IDX shadow register
  2806. * - IDX_SHADOW_REG_PADDR_HI
  2807. * Bits 31:0
  2808. * Value: upper 4 bytes of physical address of the host's
  2809. * FW_IDX shadow register
  2810. * - RING_BASE_PADDR_LO
  2811. * Bits 31:0
  2812. * Value: lower 4 bytes of physical address of the host's rx ring
  2813. * - RING_BASE_PADDR_HI
  2814. * Bits 31:0
  2815. * Value: uppper 4 bytes of physical address of the host's rx ring
  2816. * for systems using 32-bit format for bus addresses:
  2817. * - IDX_SHADOW_REG_PADDR
  2818. * Bits 31:0
  2819. * Value: physical address of the host's FW_IDX shadow register
  2820. * - RING_BASE_PADDR
  2821. * Bits 31:0
  2822. * Value: physical address of the host's rx ring
  2823. * - RING_LEN
  2824. * Bits 15:0
  2825. * Value: number of elements in the rx ring
  2826. * - RING_BUF_SZ
  2827. * Bits 31:16
  2828. * Value: size of the buffers referenced by the rx ring, in byte units
  2829. * - ENABLED_FLAGS
  2830. * Bits 15:0
  2831. * Value: 1-bit flags to show whether different rx fields are enabled
  2832. * bit 0: 802.11 header enabled (1) or disabled (0)
  2833. * bit 1: MSDU payload enabled (1) or disabled (0)
  2834. * bit 2: PPDU start enabled (1) or disabled (0)
  2835. * bit 3: PPDU end enabled (1) or disabled (0)
  2836. * bit 4: MPDU start enabled (1) or disabled (0)
  2837. * bit 5: MPDU end enabled (1) or disabled (0)
  2838. * bit 6: MSDU start enabled (1) or disabled (0)
  2839. * bit 7: MSDU end enabled (1) or disabled (0)
  2840. * bit 8: rx attention enabled (1) or disabled (0)
  2841. * bit 9: frag info enabled (1) or disabled (0)
  2842. * bit 10: unicast rx enabled (1) or disabled (0)
  2843. * bit 11: multicast rx enabled (1) or disabled (0)
  2844. * bit 12: ctrl rx enabled (1) or disabled (0)
  2845. * bit 13: mgmt rx enabled (1) or disabled (0)
  2846. * bit 14: null rx enabled (1) or disabled (0)
  2847. * bit 15: phy data rx enabled (1) or disabled (0)
  2848. * - IDX_INIT_VAL
  2849. * Bits 31:16
  2850. * Purpose: Specify the initial value for the FW_IDX.
  2851. * Value: the number of buffers initially present in the host's rx ring
  2852. * - OFFSET_802_11_HDR
  2853. * Bits 15:0
  2854. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2855. * - OFFSET_MSDU_PAYLOAD
  2856. * Bits 31:16
  2857. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2858. * - OFFSET_PPDU_START
  2859. * Bits 15:0
  2860. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2861. * - OFFSET_PPDU_END
  2862. * Bits 31:16
  2863. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2864. * - OFFSET_MPDU_START
  2865. * Bits 15:0
  2866. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2867. * - OFFSET_MPDU_END
  2868. * Bits 31:16
  2869. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2870. * - OFFSET_MSDU_START
  2871. * Bits 15:0
  2872. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2873. * - OFFSET_MSDU_END
  2874. * Bits 31:16
  2875. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2876. * - OFFSET_RX_ATTN
  2877. * Bits 15:0
  2878. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2879. * - OFFSET_FRAG_INFO
  2880. * Bits 31:16
  2881. * Value: offset in QUAD-bytes of frag info table
  2882. */
  2883. /* header fields */
  2884. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2885. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2886. /* payload fields */
  2887. /* for systems using a 64-bit format for bus addresses */
  2888. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2889. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2890. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2891. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2892. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2893. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2894. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2895. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2896. /* for systems using a 32-bit format for bus addresses */
  2897. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2898. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2899. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2900. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2901. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2902. #define HTT_RX_RING_CFG_LEN_S 0
  2903. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2904. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2905. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2906. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2907. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2908. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2909. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2910. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2911. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2912. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2913. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2914. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2915. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2916. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2917. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2918. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2919. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2920. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2921. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2922. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2923. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2924. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2925. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2926. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2927. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2928. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2929. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2930. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2931. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2932. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2933. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2934. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2935. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2936. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2937. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2938. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2939. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2940. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2941. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2943. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2944. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2945. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2946. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2947. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2948. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2949. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2950. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2951. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2952. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2954. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2955. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2956. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2957. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2958. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2959. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2960. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2961. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2962. #if HTT_PADDR64
  2963. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2964. #else
  2965. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2966. #endif
  2967. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2968. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2969. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2970. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2971. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2974. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2975. } while (0)
  2976. /* degenerate case for 32-bit fields */
  2977. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2978. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2979. ((_var) = (_val))
  2980. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2981. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2982. ((_var) = (_val))
  2983. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2984. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2985. ((_var) = (_val))
  2986. /* degenerate case for 32-bit fields */
  2987. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2988. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2989. ((_var) = (_val))
  2990. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2991. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2992. ((_var) = (_val))
  2993. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2994. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2995. ((_var) = (_val))
  2996. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2997. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2998. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3001. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3002. } while (0)
  3003. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3004. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3005. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3008. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3009. } while (0)
  3010. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3011. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3012. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3013. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3014. do { \
  3015. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3016. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3017. } while (0)
  3018. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3019. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3020. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3021. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3024. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3025. } while (0)
  3026. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3027. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3028. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3029. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3032. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3033. } while (0)
  3034. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3035. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3036. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3037. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3040. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3041. } while (0)
  3042. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3043. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3044. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3045. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3048. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3049. } while (0)
  3050. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3051. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3052. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3053. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3054. do { \
  3055. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3056. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3057. } while (0)
  3058. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3059. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3060. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3061. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3062. do { \
  3063. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3064. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3065. } while (0)
  3066. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3067. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3068. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3069. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3070. do { \
  3071. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3072. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3073. } while (0)
  3074. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3075. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3076. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3077. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3078. do { \
  3079. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3080. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3081. } while (0)
  3082. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3083. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3084. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3085. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3086. do { \
  3087. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3088. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3089. } while (0)
  3090. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3091. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3092. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3093. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3094. do { \
  3095. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3096. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3097. } while (0)
  3098. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3099. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3100. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3101. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3102. do { \
  3103. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3104. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3105. } while (0)
  3106. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3107. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3108. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3109. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3110. do { \
  3111. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3112. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3113. } while (0)
  3114. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3115. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3116. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3117. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3118. do { \
  3119. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3120. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3121. } while (0)
  3122. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3123. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3124. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3125. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3126. do { \
  3127. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3128. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3129. } while (0)
  3130. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3131. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3132. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3133. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3134. do { \
  3135. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3136. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3137. } while (0)
  3138. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3139. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3140. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3141. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3142. do { \
  3143. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3144. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3145. } while (0)
  3146. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3147. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3148. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3149. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3150. do { \
  3151. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3152. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3153. } while (0)
  3154. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3155. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3156. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3157. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3158. do { \
  3159. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3160. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3161. } while (0)
  3162. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3163. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3164. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3165. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3166. do { \
  3167. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3168. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3169. } while (0)
  3170. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3171. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3172. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3173. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3176. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3177. } while (0)
  3178. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3179. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3180. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3181. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3182. do { \
  3183. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3184. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3185. } while (0)
  3186. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3187. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3188. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3189. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3190. do { \
  3191. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3192. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3193. } while (0)
  3194. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3195. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3196. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3197. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3198. do { \
  3199. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3200. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3201. } while (0)
  3202. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3203. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3204. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3205. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3206. do { \
  3207. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3208. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3209. } while (0)
  3210. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3211. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3212. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3213. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3214. do { \
  3215. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3216. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3217. } while (0)
  3218. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3219. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3220. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3221. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3222. do { \
  3223. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3224. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3225. } while (0)
  3226. /**
  3227. * @brief host -> target FW statistics retrieve
  3228. *
  3229. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3230. *
  3231. * @details
  3232. * The following field definitions describe the format of the HTT host
  3233. * to target FW stats retrieve message. The message specifies the type of
  3234. * stats host wants to retrieve.
  3235. *
  3236. * |31 24|23 16|15 8|7 0|
  3237. * |-----------------------------------------------------------|
  3238. * | stats types request bitmask | msg type |
  3239. * |-----------------------------------------------------------|
  3240. * | stats types reset bitmask | reserved |
  3241. * |-----------------------------------------------------------|
  3242. * | stats type | config value |
  3243. * |-----------------------------------------------------------|
  3244. * | cookie LSBs |
  3245. * |-----------------------------------------------------------|
  3246. * | cookie MSBs |
  3247. * |-----------------------------------------------------------|
  3248. * Header fields:
  3249. * - MSG_TYPE
  3250. * Bits 7:0
  3251. * Purpose: identifies this is a stats upload request message
  3252. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3253. * - UPLOAD_TYPES
  3254. * Bits 31:8
  3255. * Purpose: identifies which types of FW statistics to upload
  3256. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3257. * - RESET_TYPES
  3258. * Bits 31:8
  3259. * Purpose: identifies which types of FW statistics to reset
  3260. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3261. * - CFG_VAL
  3262. * Bits 23:0
  3263. * Purpose: give an opaque configuration value to the specified stats type
  3264. * Value: stats-type specific configuration value
  3265. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3266. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3267. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3268. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3269. * - CFG_STAT_TYPE
  3270. * Bits 31:24
  3271. * Purpose: specify which stats type (if any) the config value applies to
  3272. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3273. * a valid configuration specification
  3274. * - COOKIE_LSBS
  3275. * Bits 31:0
  3276. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3277. * message with its preceding host->target stats request message.
  3278. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3279. * - COOKIE_MSBS
  3280. * Bits 31:0
  3281. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3282. * message with its preceding host->target stats request message.
  3283. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3284. */
  3285. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3286. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3287. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3288. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3289. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3290. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3291. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3292. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3293. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3294. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3295. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3296. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3297. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3298. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3299. do { \
  3300. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3301. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3302. } while (0)
  3303. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3304. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3305. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3306. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3307. do { \
  3308. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3309. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3310. } while (0)
  3311. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3312. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3313. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3314. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3315. do { \
  3316. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3317. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3318. } while (0)
  3319. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3320. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3321. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3322. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3323. do { \
  3324. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3325. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3326. } while (0)
  3327. /**
  3328. * @brief host -> target HTT out-of-band sync request
  3329. *
  3330. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3331. *
  3332. * @details
  3333. * The HTT SYNC tells the target to suspend processing of subsequent
  3334. * HTT host-to-target messages until some other target agent locally
  3335. * informs the target HTT FW that the current sync counter is equal to
  3336. * or greater than (in a modulo sense) the sync counter specified in
  3337. * the SYNC message.
  3338. * This allows other host-target components to synchronize their operation
  3339. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3340. * security key has been downloaded to and activated by the target.
  3341. * In the absence of any explicit synchronization counter value
  3342. * specification, the target HTT FW will use zero as the default current
  3343. * sync value.
  3344. *
  3345. * |31 24|23 16|15 8|7 0|
  3346. * |-----------------------------------------------------------|
  3347. * | reserved | sync count | msg type |
  3348. * |-----------------------------------------------------------|
  3349. * Header fields:
  3350. * - MSG_TYPE
  3351. * Bits 7:0
  3352. * Purpose: identifies this as a sync message
  3353. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3354. * - SYNC_COUNT
  3355. * Bits 15:8
  3356. * Purpose: specifies what sync value the HTT FW will wait for from
  3357. * an out-of-band specification to resume its operation
  3358. * Value: in-band sync counter value to compare against the out-of-band
  3359. * counter spec.
  3360. * The HTT target FW will suspend its host->target message processing
  3361. * as long as
  3362. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3363. */
  3364. #define HTT_H2T_SYNC_MSG_SZ 4
  3365. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3366. #define HTT_H2T_SYNC_COUNT_S 8
  3367. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3368. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3369. HTT_H2T_SYNC_COUNT_S)
  3370. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3373. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3374. } while (0)
  3375. /**
  3376. * @brief host -> target HTT aggregation configuration
  3377. *
  3378. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3379. */
  3380. #define HTT_AGGR_CFG_MSG_SZ 4
  3381. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3382. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3383. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3384. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3385. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3386. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3387. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3388. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3391. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3392. } while (0)
  3393. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3394. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3395. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3396. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3399. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3400. } while (0)
  3401. /**
  3402. * @brief host -> target HTT configure max amsdu info per vdev
  3403. *
  3404. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3405. *
  3406. * @details
  3407. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3408. *
  3409. * |31 21|20 16|15 8|7 0|
  3410. * |-----------------------------------------------------------|
  3411. * | reserved | vdev id | max amsdu | msg type |
  3412. * |-----------------------------------------------------------|
  3413. * Header fields:
  3414. * - MSG_TYPE
  3415. * Bits 7:0
  3416. * Purpose: identifies this as a aggr cfg ex message
  3417. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3418. * - MAX_NUM_AMSDU_SUBFRM
  3419. * Bits 15:8
  3420. * Purpose: max MSDUs per A-MSDU
  3421. * - VDEV_ID
  3422. * Bits 20:16
  3423. * Purpose: ID of the vdev to which this limit is applied
  3424. */
  3425. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3426. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3427. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3428. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3429. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3430. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3431. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3432. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3433. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3436. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3437. } while (0)
  3438. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3439. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3440. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3441. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3444. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3445. } while (0)
  3446. /**
  3447. * @brief HTT WDI_IPA Config Message
  3448. *
  3449. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3450. *
  3451. * @details
  3452. * The HTT WDI_IPA config message is created/sent by host at driver
  3453. * init time. It contains information about data structures used on
  3454. * WDI_IPA TX and RX path.
  3455. * TX CE ring is used for pushing packet metadata from IPA uC
  3456. * to WLAN FW
  3457. * TX Completion ring is used for generating TX completions from
  3458. * WLAN FW to IPA uC
  3459. * RX Indication ring is used for indicating RX packets from FW
  3460. * to IPA uC
  3461. * RX Ring2 is used as either completion ring or as second
  3462. * indication ring. when Ring2 is used as completion ring, IPA uC
  3463. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3464. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3465. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3466. * indicated in RX Indication ring. Please see WDI_IPA specification
  3467. * for more details.
  3468. * |31 24|23 16|15 8|7 0|
  3469. * |----------------+----------------+----------------+----------------|
  3470. * | tx pkt pool size | Rsvd | msg_type |
  3471. * |-------------------------------------------------------------------|
  3472. * | tx comp ring base (bits 31:0) |
  3473. #if HTT_PADDR64
  3474. * | tx comp ring base (bits 63:32) |
  3475. #endif
  3476. * |-------------------------------------------------------------------|
  3477. * | tx comp ring size |
  3478. * |-------------------------------------------------------------------|
  3479. * | tx comp WR_IDX physical address (bits 31:0) |
  3480. #if HTT_PADDR64
  3481. * | tx comp WR_IDX physical address (bits 63:32) |
  3482. #endif
  3483. * |-------------------------------------------------------------------|
  3484. * | tx CE WR_IDX physical address (bits 31:0) |
  3485. #if HTT_PADDR64
  3486. * | tx CE WR_IDX physical address (bits 63:32) |
  3487. #endif
  3488. * |-------------------------------------------------------------------|
  3489. * | rx indication ring base (bits 31:0) |
  3490. #if HTT_PADDR64
  3491. * | rx indication ring base (bits 63:32) |
  3492. #endif
  3493. * |-------------------------------------------------------------------|
  3494. * | rx indication ring size |
  3495. * |-------------------------------------------------------------------|
  3496. * | rx ind RD_IDX physical address (bits 31:0) |
  3497. #if HTT_PADDR64
  3498. * | rx ind RD_IDX physical address (bits 63:32) |
  3499. #endif
  3500. * |-------------------------------------------------------------------|
  3501. * | rx ind WR_IDX physical address (bits 31:0) |
  3502. #if HTT_PADDR64
  3503. * | rx ind WR_IDX physical address (bits 63:32) |
  3504. #endif
  3505. * |-------------------------------------------------------------------|
  3506. * |-------------------------------------------------------------------|
  3507. * | rx ring2 base (bits 31:0) |
  3508. #if HTT_PADDR64
  3509. * | rx ring2 base (bits 63:32) |
  3510. #endif
  3511. * |-------------------------------------------------------------------|
  3512. * | rx ring2 size |
  3513. * |-------------------------------------------------------------------|
  3514. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3515. #if HTT_PADDR64
  3516. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3517. #endif
  3518. * |-------------------------------------------------------------------|
  3519. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3520. #if HTT_PADDR64
  3521. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3522. #endif
  3523. * |-------------------------------------------------------------------|
  3524. *
  3525. * Header fields:
  3526. * Header fields:
  3527. * - MSG_TYPE
  3528. * Bits 7:0
  3529. * Purpose: Identifies this as WDI_IPA config message
  3530. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3531. * - TX_PKT_POOL_SIZE
  3532. * Bits 15:0
  3533. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3534. * WDI_IPA TX path
  3535. * For systems using 32-bit format for bus addresses:
  3536. * - TX_COMP_RING_BASE_ADDR
  3537. * Bits 31:0
  3538. * Purpose: TX Completion Ring base address in DDR
  3539. * - TX_COMP_RING_SIZE
  3540. * Bits 31:0
  3541. * Purpose: TX Completion Ring size (must be power of 2)
  3542. * - TX_COMP_WR_IDX_ADDR
  3543. * Bits 31:0
  3544. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3545. * updates the Write Index for WDI_IPA TX completion ring
  3546. * - TX_CE_WR_IDX_ADDR
  3547. * Bits 31:0
  3548. * Purpose: DDR address where IPA uC
  3549. * updates the WR Index for TX CE ring
  3550. * (needed for fusion platforms)
  3551. * - RX_IND_RING_BASE_ADDR
  3552. * Bits 31:0
  3553. * Purpose: RX Indication Ring base address in DDR
  3554. * - RX_IND_RING_SIZE
  3555. * Bits 31:0
  3556. * Purpose: RX Indication Ring size
  3557. * - RX_IND_RD_IDX_ADDR
  3558. * Bits 31:0
  3559. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3560. * RX indication ring
  3561. * - RX_IND_WR_IDX_ADDR
  3562. * Bits 31:0
  3563. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3564. * updates the Write Index for WDI_IPA RX indication ring
  3565. * - RX_RING2_BASE_ADDR
  3566. * Bits 31:0
  3567. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3568. * - RX_RING2_SIZE
  3569. * Bits 31:0
  3570. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3571. * - RX_RING2_RD_IDX_ADDR
  3572. * Bits 31:0
  3573. * Purpose: If Second RX ring is Indication ring, DDR address where
  3574. * IPA uC updates the Read Index for Ring2.
  3575. * If Second RX ring is completion ring, this is NOT used
  3576. * - RX_RING2_WR_IDX_ADDR
  3577. * Bits 31:0
  3578. * Purpose: If Second RX ring is Indication ring, DDR address where
  3579. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3580. * If second RX ring is completion ring, DDR address where
  3581. * IPA uC updates the Write Index for Ring 2.
  3582. * For systems using 64-bit format for bus addresses:
  3583. * - TX_COMP_RING_BASE_ADDR_LO
  3584. * Bits 31:0
  3585. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3586. * - TX_COMP_RING_BASE_ADDR_HI
  3587. * Bits 31:0
  3588. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3589. * - TX_COMP_RING_SIZE
  3590. * Bits 31:0
  3591. * Purpose: TX Completion Ring size (must be power of 2)
  3592. * - TX_COMP_WR_IDX_ADDR_LO
  3593. * Bits 31:0
  3594. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3595. * Lower 4 bytes of DDR address where WIFI FW
  3596. * updates the Write Index for WDI_IPA TX completion ring
  3597. * - TX_COMP_WR_IDX_ADDR_HI
  3598. * Bits 31:0
  3599. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3600. * Higher 4 bytes of DDR address where WIFI FW
  3601. * updates the Write Index for WDI_IPA TX completion ring
  3602. * - TX_CE_WR_IDX_ADDR_LO
  3603. * Bits 31:0
  3604. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3605. * updates the WR Index for TX CE ring
  3606. * (needed for fusion platforms)
  3607. * - TX_CE_WR_IDX_ADDR_HI
  3608. * Bits 31:0
  3609. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3610. * updates the WR Index for TX CE ring
  3611. * (needed for fusion platforms)
  3612. * - RX_IND_RING_BASE_ADDR_LO
  3613. * Bits 31:0
  3614. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3615. * - RX_IND_RING_BASE_ADDR_HI
  3616. * Bits 31:0
  3617. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3618. * - RX_IND_RING_SIZE
  3619. * Bits 31:0
  3620. * Purpose: RX Indication Ring size
  3621. * - RX_IND_RD_IDX_ADDR_LO
  3622. * Bits 31:0
  3623. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3624. * for WDI_IPA RX indication ring
  3625. * - RX_IND_RD_IDX_ADDR_HI
  3626. * Bits 31:0
  3627. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3628. * for WDI_IPA RX indication ring
  3629. * - RX_IND_WR_IDX_ADDR_LO
  3630. * Bits 31:0
  3631. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3632. * Lower 4 bytes of DDR address where WIFI FW
  3633. * updates the Write Index for WDI_IPA RX indication ring
  3634. * - RX_IND_WR_IDX_ADDR_HI
  3635. * Bits 31:0
  3636. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3637. * Higher 4 bytes of DDR address where WIFI FW
  3638. * updates the Write Index for WDI_IPA RX indication ring
  3639. * - RX_RING2_BASE_ADDR_LO
  3640. * Bits 31:0
  3641. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3642. * - RX_RING2_BASE_ADDR_HI
  3643. * Bits 31:0
  3644. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3645. * - RX_RING2_SIZE
  3646. * Bits 31:0
  3647. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3648. * - RX_RING2_RD_IDX_ADDR_LO
  3649. * Bits 31:0
  3650. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3651. * DDR address where IPA uC updates the Read Index for Ring2.
  3652. * If Second RX ring is completion ring, this is NOT used
  3653. * - RX_RING2_RD_IDX_ADDR_HI
  3654. * Bits 31:0
  3655. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3656. * DDR address where IPA uC updates the Read Index for Ring2.
  3657. * If Second RX ring is completion ring, this is NOT used
  3658. * - RX_RING2_WR_IDX_ADDR_LO
  3659. * Bits 31:0
  3660. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3661. * DDR address where WIFI FW updates the Write Index
  3662. * for WDI_IPA RX ring2
  3663. * If second RX ring is completion ring, lower 4 bytes of
  3664. * DDR address where IPA uC updates the Write Index for Ring 2.
  3665. * - RX_RING2_WR_IDX_ADDR_HI
  3666. * Bits 31:0
  3667. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3668. * DDR address where WIFI FW updates the Write Index
  3669. * for WDI_IPA RX ring2
  3670. * If second RX ring is completion ring, higher 4 bytes of
  3671. * DDR address where IPA uC updates the Write Index for Ring 2.
  3672. */
  3673. #if HTT_PADDR64
  3674. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3675. #else
  3676. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3677. #endif
  3678. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3679. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3680. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3681. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3682. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3683. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3684. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3685. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3686. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3687. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3688. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3689. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3690. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3694. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3695. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3696. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3697. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3698. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3699. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3700. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3701. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3702. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3704. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3706. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3708. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3710. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3714. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3716. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3718. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3740. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3741. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3742. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3743. do { \
  3744. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3745. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3746. } while (0)
  3747. /* for systems using 32-bit format for bus addr */
  3748. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3749. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3750. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3751. do { \
  3752. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3753. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3754. } while (0)
  3755. /* for systems using 64-bit format for bus addr */
  3756. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3757. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3758. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3759. do { \
  3760. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3761. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3762. } while (0)
  3763. /* for systems using 64-bit format for bus addr */
  3764. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3765. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3766. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3767. do { \
  3768. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3769. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3770. } while (0)
  3771. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3773. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3777. } while (0)
  3778. /* for systems using 32-bit format for bus addr */
  3779. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3780. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3781. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3784. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3785. } while (0)
  3786. /* for systems using 64-bit format for bus addr */
  3787. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3788. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3789. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3792. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3793. } while (0)
  3794. /* for systems using 64-bit format for bus addr */
  3795. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3796. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3797. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3800. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3801. } while (0)
  3802. /* for systems using 32-bit format for bus addr */
  3803. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3804. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3805. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3806. do { \
  3807. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3808. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3809. } while (0)
  3810. /* for systems using 64-bit format for bus addr */
  3811. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3812. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3813. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3814. do { \
  3815. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3816. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3817. } while (0)
  3818. /* for systems using 64-bit format for bus addr */
  3819. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3820. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3821. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3822. do { \
  3823. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3824. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3825. } while (0)
  3826. /* for systems using 32-bit format for bus addr */
  3827. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3828. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3829. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3830. do { \
  3831. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3832. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3833. } while (0)
  3834. /* for systems using 64-bit format for bus addr */
  3835. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3836. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3837. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3838. do { \
  3839. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3840. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3841. } while (0)
  3842. /* for systems using 64-bit format for bus addr */
  3843. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3844. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3845. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3846. do { \
  3847. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3848. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3849. } while (0)
  3850. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3851. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3852. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3853. do { \
  3854. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3855. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3856. } while (0)
  3857. /* for systems using 32-bit format for bus addr */
  3858. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3859. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3860. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3861. do { \
  3862. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3863. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3864. } while (0)
  3865. /* for systems using 64-bit format for bus addr */
  3866. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3867. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3868. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3869. do { \
  3870. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3871. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3872. } while (0)
  3873. /* for systems using 64-bit format for bus addr */
  3874. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3875. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3876. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3877. do { \
  3878. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3879. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3880. } while (0)
  3881. /* for systems using 32-bit format for bus addr */
  3882. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3883. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3884. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3885. do { \
  3886. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3887. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3888. } while (0)
  3889. /* for systems using 64-bit format for bus addr */
  3890. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3891. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3892. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3893. do { \
  3894. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3895. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3896. } while (0)
  3897. /* for systems using 64-bit format for bus addr */
  3898. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3899. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3900. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3901. do { \
  3902. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3903. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3904. } while (0)
  3905. /* for systems using 32-bit format for bus addr */
  3906. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3907. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3908. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3909. do { \
  3910. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3911. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3912. } while (0)
  3913. /* for systems using 64-bit format for bus addr */
  3914. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3915. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3916. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3917. do { \
  3918. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3919. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3920. } while (0)
  3921. /* for systems using 64-bit format for bus addr */
  3922. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3923. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3924. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3925. do { \
  3926. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3927. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3928. } while (0)
  3929. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3930. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3931. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3932. do { \
  3933. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3934. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3935. } while (0)
  3936. /* for systems using 32-bit format for bus addr */
  3937. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3938. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3939. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3940. do { \
  3941. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3942. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3943. } while (0)
  3944. /* for systems using 64-bit format for bus addr */
  3945. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3946. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3947. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3948. do { \
  3949. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3950. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3951. } while (0)
  3952. /* for systems using 64-bit format for bus addr */
  3953. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3954. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3955. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3956. do { \
  3957. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3958. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3959. } while (0)
  3960. /* for systems using 32-bit format for bus addr */
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3962. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3963. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3964. do { \
  3965. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3966. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3967. } while (0)
  3968. /* for systems using 64-bit format for bus addr */
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3970. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3971. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3972. do { \
  3973. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3974. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3975. } while (0)
  3976. /* for systems using 64-bit format for bus addr */
  3977. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3978. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3979. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3980. do { \
  3981. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3982. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3983. } while (0)
  3984. /*
  3985. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3986. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3987. * addresses are stored in a XXX-bit field.
  3988. * This macro is used to define both htt_wdi_ipa_config32_t and
  3989. * htt_wdi_ipa_config64_t structs.
  3990. */
  3991. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3992. _paddr__tx_comp_ring_base_addr_, \
  3993. _paddr__tx_comp_wr_idx_addr_, \
  3994. _paddr__tx_ce_wr_idx_addr_, \
  3995. _paddr__rx_ind_ring_base_addr_, \
  3996. _paddr__rx_ind_rd_idx_addr_, \
  3997. _paddr__rx_ind_wr_idx_addr_, \
  3998. _paddr__rx_ring2_base_addr_,\
  3999. _paddr__rx_ring2_rd_idx_addr_,\
  4000. _paddr__rx_ring2_wr_idx_addr_) \
  4001. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4002. { \
  4003. /* DWORD 0: flags and meta-data */ \
  4004. A_UINT32 \
  4005. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4006. reserved: 8, \
  4007. tx_pkt_pool_size: 16;\
  4008. /* DWORD 1 */\
  4009. _paddr__tx_comp_ring_base_addr_;\
  4010. /* DWORD 2 (or 3)*/\
  4011. A_UINT32 tx_comp_ring_size;\
  4012. /* DWORD 3 (or 4)*/\
  4013. _paddr__tx_comp_wr_idx_addr_;\
  4014. /* DWORD 4 (or 6)*/\
  4015. _paddr__tx_ce_wr_idx_addr_;\
  4016. /* DWORD 5 (or 8)*/\
  4017. _paddr__rx_ind_ring_base_addr_;\
  4018. /* DWORD 6 (or 10)*/\
  4019. A_UINT32 rx_ind_ring_size;\
  4020. /* DWORD 7 (or 11)*/\
  4021. _paddr__rx_ind_rd_idx_addr_;\
  4022. /* DWORD 8 (or 13)*/\
  4023. _paddr__rx_ind_wr_idx_addr_;\
  4024. /* DWORD 9 (or 15)*/\
  4025. _paddr__rx_ring2_base_addr_;\
  4026. /* DWORD 10 (or 17) */\
  4027. A_UINT32 rx_ring2_size;\
  4028. /* DWORD 11 (or 18) */\
  4029. _paddr__rx_ring2_rd_idx_addr_;\
  4030. /* DWORD 12 (or 20) */\
  4031. _paddr__rx_ring2_wr_idx_addr_;\
  4032. } POSTPACK
  4033. /* define a htt_wdi_ipa_config32_t type */
  4034. 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));
  4035. /* define a htt_wdi_ipa_config64_t type */
  4036. 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));
  4037. #if HTT_PADDR64
  4038. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4039. #else
  4040. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4041. #endif
  4042. enum htt_wdi_ipa_op_code {
  4043. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4044. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4045. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4046. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4047. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4048. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4049. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4050. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4051. /* keep this last */
  4052. HTT_WDI_IPA_OPCODE_MAX
  4053. };
  4054. /**
  4055. * @brief HTT WDI_IPA Operation Request Message
  4056. *
  4057. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4058. *
  4059. * @details
  4060. * HTT WDI_IPA Operation Request message is sent by host
  4061. * to either suspend or resume WDI_IPA TX or RX path.
  4062. * |31 24|23 16|15 8|7 0|
  4063. * |----------------+----------------+----------------+----------------|
  4064. * | op_code | Rsvd | msg_type |
  4065. * |-------------------------------------------------------------------|
  4066. *
  4067. * Header fields:
  4068. * - MSG_TYPE
  4069. * Bits 7:0
  4070. * Purpose: Identifies this as WDI_IPA Operation Request message
  4071. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4072. * - OP_CODE
  4073. * Bits 31:16
  4074. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4075. * value: = enum htt_wdi_ipa_op_code
  4076. */
  4077. PREPACK struct htt_wdi_ipa_op_request_t
  4078. {
  4079. /* DWORD 0: flags and meta-data */
  4080. A_UINT32
  4081. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4082. reserved: 8,
  4083. op_code: 16;
  4084. } POSTPACK;
  4085. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4086. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4087. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4088. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4089. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4090. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4093. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4094. } while (0)
  4095. /*
  4096. * @brief host -> target HTT_SRING_SETUP message
  4097. *
  4098. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4099. *
  4100. * @details
  4101. * After target is booted up, Host can send SRING setup message for
  4102. * each host facing LMAC SRING. Target setups up HW registers based
  4103. * on setup message and confirms back to Host if response_required is set.
  4104. * Host should wait for confirmation message before sending new SRING
  4105. * setup message
  4106. *
  4107. * The message would appear as follows:
  4108. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4109. * |--------------- +-----------------+-----------------+-----------------|
  4110. * | ring_type | ring_id | pdev_id | msg_type |
  4111. * |----------------------------------------------------------------------|
  4112. * | ring_base_addr_lo |
  4113. * |----------------------------------------------------------------------|
  4114. * | ring_base_addr_hi |
  4115. * |----------------------------------------------------------------------|
  4116. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4117. * |----------------------------------------------------------------------|
  4118. * | ring_head_offset32_remote_addr_lo |
  4119. * |----------------------------------------------------------------------|
  4120. * | ring_head_offset32_remote_addr_hi |
  4121. * |----------------------------------------------------------------------|
  4122. * | ring_tail_offset32_remote_addr_lo |
  4123. * |----------------------------------------------------------------------|
  4124. * | ring_tail_offset32_remote_addr_hi |
  4125. * |----------------------------------------------------------------------|
  4126. * | ring_msi_addr_lo |
  4127. * |----------------------------------------------------------------------|
  4128. * | ring_msi_addr_hi |
  4129. * |----------------------------------------------------------------------|
  4130. * | ring_msi_data |
  4131. * |----------------------------------------------------------------------|
  4132. * | intr_timer_th |IM| intr_batch_counter_th |
  4133. * |----------------------------------------------------------------------|
  4134. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4135. * |----------------------------------------------------------------------|
  4136. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4137. * |----------------------------------------------------------------------|
  4138. * Where
  4139. * IM = sw_intr_mode
  4140. * RR = response_required
  4141. * PTCF = prefetch_timer_cfg
  4142. * IP = IPA drop flag
  4143. *
  4144. * The message is interpreted as follows:
  4145. * dword0 - b'0:7 - msg_type: This will be set to
  4146. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4147. * b'8:15 - pdev_id:
  4148. * 0 (for rings at SOC/UMAC level),
  4149. * 1/2/3 mac id (for rings at LMAC level)
  4150. * b'16:23 - ring_id: identify which ring is to setup,
  4151. * more details can be got from enum htt_srng_ring_id
  4152. * b'24:31 - ring_type: identify type of host rings,
  4153. * more details can be got from enum htt_srng_ring_type
  4154. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4155. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4156. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4157. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4158. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4159. * SW_TO_HW_RING.
  4160. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4161. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4162. * Lower 32 bits of memory address of the remote variable
  4163. * storing the 4-byte word offset that identifies the head
  4164. * element within the ring.
  4165. * (The head offset variable has type A_UINT32.)
  4166. * Valid for HW_TO_SW and SW_TO_SW rings.
  4167. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4168. * Upper 32 bits of memory address of the remote variable
  4169. * storing the 4-byte word offset that identifies the head
  4170. * element within the ring.
  4171. * (The head offset variable has type A_UINT32.)
  4172. * Valid for HW_TO_SW and SW_TO_SW rings.
  4173. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4174. * Lower 32 bits of memory address of the remote variable
  4175. * storing the 4-byte word offset that identifies the tail
  4176. * element within the ring.
  4177. * (The tail offset variable has type A_UINT32.)
  4178. * Valid for HW_TO_SW and SW_TO_SW rings.
  4179. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4180. * Upper 32 bits of memory address of the remote variable
  4181. * storing the 4-byte word offset that identifies the tail
  4182. * element within the ring.
  4183. * (The tail offset variable has type A_UINT32.)
  4184. * Valid for HW_TO_SW and SW_TO_SW rings.
  4185. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4186. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4187. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4188. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4189. * dword10 - b'0:31 - ring_msi_data: MSI data
  4190. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4191. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4192. * dword11 - b'0:14 - intr_batch_counter_th:
  4193. * batch counter threshold is in units of 4-byte words.
  4194. * HW internally maintains and increments batch count.
  4195. * (see SRING spec for detail description).
  4196. * When batch count reaches threshold value, an interrupt
  4197. * is generated by HW.
  4198. * b'15 - sw_intr_mode:
  4199. * This configuration shall be static.
  4200. * Only programmed at power up.
  4201. * 0: generate pulse style sw interrupts
  4202. * 1: generate level style sw interrupts
  4203. * b'16:31 - intr_timer_th:
  4204. * The timer init value when timer is idle or is
  4205. * initialized to start downcounting.
  4206. * In 8us units (to cover a range of 0 to 524 ms)
  4207. * dword12 - b'0:15 - intr_low_threshold:
  4208. * Used only by Consumer ring to generate ring_sw_int_p.
  4209. * Ring entries low threshold water mark, that is used
  4210. * in combination with the interrupt timer as well as
  4211. * the the clearing of the level interrupt.
  4212. * b'16:18 - prefetch_timer_cfg:
  4213. * Used only by Consumer ring to set timer mode to
  4214. * support Application prefetch handling.
  4215. * The external tail offset/pointer will be updated
  4216. * at following intervals:
  4217. * 3'b000: (Prefetch feature disabled; used only for debug)
  4218. * 3'b001: 1 usec
  4219. * 3'b010: 4 usec
  4220. * 3'b011: 8 usec (default)
  4221. * 3'b100: 16 usec
  4222. * Others: Reserverd
  4223. * b'19 - response_required:
  4224. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4225. * b'20 - ipa_drop_flag:
  4226. Indicates that host will config ipa drop threshold percentage
  4227. * b'21:31 - reserved: reserved for future use
  4228. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4229. * b'8:15 - ipa drop high threshold percentage:
  4230. * b'16:31 - Reserved
  4231. */
  4232. PREPACK struct htt_sring_setup_t {
  4233. A_UINT32 msg_type: 8,
  4234. pdev_id: 8,
  4235. ring_id: 8,
  4236. ring_type: 8;
  4237. A_UINT32 ring_base_addr_lo;
  4238. A_UINT32 ring_base_addr_hi;
  4239. A_UINT32 ring_size: 16,
  4240. ring_entry_size: 8,
  4241. ring_misc_cfg_flag: 8;
  4242. A_UINT32 ring_head_offset32_remote_addr_lo;
  4243. A_UINT32 ring_head_offset32_remote_addr_hi;
  4244. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4245. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4246. A_UINT32 ring_msi_addr_lo;
  4247. A_UINT32 ring_msi_addr_hi;
  4248. A_UINT32 ring_msi_data;
  4249. A_UINT32 intr_batch_counter_th: 15,
  4250. sw_intr_mode: 1,
  4251. intr_timer_th: 16;
  4252. A_UINT32 intr_low_threshold: 16,
  4253. prefetch_timer_cfg: 3,
  4254. response_required: 1,
  4255. ipa_drop_flag: 1,
  4256. reserved1: 11;
  4257. A_UINT32 ipa_drop_low_threshold: 8,
  4258. ipa_drop_high_threshold: 8,
  4259. reserved: 16;
  4260. } POSTPACK;
  4261. enum htt_srng_ring_type {
  4262. HTT_HW_TO_SW_RING = 0,
  4263. HTT_SW_TO_HW_RING,
  4264. HTT_SW_TO_SW_RING,
  4265. /* Insert new ring types above this line */
  4266. };
  4267. enum htt_srng_ring_id {
  4268. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4269. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4270. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4271. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4272. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4273. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4274. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4275. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4276. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4277. /* Add Other SRING which can't be directly configured by host software above this line */
  4278. };
  4279. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4280. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4281. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4282. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4283. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4284. HTT_SRING_SETUP_PDEV_ID_S)
  4285. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4288. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4289. } while (0)
  4290. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4291. #define HTT_SRING_SETUP_RING_ID_S 16
  4292. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4293. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4294. HTT_SRING_SETUP_RING_ID_S)
  4295. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4298. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4299. } while (0)
  4300. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4301. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4302. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4303. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4304. HTT_SRING_SETUP_RING_TYPE_S)
  4305. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4308. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4309. } while (0)
  4310. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4311. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4312. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4313. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4314. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4315. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4318. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4319. } while (0)
  4320. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4321. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4322. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4323. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4324. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4325. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4328. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4329. } while (0)
  4330. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4331. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4332. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4333. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4334. HTT_SRING_SETUP_RING_SIZE_S)
  4335. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4338. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4339. } while (0)
  4340. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4341. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4342. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4343. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4344. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4345. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4348. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4349. } while (0)
  4350. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4351. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4352. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4353. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4354. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4355. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4358. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4359. } while (0)
  4360. /* This control bit is applicable to only Producer, which updates Ring ID field
  4361. * of each descriptor before pushing into the ring.
  4362. * 0: updates ring_id(default)
  4363. * 1: ring_id updating disabled */
  4364. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4365. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4366. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4367. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4368. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4369. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4370. do { \
  4371. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4372. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4373. } while (0)
  4374. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4375. * of each descriptor before pushing into the ring.
  4376. * 0: updates Loopcnt(default)
  4377. * 1: Loopcnt updating disabled */
  4378. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4379. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4380. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4381. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4382. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4383. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4384. do { \
  4385. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4386. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4387. } while (0)
  4388. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4389. * into security_id port of GXI/AXI. */
  4390. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4393. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4394. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4395. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4398. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4399. } while (0)
  4400. /* During MSI write operation, SRNG drives value of this register bit into
  4401. * swap bit of GXI/AXI. */
  4402. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4403. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4404. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4405. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4406. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4407. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4408. do { \
  4409. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4410. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4411. } while (0)
  4412. /* During Pointer write operation, SRNG drives value of this register bit into
  4413. * swap bit of GXI/AXI. */
  4414. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4415. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4416. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4417. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4418. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4419. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4420. do { \
  4421. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4422. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4423. } while (0)
  4424. /* During any data or TLV write operation, SRNG drives value of this register
  4425. * bit into swap bit of GXI/AXI. */
  4426. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4427. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4428. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4429. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4430. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4431. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4432. do { \
  4433. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4434. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4435. } while (0)
  4436. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4437. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4438. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4439. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4440. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4441. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4442. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4443. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4444. do { \
  4445. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4446. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4447. } while (0)
  4448. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4449. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4450. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4451. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4452. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4453. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4454. do { \
  4455. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4456. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4457. } while (0)
  4458. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4459. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4460. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4461. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4462. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4463. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4464. do { \
  4465. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4466. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4467. } while (0)
  4468. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4469. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4470. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4471. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4472. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4473. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4474. do { \
  4475. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4476. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4477. } while (0)
  4478. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4479. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4480. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4481. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4482. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4483. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4484. do { \
  4485. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4486. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4487. } while (0)
  4488. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4489. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4490. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4491. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4492. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4493. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4494. do { \
  4495. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4496. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4497. } while (0)
  4498. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4499. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4500. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4501. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4502. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4503. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4504. do { \
  4505. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4506. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4507. } while (0)
  4508. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4509. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4510. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4511. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4512. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4513. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4514. do { \
  4515. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4516. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4517. } while (0)
  4518. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4519. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4520. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4521. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4522. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4523. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4524. do { \
  4525. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4526. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4527. } while (0)
  4528. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4529. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4530. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4531. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4532. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4533. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4534. do { \
  4535. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4536. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4537. } while (0)
  4538. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4539. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4540. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4541. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4542. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4543. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4544. do { \
  4545. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4546. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4547. } while (0)
  4548. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4549. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4550. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4551. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4552. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4553. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4554. do { \
  4555. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4556. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4557. } while (0)
  4558. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4559. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4560. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4561. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4562. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4563. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4564. do { \
  4565. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4566. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4567. } while (0)
  4568. /**
  4569. * @brief host -> target RX ring selection config message
  4570. *
  4571. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4572. *
  4573. * @details
  4574. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4575. * configure RXDMA rings.
  4576. * The configuration is per ring based and includes both packet subtypes
  4577. * and PPDU/MPDU TLVs.
  4578. *
  4579. * The message would appear as follows:
  4580. *
  4581. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4582. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4583. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4584. * |-------------------------------------------------------------------|
  4585. * | rsvd2 | ring_buffer_size |
  4586. * |-------------------------------------------------------------------|
  4587. * | packet_type_enable_flags_0 |
  4588. * |-------------------------------------------------------------------|
  4589. * | packet_type_enable_flags_1 |
  4590. * |-------------------------------------------------------------------|
  4591. * | packet_type_enable_flags_2 |
  4592. * |-------------------------------------------------------------------|
  4593. * | packet_type_enable_flags_3 |
  4594. * |-------------------------------------------------------------------|
  4595. * | tlv_filter_in_flags |
  4596. * |-------------------------------------------------------------------|
  4597. * | rx_header_offset | rx_packet_offset |
  4598. * |-------------------------------------------------------------------|
  4599. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4600. * |-------------------------------------------------------------------|
  4601. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4602. * |-------------------------------------------------------------------|
  4603. * | rsvd3 | rx_attention_offset |
  4604. * |-------------------------------------------------------------------|
  4605. * | rsvd4 | mo| fp| rx_drop_threshold |
  4606. * | |ndp|ndp| |
  4607. * |-------------------------------------------------------------------|
  4608. * Where:
  4609. * PS = pkt_swap
  4610. * SS = status_swap
  4611. * OV = rx_offsets_valid
  4612. * DT = drop_thresh_valid
  4613. * The message is interpreted as follows:
  4614. * dword0 - b'0:7 - msg_type: This will be set to
  4615. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4616. * b'8:15 - pdev_id:
  4617. * 0 (for rings at SOC/UMAC level),
  4618. * 1/2/3 mac id (for rings at LMAC level)
  4619. * b'16:23 - ring_id : Identify the ring to configure.
  4620. * More details can be got from enum htt_srng_ring_id
  4621. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4622. * BUF_RING_CFG_0 defs within HW .h files,
  4623. * e.g. wmac_top_reg_seq_hwioreg.h
  4624. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4625. * BUF_RING_CFG_0 defs within HW .h files,
  4626. * e.g. wmac_top_reg_seq_hwioreg.h
  4627. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4628. * configuration fields are valid
  4629. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4630. * rx_drop_threshold field is valid
  4631. * b'28:31 - rsvd1: reserved for future use
  4632. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4633. * in byte units.
  4634. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4635. * - b'16:31 - rsvd2: Reserved for future use
  4636. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4637. * Enable MGMT packet from 0b0000 to 0b1001
  4638. * bits from low to high: FP, MD, MO - 3 bits
  4639. * FP: Filter_Pass
  4640. * MD: Monitor_Direct
  4641. * MO: Monitor_Other
  4642. * 10 mgmt subtypes * 3 bits -> 30 bits
  4643. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4644. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4645. * Enable MGMT packet from 0b1010 to 0b1111
  4646. * bits from low to high: FP, MD, MO - 3 bits
  4647. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4648. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4649. * Enable CTRL packet from 0b0000 to 0b1001
  4650. * bits from low to high: FP, MD, MO - 3 bits
  4651. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4652. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4653. * Enable CTRL packet from 0b1010 to 0b1111,
  4654. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4655. * bits from low to high: FP, MD, MO - 3 bits
  4656. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4657. * dword6 - b'0:31 - tlv_filter_in_flags:
  4658. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4659. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4660. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4661. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4662. * A value of 0 will be considered as ignore this config.
  4663. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4664. * e.g. wmac_top_reg_seq_hwioreg.h
  4665. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4666. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4667. * A value of 0 will be considered as ignore this config.
  4668. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4669. * e.g. wmac_top_reg_seq_hwioreg.h
  4670. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4671. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4672. * A value of 0 will be considered as ignore this config.
  4673. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4674. * e.g. wmac_top_reg_seq_hwioreg.h
  4675. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4676. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4677. * A value of 0 will be considered as ignore this config.
  4678. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4679. * e.g. wmac_top_reg_seq_hwioreg.h
  4680. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4681. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4682. * A value of 0 will be considered as ignore this config.
  4683. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4684. * e.g. wmac_top_reg_seq_hwioreg.h
  4685. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4686. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4687. * A value of 0 will be considered as ignore this config.
  4688. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4689. * e.g. wmac_top_reg_seq_hwioreg.h
  4690. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4691. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4692. * A value of 0 will be considered as ignore this config.
  4693. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4694. * e.g. wmac_top_reg_seq_hwioreg.h
  4695. * - b'16:31 - rsvd3 for future use
  4696. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4697. * to source rings. Consumer drops packets if the available
  4698. * words in the ring falls below the configured threshold
  4699. * value.
  4700. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4701. * by host. 1 -> subscribed
  4702. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4703. * by host. 1 -> subscribed
  4704. */
  4705. PREPACK struct htt_rx_ring_selection_cfg_t {
  4706. A_UINT32 msg_type: 8,
  4707. pdev_id: 8,
  4708. ring_id: 8,
  4709. status_swap: 1,
  4710. pkt_swap: 1,
  4711. rx_offsets_valid: 1,
  4712. drop_thresh_valid: 1,
  4713. rsvd1: 4;
  4714. A_UINT32 ring_buffer_size: 16,
  4715. rsvd2: 16;
  4716. A_UINT32 packet_type_enable_flags_0;
  4717. A_UINT32 packet_type_enable_flags_1;
  4718. A_UINT32 packet_type_enable_flags_2;
  4719. A_UINT32 packet_type_enable_flags_3;
  4720. A_UINT32 tlv_filter_in_flags;
  4721. A_UINT32 rx_packet_offset: 16,
  4722. rx_header_offset: 16;
  4723. A_UINT32 rx_mpdu_end_offset: 16,
  4724. rx_mpdu_start_offset: 16;
  4725. A_UINT32 rx_msdu_end_offset: 16,
  4726. rx_msdu_start_offset: 16;
  4727. A_UINT32 rx_attn_offset: 16,
  4728. rsvd3: 16;
  4729. A_UINT32 rx_drop_threshold: 10,
  4730. fp_ndp: 1,
  4731. mo_ndp: 1,
  4732. rsvd4: 20;
  4733. } POSTPACK;
  4734. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4735. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4736. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4737. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4738. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4739. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4740. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4741. do { \
  4742. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4743. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4744. } while (0)
  4745. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4746. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4747. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4748. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4749. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4750. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4751. do { \
  4752. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4753. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4754. } while (0)
  4755. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4756. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4757. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4758. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4759. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4760. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4761. do { \
  4762. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4763. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4764. } while (0)
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4768. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4769. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4771. do { \
  4772. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4773. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4774. } while (0)
  4775. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4776. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4777. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4778. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4779. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4780. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4781. do { \
  4782. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4783. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4784. } while (0)
  4785. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4786. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4787. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4788. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4789. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4790. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4791. do { \
  4792. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4793. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4794. } while (0)
  4795. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4796. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4797. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4798. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4799. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4800. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4801. do { \
  4802. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4803. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4804. } while (0)
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4808. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4809. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4811. do { \
  4812. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4813. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4814. } while (0)
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4818. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4819. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4821. do { \
  4822. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4823. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4824. } while (0)
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4828. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4829. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4833. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4834. } while (0)
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4838. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4839. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4841. do { \
  4842. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4843. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4844. } while (0)
  4845. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4846. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4847. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4848. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4849. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4850. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4851. do { \
  4852. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4853. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4854. } while (0)
  4855. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4856. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4857. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4858. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4859. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4860. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4861. do { \
  4862. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4863. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4864. } while (0)
  4865. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4866. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4867. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4868. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4869. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4870. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4871. do { \
  4872. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4873. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4874. } while (0)
  4875. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4876. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4877. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4878. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4879. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4880. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4883. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4884. } while (0)
  4885. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4886. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4888. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4889. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4890. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4893. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4894. } while (0)
  4895. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4896. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4898. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4899. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4900. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4903. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4904. } while (0)
  4905. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4906. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4908. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4909. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4910. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4913. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4914. } while (0)
  4915. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4916. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4918. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4919. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4920. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4923. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4924. } while (0)
  4925. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4926. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4928. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4929. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4930. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4933. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4934. } while (0)
  4935. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4936. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4937. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4938. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4939. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4940. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4943. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4944. } while (0)
  4945. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4946. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4947. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4948. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4949. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4950. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4951. do { \
  4952. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4953. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4954. } while (0)
  4955. /*
  4956. * Subtype based MGMT frames enable bits.
  4957. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4958. */
  4959. /* association request */
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4966. /* association response */
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4973. /* Reassociation request */
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4980. /* Reassociation response */
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4987. /* Probe request */
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4994. /* Probe response */
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5001. /* Timing Advertisement */
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5008. /* Reserved */
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5015. /* Beacon */
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5022. /* ATIM */
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5029. /* Disassociation */
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5036. /* Authentication */
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5043. /* Deauthentication */
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5050. /* Action */
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5057. /* Action No Ack */
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5064. /* Reserved */
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5071. /*
  5072. * Subtype based CTRL frames enable bits.
  5073. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5074. */
  5075. /* Reserved */
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5082. /* Reserved */
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5089. /* Reserved */
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5096. /* Reserved */
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5103. /* Reserved */
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5110. /* Reserved */
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5117. /* Reserved */
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5124. /* Control Wrapper */
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5131. /* Block Ack Request */
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5138. /* Block Ack*/
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5145. /* PS-POLL */
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5152. /* RTS */
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5159. /* CTS */
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5166. /* ACK */
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5173. /* CF-END */
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5180. /* CF-END + CF-ACK */
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5187. /* Multicast data */
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5194. /* Unicast data */
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5201. /* NULL data */
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5209. do { \
  5210. HTT_CHECK_SET_VAL(httsym, value); \
  5211. (word) |= (value) << httsym##_S; \
  5212. } while (0)
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5214. (((word) & httsym##_M) >> httsym##_S)
  5215. #define htt_rx_ring_pkt_enable_subtype_set( \
  5216. word, flag, mode, type, subtype, val) \
  5217. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5218. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5219. #define htt_rx_ring_pkt_enable_subtype_get( \
  5220. word, flag, mode, type, subtype) \
  5221. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5222. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5223. /* Definition to filter in TLVs */
  5224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5234. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5235. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5250. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5251. do { \
  5252. HTT_CHECK_SET_VAL(httsym, enable); \
  5253. (word) |= (enable) << httsym##_S; \
  5254. } while (0)
  5255. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5256. (((word) & httsym##_M) >> httsym##_S)
  5257. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5258. HTT_RX_RING_TLV_ENABLE_SET( \
  5259. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5260. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5261. HTT_RX_RING_TLV_ENABLE_GET( \
  5262. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5263. /**
  5264. * @brief host --> target Receive Flow Steering configuration message definition
  5265. *
  5266. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5267. *
  5268. * host --> target Receive Flow Steering configuration message definition.
  5269. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5270. * The reason for this is we want RFS to be configured and ready before MAC
  5271. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5272. *
  5273. * |31 24|23 16|15 9|8|7 0|
  5274. * |----------------+----------------+----------------+----------------|
  5275. * | reserved |E| msg type |
  5276. * |-------------------------------------------------------------------|
  5277. * Where E = RFS enable flag
  5278. *
  5279. * The RFS_CONFIG message consists of a single 4-byte word.
  5280. *
  5281. * Header fields:
  5282. * - MSG_TYPE
  5283. * Bits 7:0
  5284. * Purpose: identifies this as a RFS config msg
  5285. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5286. * - RFS_CONFIG
  5287. * Bit 8
  5288. * Purpose: Tells target whether to enable (1) or disable (0)
  5289. * flow steering feature when sending rx indication messages to host
  5290. */
  5291. #define HTT_H2T_RFS_CONFIG_M 0x100
  5292. #define HTT_H2T_RFS_CONFIG_S 8
  5293. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5294. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5295. HTT_H2T_RFS_CONFIG_S)
  5296. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5297. do { \
  5298. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5299. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5300. } while (0)
  5301. #define HTT_RFS_CFG_REQ_BYTES 4
  5302. /**
  5303. * @brief host -> target FW extended statistics retrieve
  5304. *
  5305. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5306. *
  5307. * @details
  5308. * The following field definitions describe the format of the HTT host
  5309. * to target FW extended stats retrieve message.
  5310. * The message specifies the type of stats the host wants to retrieve.
  5311. *
  5312. * |31 24|23 16|15 8|7 0|
  5313. * |-----------------------------------------------------------|
  5314. * | reserved | stats type | pdev_mask | msg type |
  5315. * |-----------------------------------------------------------|
  5316. * | config param [0] |
  5317. * |-----------------------------------------------------------|
  5318. * | config param [1] |
  5319. * |-----------------------------------------------------------|
  5320. * | config param [2] |
  5321. * |-----------------------------------------------------------|
  5322. * | config param [3] |
  5323. * |-----------------------------------------------------------|
  5324. * | reserved |
  5325. * |-----------------------------------------------------------|
  5326. * | cookie LSBs |
  5327. * |-----------------------------------------------------------|
  5328. * | cookie MSBs |
  5329. * |-----------------------------------------------------------|
  5330. * Header fields:
  5331. * - MSG_TYPE
  5332. * Bits 7:0
  5333. * Purpose: identifies this is a extended stats upload request message
  5334. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5335. * - PDEV_MASK
  5336. * Bits 8:15
  5337. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5338. * Value: This is a overloaded field, refer to usage and interpretation of
  5339. * PDEV in interface document.
  5340. * Bit 8 : Reserved for SOC stats
  5341. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5342. * Indicates MACID_MASK in DBS
  5343. * - STATS_TYPE
  5344. * Bits 23:16
  5345. * Purpose: identifies which FW statistics to upload
  5346. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5347. * - Reserved
  5348. * Bits 31:24
  5349. * - CONFIG_PARAM [0]
  5350. * Bits 31:0
  5351. * Purpose: give an opaque configuration value to the specified stats type
  5352. * Value: stats-type specific configuration value
  5353. * Refer to htt_stats.h for interpretation for each stats sub_type
  5354. * - CONFIG_PARAM [1]
  5355. * Bits 31:0
  5356. * Purpose: give an opaque configuration value to the specified stats type
  5357. * Value: stats-type specific configuration value
  5358. * Refer to htt_stats.h for interpretation for each stats sub_type
  5359. * - CONFIG_PARAM [2]
  5360. * Bits 31:0
  5361. * Purpose: give an opaque configuration value to the specified stats type
  5362. * Value: stats-type specific configuration value
  5363. * Refer to htt_stats.h for interpretation for each stats sub_type
  5364. * - CONFIG_PARAM [3]
  5365. * Bits 31:0
  5366. * Purpose: give an opaque configuration value to the specified stats type
  5367. * Value: stats-type specific configuration value
  5368. * Refer to htt_stats.h for interpretation for each stats sub_type
  5369. * - Reserved [31:0] for future use.
  5370. * - COOKIE_LSBS
  5371. * Bits 31:0
  5372. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5373. * message with its preceding host->target stats request message.
  5374. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5375. * - COOKIE_MSBS
  5376. * Bits 31:0
  5377. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5378. * message with its preceding host->target stats request message.
  5379. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5380. */
  5381. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5382. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5383. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5384. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5385. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5386. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5387. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5388. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5389. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5390. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5391. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5394. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5395. } while (0)
  5396. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5397. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5398. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5399. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5400. do { \
  5401. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5402. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5403. } while (0)
  5404. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5405. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5406. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5407. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5408. do { \
  5409. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5410. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5411. } while (0)
  5412. /**
  5413. * @brief host -> target FW PPDU_STATS request message
  5414. *
  5415. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5416. *
  5417. * @details
  5418. * The following field definitions describe the format of the HTT host
  5419. * to target FW for PPDU_STATS_CFG msg.
  5420. * The message allows the host to configure the PPDU_STATS_IND messages
  5421. * produced by the target.
  5422. *
  5423. * |31 24|23 16|15 8|7 0|
  5424. * |-----------------------------------------------------------|
  5425. * | REQ bit mask | pdev_mask | msg type |
  5426. * |-----------------------------------------------------------|
  5427. * Header fields:
  5428. * - MSG_TYPE
  5429. * Bits 7:0
  5430. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5431. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5432. * - PDEV_MASK
  5433. * Bits 8:15
  5434. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5435. * Value: This is a overloaded field, refer to usage and interpretation of
  5436. * PDEV in interface document.
  5437. * Bit 8 : Reserved for SOC stats
  5438. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5439. * Indicates MACID_MASK in DBS
  5440. * - REQ_TLV_BIT_MASK
  5441. * Bits 16:31
  5442. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5443. * needs to be included in the target's PPDU_STATS_IND messages.
  5444. * Value: refer htt_ppdu_stats_tlv_tag_t
  5445. *
  5446. */
  5447. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5448. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5449. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5450. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5451. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5452. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5453. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5454. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5455. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5456. do { \
  5457. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5458. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5459. } while (0)
  5460. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5461. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5462. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5463. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5466. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5467. } while (0)
  5468. /**
  5469. * @brief Host-->target HTT RX FSE setup message
  5470. *
  5471. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5472. *
  5473. * @details
  5474. * Through this message, the host will provide details of the flow tables
  5475. * in host DDR along with hash keys.
  5476. * This message can be sent per SOC or per PDEV, which is differentiated
  5477. * by pdev id values.
  5478. * The host will allocate flow search table and sends table size,
  5479. * physical DMA address of flow table, and hash keys to firmware to
  5480. * program into the RXOLE FSE HW block.
  5481. *
  5482. * The following field definitions describe the format of the RX FSE setup
  5483. * message sent from the host to target
  5484. *
  5485. * Header fields:
  5486. * dword0 - b'7:0 - msg_type: This will be set to
  5487. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5488. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5489. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5490. * pdev's LMAC ring.
  5491. * b'31:16 - reserved : Reserved for future use
  5492. * dword1 - b'19:0 - number of records: This field indicates the number of
  5493. * entries in the flow table. For example: 8k number of
  5494. * records is equivalent to
  5495. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5496. * b'27:20 - max search: This field specifies the skid length to FSE
  5497. * parser HW module whenever match is not found at the
  5498. * exact index pointed by hash.
  5499. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5500. * Refer htt_ip_da_sa_prefix below for more details.
  5501. * b'31:30 - reserved: Reserved for future use
  5502. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5503. * table allocated by host in DDR
  5504. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5505. * table allocated by host in DDR
  5506. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5507. * entry hashing
  5508. *
  5509. *
  5510. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5511. * |---------------------------------------------------------------|
  5512. * | reserved | pdev_id | MSG_TYPE |
  5513. * |---------------------------------------------------------------|
  5514. * |resvd|IPDSA| max_search | Number of records |
  5515. * |---------------------------------------------------------------|
  5516. * | base address lo |
  5517. * |---------------------------------------------------------------|
  5518. * | base address high |
  5519. * |---------------------------------------------------------------|
  5520. * | toeplitz key 31_0 |
  5521. * |---------------------------------------------------------------|
  5522. * | toeplitz key 63_32 |
  5523. * |---------------------------------------------------------------|
  5524. * | toeplitz key 95_64 |
  5525. * |---------------------------------------------------------------|
  5526. * | toeplitz key 127_96 |
  5527. * |---------------------------------------------------------------|
  5528. * | toeplitz key 159_128 |
  5529. * |---------------------------------------------------------------|
  5530. * | toeplitz key 191_160 |
  5531. * |---------------------------------------------------------------|
  5532. * | toeplitz key 223_192 |
  5533. * |---------------------------------------------------------------|
  5534. * | toeplitz key 255_224 |
  5535. * |---------------------------------------------------------------|
  5536. * | toeplitz key 287_256 |
  5537. * |---------------------------------------------------------------|
  5538. * | reserved | toeplitz key 314_288(26:0 bits) |
  5539. * |---------------------------------------------------------------|
  5540. * where:
  5541. * IPDSA = ip_da_sa
  5542. */
  5543. /**
  5544. * @brief: htt_ip_da_sa_prefix
  5545. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5546. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5547. * documentation per RFC3849
  5548. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5549. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5550. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5551. */
  5552. enum htt_ip_da_sa_prefix {
  5553. HTT_RX_IPV6_20010db8,
  5554. HTT_RX_IPV4_MAPPED_IPV6,
  5555. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5556. HTT_RX_IPV6_64FF9B,
  5557. };
  5558. /**
  5559. * @brief Host-->target HTT RX FISA configure and enable
  5560. *
  5561. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5562. *
  5563. * @details
  5564. * The host will send this command down to configure and enable the FISA
  5565. * operational params.
  5566. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5567. * register.
  5568. * Should configure both the MACs.
  5569. *
  5570. * dword0 - b'7:0 - msg_type:
  5571. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5572. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5573. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5574. * pdev's LMAC ring.
  5575. * b'31:16 - reserved : Reserved for future use
  5576. *
  5577. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5578. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5579. * packets. 1 flow search will be skipped
  5580. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5581. * tcp,udp packets
  5582. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5583. * calculation
  5584. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5585. * calculation
  5586. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5587. * calculation
  5588. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5589. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5590. * length
  5591. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5592. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5593. * length
  5594. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5595. * num jump
  5596. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5597. * num jump
  5598. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5599. * data type switch has happend for MPDU Sequence num jump
  5600. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5601. * for MPDU Sequence num jump
  5602. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5603. * for decrypt errors
  5604. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5605. * while aggregating a msdu
  5606. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5607. * The aggregation is done until (number of MSDUs aggregated
  5608. * < LIMIT + 1)
  5609. * b'31:18 - Reserved
  5610. *
  5611. * fisa_control_value - 32bit value FW can write to register
  5612. *
  5613. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5614. * Threshold value for FISA timeout (units are microseconds).
  5615. * When the global timestamp exceeds this threshold, FISA
  5616. * aggregation will be restarted.
  5617. * A value of 0 means timeout is disabled.
  5618. * Compare the threshold register with timestamp field in
  5619. * flow entry to generate timeout for the flow.
  5620. *
  5621. * |31 18 |17 16|15 8|7 0|
  5622. * |-------------------------------------------------------------|
  5623. * | reserved | pdev_mask | msg type |
  5624. * |-------------------------------------------------------------|
  5625. * | reserved | FISA_CTRL |
  5626. * |-------------------------------------------------------------|
  5627. * | FISA_TIMEOUT_THRESH |
  5628. * |-------------------------------------------------------------|
  5629. */
  5630. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5631. A_UINT32 msg_type:8,
  5632. pdev_id:8,
  5633. reserved0:16;
  5634. /**
  5635. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5636. * [17:0]
  5637. */
  5638. union {
  5639. /*
  5640. * fisa_control_bits structure is deprecated.
  5641. * Please use fisa_control_bits_v2 going forward.
  5642. */
  5643. struct {
  5644. A_UINT32 fisa_enable: 1,
  5645. ipsec_skip_search: 1,
  5646. nontcp_skip_search: 1,
  5647. add_ipv4_fixed_hdr_len: 1,
  5648. add_ipv6_fixed_hdr_len: 1,
  5649. add_tcp_fixed_hdr_len: 1,
  5650. add_udp_hdr_len: 1,
  5651. chksum_cum_ip_len_en: 1,
  5652. disable_tid_check: 1,
  5653. disable_ta_check: 1,
  5654. disable_qos_check: 1,
  5655. disable_raw_check: 1,
  5656. disable_decrypt_err_check: 1,
  5657. disable_msdu_drop_check: 1,
  5658. fisa_aggr_limit: 4,
  5659. reserved: 14;
  5660. } fisa_control_bits;
  5661. struct {
  5662. A_UINT32 fisa_enable: 1,
  5663. fisa_aggr_limit: 4,
  5664. reserved: 27;
  5665. } fisa_control_bits_v2;
  5666. A_UINT32 fisa_control_value;
  5667. } u_fisa_control;
  5668. /**
  5669. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5670. * timeout threshold for aggregation. Unit in usec.
  5671. * [31:0]
  5672. */
  5673. A_UINT32 fisa_timeout_threshold;
  5674. } POSTPACK;
  5675. /* DWord 0: pdev-ID */
  5676. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5677. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5678. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5679. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5680. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5681. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5685. } while (0)
  5686. /* Dword 1: fisa_control_value fisa config */
  5687. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5688. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5689. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5690. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5691. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5692. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5695. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5696. } while (0)
  5697. /* Dword 1: fisa_control_value ipsec_skip_search */
  5698. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5699. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5700. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5701. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5702. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5703. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5706. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5707. } while (0)
  5708. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5709. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5710. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5711. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5712. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5713. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5714. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5717. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5718. } while (0)
  5719. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5720. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5721. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5722. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5723. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5724. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5725. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5726. do { \
  5727. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5728. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5729. } while (0)
  5730. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5731. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5732. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5733. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5734. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5735. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5736. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5739. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5740. } while (0)
  5741. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5742. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5743. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5744. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5745. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5746. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5747. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5748. do { \
  5749. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5750. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5751. } while (0)
  5752. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5753. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5754. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5755. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5756. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5757. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5758. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5759. do { \
  5760. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5761. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5762. } while (0)
  5763. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5764. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5765. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5766. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5767. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5768. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5769. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5770. do { \
  5771. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5772. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5773. } while (0)
  5774. /* Dword 1: fisa_control_value disable_tid_check */
  5775. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5776. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5777. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5778. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5779. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5780. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5781. do { \
  5782. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5783. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5784. } while (0)
  5785. /* Dword 1: fisa_control_value disable_ta_check */
  5786. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5787. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5788. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5789. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5790. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5791. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5792. do { \
  5793. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5794. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5795. } while (0)
  5796. /* Dword 1: fisa_control_value disable_qos_check */
  5797. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5798. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5799. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5800. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5801. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5802. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5803. do { \
  5804. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5805. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5806. } while (0)
  5807. /* Dword 1: fisa_control_value disable_raw_check */
  5808. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5809. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5810. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5811. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5812. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5813. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5816. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5817. } while (0)
  5818. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5819. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5820. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5821. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5822. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5823. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5824. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5825. do { \
  5826. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5827. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5828. } while (0)
  5829. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5830. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5831. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5832. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5833. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5834. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5835. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5836. do { \
  5837. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5838. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5839. } while (0)
  5840. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5841. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5842. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5843. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5844. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5845. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5846. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5847. do { \
  5848. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5849. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5850. } while (0)
  5851. /* Dword 1: fisa_control_value fisa config */
  5852. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5853. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5854. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5855. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5856. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5857. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5858. do { \
  5859. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5860. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5861. } while (0)
  5862. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5863. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5864. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5865. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5866. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5867. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5868. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5869. do { \
  5870. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5871. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5872. } while (0)
  5873. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5874. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5875. pdev_id:8,
  5876. reserved0:16;
  5877. A_UINT32 num_records:20,
  5878. max_search:8,
  5879. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5880. reserved1:2;
  5881. A_UINT32 base_addr_lo;
  5882. A_UINT32 base_addr_hi;
  5883. A_UINT32 toeplitz31_0;
  5884. A_UINT32 toeplitz63_32;
  5885. A_UINT32 toeplitz95_64;
  5886. A_UINT32 toeplitz127_96;
  5887. A_UINT32 toeplitz159_128;
  5888. A_UINT32 toeplitz191_160;
  5889. A_UINT32 toeplitz223_192;
  5890. A_UINT32 toeplitz255_224;
  5891. A_UINT32 toeplitz287_256;
  5892. A_UINT32 toeplitz314_288:27,
  5893. reserved2:5;
  5894. } POSTPACK;
  5895. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5896. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5897. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5898. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5899. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5900. /* DWORD 0: Pdev ID */
  5901. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5902. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5903. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5904. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5905. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5906. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5907. do { \
  5908. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5909. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5910. } while (0)
  5911. /* DWORD 1:num of records */
  5912. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5913. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5914. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5915. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5916. HTT_RX_FSE_SETUP_NUM_REC_S)
  5917. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5920. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5921. } while (0)
  5922. /* DWORD 1:max_search */
  5923. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5924. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5925. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5926. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5927. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5928. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5929. do { \
  5930. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5931. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5932. } while (0)
  5933. /* DWORD 1:ip_da_sa prefix */
  5934. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5935. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5936. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5937. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5938. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5939. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5942. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5943. } while (0)
  5944. /* DWORD 2: Base Address LO */
  5945. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5946. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5947. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5948. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5949. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5950. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5951. do { \
  5952. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5953. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5954. } while (0)
  5955. /* DWORD 3: Base Address High */
  5956. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5957. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5958. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5959. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5960. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5961. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5962. do { \
  5963. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5964. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5965. } while (0)
  5966. /* DWORD 4-12: Hash Value */
  5967. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5968. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5969. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5970. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5971. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5972. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5973. do { \
  5974. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5975. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5976. } while (0)
  5977. /* DWORD 13: Hash Value 314:288 bits */
  5978. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5979. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5980. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5981. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5984. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5985. } while (0)
  5986. /**
  5987. * @brief Host-->target HTT RX FSE operation message
  5988. *
  5989. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5990. *
  5991. * @details
  5992. * The host will send this Flow Search Engine (FSE) operation message for
  5993. * every flow add/delete operation.
  5994. * The FSE operation includes FSE full cache invalidation or individual entry
  5995. * invalidation.
  5996. * This message can be sent per SOC or per PDEV which is differentiated
  5997. * by pdev id values.
  5998. *
  5999. * |31 16|15 8|7 1|0|
  6000. * |-------------------------------------------------------------|
  6001. * | reserved | pdev_id | MSG_TYPE |
  6002. * |-------------------------------------------------------------|
  6003. * | reserved | operation |I|
  6004. * |-------------------------------------------------------------|
  6005. * | ip_src_addr_31_0 |
  6006. * |-------------------------------------------------------------|
  6007. * | ip_src_addr_63_32 |
  6008. * |-------------------------------------------------------------|
  6009. * | ip_src_addr_95_64 |
  6010. * |-------------------------------------------------------------|
  6011. * | ip_src_addr_127_96 |
  6012. * |-------------------------------------------------------------|
  6013. * | ip_dst_addr_31_0 |
  6014. * |-------------------------------------------------------------|
  6015. * | ip_dst_addr_63_32 |
  6016. * |-------------------------------------------------------------|
  6017. * | ip_dst_addr_95_64 |
  6018. * |-------------------------------------------------------------|
  6019. * | ip_dst_addr_127_96 |
  6020. * |-------------------------------------------------------------|
  6021. * | l4_dst_port | l4_src_port |
  6022. * | (32-bit SPI incase of IPsec) |
  6023. * |-------------------------------------------------------------|
  6024. * | reserved | l4_proto |
  6025. * |-------------------------------------------------------------|
  6026. *
  6027. * where I is 1-bit ipsec_valid.
  6028. *
  6029. * The following field definitions describe the format of the RX FSE operation
  6030. * message sent from the host to target for every add/delete flow entry to flow
  6031. * table.
  6032. *
  6033. * Header fields:
  6034. * dword0 - b'7:0 - msg_type: This will be set to
  6035. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6036. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6037. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6038. * specified pdev's LMAC ring.
  6039. * b'31:16 - reserved : Reserved for future use
  6040. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6041. * (Internet Protocol Security).
  6042. * IPsec describes the framework for providing security at
  6043. * IP layer. IPsec is defined for both versions of IP:
  6044. * IPV4 and IPV6.
  6045. * Please refer to htt_rx_flow_proto enumeration below for
  6046. * more info.
  6047. * ipsec_valid = 1 for IPSEC packets
  6048. * ipsec_valid = 0 for IP Packets
  6049. * b'7:1 - operation: This indicates types of FSE operation.
  6050. * Refer to htt_rx_fse_operation enumeration:
  6051. * 0 - No Cache Invalidation required
  6052. * 1 - Cache invalidate only one entry given by IP
  6053. * src/dest address at DWORD[2:9]
  6054. * 2 - Complete FSE Cache Invalidation
  6055. * 3 - FSE Disable
  6056. * 4 - FSE Enable
  6057. * b'31:8 - reserved: Reserved for future use
  6058. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6059. * for per flow addition/deletion
  6060. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6061. * and the subsequent 3 A_UINT32 will be padding bytes.
  6062. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6063. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6064. * from 0 to 65535 but only 0 to 1023 are designated as
  6065. * well-known ports. Refer to [RFC1700] for more details.
  6066. * This field is valid only if
  6067. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6068. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6069. * range from 0 to 65535 but only 0 to 1023 are designated
  6070. * as well-known ports. Refer to [RFC1700] for more details.
  6071. * This field is valid only if
  6072. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6073. * - SPI (31:0): Security Parameters Index is an
  6074. * identification tag added to the header while using IPsec
  6075. * for tunneling the IP traffici.
  6076. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6077. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6078. * Assigned Internet Protocol Numbers.
  6079. * l4_proto numbers for standard protocol like UDP/TCP
  6080. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6081. * l4_proto = 17 for UDP etc.
  6082. * b'31:8 - reserved: Reserved for future use.
  6083. *
  6084. */
  6085. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6086. A_UINT32 msg_type:8,
  6087. pdev_id:8,
  6088. reserved0:16;
  6089. A_UINT32 ipsec_valid:1,
  6090. operation:7,
  6091. reserved1:24;
  6092. A_UINT32 ip_src_addr_31_0;
  6093. A_UINT32 ip_src_addr_63_32;
  6094. A_UINT32 ip_src_addr_95_64;
  6095. A_UINT32 ip_src_addr_127_96;
  6096. A_UINT32 ip_dest_addr_31_0;
  6097. A_UINT32 ip_dest_addr_63_32;
  6098. A_UINT32 ip_dest_addr_95_64;
  6099. A_UINT32 ip_dest_addr_127_96;
  6100. union {
  6101. A_UINT32 spi;
  6102. struct {
  6103. A_UINT32 l4_src_port:16,
  6104. l4_dest_port:16;
  6105. } ip;
  6106. } u;
  6107. A_UINT32 l4_proto:8,
  6108. reserved:24;
  6109. } POSTPACK;
  6110. /**
  6111. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6112. *
  6113. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6114. *
  6115. * @details
  6116. * The host will send this Full monitor mode register configuration message.
  6117. * This message can be sent per SOC or per PDEV which is differentiated
  6118. * by pdev id values.
  6119. *
  6120. * |31 16|15 11|10 8|7 3|2|1|0|
  6121. * |-------------------------------------------------------------|
  6122. * | reserved | pdev_id | MSG_TYPE |
  6123. * |-------------------------------------------------------------|
  6124. * | reserved |Release Ring |N|Z|E|
  6125. * |-------------------------------------------------------------|
  6126. *
  6127. * where E is 1-bit full monitor mode enable/disable.
  6128. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6129. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6130. *
  6131. * The following field definitions describe the format of the full monitor
  6132. * mode configuration message sent from the host to target for each pdev.
  6133. *
  6134. * Header fields:
  6135. * dword0 - b'7:0 - msg_type: This will be set to
  6136. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6137. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6138. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6139. * specified pdev's LMAC ring.
  6140. * b'31:16 - reserved : Reserved for future use.
  6141. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6142. * monitor mode rxdma register is to be enabled or disabled.
  6143. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6144. * additional descriptors at ppdu end for zero mpdus
  6145. * enabled or disabled.
  6146. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6147. * additional descriptors at ppdu end for non zero mpdus
  6148. * enabled or disabled.
  6149. * b'10:3 - release_ring: This indicates the destination ring
  6150. * selection for the descriptor at the end of PPDU
  6151. * 0 - REO ring select
  6152. * 1 - FW ring select
  6153. * 2 - SW ring select
  6154. * 3 - Release ring select
  6155. * Refer to htt_rx_full_mon_release_ring.
  6156. * b'31:11 - reserved for future use
  6157. */
  6158. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6159. A_UINT32 msg_type:8,
  6160. pdev_id:8,
  6161. reserved0:16;
  6162. A_UINT32 full_monitor_mode_enable:1,
  6163. addnl_descs_zero_mpdus_end:1,
  6164. addnl_descs_non_zero_mpdus_end:1,
  6165. release_ring:8,
  6166. reserved1:21;
  6167. } POSTPACK;
  6168. /**
  6169. * Enumeration for full monitor mode destination ring select
  6170. * 0 - REO destination ring select
  6171. * 1 - FW destination ring select
  6172. * 2 - SW destination ring select
  6173. * 3 - Release destination ring select
  6174. */
  6175. enum htt_rx_full_mon_release_ring {
  6176. HTT_RX_MON_RING_REO,
  6177. HTT_RX_MON_RING_FW,
  6178. HTT_RX_MON_RING_SW,
  6179. HTT_RX_MON_RING_RELEASE,
  6180. };
  6181. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6182. /* DWORD 0: Pdev ID */
  6183. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6184. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6185. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6186. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6187. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6188. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6189. do { \
  6190. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6191. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6192. } while (0)
  6193. /* DWORD 1:ENABLE */
  6194. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6195. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6196. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6197. do { \
  6198. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6199. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6200. } while (0)
  6201. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6202. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6203. /* DWORD 1:ZERO_MPDU */
  6204. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6205. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6206. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6207. do { \
  6208. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6209. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6210. } while (0)
  6211. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6212. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6213. /* DWORD 1:NON_ZERO_MPDU */
  6214. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6215. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6216. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6217. do { \
  6218. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6219. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6220. } while (0)
  6221. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6222. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6223. /* DWORD 1:RELEASE_RINGS */
  6224. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6225. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6226. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6229. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6230. } while (0)
  6231. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6232. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6233. /**
  6234. * Enumeration for IP Protocol or IPSEC Protocol
  6235. * IPsec describes the framework for providing security at IP layer.
  6236. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6237. */
  6238. enum htt_rx_flow_proto {
  6239. HTT_RX_FLOW_IP_PROTO,
  6240. HTT_RX_FLOW_IPSEC_PROTO,
  6241. };
  6242. /**
  6243. * Enumeration for FSE Cache Invalidation
  6244. * 0 - No Cache Invalidation required
  6245. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6246. * 2 - Complete FSE Cache Invalidation
  6247. * 3 - FSE Disable
  6248. * 4 - FSE Enable
  6249. */
  6250. enum htt_rx_fse_operation {
  6251. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6252. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6253. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6254. HTT_RX_FSE_DISABLE,
  6255. HTT_RX_FSE_ENABLE,
  6256. };
  6257. /* DWORD 0: Pdev ID */
  6258. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6259. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6260. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6261. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6262. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6263. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6264. do { \
  6265. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6266. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6267. } while (0)
  6268. /* DWORD 1:IP PROTO or IPSEC */
  6269. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6270. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6271. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6272. do { \
  6273. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6274. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6275. } while (0)
  6276. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6277. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6278. /* DWORD 1:FSE Operation */
  6279. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6280. #define HTT_RX_FSE_OPERATION_S 1
  6281. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6282. do { \
  6283. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6284. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6285. } while (0)
  6286. #define HTT_RX_FSE_OPERATION_GET(word) \
  6287. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6288. /* DWORD 2-9:IP Address */
  6289. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6290. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6291. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6292. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6293. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6294. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6297. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6298. } while (0)
  6299. /* DWORD 10:Source Port Number */
  6300. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6301. #define HTT_RX_FSE_SOURCEPORT_S 0
  6302. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6303. do { \
  6304. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6305. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6306. } while (0)
  6307. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6308. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6309. /* DWORD 11:Destination Port Number */
  6310. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6311. #define HTT_RX_FSE_DESTPORT_S 16
  6312. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6315. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6316. } while (0)
  6317. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6318. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6319. /* DWORD 10-11:SPI (In case of IPSEC) */
  6320. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6321. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6322. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6323. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6324. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6325. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6328. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6329. } while (0)
  6330. /* DWORD 12:L4 PROTO */
  6331. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6332. #define HTT_RX_FSE_L4_PROTO_S 0
  6333. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6334. do { \
  6335. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6336. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6337. } while (0)
  6338. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6339. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6340. /**
  6341. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6342. *
  6343. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6344. *
  6345. * |31 24|23 |15 8|7 2|1|0|
  6346. * |----------------+----------------+----------------+----------------|
  6347. * | reserved | pdev_id | msg_type |
  6348. * |---------------------------------+----------------+----------------|
  6349. * | reserved |E|F|
  6350. * |---------------------------------+----------------+----------------|
  6351. * Where E = Configure the target to provide the 3-tuple hash value in
  6352. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6353. * F = Configure the target to provide the 3-tuple hash value in
  6354. * flow_id_toeplitz field of rx_msdu_start tlv
  6355. *
  6356. * The following field definitions describe the format of the 3 tuple hash value
  6357. * message sent from the host to target as part of initialization sequence.
  6358. *
  6359. * Header fields:
  6360. * dword0 - b'7:0 - msg_type: This will be set to
  6361. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6362. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6363. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6364. * specified pdev's LMAC ring.
  6365. * b'31:16 - reserved : Reserved for future use
  6366. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6367. * b'1 - toeplitz_hash_2_or_4_field_enable
  6368. * b'31:2 - reserved : Reserved for future use
  6369. * ---------+------+----------------------------------------------------------
  6370. * bit1 | bit0 | Functionality
  6371. * ---------+------+----------------------------------------------------------
  6372. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6373. * | | in flow_id_toeplitz field
  6374. * ---------+------+----------------------------------------------------------
  6375. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6376. * | | in toeplitz_hash_2_or_4 field
  6377. * ---------+------+----------------------------------------------------------
  6378. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6379. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6380. * ---------+------+----------------------------------------------------------
  6381. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6382. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6383. * | | toeplitz_hash_2_or_4 field
  6384. *----------------------------------------------------------------------------
  6385. */
  6386. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6387. A_UINT32 msg_type :8,
  6388. pdev_id :8,
  6389. reserved0 :16;
  6390. A_UINT32 flow_id_toeplitz_field_enable :1,
  6391. toeplitz_hash_2_or_4_field_enable :1,
  6392. reserved1 :30;
  6393. } POSTPACK;
  6394. /* DWORD0 : pdev_id configuration Macros */
  6395. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6396. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6397. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6398. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6399. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6400. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6401. do { \
  6402. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6403. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6404. } while (0)
  6405. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6406. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6407. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6408. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6409. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6410. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6411. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6412. do { \
  6413. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6414. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6415. } while (0)
  6416. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6417. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6418. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6419. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6420. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6421. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6424. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6425. } while (0)
  6426. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6427. /**
  6428. * @brief host --> target Host PA Address Size
  6429. *
  6430. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6431. *
  6432. * @details
  6433. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6434. * provide the physical start address and size of each of the memory
  6435. * areas within host DDR that the target FW may need to access.
  6436. *
  6437. * For example, the host can use this message to allow the target FW
  6438. * to set up access to the host's pools of TQM link descriptors.
  6439. * The message would appear as follows:
  6440. *
  6441. * |31 24|23 16|15 8|7 0|
  6442. * |----------------+----------------+----------------+----------------|
  6443. * | reserved | num_entries | msg_type |
  6444. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6445. * | mem area 0 size |
  6446. * |----------------+----------------+----------------+----------------|
  6447. * | mem area 0 physical_address_lo |
  6448. * |----------------+----------------+----------------+----------------|
  6449. * | mem area 0 physical_address_hi |
  6450. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6451. * | mem area 1 size |
  6452. * |----------------+----------------+----------------+----------------|
  6453. * | mem area 1 physical_address_lo |
  6454. * |----------------+----------------+----------------+----------------|
  6455. * | mem area 1 physical_address_hi |
  6456. * |----------------+----------------+----------------+----------------|
  6457. * ...
  6458. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6459. * | mem area N size |
  6460. * |----------------+----------------+----------------+----------------|
  6461. * | mem area N physical_address_lo |
  6462. * |----------------+----------------+----------------+----------------|
  6463. * | mem area N physical_address_hi |
  6464. * |----------------+----------------+----------------+----------------|
  6465. *
  6466. * The message is interpreted as follows:
  6467. * dword0 - b'0:7 - msg_type: This will be set to
  6468. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6469. * b'8:15 - number_entries: Indicated the number of host memory
  6470. * areas specified within the remainder of the message
  6471. * b'16:31 - reserved.
  6472. * dword1 - b'0:31 - memory area 0 size in bytes
  6473. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6474. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6475. * and similar for memory area 1 through memory area N.
  6476. */
  6477. PREPACK struct htt_h2t_host_paddr_size {
  6478. A_UINT32 msg_type: 8,
  6479. num_entries: 8,
  6480. reserved: 16;
  6481. } POSTPACK;
  6482. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6483. A_UINT32 size;
  6484. A_UINT32 physical_address_lo;
  6485. A_UINT32 physical_address_hi;
  6486. } POSTPACK;
  6487. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6488. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6489. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6490. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6491. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6492. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6493. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6496. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6497. } while (0)
  6498. /**
  6499. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  6500. *
  6501. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  6502. *
  6503. * @details
  6504. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  6505. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  6506. *
  6507. * The message would appear as follows:
  6508. *
  6509. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  6510. * |---------------------------------+---+---+----------+-+-----------|
  6511. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  6512. * |---------------------+---+---+---+---+---+----------+-+-----------|
  6513. *
  6514. *
  6515. * The message is interpreted as follows:
  6516. * dword0 - b'0:7 - msg_type: This will be set to
  6517. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  6518. * b'8 - override bit to drive MSDUs to PPE ring
  6519. * b'9:13 - REO destination ring indication
  6520. * b'14 - Multi buffer msdu override enable bit
  6521. * b'15 - Intra BSS override
  6522. * b'16 - Decap raw override
  6523. * b'17 - Decap Native wifi override
  6524. * b'18 - IP frag override
  6525. * b'19:31 - reserved
  6526. */
  6527. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  6528. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  6529. override: 1,
  6530. reo_destination_indication: 5,
  6531. multi_buffer_msdu_override_en: 1,
  6532. intra_bss_override: 1,
  6533. decap_raw_override: 1,
  6534. decap_nwifi_override: 1,
  6535. ip_frag_override: 1,
  6536. reserved: 13;
  6537. } POSTPACK;
  6538. /* DWORD 0: Override */
  6539. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  6540. #define HTT_PPE_CFG_OVERRIDE_S 8
  6541. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  6542. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  6543. HTT_PPE_CFG_OVERRIDE_S)
  6544. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  6547. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  6548. } while (0)
  6549. /* DWORD 0: REO Destination Indication*/
  6550. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  6551. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  6552. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  6553. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  6554. HTT_PPE_CFG_REO_DEST_IND_S)
  6555. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  6556. do { \
  6557. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  6558. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  6559. } while (0)
  6560. /* DWORD 0: Multi buffer MSDU override */
  6561. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  6562. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  6563. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  6564. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  6565. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  6566. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  6567. do { \
  6568. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  6569. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  6570. } while (0)
  6571. /* DWORD 0: Intra BSS override */
  6572. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  6573. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  6574. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  6575. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  6576. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  6577. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  6578. do { \
  6579. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  6580. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  6581. } while (0)
  6582. /* DWORD 0: Decap RAW override */
  6583. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  6584. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  6585. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  6586. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  6587. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  6588. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  6591. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  6592. } while (0)
  6593. /* DWORD 0: Decap NWIFI override */
  6594. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  6595. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  6596. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  6597. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  6598. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  6599. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  6600. do { \
  6601. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  6602. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  6603. } while (0)
  6604. /* DWORD 0: IP frag override */
  6605. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  6606. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  6607. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  6608. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  6609. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  6610. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  6613. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  6614. } while (0)
  6615. /*
  6616. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  6617. *
  6618. * @details
  6619. * The following field definitions describe the format of the HTT host
  6620. * to target FW VDEV TX RX stats retrieve message.
  6621. * The message specifies the type of stats the host wants to retrieve.
  6622. *
  6623. * |31 27|26 25|24 17|16|15 8|7 0|
  6624. * |-----------------------------------------------------------|
  6625. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  6626. * |-----------------------------------------------------------|
  6627. * | vdev_id lower bitmask |
  6628. * |-----------------------------------------------------------|
  6629. * | vdev_id upper bitmask |
  6630. * |-----------------------------------------------------------|
  6631. * Header fields:
  6632. * Where:
  6633. * dword0 - b'7:0 - msg_type: This will be set to
  6634. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  6635. * b'15:8 - pdev id
  6636. * b'16(E) - Enable/Disable the vdev HW stats
  6637. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  6638. * b'25:26(R) - Reset stats bits
  6639. * 0: don't reset stats
  6640. * 1: reset stats once
  6641. * 2: reset stats at the start of each periodic interval
  6642. * b'27:31 - reserved for future use
  6643. * dword1 - b'0:31 - vdev_id lower bitmask
  6644. * dword2 - b'0:31 - vdev_id upper bitmask
  6645. */
  6646. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  6647. A_UINT32 msg_type :8,
  6648. pdev_id :8,
  6649. enable :1,
  6650. periodic_interval :8,
  6651. reset_stats_bits :2,
  6652. reserved0 :5;
  6653. A_UINT32 vdev_id_lower_bitmask;
  6654. A_UINT32 vdev_id_upper_bitmask;
  6655. } POSTPACK;
  6656. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  6657. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  6658. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  6659. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  6660. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  6661. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  6664. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  6665. } while (0)
  6666. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  6667. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  6668. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  6669. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  6670. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  6671. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  6672. do { \
  6673. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  6674. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  6675. } while (0)
  6676. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  6677. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  6678. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  6679. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  6680. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  6681. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  6682. do { \
  6683. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  6684. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  6685. } while (0)
  6686. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  6687. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  6688. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  6689. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  6690. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  6691. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  6692. do { \
  6693. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  6694. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  6695. } while (0)
  6696. /*=== target -> host messages ===============================================*/
  6697. enum htt_t2h_msg_type {
  6698. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6699. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6700. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6701. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6702. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6703. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6704. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6705. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6706. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6707. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6708. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6709. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6710. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6711. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6712. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6713. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6714. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6715. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6716. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6717. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6718. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6719. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6720. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6721. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6722. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6723. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6724. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6725. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6726. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6727. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6728. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6729. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6730. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6731. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6732. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6733. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6734. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6735. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6736. /* TX_OFFLOAD_DELIVER_IND:
  6737. * Forward the target's locally-generated packets to the host,
  6738. * to provide to the monitor mode interface.
  6739. */
  6740. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6741. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6742. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6743. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6744. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  6745. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  6746. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  6747. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  6748. HTT_T2H_MSG_TYPE_TEST,
  6749. /* keep this last */
  6750. HTT_T2H_NUM_MSGS
  6751. };
  6752. /*
  6753. * HTT target to host message type -
  6754. * stored in bits 7:0 of the first word of the message
  6755. */
  6756. #define HTT_T2H_MSG_TYPE_M 0xff
  6757. #define HTT_T2H_MSG_TYPE_S 0
  6758. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6759. do { \
  6760. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6761. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6762. } while (0)
  6763. #define HTT_T2H_MSG_TYPE_GET(word) \
  6764. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6765. /**
  6766. * @brief target -> host version number confirmation message definition
  6767. *
  6768. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6769. *
  6770. * |31 24|23 16|15 8|7 0|
  6771. * |----------------+----------------+----------------+----------------|
  6772. * | reserved | major number | minor number | msg type |
  6773. * |-------------------------------------------------------------------|
  6774. * : option request TLV (optional) |
  6775. * :...................................................................:
  6776. *
  6777. * The VER_CONF message may consist of a single 4-byte word, or may be
  6778. * extended with TLVs that specify HTT options selected by the target.
  6779. * The following option TLVs may be appended to the VER_CONF message:
  6780. * - LL_BUS_ADDR_SIZE
  6781. * - HL_SUPPRESS_TX_COMPL_IND
  6782. * - MAX_TX_QUEUE_GROUPS
  6783. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6784. * may be appended to the VER_CONF message (but only one TLV of each type).
  6785. *
  6786. * Header fields:
  6787. * - MSG_TYPE
  6788. * Bits 7:0
  6789. * Purpose: identifies this as a version number confirmation message
  6790. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6791. * - VER_MINOR
  6792. * Bits 15:8
  6793. * Purpose: Specify the minor number of the HTT message library version
  6794. * in use by the target firmware.
  6795. * The minor number specifies the specific revision within a range
  6796. * of fundamentally compatible HTT message definition revisions.
  6797. * Compatible revisions involve adding new messages or perhaps
  6798. * adding new fields to existing messages, in a backwards-compatible
  6799. * manner.
  6800. * Incompatible revisions involve changing the message type values,
  6801. * or redefining existing messages.
  6802. * Value: minor number
  6803. * - VER_MAJOR
  6804. * Bits 15:8
  6805. * Purpose: Specify the major number of the HTT message library version
  6806. * in use by the target firmware.
  6807. * The major number specifies the family of minor revisions that are
  6808. * fundamentally compatible with each other, but not with prior or
  6809. * later families.
  6810. * Value: major number
  6811. */
  6812. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6813. #define HTT_VER_CONF_MINOR_S 8
  6814. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6815. #define HTT_VER_CONF_MAJOR_S 16
  6816. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6817. do { \
  6818. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6819. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6820. } while (0)
  6821. #define HTT_VER_CONF_MINOR_GET(word) \
  6822. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6823. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6824. do { \
  6825. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6826. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6827. } while (0)
  6828. #define HTT_VER_CONF_MAJOR_GET(word) \
  6829. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6830. #define HTT_VER_CONF_BYTES 4
  6831. /**
  6832. * @brief - target -> host HTT Rx In order indication message
  6833. *
  6834. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6835. *
  6836. * @details
  6837. *
  6838. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6839. * |----------------+-------------------+---------------------+---------------|
  6840. * | peer ID | P| F| O| ext TID | msg type |
  6841. * |--------------------------------------------------------------------------|
  6842. * | MSDU count | Reserved | vdev id |
  6843. * |--------------------------------------------------------------------------|
  6844. * | MSDU 0 bus address (bits 31:0) |
  6845. #if HTT_PADDR64
  6846. * | MSDU 0 bus address (bits 63:32) |
  6847. #endif
  6848. * |--------------------------------------------------------------------------|
  6849. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6850. * |--------------------------------------------------------------------------|
  6851. * | MSDU 1 bus address (bits 31:0) |
  6852. #if HTT_PADDR64
  6853. * | MSDU 1 bus address (bits 63:32) |
  6854. #endif
  6855. * |--------------------------------------------------------------------------|
  6856. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6857. * |--------------------------------------------------------------------------|
  6858. */
  6859. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6860. *
  6861. * @details
  6862. * bits
  6863. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6864. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6865. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6866. * | | frag | | | | fail |chksum fail|
  6867. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6868. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6869. */
  6870. struct htt_rx_in_ord_paddr_ind_hdr_t
  6871. {
  6872. A_UINT32 /* word 0 */
  6873. msg_type: 8,
  6874. ext_tid: 5,
  6875. offload: 1,
  6876. frag: 1,
  6877. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6878. peer_id: 16;
  6879. A_UINT32 /* word 1 */
  6880. vap_id: 8,
  6881. /* NOTE:
  6882. * This reserved_1 field is not truly reserved - certain targets use
  6883. * this field internally to store debug information, and do not zero
  6884. * out the contents of the field before uploading the message to the
  6885. * host. Thus, any host-target communication supported by this field
  6886. * is limited to using values that are never used by the debug
  6887. * information stored by certain targets in the reserved_1 field.
  6888. * In particular, the targets in question don't use the value 0x3
  6889. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6890. * so this previously-unused value within these bits is available to
  6891. * use as the host / target PKT_CAPTURE_MODE flag.
  6892. */
  6893. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6894. /* if pkt_capture_mode == 0x3, host should
  6895. * send rx frames to monitor mode interface
  6896. */
  6897. msdu_cnt: 16;
  6898. };
  6899. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6900. {
  6901. A_UINT32 dma_addr;
  6902. A_UINT32
  6903. length: 16,
  6904. fw_desc: 8,
  6905. msdu_info:8;
  6906. };
  6907. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6908. {
  6909. A_UINT32 dma_addr_lo;
  6910. A_UINT32 dma_addr_hi;
  6911. A_UINT32
  6912. length: 16,
  6913. fw_desc: 8,
  6914. msdu_info:8;
  6915. };
  6916. #if HTT_PADDR64
  6917. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6918. #else
  6919. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6920. #endif
  6921. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6922. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6923. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6924. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6925. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6926. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6927. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6928. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6929. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6930. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6931. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6932. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6933. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6934. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6935. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6936. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6937. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6938. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6939. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6940. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6941. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6942. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6943. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6944. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6945. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6946. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6947. /* for systems using 64-bit format for bus addresses */
  6948. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6949. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6950. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6951. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6952. /* for systems using 32-bit format for bus addresses */
  6953. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6954. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6955. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6956. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6957. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6958. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6959. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6960. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6961. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6962. do { \
  6963. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6964. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6965. } while (0)
  6966. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6967. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6968. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6969. do { \
  6970. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6971. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6972. } while (0)
  6973. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6974. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6975. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6978. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6979. } while (0)
  6980. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6981. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6982. /*
  6983. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6984. * deliver the rx frames to the monitor mode interface.
  6985. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6986. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6987. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6988. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6989. */
  6990. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6991. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6992. do { \
  6993. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6994. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6995. } while (0)
  6996. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6997. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6998. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6999. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7000. do { \
  7001. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7002. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7003. } while (0)
  7004. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7005. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7006. /* for systems using 64-bit format for bus addresses */
  7007. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7008. do { \
  7009. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7010. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7011. } while (0)
  7012. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7013. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7014. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7015. do { \
  7016. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7017. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7018. } while (0)
  7019. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7020. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7021. /* for systems using 32-bit format for bus addresses */
  7022. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7023. do { \
  7024. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7025. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7026. } while (0)
  7027. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7028. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7029. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7030. do { \
  7031. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7032. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7033. } while (0)
  7034. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7035. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7036. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7037. do { \
  7038. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7039. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7040. } while (0)
  7041. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7042. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7043. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7044. do { \
  7045. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7046. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7047. } while (0)
  7048. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7049. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7050. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7051. do { \
  7052. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7053. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7054. } while (0)
  7055. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7056. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7057. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7058. do { \
  7059. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7060. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7061. } while (0)
  7062. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7063. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7064. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7065. do { \
  7066. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7067. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7068. } while (0)
  7069. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7070. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7071. /* definitions used within target -> host rx indication message */
  7072. PREPACK struct htt_rx_ind_hdr_prefix_t
  7073. {
  7074. A_UINT32 /* word 0 */
  7075. msg_type: 8,
  7076. ext_tid: 5,
  7077. release_valid: 1,
  7078. flush_valid: 1,
  7079. reserved0: 1,
  7080. peer_id: 16;
  7081. A_UINT32 /* word 1 */
  7082. flush_start_seq_num: 6,
  7083. flush_end_seq_num: 6,
  7084. release_start_seq_num: 6,
  7085. release_end_seq_num: 6,
  7086. num_mpdu_ranges: 8;
  7087. } POSTPACK;
  7088. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7089. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7090. #define HTT_TGT_RSSI_INVALID 0x80
  7091. PREPACK struct htt_rx_ppdu_desc_t
  7092. {
  7093. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7094. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7095. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7096. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7097. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7098. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7099. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7100. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7101. A_UINT32 /* word 0 */
  7102. rssi_cmb: 8,
  7103. timestamp_submicrosec: 8,
  7104. phy_err_code: 8,
  7105. phy_err: 1,
  7106. legacy_rate: 4,
  7107. legacy_rate_sel: 1,
  7108. end_valid: 1,
  7109. start_valid: 1;
  7110. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7111. union {
  7112. A_UINT32 /* word 1 */
  7113. rssi0_pri20: 8,
  7114. rssi0_ext20: 8,
  7115. rssi0_ext40: 8,
  7116. rssi0_ext80: 8;
  7117. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7118. } u0;
  7119. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7120. union {
  7121. A_UINT32 /* word 2 */
  7122. rssi1_pri20: 8,
  7123. rssi1_ext20: 8,
  7124. rssi1_ext40: 8,
  7125. rssi1_ext80: 8;
  7126. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7127. } u1;
  7128. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7129. union {
  7130. A_UINT32 /* word 3 */
  7131. rssi2_pri20: 8,
  7132. rssi2_ext20: 8,
  7133. rssi2_ext40: 8,
  7134. rssi2_ext80: 8;
  7135. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7136. } u2;
  7137. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7138. union {
  7139. A_UINT32 /* word 4 */
  7140. rssi3_pri20: 8,
  7141. rssi3_ext20: 8,
  7142. rssi3_ext40: 8,
  7143. rssi3_ext80: 8;
  7144. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7145. } u3;
  7146. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7147. A_UINT32 tsf32; /* word 5 */
  7148. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7149. A_UINT32 timestamp_microsec; /* word 6 */
  7150. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7151. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7152. A_UINT32 /* word 7 */
  7153. vht_sig_a1: 24,
  7154. preamble_type: 8;
  7155. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7156. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7157. A_UINT32 /* word 8 */
  7158. vht_sig_a2: 24,
  7159. /* sa_ant_matrix
  7160. * For cases where a single rx chain has options to be connected to
  7161. * different rx antennas, show which rx antennas were in use during
  7162. * receipt of a given PPDU.
  7163. * This sa_ant_matrix provides a bitmask of the antennas used while
  7164. * receiving this frame.
  7165. */
  7166. sa_ant_matrix: 8;
  7167. } POSTPACK;
  7168. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7169. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7170. PREPACK struct htt_rx_ind_hdr_suffix_t
  7171. {
  7172. A_UINT32 /* word 0 */
  7173. fw_rx_desc_bytes: 16,
  7174. reserved0: 16;
  7175. } POSTPACK;
  7176. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7177. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7178. PREPACK struct htt_rx_ind_hdr_t
  7179. {
  7180. struct htt_rx_ind_hdr_prefix_t prefix;
  7181. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7182. struct htt_rx_ind_hdr_suffix_t suffix;
  7183. } POSTPACK;
  7184. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7185. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7186. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7187. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7188. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7189. /*
  7190. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7191. * the offset into the HTT rx indication message at which the
  7192. * FW rx PPDU descriptor resides
  7193. */
  7194. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7195. /*
  7196. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7197. * the offset into the HTT rx indication message at which the
  7198. * header suffix (FW rx MSDU byte count) resides
  7199. */
  7200. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7201. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7202. /*
  7203. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7204. * the offset into the HTT rx indication message at which the per-MSDU
  7205. * information starts
  7206. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7207. * per-MSDU information portion of the message. The per-MSDU info itself
  7208. * starts at byte 12.
  7209. */
  7210. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7211. /**
  7212. * @brief target -> host rx indication message definition
  7213. *
  7214. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7215. *
  7216. * @details
  7217. * The following field definitions describe the format of the rx indication
  7218. * message sent from the target to the host.
  7219. * The message consists of three major sections:
  7220. * 1. a fixed-length header
  7221. * 2. a variable-length list of firmware rx MSDU descriptors
  7222. * 3. one or more 4-octet MPDU range information elements
  7223. * The fixed length header itself has two sub-sections
  7224. * 1. the message meta-information, including identification of the
  7225. * sender and type of the received data, and a 4-octet flush/release IE
  7226. * 2. the firmware rx PPDU descriptor
  7227. *
  7228. * The format of the message is depicted below.
  7229. * in this depiction, the following abbreviations are used for information
  7230. * elements within the message:
  7231. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7232. * elements associated with the PPDU start are valid.
  7233. * Specifically, the following fields are valid only if SV is set:
  7234. * RSSI (all variants), L, legacy rate, preamble type, service,
  7235. * VHT-SIG-A
  7236. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7237. * elements associated with the PPDU end are valid.
  7238. * Specifically, the following fields are valid only if EV is set:
  7239. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7240. * - L - Legacy rate selector - if legacy rates are used, this flag
  7241. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7242. * (L == 0) PHY.
  7243. * - P - PHY error flag - boolean indication of whether the rx frame had
  7244. * a PHY error
  7245. *
  7246. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7247. * |----------------+-------------------+---------------------+---------------|
  7248. * | peer ID | |RV|FV| ext TID | msg type |
  7249. * |--------------------------------------------------------------------------|
  7250. * | num | release | release | flush | flush |
  7251. * | MPDU | end | start | end | start |
  7252. * | ranges | seq num | seq num | seq num | seq num |
  7253. * |==========================================================================|
  7254. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7255. * |V|V| | rate | | | timestamp | RSSI |
  7256. * |--------------------------------------------------------------------------|
  7257. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7258. * |--------------------------------------------------------------------------|
  7259. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7260. * |--------------------------------------------------------------------------|
  7261. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7262. * |--------------------------------------------------------------------------|
  7263. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7264. * |--------------------------------------------------------------------------|
  7265. * | TSF LSBs |
  7266. * |--------------------------------------------------------------------------|
  7267. * | microsec timestamp |
  7268. * |--------------------------------------------------------------------------|
  7269. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7270. * |--------------------------------------------------------------------------|
  7271. * | service | HT-SIG / VHT-SIG-A2 |
  7272. * |==========================================================================|
  7273. * | reserved | FW rx desc bytes |
  7274. * |--------------------------------------------------------------------------|
  7275. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7276. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7277. * |--------------------------------------------------------------------------|
  7278. * : : :
  7279. * |--------------------------------------------------------------------------|
  7280. * | alignment | MSDU Rx |
  7281. * | padding | desc Bn |
  7282. * |--------------------------------------------------------------------------|
  7283. * | reserved | MPDU range status | MPDU count |
  7284. * |--------------------------------------------------------------------------|
  7285. * : reserved : MPDU range status : MPDU count :
  7286. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7287. *
  7288. * Header fields:
  7289. * - MSG_TYPE
  7290. * Bits 7:0
  7291. * Purpose: identifies this as an rx indication message
  7292. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7293. * - EXT_TID
  7294. * Bits 12:8
  7295. * Purpose: identify the traffic ID of the rx data, including
  7296. * special "extended" TID values for multicast, broadcast, and
  7297. * non-QoS data frames
  7298. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7299. * - FLUSH_VALID (FV)
  7300. * Bit 13
  7301. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7302. * is valid
  7303. * Value:
  7304. * 1 -> flush IE is valid and needs to be processed
  7305. * 0 -> flush IE is not valid and should be ignored
  7306. * - REL_VALID (RV)
  7307. * Bit 13
  7308. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7309. * is valid
  7310. * Value:
  7311. * 1 -> release IE is valid and needs to be processed
  7312. * 0 -> release IE is not valid and should be ignored
  7313. * - PEER_ID
  7314. * Bits 31:16
  7315. * Purpose: Identify, by ID, which peer sent the rx data
  7316. * Value: ID of the peer who sent the rx data
  7317. * - FLUSH_SEQ_NUM_START
  7318. * Bits 5:0
  7319. * Purpose: Indicate the start of a series of MPDUs to flush
  7320. * Not all MPDUs within this series are necessarily valid - the host
  7321. * must check each sequence number within this range to see if the
  7322. * corresponding MPDU is actually present.
  7323. * This field is only valid if the FV bit is set.
  7324. * Value:
  7325. * The sequence number for the first MPDUs to check to flush.
  7326. * The sequence number is masked by 0x3f.
  7327. * - FLUSH_SEQ_NUM_END
  7328. * Bits 11:6
  7329. * Purpose: Indicate the end of a series of MPDUs to flush
  7330. * Value:
  7331. * The sequence number one larger than the sequence number of the
  7332. * last MPDU to check to flush.
  7333. * The sequence number is masked by 0x3f.
  7334. * Not all MPDUs within this series are necessarily valid - the host
  7335. * must check each sequence number within this range to see if the
  7336. * corresponding MPDU is actually present.
  7337. * This field is only valid if the FV bit is set.
  7338. * - REL_SEQ_NUM_START
  7339. * Bits 17:12
  7340. * Purpose: Indicate the start of a series of MPDUs to release.
  7341. * All MPDUs within this series are present and valid - the host
  7342. * need not check each sequence number within this range to see if
  7343. * the corresponding MPDU is actually present.
  7344. * This field is only valid if the RV bit is set.
  7345. * Value:
  7346. * The sequence number for the first MPDUs to check to release.
  7347. * The sequence number is masked by 0x3f.
  7348. * - REL_SEQ_NUM_END
  7349. * Bits 23:18
  7350. * Purpose: Indicate the end of a series of MPDUs to release.
  7351. * Value:
  7352. * The sequence number one larger than the sequence number of the
  7353. * last MPDU to check to release.
  7354. * The sequence number is masked by 0x3f.
  7355. * All MPDUs within this series are present and valid - the host
  7356. * need not check each sequence number within this range to see if
  7357. * the corresponding MPDU is actually present.
  7358. * This field is only valid if the RV bit is set.
  7359. * - NUM_MPDU_RANGES
  7360. * Bits 31:24
  7361. * Purpose: Indicate how many ranges of MPDUs are present.
  7362. * Each MPDU range consists of a series of contiguous MPDUs within the
  7363. * rx frame sequence which all have the same MPDU status.
  7364. * Value: 1-63 (typically a small number, like 1-3)
  7365. *
  7366. * Rx PPDU descriptor fields:
  7367. * - RSSI_CMB
  7368. * Bits 7:0
  7369. * Purpose: Combined RSSI from all active rx chains, across the active
  7370. * bandwidth.
  7371. * Value: RSSI dB units w.r.t. noise floor
  7372. * - TIMESTAMP_SUBMICROSEC
  7373. * Bits 15:8
  7374. * Purpose: high-resolution timestamp
  7375. * Value:
  7376. * Sub-microsecond time of PPDU reception.
  7377. * This timestamp ranges from [0,MAC clock MHz).
  7378. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  7379. * to form a high-resolution, large range rx timestamp.
  7380. * - PHY_ERR_CODE
  7381. * Bits 23:16
  7382. * Purpose:
  7383. * If the rx frame processing resulted in a PHY error, indicate what
  7384. * type of rx PHY error occurred.
  7385. * Value:
  7386. * This field is valid if the "P" (PHY_ERR) flag is set.
  7387. * TBD: document/specify the values for this field
  7388. * - PHY_ERR
  7389. * Bit 24
  7390. * Purpose: indicate whether the rx PPDU had a PHY error
  7391. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7392. * - LEGACY_RATE
  7393. * Bits 28:25
  7394. * Purpose:
  7395. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7396. * specify which rate was used.
  7397. * Value:
  7398. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7399. * flag.
  7400. * If LEGACY_RATE_SEL is 0:
  7401. * 0x8: OFDM 48 Mbps
  7402. * 0x9: OFDM 24 Mbps
  7403. * 0xA: OFDM 12 Mbps
  7404. * 0xB: OFDM 6 Mbps
  7405. * 0xC: OFDM 54 Mbps
  7406. * 0xD: OFDM 36 Mbps
  7407. * 0xE: OFDM 18 Mbps
  7408. * 0xF: OFDM 9 Mbps
  7409. * If LEGACY_RATE_SEL is 1:
  7410. * 0x8: CCK 11 Mbps long preamble
  7411. * 0x9: CCK 5.5 Mbps long preamble
  7412. * 0xA: CCK 2 Mbps long preamble
  7413. * 0xB: CCK 1 Mbps long preamble
  7414. * 0xC: CCK 11 Mbps short preamble
  7415. * 0xD: CCK 5.5 Mbps short preamble
  7416. * 0xE: CCK 2 Mbps short preamble
  7417. * - LEGACY_RATE_SEL
  7418. * Bit 29
  7419. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7420. * Value:
  7421. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7422. * used a legacy rate.
  7423. * 0 -> OFDM, 1 -> CCK
  7424. * - END_VALID
  7425. * Bit 30
  7426. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7427. * the start of the PPDU are valid. Specifically, the following
  7428. * fields are only valid if END_VALID is set:
  7429. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7430. * TIMESTAMP_SUBMICROSEC
  7431. * Value:
  7432. * 0 -> rx PPDU desc end fields are not valid
  7433. * 1 -> rx PPDU desc end fields are valid
  7434. * - START_VALID
  7435. * Bit 31
  7436. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7437. * the end of the PPDU are valid. Specifically, the following
  7438. * fields are only valid if START_VALID is set:
  7439. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7440. * VHT-SIG-A
  7441. * Value:
  7442. * 0 -> rx PPDU desc start fields are not valid
  7443. * 1 -> rx PPDU desc start fields are valid
  7444. * - RSSI0_PRI20
  7445. * Bits 7:0
  7446. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7447. * Value: RSSI dB units w.r.t. noise floor
  7448. *
  7449. * - RSSI0_EXT20
  7450. * Bits 7:0
  7451. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7452. * (if the rx bandwidth was >= 40 MHz)
  7453. * Value: RSSI dB units w.r.t. noise floor
  7454. * - RSSI0_EXT40
  7455. * Bits 7:0
  7456. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7457. * (if the rx bandwidth was >= 80 MHz)
  7458. * Value: RSSI dB units w.r.t. noise floor
  7459. * - RSSI0_EXT80
  7460. * Bits 7:0
  7461. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7462. * (if the rx bandwidth was >= 160 MHz)
  7463. * Value: RSSI dB units w.r.t. noise floor
  7464. *
  7465. * - RSSI1_PRI20
  7466. * Bits 7:0
  7467. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7468. * Value: RSSI dB units w.r.t. noise floor
  7469. * - RSSI1_EXT20
  7470. * Bits 7:0
  7471. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7472. * (if the rx bandwidth was >= 40 MHz)
  7473. * Value: RSSI dB units w.r.t. noise floor
  7474. * - RSSI1_EXT40
  7475. * Bits 7:0
  7476. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7477. * (if the rx bandwidth was >= 80 MHz)
  7478. * Value: RSSI dB units w.r.t. noise floor
  7479. * - RSSI1_EXT80
  7480. * Bits 7:0
  7481. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7482. * (if the rx bandwidth was >= 160 MHz)
  7483. * Value: RSSI dB units w.r.t. noise floor
  7484. *
  7485. * - RSSI2_PRI20
  7486. * Bits 7:0
  7487. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7488. * Value: RSSI dB units w.r.t. noise floor
  7489. * - RSSI2_EXT20
  7490. * Bits 7:0
  7491. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7492. * (if the rx bandwidth was >= 40 MHz)
  7493. * Value: RSSI dB units w.r.t. noise floor
  7494. * - RSSI2_EXT40
  7495. * Bits 7:0
  7496. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7497. * (if the rx bandwidth was >= 80 MHz)
  7498. * Value: RSSI dB units w.r.t. noise floor
  7499. * - RSSI2_EXT80
  7500. * Bits 7:0
  7501. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7502. * (if the rx bandwidth was >= 160 MHz)
  7503. * Value: RSSI dB units w.r.t. noise floor
  7504. *
  7505. * - RSSI3_PRI20
  7506. * Bits 7:0
  7507. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7508. * Value: RSSI dB units w.r.t. noise floor
  7509. * - RSSI3_EXT20
  7510. * Bits 7:0
  7511. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7512. * (if the rx bandwidth was >= 40 MHz)
  7513. * Value: RSSI dB units w.r.t. noise floor
  7514. * - RSSI3_EXT40
  7515. * Bits 7:0
  7516. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7517. * (if the rx bandwidth was >= 80 MHz)
  7518. * Value: RSSI dB units w.r.t. noise floor
  7519. * - RSSI3_EXT80
  7520. * Bits 7:0
  7521. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7522. * (if the rx bandwidth was >= 160 MHz)
  7523. * Value: RSSI dB units w.r.t. noise floor
  7524. *
  7525. * - TSF32
  7526. * Bits 31:0
  7527. * Purpose: specify the time the rx PPDU was received, in TSF units
  7528. * Value: 32 LSBs of the TSF
  7529. * - TIMESTAMP_MICROSEC
  7530. * Bits 31:0
  7531. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7532. * Value: PPDU rx time, in microseconds
  7533. * - VHT_SIG_A1
  7534. * Bits 23:0
  7535. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7536. * from the rx PPDU
  7537. * Value:
  7538. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7539. * VHT-SIG-A1 data.
  7540. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7541. * first 24 bits of the HT-SIG data.
  7542. * Otherwise, this field is invalid.
  7543. * Refer to the the 802.11 protocol for the definition of the
  7544. * HT-SIG and VHT-SIG-A1 fields
  7545. * - VHT_SIG_A2
  7546. * Bits 23:0
  7547. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7548. * from the rx PPDU
  7549. * Value:
  7550. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7551. * VHT-SIG-A2 data.
  7552. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7553. * last 24 bits of the HT-SIG data.
  7554. * Otherwise, this field is invalid.
  7555. * Refer to the the 802.11 protocol for the definition of the
  7556. * HT-SIG and VHT-SIG-A2 fields
  7557. * - PREAMBLE_TYPE
  7558. * Bits 31:24
  7559. * Purpose: indicate the PHY format of the received burst
  7560. * Value:
  7561. * 0x4: Legacy (OFDM/CCK)
  7562. * 0x8: HT
  7563. * 0x9: HT with TxBF
  7564. * 0xC: VHT
  7565. * 0xD: VHT with TxBF
  7566. * - SERVICE
  7567. * Bits 31:24
  7568. * Purpose: TBD
  7569. * Value: TBD
  7570. *
  7571. * Rx MSDU descriptor fields:
  7572. * - FW_RX_DESC_BYTES
  7573. * Bits 15:0
  7574. * Purpose: Indicate how many bytes in the Rx indication are used for
  7575. * FW Rx descriptors
  7576. *
  7577. * Payload fields:
  7578. * - MPDU_COUNT
  7579. * Bits 7:0
  7580. * Purpose: Indicate how many sequential MPDUs share the same status.
  7581. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7582. * - MPDU_STATUS
  7583. * Bits 15:8
  7584. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7585. * received successfully.
  7586. * Value:
  7587. * 0x1: success
  7588. * 0x2: FCS error
  7589. * 0x3: duplicate error
  7590. * 0x4: replay error
  7591. * 0x5: invalid peer
  7592. */
  7593. /* header fields */
  7594. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7595. #define HTT_RX_IND_EXT_TID_S 8
  7596. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7597. #define HTT_RX_IND_FLUSH_VALID_S 13
  7598. #define HTT_RX_IND_REL_VALID_M 0x4000
  7599. #define HTT_RX_IND_REL_VALID_S 14
  7600. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7601. #define HTT_RX_IND_PEER_ID_S 16
  7602. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7603. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7604. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7605. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7606. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7607. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7608. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7609. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7610. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7611. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7612. /* rx PPDU descriptor fields */
  7613. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7614. #define HTT_RX_IND_RSSI_CMB_S 0
  7615. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7616. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7617. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7618. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7619. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7620. #define HTT_RX_IND_PHY_ERR_S 24
  7621. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7622. #define HTT_RX_IND_LEGACY_RATE_S 25
  7623. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7624. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7625. #define HTT_RX_IND_END_VALID_M 0x40000000
  7626. #define HTT_RX_IND_END_VALID_S 30
  7627. #define HTT_RX_IND_START_VALID_M 0x80000000
  7628. #define HTT_RX_IND_START_VALID_S 31
  7629. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7630. #define HTT_RX_IND_RSSI_PRI20_S 0
  7631. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7632. #define HTT_RX_IND_RSSI_EXT20_S 8
  7633. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7634. #define HTT_RX_IND_RSSI_EXT40_S 16
  7635. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7636. #define HTT_RX_IND_RSSI_EXT80_S 24
  7637. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7638. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7639. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7640. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7641. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7642. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7643. #define HTT_RX_IND_SERVICE_M 0xff000000
  7644. #define HTT_RX_IND_SERVICE_S 24
  7645. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7646. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7647. /* rx MSDU descriptor fields */
  7648. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7649. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7650. /* payload fields */
  7651. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7652. #define HTT_RX_IND_MPDU_COUNT_S 0
  7653. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7654. #define HTT_RX_IND_MPDU_STATUS_S 8
  7655. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7656. do { \
  7657. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7658. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7659. } while (0)
  7660. #define HTT_RX_IND_EXT_TID_GET(word) \
  7661. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7662. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7663. do { \
  7664. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7665. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7666. } while (0)
  7667. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7668. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7669. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7670. do { \
  7671. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7672. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7673. } while (0)
  7674. #define HTT_RX_IND_REL_VALID_GET(word) \
  7675. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7676. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7677. do { \
  7678. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7679. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7680. } while (0)
  7681. #define HTT_RX_IND_PEER_ID_GET(word) \
  7682. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7683. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7684. do { \
  7685. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7686. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7687. } while (0)
  7688. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7689. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7690. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7691. do { \
  7692. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7693. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7694. } while (0)
  7695. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7696. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7697. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7698. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7701. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7702. } while (0)
  7703. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7704. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7705. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7706. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7709. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7710. } while (0)
  7711. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7712. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7713. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7714. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7717. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7718. } while (0)
  7719. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7720. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7721. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7722. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7725. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7726. } while (0)
  7727. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7728. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7729. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7730. /* FW rx PPDU descriptor fields */
  7731. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7734. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7735. } while (0)
  7736. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7737. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7738. HTT_RX_IND_RSSI_CMB_S)
  7739. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7742. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7743. } while (0)
  7744. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7745. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7746. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7747. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7750. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7751. } while (0)
  7752. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7753. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7754. HTT_RX_IND_PHY_ERR_CODE_S)
  7755. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7756. do { \
  7757. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7758. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7759. } while (0)
  7760. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7761. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7762. HTT_RX_IND_PHY_ERR_S)
  7763. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7764. do { \
  7765. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7766. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7767. } while (0)
  7768. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7769. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7770. HTT_RX_IND_LEGACY_RATE_S)
  7771. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7772. do { \
  7773. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7774. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7775. } while (0)
  7776. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7777. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7778. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7779. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7780. do { \
  7781. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7782. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7783. } while (0)
  7784. #define HTT_RX_IND_END_VALID_GET(word) \
  7785. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7786. HTT_RX_IND_END_VALID_S)
  7787. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7788. do { \
  7789. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7790. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7791. } while (0)
  7792. #define HTT_RX_IND_START_VALID_GET(word) \
  7793. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7794. HTT_RX_IND_START_VALID_S)
  7795. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7798. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7799. } while (0)
  7800. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7801. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7802. HTT_RX_IND_RSSI_PRI20_S)
  7803. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7804. do { \
  7805. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7806. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7807. } while (0)
  7808. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7809. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7810. HTT_RX_IND_RSSI_EXT20_S)
  7811. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7812. do { \
  7813. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7814. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7815. } while (0)
  7816. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7817. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7818. HTT_RX_IND_RSSI_EXT40_S)
  7819. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7820. do { \
  7821. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7822. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7823. } while (0)
  7824. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7825. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7826. HTT_RX_IND_RSSI_EXT80_S)
  7827. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7828. do { \
  7829. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7830. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7831. } while (0)
  7832. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7833. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7834. HTT_RX_IND_VHT_SIG_A1_S)
  7835. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7836. do { \
  7837. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7838. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7839. } while (0)
  7840. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7841. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7842. HTT_RX_IND_VHT_SIG_A2_S)
  7843. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7844. do { \
  7845. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7846. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7847. } while (0)
  7848. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7849. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7850. HTT_RX_IND_PREAMBLE_TYPE_S)
  7851. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7852. do { \
  7853. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7854. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7855. } while (0)
  7856. #define HTT_RX_IND_SERVICE_GET(word) \
  7857. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7858. HTT_RX_IND_SERVICE_S)
  7859. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7860. do { \
  7861. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7862. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7863. } while (0)
  7864. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7865. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7866. HTT_RX_IND_SA_ANT_MATRIX_S)
  7867. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7868. do { \
  7869. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7870. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7871. } while (0)
  7872. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7873. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7874. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7875. do { \
  7876. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7877. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7878. } while (0)
  7879. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7880. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7881. #define HTT_RX_IND_HL_BYTES \
  7882. (HTT_RX_IND_HDR_BYTES + \
  7883. 4 /* single FW rx MSDU descriptor */ + \
  7884. 4 /* single MPDU range information element */)
  7885. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7886. /* Could we use one macro entry? */
  7887. #define HTT_WORD_SET(word, field, value) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(field, value); \
  7890. (word) |= ((value) << field ## _S); \
  7891. } while (0)
  7892. #define HTT_WORD_GET(word, field) \
  7893. (((word) & field ## _M) >> field ## _S)
  7894. PREPACK struct hl_htt_rx_ind_base {
  7895. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7896. } POSTPACK;
  7897. /*
  7898. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7899. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7900. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7901. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7902. * htt_rx_ind_hl_rx_desc_t.
  7903. */
  7904. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7905. struct htt_rx_ind_hl_rx_desc_t {
  7906. A_UINT8 ver;
  7907. A_UINT8 len;
  7908. struct {
  7909. A_UINT8
  7910. first_msdu: 1,
  7911. last_msdu: 1,
  7912. c3_failed: 1,
  7913. c4_failed: 1,
  7914. ipv6: 1,
  7915. tcp: 1,
  7916. udp: 1,
  7917. reserved: 1;
  7918. } flags;
  7919. /* NOTE: no reserved space - don't append any new fields here */
  7920. };
  7921. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7922. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7923. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7924. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7925. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7926. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7927. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7928. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7929. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7930. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7931. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7932. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7933. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7934. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7935. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7936. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7937. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7938. /* This structure is used in HL, the basic descriptor information
  7939. * used by host. the structure is translated by FW from HW desc
  7940. * or generated by FW. But in HL monitor mode, the host would use
  7941. * the same structure with LL.
  7942. */
  7943. PREPACK struct hl_htt_rx_desc_base {
  7944. A_UINT32
  7945. seq_num:12,
  7946. encrypted:1,
  7947. chan_info_present:1,
  7948. resv0:2,
  7949. mcast_bcast:1,
  7950. fragment:1,
  7951. key_id_oct:8,
  7952. resv1:6;
  7953. A_UINT32
  7954. pn_31_0;
  7955. union {
  7956. struct {
  7957. A_UINT16 pn_47_32;
  7958. A_UINT16 pn_63_48;
  7959. } pn16;
  7960. A_UINT32 pn_63_32;
  7961. } u0;
  7962. A_UINT32
  7963. pn_95_64;
  7964. A_UINT32
  7965. pn_127_96;
  7966. } POSTPACK;
  7967. /*
  7968. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7969. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7970. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7971. * Please see htt_chan_change_t for description of the fields.
  7972. */
  7973. PREPACK struct htt_chan_info_t
  7974. {
  7975. A_UINT32 primary_chan_center_freq_mhz: 16,
  7976. contig_chan1_center_freq_mhz: 16;
  7977. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7978. phy_mode: 8,
  7979. reserved: 8;
  7980. } POSTPACK;
  7981. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7982. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7983. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7984. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7985. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7986. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7987. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7988. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7989. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7990. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7991. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7992. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7993. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7994. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7995. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7996. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7997. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7998. /* Channel information */
  7999. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8000. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8001. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8002. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8003. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8004. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8005. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8006. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8007. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8008. do { \
  8009. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8010. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8011. } while (0)
  8012. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8013. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8014. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8015. do { \
  8016. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8017. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8018. } while (0)
  8019. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8020. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8021. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8024. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8025. } while (0)
  8026. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8027. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8028. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8031. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8032. } while (0)
  8033. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8034. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8035. /*
  8036. * @brief target -> host message definition for FW offloaded pkts
  8037. *
  8038. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8039. *
  8040. * @details
  8041. * The following field definitions describe the format of the firmware
  8042. * offload deliver message sent from the target to the host.
  8043. *
  8044. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8045. *
  8046. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8047. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8048. * | reserved_1 | msg type |
  8049. * |--------------------------------------------------------------------------|
  8050. * | phy_timestamp_l32 |
  8051. * |--------------------------------------------------------------------------|
  8052. * | WORD2 (see below) |
  8053. * |--------------------------------------------------------------------------|
  8054. * | seqno | framectrl |
  8055. * |--------------------------------------------------------------------------|
  8056. * | reserved_3 | vdev_id | tid_num|
  8057. * |--------------------------------------------------------------------------|
  8058. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8059. * |--------------------------------------------------------------------------|
  8060. *
  8061. * where:
  8062. * STAT = status
  8063. * F = format (802.3 vs. 802.11)
  8064. *
  8065. * definition for word 2
  8066. *
  8067. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8068. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8069. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8070. * |--------------------------------------------------------------------------|
  8071. *
  8072. * where:
  8073. * PR = preamble
  8074. * BF = beamformed
  8075. */
  8076. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8077. {
  8078. A_UINT32 /* word 0 */
  8079. msg_type:8, /* [ 7: 0] */
  8080. reserved_1:24; /* [31: 8] */
  8081. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8082. A_UINT32 /* word 2 */
  8083. /* preamble:
  8084. * 0-OFDM,
  8085. * 1-CCk,
  8086. * 2-HT,
  8087. * 3-VHT
  8088. */
  8089. preamble: 2, /* [1:0] */
  8090. /* mcs:
  8091. * In case of HT preamble interpret
  8092. * MCS along with NSS.
  8093. * Valid values for HT are 0 to 7.
  8094. * HT mcs 0 with NSS 2 is mcs 8.
  8095. * Valid values for VHT are 0 to 9.
  8096. */
  8097. mcs: 4, /* [5:2] */
  8098. /* rate:
  8099. * This is applicable only for
  8100. * CCK and OFDM preamble type
  8101. * rate 0: OFDM 48 Mbps,
  8102. * 1: OFDM 24 Mbps,
  8103. * 2: OFDM 12 Mbps
  8104. * 3: OFDM 6 Mbps
  8105. * 4: OFDM 54 Mbps
  8106. * 5: OFDM 36 Mbps
  8107. * 6: OFDM 18 Mbps
  8108. * 7: OFDM 9 Mbps
  8109. * rate 0: CCK 11 Mbps Long
  8110. * 1: CCK 5.5 Mbps Long
  8111. * 2: CCK 2 Mbps Long
  8112. * 3: CCK 1 Mbps Long
  8113. * 4: CCK 11 Mbps Short
  8114. * 5: CCK 5.5 Mbps Short
  8115. * 6: CCK 2 Mbps Short
  8116. */
  8117. rate : 3, /* [ 8: 6] */
  8118. rssi : 8, /* [16: 9] units=dBm */
  8119. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8120. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8121. stbc : 1, /* [22] */
  8122. sgi : 1, /* [23] */
  8123. ldpc : 1, /* [24] */
  8124. beamformed: 1, /* [25] */
  8125. reserved_2: 6; /* [31:26] */
  8126. A_UINT32 /* word 3 */
  8127. framectrl:16, /* [15: 0] */
  8128. seqno:16; /* [31:16] */
  8129. A_UINT32 /* word 4 */
  8130. tid_num:5, /* [ 4: 0] actual TID number */
  8131. vdev_id:8, /* [12: 5] */
  8132. reserved_3:19; /* [31:13] */
  8133. A_UINT32 /* word 5 */
  8134. /* status:
  8135. * 0: tx_ok
  8136. * 1: retry
  8137. * 2: drop
  8138. * 3: filtered
  8139. * 4: abort
  8140. * 5: tid delete
  8141. * 6: sw abort
  8142. * 7: dropped by peer migration
  8143. */
  8144. status:3, /* [2:0] */
  8145. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8146. tx_mpdu_bytes:16, /* [19:4] */
  8147. /* Indicates retry count of offloaded/local generated Data tx frames */
  8148. tx_retry_cnt:6, /* [25:20] */
  8149. reserved_4:6; /* [31:26] */
  8150. } POSTPACK;
  8151. /* FW offload deliver ind message header fields */
  8152. /* DWORD one */
  8153. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8154. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8155. /* DWORD two */
  8156. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8157. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8158. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8159. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8160. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8161. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8162. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8163. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8164. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8165. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8166. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8167. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8168. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8169. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8170. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8171. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8172. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8173. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8174. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8175. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8176. /* DWORD three*/
  8177. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8178. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8179. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8180. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8181. /* DWORD four */
  8182. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8183. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8184. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8185. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8186. /* DWORD five */
  8187. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8188. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8189. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8190. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8191. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8192. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8193. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8194. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8195. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8196. do { \
  8197. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8198. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8199. } while (0)
  8200. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8201. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8202. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8203. do { \
  8204. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8205. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8206. } while (0)
  8207. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8208. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8209. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8210. do { \
  8211. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8212. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8213. } while (0)
  8214. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8215. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8216. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8217. do { \
  8218. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8219. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8220. } while (0)
  8221. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8222. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8223. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8224. do { \
  8225. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8226. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8227. } while (0)
  8228. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8229. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8230. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8231. do { \
  8232. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8233. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8234. } while (0)
  8235. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8236. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8237. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8240. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8241. } while (0)
  8242. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8243. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8244. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8245. do { \
  8246. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8247. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8248. } while (0)
  8249. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8250. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8251. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8254. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8255. } while (0)
  8256. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8257. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8258. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8259. do { \
  8260. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8261. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8262. } while (0)
  8263. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8264. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8265. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8268. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8269. } while (0)
  8270. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8271. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8272. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8275. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8276. } while (0)
  8277. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8278. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8279. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8280. do { \
  8281. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8282. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8283. } while (0)
  8284. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8285. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8286. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8287. do { \
  8288. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8289. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8290. } while (0)
  8291. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8292. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8293. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8294. do { \
  8295. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8296. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8297. } while (0)
  8298. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8299. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8300. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8301. do { \
  8302. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8303. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8304. } while (0)
  8305. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8306. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8307. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8308. do { \
  8309. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8310. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8311. } while (0)
  8312. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8313. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8314. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8315. do { \
  8316. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8317. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8318. } while (0)
  8319. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8320. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8321. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8322. do { \
  8323. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8324. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8325. } while (0)
  8326. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  8327. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  8328. /*
  8329. * @brief target -> host rx reorder flush message definition
  8330. *
  8331. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  8332. *
  8333. * @details
  8334. * The following field definitions describe the format of the rx flush
  8335. * message sent from the target to the host.
  8336. * The message consists of a 4-octet header, followed by one or more
  8337. * 4-octet payload information elements.
  8338. *
  8339. * |31 24|23 8|7 0|
  8340. * |--------------------------------------------------------------|
  8341. * | TID | peer ID | msg type |
  8342. * |--------------------------------------------------------------|
  8343. * | seq num end | seq num start | MPDU status | reserved |
  8344. * |--------------------------------------------------------------|
  8345. * First DWORD:
  8346. * - MSG_TYPE
  8347. * Bits 7:0
  8348. * Purpose: identifies this as an rx flush message
  8349. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  8350. * - PEER_ID
  8351. * Bits 23:8 (only bits 18:8 actually used)
  8352. * Purpose: identify which peer's rx data is being flushed
  8353. * Value: (rx) peer ID
  8354. * - TID
  8355. * Bits 31:24 (only bits 27:24 actually used)
  8356. * Purpose: Specifies which traffic identifier's rx data is being flushed
  8357. * Value: traffic identifier
  8358. * Second DWORD:
  8359. * - MPDU_STATUS
  8360. * Bits 15:8
  8361. * Purpose:
  8362. * Indicate whether the flushed MPDUs should be discarded or processed.
  8363. * Value:
  8364. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  8365. * stages of rx processing
  8366. * other: discard the MPDUs
  8367. * It is anticipated that flush messages will always have
  8368. * MPDU status == 1, but the status flag is included for
  8369. * flexibility.
  8370. * - SEQ_NUM_START
  8371. * Bits 23:16
  8372. * Purpose:
  8373. * Indicate the start of a series of consecutive MPDUs being flushed.
  8374. * Not all MPDUs within this range are necessarily valid - the host
  8375. * must check each sequence number within this range to see if the
  8376. * corresponding MPDU is actually present.
  8377. * Value:
  8378. * The sequence number for the first MPDU in the sequence.
  8379. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8380. * - SEQ_NUM_END
  8381. * Bits 30:24
  8382. * Purpose:
  8383. * Indicate the end of a series of consecutive MPDUs being flushed.
  8384. * Value:
  8385. * The sequence number one larger than the sequence number of the
  8386. * last MPDU being flushed.
  8387. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8388. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8389. * are to be released for further rx processing.
  8390. * Not all MPDUs within this range are necessarily valid - the host
  8391. * must check each sequence number within this range to see if the
  8392. * corresponding MPDU is actually present.
  8393. */
  8394. /* first DWORD */
  8395. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8396. #define HTT_RX_FLUSH_PEER_ID_S 8
  8397. #define HTT_RX_FLUSH_TID_M 0xff000000
  8398. #define HTT_RX_FLUSH_TID_S 24
  8399. /* second DWORD */
  8400. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8401. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8402. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8403. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8404. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8405. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8406. #define HTT_RX_FLUSH_BYTES 8
  8407. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8408. do { \
  8409. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8410. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8411. } while (0)
  8412. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8413. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8414. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8415. do { \
  8416. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8417. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8418. } while (0)
  8419. #define HTT_RX_FLUSH_TID_GET(word) \
  8420. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8421. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8422. do { \
  8423. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8424. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8425. } while (0)
  8426. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8427. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8428. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8429. do { \
  8430. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8431. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8432. } while (0)
  8433. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8434. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8435. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8436. do { \
  8437. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8438. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8439. } while (0)
  8440. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8441. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8442. /*
  8443. * @brief target -> host rx pn check indication message
  8444. *
  8445. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8446. *
  8447. * @details
  8448. * The following field definitions describe the format of the Rx PN check
  8449. * indication message sent from the target to the host.
  8450. * The message consists of a 4-octet header, followed by the start and
  8451. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8452. * IE is one octet containing the sequence number that failed the PN
  8453. * check.
  8454. *
  8455. * |31 24|23 8|7 0|
  8456. * |--------------------------------------------------------------|
  8457. * | TID | peer ID | msg type |
  8458. * |--------------------------------------------------------------|
  8459. * | Reserved | PN IE count | seq num end | seq num start|
  8460. * |--------------------------------------------------------------|
  8461. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8462. * |--------------------------------------------------------------|
  8463. * First DWORD:
  8464. * - MSG_TYPE
  8465. * Bits 7:0
  8466. * Purpose: Identifies this as an rx pn check indication message
  8467. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8468. * - PEER_ID
  8469. * Bits 23:8 (only bits 18:8 actually used)
  8470. * Purpose: identify which peer
  8471. * Value: (rx) peer ID
  8472. * - TID
  8473. * Bits 31:24 (only bits 27:24 actually used)
  8474. * Purpose: identify traffic identifier
  8475. * Value: traffic identifier
  8476. * Second DWORD:
  8477. * - SEQ_NUM_START
  8478. * Bits 7:0
  8479. * Purpose:
  8480. * Indicates the starting sequence number of the MPDU in this
  8481. * series of MPDUs that went though PN check.
  8482. * Value:
  8483. * The sequence number for the first MPDU in the sequence.
  8484. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8485. * - SEQ_NUM_END
  8486. * Bits 15:8
  8487. * Purpose:
  8488. * Indicates the ending sequence number of the MPDU in this
  8489. * series of MPDUs that went though PN check.
  8490. * Value:
  8491. * The sequence number one larger then the sequence number of the last
  8492. * MPDU being flushed.
  8493. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8494. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8495. * for invalid PN numbers and are ready to be released for further processing.
  8496. * Not all MPDUs within this range are necessarily valid - the host
  8497. * must check each sequence number within this range to see if the
  8498. * corresponding MPDU is actually present.
  8499. * - PN_IE_COUNT
  8500. * Bits 23:16
  8501. * Purpose:
  8502. * Used to determine the variable number of PN information elements in this
  8503. * message
  8504. *
  8505. * PN information elements:
  8506. * - PN_IE_x-
  8507. * Purpose:
  8508. * Each PN information element contains the sequence number of the MPDU that
  8509. * has failed the target PN check.
  8510. * Value:
  8511. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8512. * that failed the PN check.
  8513. */
  8514. /* first DWORD */
  8515. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8516. #define HTT_RX_PN_IND_PEER_ID_S 8
  8517. #define HTT_RX_PN_IND_TID_M 0xff000000
  8518. #define HTT_RX_PN_IND_TID_S 24
  8519. /* second DWORD */
  8520. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8521. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8522. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8523. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8524. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8525. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8526. #define HTT_RX_PN_IND_BYTES 8
  8527. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8528. do { \
  8529. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8530. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8531. } while (0)
  8532. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8533. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8534. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8537. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8538. } while (0)
  8539. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8540. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8541. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8542. do { \
  8543. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8544. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8545. } while (0)
  8546. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8547. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8548. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8549. do { \
  8550. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8551. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8552. } while (0)
  8553. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8554. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8555. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8556. do { \
  8557. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8558. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8559. } while (0)
  8560. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8561. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8562. /*
  8563. * @brief target -> host rx offload deliver message for LL system
  8564. *
  8565. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8566. *
  8567. * @details
  8568. * In a low latency system this message is sent whenever the offload
  8569. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8570. * The DMA of the actual packets into host memory is done before sending out
  8571. * this message. This message indicates only how many MSDUs to reap. The
  8572. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8573. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8574. * DMA'd by the MAC directly into host memory these packets do not contain
  8575. * the MAC descriptors in the header portion of the packet. Instead they contain
  8576. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8577. * message, the packets are delivered directly to the NW stack without going
  8578. * through the regular reorder buffering and PN checking path since it has
  8579. * already been done in target.
  8580. *
  8581. * |31 24|23 16|15 8|7 0|
  8582. * |-----------------------------------------------------------------------|
  8583. * | Total MSDU count | reserved | msg type |
  8584. * |-----------------------------------------------------------------------|
  8585. *
  8586. * @brief target -> host rx offload deliver message for HL system
  8587. *
  8588. * @details
  8589. * In a high latency system this message is sent whenever the offload manager
  8590. * flushes out the packets it has coalesced in its coalescing buffer. The
  8591. * actual packets are also carried along with this message. When the host
  8592. * receives this message, it is expected to deliver these packets to the NW
  8593. * stack directly instead of routing them through the reorder buffering and
  8594. * PN checking path since it has already been done in target.
  8595. *
  8596. * |31 24|23 16|15 8|7 0|
  8597. * |-----------------------------------------------------------------------|
  8598. * | Total MSDU count | reserved | msg type |
  8599. * |-----------------------------------------------------------------------|
  8600. * | peer ID | MSDU length |
  8601. * |-----------------------------------------------------------------------|
  8602. * | MSDU payload | FW Desc | tid | vdev ID |
  8603. * |-----------------------------------------------------------------------|
  8604. * | MSDU payload contd. |
  8605. * |-----------------------------------------------------------------------|
  8606. * | peer ID | MSDU length |
  8607. * |-----------------------------------------------------------------------|
  8608. * | MSDU payload | FW Desc | tid | vdev ID |
  8609. * |-----------------------------------------------------------------------|
  8610. * | MSDU payload contd. |
  8611. * |-----------------------------------------------------------------------|
  8612. *
  8613. */
  8614. /* first DWORD */
  8615. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8616. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8617. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8618. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8619. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8620. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8621. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8622. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8623. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8624. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8625. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8626. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8627. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8628. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8629. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8630. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8631. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8634. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8635. } while (0)
  8636. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8637. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8638. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8639. do { \
  8640. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8641. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8642. } while (0)
  8643. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8644. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8645. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8648. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8649. } while (0)
  8650. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8651. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8652. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8653. do { \
  8654. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8655. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8656. } while (0)
  8657. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8658. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8659. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8660. do { \
  8661. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8662. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8663. } while (0)
  8664. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8665. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8666. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8669. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8670. } while (0)
  8671. /**
  8672. * @brief target -> host rx peer map/unmap message definition
  8673. *
  8674. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8675. *
  8676. * @details
  8677. * The following diagram shows the format of the rx peer map message sent
  8678. * from the target to the host. This layout assumes the target operates
  8679. * as little-endian.
  8680. *
  8681. * This message always contains a SW peer ID. The main purpose of the
  8682. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8683. * with, so that the host can use that peer ID to determine which peer
  8684. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8685. * other purposes, such as identifying during tx completions which peer
  8686. * the tx frames in question were transmitted to.
  8687. *
  8688. * In certain generations of chips, the peer map message also contains
  8689. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8690. * to identify which peer the frame needs to be forwarded to (i.e. the
  8691. * peer assocated with the Destination MAC Address within the packet),
  8692. * and particularly which vdev needs to transmit the frame (for cases
  8693. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8694. * meaning as AST_INDEX_0.
  8695. * This DA-based peer ID that is provided for certain rx frames
  8696. * (the rx frames that need to be re-transmitted as tx frames)
  8697. * is the ID that the HW uses for referring to the peer in question,
  8698. * rather than the peer ID that the SW+FW use to refer to the peer.
  8699. *
  8700. *
  8701. * |31 24|23 16|15 8|7 0|
  8702. * |-----------------------------------------------------------------------|
  8703. * | SW peer ID | VDEV ID | msg type |
  8704. * |-----------------------------------------------------------------------|
  8705. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8706. * |-----------------------------------------------------------------------|
  8707. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8708. * |-----------------------------------------------------------------------|
  8709. *
  8710. *
  8711. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8712. *
  8713. * The following diagram shows the format of the rx peer unmap message sent
  8714. * from the target to the host.
  8715. *
  8716. * |31 24|23 16|15 8|7 0|
  8717. * |-----------------------------------------------------------------------|
  8718. * | SW peer ID | VDEV ID | msg type |
  8719. * |-----------------------------------------------------------------------|
  8720. *
  8721. * The following field definitions describe the format of the rx peer map
  8722. * and peer unmap messages sent from the target to the host.
  8723. * - MSG_TYPE
  8724. * Bits 7:0
  8725. * Purpose: identifies this as an rx peer map or peer unmap message
  8726. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8727. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8728. * - VDEV_ID
  8729. * Bits 15:8
  8730. * Purpose: Indicates which virtual device the peer is associated
  8731. * with.
  8732. * Value: vdev ID (used in the host to look up the vdev object)
  8733. * - PEER_ID (a.k.a. SW_PEER_ID)
  8734. * Bits 31:16
  8735. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8736. * freeing (unmap)
  8737. * Value: (rx) peer ID
  8738. * - MAC_ADDR_L32 (peer map only)
  8739. * Bits 31:0
  8740. * Purpose: Identifies which peer node the peer ID is for.
  8741. * Value: lower 4 bytes of peer node's MAC address
  8742. * - MAC_ADDR_U16 (peer map only)
  8743. * Bits 15:0
  8744. * Purpose: Identifies which peer node the peer ID is for.
  8745. * Value: upper 2 bytes of peer node's MAC address
  8746. * - HW_PEER_ID
  8747. * Bits 31:16
  8748. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8749. * address, so for rx frames marked for rx --> tx forwarding, the
  8750. * host can determine from the HW peer ID provided as meta-data with
  8751. * the rx frame which peer the frame is supposed to be forwarded to.
  8752. * Value: ID used by the MAC HW to identify the peer
  8753. */
  8754. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8755. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8756. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8757. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8758. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8759. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8760. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8761. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8762. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8763. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8764. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8765. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8766. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8767. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8768. do { \
  8769. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8770. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8771. } while (0)
  8772. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8773. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8774. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8775. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8776. do { \
  8777. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8778. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8779. } while (0)
  8780. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8781. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8782. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8783. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8784. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8785. do { \
  8786. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8787. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8788. } while (0)
  8789. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8790. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8791. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8792. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8793. #define HTT_RX_PEER_MAP_BYTES 12
  8794. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8795. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8796. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8797. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8798. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8799. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8800. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8801. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8802. #define HTT_RX_PEER_UNMAP_BYTES 4
  8803. /**
  8804. * @brief target -> host rx peer map V2 message definition
  8805. *
  8806. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8807. *
  8808. * @details
  8809. * The following diagram shows the format of the rx peer map v2 message sent
  8810. * from the target to the host. This layout assumes the target operates
  8811. * as little-endian.
  8812. *
  8813. * This message always contains a SW peer ID. The main purpose of the
  8814. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8815. * with, so that the host can use that peer ID to determine which peer
  8816. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8817. * other purposes, such as identifying during tx completions which peer
  8818. * the tx frames in question were transmitted to.
  8819. *
  8820. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8821. * is used during rx --> tx frame forwarding to identify which peer the
  8822. * frame needs to be forwarded to (i.e. the peer assocated with the
  8823. * Destination MAC Address within the packet), and particularly which vdev
  8824. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8825. * This DA-based peer ID that is provided for certain rx frames
  8826. * (the rx frames that need to be re-transmitted as tx frames)
  8827. * is the ID that the HW uses for referring to the peer in question,
  8828. * rather than the peer ID that the SW+FW use to refer to the peer.
  8829. *
  8830. * The HW peer id here is the same meaning as AST_INDEX_0.
  8831. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8832. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8833. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8834. * AST is valid.
  8835. *
  8836. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8837. * |-------------------------------------------------------------------------|
  8838. * | SW peer ID | VDEV ID | msg type |
  8839. * |-------------------------------------------------------------------------|
  8840. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8841. * |-------------------------------------------------------------------------|
  8842. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8843. * |-------------------------------------------------------------------------|
  8844. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8845. * |-------------------------------------------------------------------------|
  8846. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8847. * |-------------------------------------------------------------------------|
  8848. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8849. * |-------------------------------------------------------------------------|
  8850. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8851. * |-------------------------------------------------------------------------|
  8852. * | Reserved_2 |
  8853. * |-------------------------------------------------------------------------|
  8854. * Where:
  8855. * NH = Next Hop
  8856. * ASTVM = AST valid mask
  8857. * OA = on-chip AST valid bit
  8858. * ASTFM = AST flow mask
  8859. *
  8860. * The following field definitions describe the format of the rx peer map v2
  8861. * messages sent from the target to the host.
  8862. * - MSG_TYPE
  8863. * Bits 7:0
  8864. * Purpose: identifies this as an rx peer map v2 message
  8865. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8866. * - VDEV_ID
  8867. * Bits 15:8
  8868. * Purpose: Indicates which virtual device the peer is associated with.
  8869. * Value: vdev ID (used in the host to look up the vdev object)
  8870. * - SW_PEER_ID
  8871. * Bits 31:16
  8872. * Purpose: The peer ID (index) that WAL is allocating
  8873. * Value: (rx) peer ID
  8874. * - MAC_ADDR_L32
  8875. * Bits 31:0
  8876. * Purpose: Identifies which peer node the peer ID is for.
  8877. * Value: lower 4 bytes of peer node's MAC address
  8878. * - MAC_ADDR_U16
  8879. * Bits 15:0
  8880. * Purpose: Identifies which peer node the peer ID is for.
  8881. * Value: upper 2 bytes of peer node's MAC address
  8882. * - HW_PEER_ID / AST_INDEX_0
  8883. * Bits 31:16
  8884. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8885. * address, so for rx frames marked for rx --> tx forwarding, the
  8886. * host can determine from the HW peer ID provided as meta-data with
  8887. * the rx frame which peer the frame is supposed to be forwarded to.
  8888. * Value: ID used by the MAC HW to identify the peer
  8889. * - AST_HASH_VALUE
  8890. * Bits 15:0
  8891. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8892. * override feature.
  8893. * - NEXT_HOP
  8894. * Bit 16
  8895. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8896. * (Wireless Distribution System).
  8897. * - AST_VALID_MASK
  8898. * Bits 19:17
  8899. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8900. * - ONCHIP_AST_VALID_FLAG
  8901. * Bit 20
  8902. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8903. * is valid.
  8904. * - AST_INDEX_1
  8905. * Bits 15:0
  8906. * Purpose: indicate the second AST index for this peer
  8907. * - AST_0_FLOW_MASK
  8908. * Bits 19:16
  8909. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8910. * - AST_1_FLOW_MASK
  8911. * Bits 23:20
  8912. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8913. * - AST_2_FLOW_MASK
  8914. * Bits 27:24
  8915. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8916. * - AST_3_FLOW_MASK
  8917. * Bits 31:28
  8918. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8919. * - AST_INDEX_2
  8920. * Bits 15:0
  8921. * Purpose: indicate the third AST index for this peer
  8922. * - TID_VALID_HI_PRI
  8923. * Bits 23:16
  8924. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8925. * - TID_VALID_LOW_PRI
  8926. * Bits 31:24
  8927. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8928. * - AST_INDEX_3
  8929. * Bits 15:0
  8930. * Purpose: indicate the fourth AST index for this peer
  8931. * - ONCHIP_AST_IDX / RESERVED
  8932. * Bits 31:16
  8933. * Purpose: This field is valid only when split AST feature is enabled.
  8934. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8935. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8936. * address, this ast_idx is used for LMAC modules for RXPCU.
  8937. * Value: ID used by the LMAC HW to identify the peer
  8938. */
  8939. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8940. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8941. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8942. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8943. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8944. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8945. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8946. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8947. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8948. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8949. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8950. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8951. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8952. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8953. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8954. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8955. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8956. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8957. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8958. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8959. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8960. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8961. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8962. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8963. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8964. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8965. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8966. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8967. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8968. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8969. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8970. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8971. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8972. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8973. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8974. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8975. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8976. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8977. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8978. do { \
  8979. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8980. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8981. } while (0)
  8982. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8983. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8984. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8985. do { \
  8986. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8987. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8988. } while (0)
  8989. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8990. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8991. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8994. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8995. } while (0)
  8996. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8997. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8998. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8999. do { \
  9000. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9001. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9002. } while (0)
  9003. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9004. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9005. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9008. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9009. } while (0)
  9010. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9011. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9012. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9015. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9016. } while (0)
  9017. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9018. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9019. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9020. do { \
  9021. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9022. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9023. } while (0)
  9024. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9025. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9026. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9029. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9030. } while (0)
  9031. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9032. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9033. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9034. do { \
  9035. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9036. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9037. } while (0)
  9038. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9039. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9040. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9041. do { \
  9042. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9043. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9044. } while (0)
  9045. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9046. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9047. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9048. do { \
  9049. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9050. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9051. } while (0)
  9052. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9053. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9054. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9055. do { \
  9056. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9057. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9058. } while (0)
  9059. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9060. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9061. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9062. do { \
  9063. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9064. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9065. } while (0)
  9066. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9067. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9068. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9069. do { \
  9070. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9071. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9072. } while (0)
  9073. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9074. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9075. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9076. do { \
  9077. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9078. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9079. } while (0)
  9080. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9081. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9082. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9083. do { \
  9084. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9085. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9086. } while (0)
  9087. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9088. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9089. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9090. do { \
  9091. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9092. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9093. } while (0)
  9094. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9095. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9096. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9097. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9098. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9099. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9100. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9101. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9102. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9103. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9104. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9105. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9106. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9107. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9108. /**
  9109. * @brief target -> host rx peer map V3 message definition
  9110. *
  9111. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9112. *
  9113. * @details
  9114. * The following diagram shows the format of the rx peer map v3 message sent
  9115. * from the target to the host.
  9116. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9117. * This layout assumes the target operates as little-endian.
  9118. *
  9119. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9120. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9121. * | SW peer ID | VDEV ID | msg type |
  9122. * |-----------------+--------------------+-----------------+-----------------|
  9123. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9124. * |-----------------+--------------------+-----------------+-----------------|
  9125. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9126. * |-----------------+--------+-----------+-----------------+-----------------|
  9127. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9128. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9129. * | (8bits) | | (4bits) | |
  9130. * |-----------------+--------+--+--+--+--------------------------------------|
  9131. * | RESERVED |E |O | | |
  9132. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9133. * | |V |V | | |
  9134. * |-----------------+--------------------+-----------------------------------|
  9135. * | HTT_MSDU_IDX_ | RESERVED | |
  9136. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9137. * | (8bits) | | |
  9138. * |-----------------+--------------------+-----------------------------------|
  9139. * | Reserved_2 |
  9140. * |--------------------------------------------------------------------------|
  9141. * | Reserved_3 |
  9142. * |--------------------------------------------------------------------------|
  9143. *
  9144. * Where:
  9145. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9146. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9147. * NH = Next Hop
  9148. * The following field definitions describe the format of the rx peer map v3
  9149. * messages sent from the target to the host.
  9150. * - MSG_TYPE
  9151. * Bits 7:0
  9152. * Purpose: identifies this as a peer map v3 message
  9153. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9154. * - VDEV_ID
  9155. * Bits 15:8
  9156. * Purpose: Indicates which virtual device the peer is associated with.
  9157. * - SW_PEER_ID
  9158. * Bits 31:16
  9159. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9160. * - MAC_ADDR_L32
  9161. * Bits 31:0
  9162. * Purpose: Identifies which peer node the peer ID is for.
  9163. * Value: lower 4 bytes of peer node's MAC address
  9164. * - MAC_ADDR_U16
  9165. * Bits 15:0
  9166. * Purpose: Identifies which peer node the peer ID is for.
  9167. * Value: upper 2 bytes of peer node's MAC address
  9168. * - MULTICAST_SW_PEER_ID
  9169. * Bits 31:16
  9170. * Purpose: The multicast peer ID (index)
  9171. * Value: set to HTT_INVALID_PEER if not valid
  9172. * - HW_PEER_ID / AST_INDEX
  9173. * Bits 15:0
  9174. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9175. * address, so for rx frames marked for rx --> tx forwarding, the
  9176. * host can determine from the HW peer ID provided as meta-data with
  9177. * the rx frame which peer the frame is supposed to be forwarded to.
  9178. * - CACHE_SET_NUM
  9179. * Bits 19:16
  9180. * Purpose: Cache Set Number for AST_INDEX
  9181. * Cache set number that should be used to cache the index based
  9182. * search results, for address and flow search.
  9183. * This value should be equal to LSB 4 bits of the hash value
  9184. * of match data, in case of search index points to an entry which
  9185. * may be used in content based search also. The value can be
  9186. * anything when the entry pointed by search index will not be
  9187. * used for content based search.
  9188. * - HTT_MSDU_IDX_VALID_MASK
  9189. * Bits 31:24
  9190. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9191. * - ONCHIP_AST_IDX / RESERVED
  9192. * Bits 15:0
  9193. * Purpose: This field is valid only when split AST feature is enabled.
  9194. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9195. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9196. * address, this ast_idx is used for LMAC modules for RXPCU.
  9197. * - NEXT_HOP
  9198. * Bits 16
  9199. * Purpose: Flag indicates next_hop AST entry used for WDS
  9200. * (Wireless Distribution System).
  9201. * - ONCHIP_AST_VALID
  9202. * Bits 17
  9203. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9204. * - EXT_AST_VALID
  9205. * Bits 18
  9206. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9207. * - EXT_AST_INDEX
  9208. * Bits 15:0
  9209. * Purpose: This field describes Extended AST index
  9210. * Valid if EXT_AST_VALID flag set
  9211. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9212. * Bits 31:24
  9213. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9214. */
  9215. /* dword 0 */
  9216. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9217. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9218. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9219. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9220. /* dword 1 */
  9221. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9222. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9223. /* dword 2 */
  9224. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9225. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9226. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9227. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9228. /* dword 3 */
  9229. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9230. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9231. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9232. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9233. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9234. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9235. /* dword 4 */
  9236. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9237. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9238. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9239. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9240. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9241. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9242. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9243. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9244. /* dword 5 */
  9245. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9246. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9247. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9248. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9249. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9250. do { \
  9251. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9252. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9253. } while (0)
  9254. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9255. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9256. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9257. do { \
  9258. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9259. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9260. } while (0)
  9261. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9262. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9263. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9266. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9267. } while (0)
  9268. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9269. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9270. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9271. do { \
  9272. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9273. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9274. } while (0)
  9275. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9276. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9277. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9280. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9281. } while (0)
  9282. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9283. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9284. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9285. do { \
  9286. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9287. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9288. } while (0)
  9289. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9290. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9291. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9292. do { \
  9293. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9294. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9295. } while (0)
  9296. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9297. (((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)
  9298. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9299. do { \
  9300. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9301. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9302. } while (0)
  9303. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9304. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9305. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9308. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9309. } while (0)
  9310. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9311. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9312. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9313. do { \
  9314. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9315. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9316. } while (0)
  9317. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9318. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9319. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9322. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9323. } while (0)
  9324. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9325. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  9326. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  9329. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  9330. } while (0)
  9331. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  9332. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  9333. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  9334. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  9335. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  9336. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  9337. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  9338. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  9339. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  9340. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9341. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9342. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  9343. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  9344. #define HTT_RX_PEER_MAP_V3_BYTES 32
  9345. /**
  9346. * @brief target -> host rx peer unmap V2 message definition
  9347. *
  9348. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  9349. *
  9350. * The following diagram shows the format of the rx peer unmap message sent
  9351. * from the target to the host.
  9352. *
  9353. * |31 24|23 16|15 8|7 0|
  9354. * |-----------------------------------------------------------------------|
  9355. * | SW peer ID | VDEV ID | msg type |
  9356. * |-----------------------------------------------------------------------|
  9357. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9358. * |-----------------------------------------------------------------------|
  9359. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  9360. * |-----------------------------------------------------------------------|
  9361. * | Peer Delete Duration |
  9362. * |-----------------------------------------------------------------------|
  9363. * | Reserved_0 | WDS Free Count |
  9364. * |-----------------------------------------------------------------------|
  9365. * | Reserved_1 |
  9366. * |-----------------------------------------------------------------------|
  9367. * | Reserved_2 |
  9368. * |-----------------------------------------------------------------------|
  9369. *
  9370. *
  9371. * The following field definitions describe the format of the rx peer unmap
  9372. * messages sent from the target to the host.
  9373. * - MSG_TYPE
  9374. * Bits 7:0
  9375. * Purpose: identifies this as an rx peer unmap v2 message
  9376. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  9377. * - VDEV_ID
  9378. * Bits 15:8
  9379. * Purpose: Indicates which virtual device the peer is associated
  9380. * with.
  9381. * Value: vdev ID (used in the host to look up the vdev object)
  9382. * - SW_PEER_ID
  9383. * Bits 31:16
  9384. * Purpose: The peer ID (index) that WAL is freeing
  9385. * Value: (rx) peer ID
  9386. * - MAC_ADDR_L32
  9387. * Bits 31:0
  9388. * Purpose: Identifies which peer node the peer ID is for.
  9389. * Value: lower 4 bytes of peer node's MAC address
  9390. * - MAC_ADDR_U16
  9391. * Bits 15:0
  9392. * Purpose: Identifies which peer node the peer ID is for.
  9393. * Value: upper 2 bytes of peer node's MAC address
  9394. * - NEXT_HOP
  9395. * Bits 16
  9396. * Purpose: Bit indicates next_hop AST entry used for WDS
  9397. * (Wireless Distribution System).
  9398. * - PEER_DELETE_DURATION
  9399. * Bits 31:0
  9400. * Purpose: Time taken to delete peer, in msec,
  9401. * Used for monitoring / debugging PEER delete response delay
  9402. * - PEER_WDS_FREE_COUNT
  9403. * Bits 15:0
  9404. * Purpose: Count of WDS entries deleted associated to peer deleted
  9405. */
  9406. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  9407. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  9408. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  9409. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  9410. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  9411. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  9412. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  9413. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  9414. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  9415. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  9416. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  9417. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  9418. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  9419. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  9420. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  9421. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  9422. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  9423. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  9424. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  9425. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  9426. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  9427. do { \
  9428. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  9429. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  9430. } while (0)
  9431. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  9432. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  9433. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  9434. do { \
  9435. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  9436. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  9437. } while (0)
  9438. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  9439. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  9440. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9441. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  9442. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  9443. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  9444. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  9445. /**
  9446. * @brief target -> host rx peer mlo map message definition
  9447. *
  9448. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  9449. *
  9450. * @details
  9451. * The following diagram shows the format of the rx mlo peer map message sent
  9452. * from the target to the host. This layout assumes the target operates
  9453. * as little-endian.
  9454. *
  9455. * MCC:
  9456. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  9457. *
  9458. * WIN:
  9459. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  9460. * It will be sent on the Assoc Link.
  9461. *
  9462. * This message always contains a MLO peer ID. The main purpose of the
  9463. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  9464. * with, so that the host can use that MLO peer ID to determine which peer
  9465. * transmitted the rx frame.
  9466. *
  9467. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  9468. * |-------------------------------------------------------------------------|
  9469. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  9470. * |-------------------------------------------------------------------------|
  9471. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9472. * |-------------------------------------------------------------------------|
  9473. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  9474. * |-------------------------------------------------------------------------|
  9475. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  9476. * |-------------------------------------------------------------------------|
  9477. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  9478. * |-------------------------------------------------------------------------|
  9479. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  9480. * |-------------------------------------------------------------------------|
  9481. * |RSVD |
  9482. * |-------------------------------------------------------------------------|
  9483. * |RSVD |
  9484. * |-------------------------------------------------------------------------|
  9485. * | htt_tlv_hdr_t |
  9486. * |-------------------------------------------------------------------------|
  9487. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9488. * |-------------------------------------------------------------------------|
  9489. * | htt_tlv_hdr_t |
  9490. * |-------------------------------------------------------------------------|
  9491. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9492. * |-------------------------------------------------------------------------|
  9493. * | htt_tlv_hdr_t |
  9494. * |-------------------------------------------------------------------------|
  9495. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9496. * |-------------------------------------------------------------------------|
  9497. *
  9498. * Where:
  9499. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  9500. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  9501. * V (valid) - 1 Bit Bit17
  9502. * CHIPID - 3 Bits
  9503. * TIDMASK - 8 Bits
  9504. * CACHE_SET_NUM - 8 Bits
  9505. *
  9506. * The following field definitions describe the format of the rx MLO peer map
  9507. * messages sent from the target to the host.
  9508. * - MSG_TYPE
  9509. * Bits 7:0
  9510. * Purpose: identifies this as an rx mlo peer map message
  9511. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  9512. *
  9513. * - MLO_PEER_ID
  9514. * Bits 23:8
  9515. * Purpose: The MLO peer ID (index).
  9516. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  9517. * Value: MLO peer ID
  9518. *
  9519. * - NUMLINK
  9520. * Bits: 26:24 (3Bits)
  9521. * Purpose: Indicate the max number of logical links supported per client.
  9522. * Value: number of logical links
  9523. *
  9524. * - PRC
  9525. * Bits: 29:27 (3Bits)
  9526. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  9527. * if there is migration of the primary chip.
  9528. * Value: Primary REO CHIPID
  9529. *
  9530. * - MAC_ADDR_L32
  9531. * Bits 31:0
  9532. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  9533. * Value: lower 4 bytes of peer node's MAC address
  9534. *
  9535. * - MAC_ADDR_U16
  9536. * Bits 15:0
  9537. * Purpose: Identifies which peer node the peer ID is for.
  9538. * Value: upper 2 bytes of peer node's MAC address
  9539. *
  9540. * - PRIMARY_TCL_AST_IDX
  9541. * Bits 15:0
  9542. * Purpose: Primary TCL AST index for this peer.
  9543. *
  9544. * - V
  9545. * 1 Bit Position 16
  9546. * Purpose: If the ast idx is valid.
  9547. *
  9548. * - CHIPID
  9549. * Bits 19:17
  9550. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  9551. *
  9552. * - TIDMASK
  9553. * Bits 27:20
  9554. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  9555. *
  9556. * - CACHE_SET_NUM
  9557. * Bits 31:28
  9558. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  9559. * Cache set number that should be used to cache the index based
  9560. * search results, for address and flow search.
  9561. * This value should be equal to LSB four bits of the hash value
  9562. * of match data, in case of search index points to an entry which
  9563. * may be used in content based search also. The value can be
  9564. * anything when the entry pointed by search index will not be
  9565. * used for content based search.
  9566. *
  9567. * - htt_tlv_hdr_t
  9568. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  9569. *
  9570. * Bits 11:0
  9571. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  9572. *
  9573. * Bits 23:12
  9574. * Purpose: Length, Length of the value that follows the header
  9575. *
  9576. * Bits 31:28
  9577. * Purpose: Reserved.
  9578. *
  9579. *
  9580. * - SW_PEER_ID
  9581. * Bits 15:0
  9582. * Purpose: The peer ID (index) that WAL is allocating
  9583. * Value: (rx) peer ID
  9584. *
  9585. * - VDEV_ID
  9586. * Bits 23:16
  9587. * Purpose: Indicates which virtual device the peer is associated with.
  9588. * Value: vdev ID (used in the host to look up the vdev object)
  9589. *
  9590. * - CHIPID
  9591. * Bits 26:24
  9592. * Purpose: Indicates which Chip id the peer is associated with.
  9593. * Value: chip ID (Provided by Host as part of QMI exchange)
  9594. */
  9595. typedef enum {
  9596. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  9597. } MLO_PEER_MAP_TLV_TAG_ID;
  9598. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  9599. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  9600. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  9601. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  9602. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  9603. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  9604. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9605. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  9606. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  9607. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  9608. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  9609. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  9610. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  9611. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  9612. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  9613. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  9614. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  9615. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  9616. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  9617. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  9618. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  9619. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  9620. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  9621. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  9622. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  9623. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  9624. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  9625. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  9626. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  9627. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  9628. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  9629. do { \
  9630. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  9631. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  9632. } while (0)
  9633. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  9634. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  9635. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  9636. do { \
  9637. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  9638. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  9639. } while (0)
  9640. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  9641. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  9642. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  9643. do { \
  9644. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  9645. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  9646. } while (0)
  9647. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  9648. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  9649. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  9650. do { \
  9651. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  9652. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  9653. } while (0)
  9654. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  9655. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  9656. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  9657. do { \
  9658. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  9659. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  9660. } while (0)
  9661. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  9662. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  9663. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  9664. do { \
  9665. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  9666. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  9667. } while (0)
  9668. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  9669. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  9670. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  9671. do { \
  9672. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  9673. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  9674. } while (0)
  9675. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  9676. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  9677. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  9678. do { \
  9679. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  9680. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  9681. } while (0)
  9682. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  9683. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  9684. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  9685. do { \
  9686. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  9687. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  9688. } while (0)
  9689. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  9690. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  9691. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  9692. do { \
  9693. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  9694. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  9695. } while (0)
  9696. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  9697. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  9698. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  9699. do { \
  9700. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  9701. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  9702. } while (0)
  9703. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  9704. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  9705. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  9706. do { \
  9707. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  9708. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  9709. } while (0)
  9710. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  9711. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  9712. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  9713. do { \
  9714. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  9715. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  9716. } while (0)
  9717. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  9718. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  9719. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9720. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  9721. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  9722. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  9723. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  9724. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  9725. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  9726. *
  9727. * The following diagram shows the format of the rx mlo peer unmap message sent
  9728. * from the target to the host.
  9729. *
  9730. * |31 24|23 16|15 8|7 0|
  9731. * |-----------------------------------------------------------------------|
  9732. * | RSVD_24_31 | MLO peer ID | msg type |
  9733. * |-----------------------------------------------------------------------|
  9734. */
  9735. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  9736. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  9737. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  9738. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  9739. /**
  9740. * @brief target -> host message specifying security parameters
  9741. *
  9742. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  9743. *
  9744. * @details
  9745. * The following diagram shows the format of the security specification
  9746. * message sent from the target to the host.
  9747. * This security specification message tells the host whether a PN check is
  9748. * necessary on rx data frames, and if so, how large the PN counter is.
  9749. * This message also tells the host about the security processing to apply
  9750. * to defragmented rx frames - specifically, whether a Message Integrity
  9751. * Check is required, and the Michael key to use.
  9752. *
  9753. * |31 24|23 16|15|14 8|7 0|
  9754. * |-----------------------------------------------------------------------|
  9755. * | peer ID | U| security type | msg type |
  9756. * |-----------------------------------------------------------------------|
  9757. * | Michael Key K0 |
  9758. * |-----------------------------------------------------------------------|
  9759. * | Michael Key K1 |
  9760. * |-----------------------------------------------------------------------|
  9761. * | WAPI RSC Low0 |
  9762. * |-----------------------------------------------------------------------|
  9763. * | WAPI RSC Low1 |
  9764. * |-----------------------------------------------------------------------|
  9765. * | WAPI RSC Hi0 |
  9766. * |-----------------------------------------------------------------------|
  9767. * | WAPI RSC Hi1 |
  9768. * |-----------------------------------------------------------------------|
  9769. *
  9770. * The following field definitions describe the format of the security
  9771. * indication message sent from the target to the host.
  9772. * - MSG_TYPE
  9773. * Bits 7:0
  9774. * Purpose: identifies this as a security specification message
  9775. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  9776. * - SEC_TYPE
  9777. * Bits 14:8
  9778. * Purpose: specifies which type of security applies to the peer
  9779. * Value: htt_sec_type enum value
  9780. * - UNICAST
  9781. * Bit 15
  9782. * Purpose: whether this security is applied to unicast or multicast data
  9783. * Value: 1 -> unicast, 0 -> multicast
  9784. * - PEER_ID
  9785. * Bits 31:16
  9786. * Purpose: The ID number for the peer the security specification is for
  9787. * Value: peer ID
  9788. * - MICHAEL_KEY_K0
  9789. * Bits 31:0
  9790. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  9791. * Value: Michael Key K0 (if security type is TKIP)
  9792. * - MICHAEL_KEY_K1
  9793. * Bits 31:0
  9794. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  9795. * Value: Michael Key K1 (if security type is TKIP)
  9796. * - WAPI_RSC_LOW0
  9797. * Bits 31:0
  9798. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  9799. * Value: WAPI RSC Low0 (if security type is WAPI)
  9800. * - WAPI_RSC_LOW1
  9801. * Bits 31:0
  9802. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  9803. * Value: WAPI RSC Low1 (if security type is WAPI)
  9804. * - WAPI_RSC_HI0
  9805. * Bits 31:0
  9806. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  9807. * Value: WAPI RSC Hi0 (if security type is WAPI)
  9808. * - WAPI_RSC_HI1
  9809. * Bits 31:0
  9810. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  9811. * Value: WAPI RSC Hi1 (if security type is WAPI)
  9812. */
  9813. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  9814. #define HTT_SEC_IND_SEC_TYPE_S 8
  9815. #define HTT_SEC_IND_UNICAST_M 0x00008000
  9816. #define HTT_SEC_IND_UNICAST_S 15
  9817. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  9818. #define HTT_SEC_IND_PEER_ID_S 16
  9819. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  9820. do { \
  9821. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  9822. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  9823. } while (0)
  9824. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  9825. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  9826. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  9827. do { \
  9828. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  9829. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  9830. } while (0)
  9831. #define HTT_SEC_IND_UNICAST_GET(word) \
  9832. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  9833. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  9834. do { \
  9835. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  9836. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  9837. } while (0)
  9838. #define HTT_SEC_IND_PEER_ID_GET(word) \
  9839. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  9840. #define HTT_SEC_IND_BYTES 28
  9841. /**
  9842. * @brief target -> host rx ADDBA / DELBA message definitions
  9843. *
  9844. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  9845. *
  9846. * @details
  9847. * The following diagram shows the format of the rx ADDBA message sent
  9848. * from the target to the host:
  9849. *
  9850. * |31 20|19 16|15 8|7 0|
  9851. * |---------------------------------------------------------------------|
  9852. * | peer ID | TID | window size | msg type |
  9853. * |---------------------------------------------------------------------|
  9854. *
  9855. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  9856. *
  9857. * The following diagram shows the format of the rx DELBA message sent
  9858. * from the target to the host:
  9859. *
  9860. * |31 20|19 16|15 10|9 8|7 0|
  9861. * |---------------------------------------------------------------------|
  9862. * | peer ID | TID | window size | IR| msg type |
  9863. * |---------------------------------------------------------------------|
  9864. *
  9865. * The following field definitions describe the format of the rx ADDBA
  9866. * and DELBA messages sent from the target to the host.
  9867. * - MSG_TYPE
  9868. * Bits 7:0
  9869. * Purpose: identifies this as an rx ADDBA or DELBA message
  9870. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  9871. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  9872. * - IR (initiator / recipient)
  9873. * Bits 9:8 (DELBA only)
  9874. * Purpose: specify whether the DELBA handshake was initiated by the
  9875. * local STA/AP, or by the peer STA/AP
  9876. * Value:
  9877. * 0 - unspecified
  9878. * 1 - initiator (a.k.a. originator)
  9879. * 2 - recipient (a.k.a. responder)
  9880. * 3 - unused / reserved
  9881. * - WIN_SIZE
  9882. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  9883. * Purpose: Specifies the length of the block ack window (max = 64).
  9884. * Value:
  9885. * block ack window length specified by the received ADDBA/DELBA
  9886. * management message.
  9887. * - TID
  9888. * Bits 19:16
  9889. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  9890. * Value:
  9891. * TID specified by the received ADDBA or DELBA management message.
  9892. * - PEER_ID
  9893. * Bits 31:20
  9894. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  9895. * Value:
  9896. * ID (hash value) used by the host for fast, direct lookup of
  9897. * host SW peer info, including rx reorder states.
  9898. */
  9899. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  9900. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  9901. #define HTT_RX_ADDBA_TID_M 0xf0000
  9902. #define HTT_RX_ADDBA_TID_S 16
  9903. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  9904. #define HTT_RX_ADDBA_PEER_ID_S 20
  9905. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  9906. do { \
  9907. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  9908. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  9909. } while (0)
  9910. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9911. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9912. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9913. do { \
  9914. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9915. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9916. } while (0)
  9917. #define HTT_RX_ADDBA_TID_GET(word) \
  9918. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9919. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9920. do { \
  9921. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9922. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9923. } while (0)
  9924. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9925. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9926. #define HTT_RX_ADDBA_BYTES 4
  9927. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9928. #define HTT_RX_DELBA_INITIATOR_S 8
  9929. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9930. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9931. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9932. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9933. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9934. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9935. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9936. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9937. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9938. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9939. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9942. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9943. } while (0)
  9944. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9945. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9946. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9947. do { \
  9948. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9949. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9950. } while (0)
  9951. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9952. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9953. #define HTT_RX_DELBA_BYTES 4
  9954. /**
  9955. * @brief tx queue group information element definition
  9956. *
  9957. * @details
  9958. * The following diagram shows the format of the tx queue group
  9959. * information element, which can be included in target --> host
  9960. * messages to specify the number of tx "credits" (tx descriptors
  9961. * for LL, or tx buffers for HL) available to a particular group
  9962. * of host-side tx queues, and which host-side tx queues belong to
  9963. * the group.
  9964. *
  9965. * |31|30 24|23 16|15|14|13 0|
  9966. * |------------------------------------------------------------------------|
  9967. * | X| reserved | tx queue grp ID | A| S| credit count |
  9968. * |------------------------------------------------------------------------|
  9969. * | vdev ID mask | AC mask |
  9970. * |------------------------------------------------------------------------|
  9971. *
  9972. * The following definitions describe the fields within the tx queue group
  9973. * information element:
  9974. * - credit_count
  9975. * Bits 13:1
  9976. * Purpose: specify how many tx credits are available to the tx queue group
  9977. * Value: An absolute or relative, positive or negative credit value
  9978. * The 'A' bit specifies whether the value is absolute or relative.
  9979. * The 'S' bit specifies whether the value is positive or negative.
  9980. * A negative value can only be relative, not absolute.
  9981. * An absolute value replaces any prior credit value the host has for
  9982. * the tx queue group in question.
  9983. * A relative value is added to the prior credit value the host has for
  9984. * the tx queue group in question.
  9985. * - sign
  9986. * Bit 14
  9987. * Purpose: specify whether the credit count is positive or negative
  9988. * Value: 0 -> positive, 1 -> negative
  9989. * - absolute
  9990. * Bit 15
  9991. * Purpose: specify whether the credit count is absolute or relative
  9992. * Value: 0 -> relative, 1 -> absolute
  9993. * - txq_group_id
  9994. * Bits 23:16
  9995. * Purpose: indicate which tx queue group's credit and/or membership are
  9996. * being specified
  9997. * Value: 0 to max_tx_queue_groups-1
  9998. * - reserved
  9999. * Bits 30:16
  10000. * Value: 0x0
  10001. * - eXtension
  10002. * Bit 31
  10003. * Purpose: specify whether another tx queue group info element follows
  10004. * Value: 0 -> no more tx queue group information elements
  10005. * 1 -> another tx queue group information element immediately follows
  10006. * - ac_mask
  10007. * Bits 15:0
  10008. * Purpose: specify which Access Categories belong to the tx queue group
  10009. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10010. * the tx queue group.
  10011. * The AC bit-mask values are obtained by left-shifting by the
  10012. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10013. * - vdev_id_mask
  10014. * Bits 31:16
  10015. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10016. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10017. * belong to the tx queue group.
  10018. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10019. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10020. */
  10021. PREPACK struct htt_txq_group {
  10022. A_UINT32
  10023. credit_count: 14,
  10024. sign: 1,
  10025. absolute: 1,
  10026. tx_queue_group_id: 8,
  10027. reserved0: 7,
  10028. extension: 1;
  10029. A_UINT32
  10030. ac_mask: 16,
  10031. vdev_id_mask: 16;
  10032. } POSTPACK;
  10033. /* first word */
  10034. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10035. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10036. #define HTT_TXQ_GROUP_SIGN_S 14
  10037. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10038. #define HTT_TXQ_GROUP_ABS_S 15
  10039. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10040. #define HTT_TXQ_GROUP_ID_S 16
  10041. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10042. #define HTT_TXQ_GROUP_EXT_S 31
  10043. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10044. /* second word */
  10045. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10046. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10047. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10048. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10049. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10052. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10053. } while (0)
  10054. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10055. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10056. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10059. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10060. } while (0)
  10061. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10062. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10063. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10064. do { \
  10065. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10066. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10067. } while (0)
  10068. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10069. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10070. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10071. do { \
  10072. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10073. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10074. } while (0)
  10075. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10076. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10077. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10078. do { \
  10079. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10080. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10081. } while (0)
  10082. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10083. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10084. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10085. do { \
  10086. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10087. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10088. } while (0)
  10089. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10090. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10091. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10092. do { \
  10093. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10094. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10095. } while (0)
  10096. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10097. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10098. /**
  10099. * @brief target -> host TX completion indication message definition
  10100. *
  10101. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10102. *
  10103. * @details
  10104. * The following diagram shows the format of the TX completion indication sent
  10105. * from the target to the host
  10106. *
  10107. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10108. * |-------------------------------------------------------------------|
  10109. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10110. * |-------------------------------------------------------------------|
  10111. * payload:| MSDU1 ID | MSDU0 ID |
  10112. * |-------------------------------------------------------------------|
  10113. * : MSDU3 ID | MSDU2 ID :
  10114. * |-------------------------------------------------------------------|
  10115. * | struct htt_tx_compl_ind_append_retries |
  10116. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10117. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10118. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10119. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10120. * |-------------------------------------------------------------------|
  10121. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10122. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10123. * | MSDU0 tx_tsf64_low |
  10124. * |-------------------------------------------------------------------|
  10125. * | MSDU0 tx_tsf64_high |
  10126. * |-------------------------------------------------------------------|
  10127. * | MSDU1 tx_tsf64_low |
  10128. * |-------------------------------------------------------------------|
  10129. * | MSDU1 tx_tsf64_high |
  10130. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10131. * | phy_timestamp |
  10132. * |-------------------------------------------------------------------|
  10133. * | rate specs (see below) |
  10134. * |-------------------------------------------------------------------|
  10135. * | seqctrl | framectrl |
  10136. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10137. * Where:
  10138. * A0 = append (a.k.a. append0)
  10139. * A1 = append1
  10140. * TP = MSDU tx power presence
  10141. * A2 = append2
  10142. * A3 = append3
  10143. * A4 = append4
  10144. *
  10145. * The following field definitions describe the format of the TX completion
  10146. * indication sent from the target to the host
  10147. * Header fields:
  10148. * - msg_type
  10149. * Bits 7:0
  10150. * Purpose: identifies this as HTT TX completion indication
  10151. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10152. * - status
  10153. * Bits 10:8
  10154. * Purpose: the TX completion status of payload fragmentations descriptors
  10155. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10156. * - tid
  10157. * Bits 14:11
  10158. * Purpose: the tid associated with those fragmentation descriptors. It is
  10159. * valid or not, depending on the tid_invalid bit.
  10160. * Value: 0 to 15
  10161. * - tid_invalid
  10162. * Bits 15:15
  10163. * Purpose: this bit indicates whether the tid field is valid or not
  10164. * Value: 0 indicates valid; 1 indicates invalid
  10165. * - num
  10166. * Bits 23:16
  10167. * Purpose: the number of payload in this indication
  10168. * Value: 1 to 255
  10169. * - append (a.k.a. append0)
  10170. * Bits 24:24
  10171. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10172. * the number of tx retries for one MSDU at the end of this message
  10173. * Value: 0 indicates no appending; 1 indicates appending
  10174. * - append1
  10175. * Bits 25:25
  10176. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10177. * contains the timestamp info for each TX msdu id in payload.
  10178. * The order of the timestamps matches the order of the MSDU IDs.
  10179. * Note that a big-endian host needs to account for the reordering
  10180. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10181. * conversion) when determining which tx timestamp corresponds to
  10182. * which MSDU ID.
  10183. * Value: 0 indicates no appending; 1 indicates appending
  10184. * - msdu_tx_power_presence
  10185. * Bits 26:26
  10186. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10187. * for each MSDU referenced by the TX_COMPL_IND message.
  10188. * The tx power is reported in 0.5 dBm units.
  10189. * The order of the per-MSDU tx power reports matches the order
  10190. * of the MSDU IDs.
  10191. * Note that a big-endian host needs to account for the reordering
  10192. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10193. * conversion) when determining which Tx Power corresponds to
  10194. * which MSDU ID.
  10195. * Value: 0 indicates MSDU tx power reports are not appended,
  10196. * 1 indicates MSDU tx power reports are appended
  10197. * - append2
  10198. * Bits 27:27
  10199. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10200. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10201. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10202. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10203. * for each MSDU, for convenience.
  10204. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10205. * this append2 bit is set).
  10206. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10207. * dB above the noise floor.
  10208. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10209. * 1 indicates MSDU ACK RSSI values are appended.
  10210. * - append3
  10211. * Bits 28:28
  10212. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10213. * contains the tx tsf info based on wlan global TSF for
  10214. * each TX msdu id in payload.
  10215. * The order of the tx tsf matches the order of the MSDU IDs.
  10216. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10217. * values to indicate the the lower 32 bits and higher 32 bits of
  10218. * the tx tsf.
  10219. * The tx_tsf64 here represents the time MSDU was acked and the
  10220. * tx_tsf64 has microseconds units.
  10221. * Value: 0 indicates no appending; 1 indicates appending
  10222. * - append4
  10223. * Bits 29:29
  10224. * Purpose: Indicate whether data frame control fields and fields required
  10225. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10226. * message. The order of the this message matches the order of
  10227. * the MSDU IDs.
  10228. * Value: 0 indicates frame control fields and fields required for
  10229. * radio tap header values are not appended,
  10230. * 1 indicates frame control fields and fields required for
  10231. * radio tap header values are appended.
  10232. * Payload fields:
  10233. * - hmsdu_id
  10234. * Bits 15:0
  10235. * Purpose: this ID is used to track the Tx buffer in host
  10236. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10237. */
  10238. PREPACK struct htt_tx_data_hdr_information {
  10239. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10240. A_UINT32 /* word 1 */
  10241. /* preamble:
  10242. * 0-OFDM,
  10243. * 1-CCk,
  10244. * 2-HT,
  10245. * 3-VHT
  10246. */
  10247. preamble: 2, /* [1:0] */
  10248. /* mcs:
  10249. * In case of HT preamble interpret
  10250. * MCS along with NSS.
  10251. * Valid values for HT are 0 to 7.
  10252. * HT mcs 0 with NSS 2 is mcs 8.
  10253. * Valid values for VHT are 0 to 9.
  10254. */
  10255. mcs: 4, /* [5:2] */
  10256. /* rate:
  10257. * This is applicable only for
  10258. * CCK and OFDM preamble type
  10259. * rate 0: OFDM 48 Mbps,
  10260. * 1: OFDM 24 Mbps,
  10261. * 2: OFDM 12 Mbps
  10262. * 3: OFDM 6 Mbps
  10263. * 4: OFDM 54 Mbps
  10264. * 5: OFDM 36 Mbps
  10265. * 6: OFDM 18 Mbps
  10266. * 7: OFDM 9 Mbps
  10267. * rate 0: CCK 11 Mbps Long
  10268. * 1: CCK 5.5 Mbps Long
  10269. * 2: CCK 2 Mbps Long
  10270. * 3: CCK 1 Mbps Long
  10271. * 4: CCK 11 Mbps Short
  10272. * 5: CCK 5.5 Mbps Short
  10273. * 6: CCK 2 Mbps Short
  10274. */
  10275. rate : 3, /* [ 8: 6] */
  10276. rssi : 8, /* [16: 9] units=dBm */
  10277. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10278. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10279. stbc : 1, /* [22] */
  10280. sgi : 1, /* [23] */
  10281. ldpc : 1, /* [24] */
  10282. beamformed: 1, /* [25] */
  10283. /* tx_retry_cnt:
  10284. * Indicates retry count of data tx frames provided by the host.
  10285. */
  10286. tx_retry_cnt: 6; /* [31:26] */
  10287. A_UINT32 /* word 2 */
  10288. framectrl:16, /* [15: 0] */
  10289. seqno:16; /* [31:16] */
  10290. } POSTPACK;
  10291. #define HTT_TX_COMPL_IND_STATUS_S 8
  10292. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10293. #define HTT_TX_COMPL_IND_TID_S 11
  10294. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10295. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10296. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10297. #define HTT_TX_COMPL_IND_NUM_S 16
  10298. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10299. #define HTT_TX_COMPL_IND_APPEND_S 24
  10300. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10301. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10302. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10303. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10304. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10305. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10306. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10307. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10308. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10309. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10310. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10311. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10312. do { \
  10313. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10314. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10315. } while (0)
  10316. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10317. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10318. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10319. do { \
  10320. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10321. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10322. } while (0)
  10323. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10324. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10325. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  10326. do { \
  10327. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  10328. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  10329. } while (0)
  10330. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  10331. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  10332. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  10333. do { \
  10334. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  10335. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  10336. } while (0)
  10337. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  10338. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  10339. HTT_TX_COMPL_IND_TID_INV_S)
  10340. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  10341. do { \
  10342. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  10343. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  10344. } while (0)
  10345. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  10346. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  10347. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  10348. do { \
  10349. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  10350. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  10351. } while (0)
  10352. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  10353. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  10354. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  10355. do { \
  10356. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  10357. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  10358. } while (0)
  10359. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  10360. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  10361. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  10362. do { \
  10363. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  10364. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  10365. } while (0)
  10366. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  10367. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  10368. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  10369. do { \
  10370. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  10371. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  10372. } while (0)
  10373. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  10374. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  10375. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  10376. do { \
  10377. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  10378. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  10379. } while (0)
  10380. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  10381. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  10382. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  10383. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  10384. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  10385. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  10386. #define HTT_TX_COMPL_IND_STAT_OK 0
  10387. /* DISCARD:
  10388. * current meaning:
  10389. * MSDUs were queued for transmission but filtered by HW or SW
  10390. * without any over the air attempts
  10391. * legacy meaning (HL Rome):
  10392. * MSDUs were discarded by the target FW without any over the air
  10393. * attempts due to lack of space
  10394. */
  10395. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  10396. /* NO_ACK:
  10397. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  10398. */
  10399. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  10400. /* POSTPONE:
  10401. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  10402. * be downloaded again later (in the appropriate order), when they are
  10403. * deliverable.
  10404. */
  10405. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  10406. /*
  10407. * The PEER_DEL tx completion status is used for HL cases
  10408. * where the peer the frame is for has been deleted.
  10409. * The host has already discarded its copy of the frame, but
  10410. * it still needs the tx completion to restore its credit.
  10411. */
  10412. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  10413. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  10414. #define HTT_TX_COMPL_IND_STAT_DROP 5
  10415. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  10416. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  10417. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  10418. PREPACK struct htt_tx_compl_ind_base {
  10419. A_UINT32 hdr;
  10420. A_UINT16 payload[1/*or more*/];
  10421. } POSTPACK;
  10422. PREPACK struct htt_tx_compl_ind_append_retries {
  10423. A_UINT16 msdu_id;
  10424. A_UINT8 tx_retries;
  10425. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  10426. 0: this is the last append_retries struct */
  10427. } POSTPACK;
  10428. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  10429. A_UINT32 timestamp[1/*or more*/];
  10430. } POSTPACK;
  10431. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  10432. A_UINT32 tx_tsf64_low;
  10433. A_UINT32 tx_tsf64_high;
  10434. } POSTPACK;
  10435. /* htt_tx_data_hdr_information payload extension fields: */
  10436. /* DWORD zero */
  10437. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  10438. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  10439. /* DWORD one */
  10440. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  10441. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  10442. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  10443. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  10444. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  10445. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  10446. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  10447. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  10448. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  10449. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  10450. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  10451. #define HTT_FW_TX_DATA_HDR_BW_S 19
  10452. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  10453. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  10454. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  10455. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  10456. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  10457. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  10458. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  10459. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  10460. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  10461. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  10462. /* DWORD two */
  10463. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  10464. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  10465. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  10466. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  10467. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  10468. do { \
  10469. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  10470. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  10471. } while (0)
  10472. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  10473. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  10474. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  10475. do { \
  10476. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  10477. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  10478. } while (0)
  10479. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  10480. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  10481. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  10484. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  10485. } while (0)
  10486. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  10487. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  10488. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  10489. do { \
  10490. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  10491. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  10492. } while (0)
  10493. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  10494. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  10495. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  10496. do { \
  10497. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  10498. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  10499. } while (0)
  10500. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  10501. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  10502. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  10503. do { \
  10504. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  10505. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  10506. } while (0)
  10507. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  10508. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  10509. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  10512. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  10513. } while (0)
  10514. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  10515. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  10516. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  10519. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  10520. } while (0)
  10521. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  10522. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  10523. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  10526. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  10527. } while (0)
  10528. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  10529. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  10530. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  10533. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  10534. } while (0)
  10535. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  10536. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  10537. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  10540. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  10541. } while (0)
  10542. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  10543. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  10544. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  10547. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  10548. } while (0)
  10549. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  10550. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  10551. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  10552. do { \
  10553. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  10554. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  10555. } while (0)
  10556. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  10557. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  10558. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  10561. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  10562. } while (0)
  10563. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  10564. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  10565. /**
  10566. * @brief target -> host rate-control update indication message
  10567. *
  10568. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  10569. *
  10570. * @details
  10571. * The following diagram shows the format of the RC Update message
  10572. * sent from the target to the host, while processing the tx-completion
  10573. * of a transmitted PPDU.
  10574. *
  10575. * |31 24|23 16|15 8|7 0|
  10576. * |-------------------------------------------------------------|
  10577. * | peer ID | vdev ID | msg_type |
  10578. * |-------------------------------------------------------------|
  10579. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10580. * |-------------------------------------------------------------|
  10581. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  10582. * |-------------------------------------------------------------|
  10583. * | : |
  10584. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10585. * | : |
  10586. * |-------------------------------------------------------------|
  10587. * | : |
  10588. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10589. * | : |
  10590. * |-------------------------------------------------------------|
  10591. * : :
  10592. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10593. *
  10594. */
  10595. typedef struct {
  10596. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  10597. A_UINT32 rate_code_flags;
  10598. A_UINT32 flags; /* Encodes information such as excessive
  10599. retransmission, aggregate, some info
  10600. from .11 frame control,
  10601. STBC, LDPC, (SGI and Tx Chain Mask
  10602. are encoded in ptx_rc->flags field),
  10603. AMPDU truncation (BT/time based etc.),
  10604. RTS/CTS attempt */
  10605. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  10606. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  10607. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  10608. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  10609. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  10610. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  10611. } HTT_RC_TX_DONE_PARAMS;
  10612. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  10613. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  10614. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  10615. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  10616. #define HTT_RC_UPDATE_VDEVID_S 8
  10617. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  10618. #define HTT_RC_UPDATE_PEERID_S 16
  10619. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  10620. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  10621. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  10622. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  10623. do { \
  10624. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  10625. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  10626. } while (0)
  10627. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  10628. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  10629. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  10630. do { \
  10631. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  10632. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  10633. } while (0)
  10634. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  10635. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  10636. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  10637. do { \
  10638. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  10639. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  10640. } while (0)
  10641. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  10642. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  10643. /**
  10644. * @brief target -> host rx fragment indication message definition
  10645. *
  10646. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  10647. *
  10648. * @details
  10649. * The following field definitions describe the format of the rx fragment
  10650. * indication message sent from the target to the host.
  10651. * The rx fragment indication message shares the format of the
  10652. * rx indication message, but not all fields from the rx indication message
  10653. * are relevant to the rx fragment indication message.
  10654. *
  10655. *
  10656. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10657. * |-----------+-------------------+---------------------+-------------|
  10658. * | peer ID | |FV| ext TID | msg type |
  10659. * |-------------------------------------------------------------------|
  10660. * | | flush | flush |
  10661. * | | end | start |
  10662. * | | seq num | seq num |
  10663. * |-------------------------------------------------------------------|
  10664. * | reserved | FW rx desc bytes |
  10665. * |-------------------------------------------------------------------|
  10666. * | | FW MSDU Rx |
  10667. * | | desc B0 |
  10668. * |-------------------------------------------------------------------|
  10669. * Header fields:
  10670. * - MSG_TYPE
  10671. * Bits 7:0
  10672. * Purpose: identifies this as an rx fragment indication message
  10673. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  10674. * - EXT_TID
  10675. * Bits 12:8
  10676. * Purpose: identify the traffic ID of the rx data, including
  10677. * special "extended" TID values for multicast, broadcast, and
  10678. * non-QoS data frames
  10679. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10680. * - FLUSH_VALID (FV)
  10681. * Bit 13
  10682. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10683. * is valid
  10684. * Value:
  10685. * 1 -> flush IE is valid and needs to be processed
  10686. * 0 -> flush IE is not valid and should be ignored
  10687. * - PEER_ID
  10688. * Bits 31:16
  10689. * Purpose: Identify, by ID, which peer sent the rx data
  10690. * Value: ID of the peer who sent the rx data
  10691. * - FLUSH_SEQ_NUM_START
  10692. * Bits 5:0
  10693. * Purpose: Indicate the start of a series of MPDUs to flush
  10694. * Not all MPDUs within this series are necessarily valid - the host
  10695. * must check each sequence number within this range to see if the
  10696. * corresponding MPDU is actually present.
  10697. * This field is only valid if the FV bit is set.
  10698. * Value:
  10699. * The sequence number for the first MPDUs to check to flush.
  10700. * The sequence number is masked by 0x3f.
  10701. * - FLUSH_SEQ_NUM_END
  10702. * Bits 11:6
  10703. * Purpose: Indicate the end of a series of MPDUs to flush
  10704. * Value:
  10705. * The sequence number one larger than the sequence number of the
  10706. * last MPDU to check to flush.
  10707. * The sequence number is masked by 0x3f.
  10708. * Not all MPDUs within this series are necessarily valid - the host
  10709. * must check each sequence number within this range to see if the
  10710. * corresponding MPDU is actually present.
  10711. * This field is only valid if the FV bit is set.
  10712. * Rx descriptor fields:
  10713. * - FW_RX_DESC_BYTES
  10714. * Bits 15:0
  10715. * Purpose: Indicate how many bytes in the Rx indication are used for
  10716. * FW Rx descriptors
  10717. * Value: 1
  10718. */
  10719. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  10720. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  10721. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  10722. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  10723. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  10724. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  10725. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  10726. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  10727. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  10728. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  10729. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  10730. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  10731. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  10732. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  10733. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  10734. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  10735. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  10736. #define HTT_RX_FRAG_IND_BYTES \
  10737. (4 /* msg hdr */ + \
  10738. 4 /* flush spec */ + \
  10739. 4 /* (unused) FW rx desc bytes spec */ + \
  10740. 4 /* FW rx desc */)
  10741. /**
  10742. * @brief target -> host test message definition
  10743. *
  10744. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  10745. *
  10746. * @details
  10747. * The following field definitions describe the format of the test
  10748. * message sent from the target to the host.
  10749. * The message consists of a 4-octet header, followed by a variable
  10750. * number of 32-bit integer values, followed by a variable number
  10751. * of 8-bit character values.
  10752. *
  10753. * |31 16|15 8|7 0|
  10754. * |-----------------------------------------------------------|
  10755. * | num chars | num ints | msg type |
  10756. * |-----------------------------------------------------------|
  10757. * | int 0 |
  10758. * |-----------------------------------------------------------|
  10759. * | int 1 |
  10760. * |-----------------------------------------------------------|
  10761. * | ... |
  10762. * |-----------------------------------------------------------|
  10763. * | char 3 | char 2 | char 1 | char 0 |
  10764. * |-----------------------------------------------------------|
  10765. * | | | ... | char 4 |
  10766. * |-----------------------------------------------------------|
  10767. * - MSG_TYPE
  10768. * Bits 7:0
  10769. * Purpose: identifies this as a test message
  10770. * Value: HTT_MSG_TYPE_TEST
  10771. * - NUM_INTS
  10772. * Bits 15:8
  10773. * Purpose: indicate how many 32-bit integers follow the message header
  10774. * - NUM_CHARS
  10775. * Bits 31:16
  10776. * Purpose: indicate how many 8-bit charaters follow the series of integers
  10777. */
  10778. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  10779. #define HTT_RX_TEST_NUM_INTS_S 8
  10780. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  10781. #define HTT_RX_TEST_NUM_CHARS_S 16
  10782. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  10783. do { \
  10784. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  10785. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  10786. } while (0)
  10787. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  10788. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  10789. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  10790. do { \
  10791. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  10792. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  10793. } while (0)
  10794. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  10795. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  10796. /**
  10797. * @brief target -> host packet log message
  10798. *
  10799. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  10800. *
  10801. * @details
  10802. * The following field definitions describe the format of the packet log
  10803. * message sent from the target to the host.
  10804. * The message consists of a 4-octet header,followed by a variable number
  10805. * of 32-bit character values.
  10806. *
  10807. * |31 16|15 12|11 10|9 8|7 0|
  10808. * |------------------------------------------------------------------|
  10809. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  10810. * |------------------------------------------------------------------|
  10811. * | payload |
  10812. * |------------------------------------------------------------------|
  10813. * - MSG_TYPE
  10814. * Bits 7:0
  10815. * Purpose: identifies this as a pktlog message
  10816. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  10817. * - mac_id
  10818. * Bits 9:8
  10819. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  10820. * Value: 0-3
  10821. * - pdev_id
  10822. * Bits 11:10
  10823. * Purpose: pdev_id
  10824. * Value: 0-3
  10825. * 0 (for rings at SOC level),
  10826. * 1/2/3 PDEV -> 0/1/2
  10827. * - payload_size
  10828. * Bits 31:16
  10829. * Purpose: explicitly specify the payload size
  10830. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  10831. */
  10832. PREPACK struct htt_pktlog_msg {
  10833. A_UINT32 header;
  10834. A_UINT32 payload[1/* or more */];
  10835. } POSTPACK;
  10836. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  10837. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  10838. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  10839. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  10840. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  10841. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  10842. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  10843. do { \
  10844. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  10845. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  10846. } while (0)
  10847. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  10848. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  10849. HTT_T2H_PKTLOG_MAC_ID_S)
  10850. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  10851. do { \
  10852. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  10853. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  10854. } while (0)
  10855. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  10856. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  10857. HTT_T2H_PKTLOG_PDEV_ID_S)
  10858. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  10859. do { \
  10860. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  10861. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  10862. } while (0)
  10863. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  10864. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  10865. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  10866. /*
  10867. * Rx reorder statistics
  10868. * NB: all the fields must be defined in 4 octets size.
  10869. */
  10870. struct rx_reorder_stats {
  10871. /* Non QoS MPDUs received */
  10872. A_UINT32 deliver_non_qos;
  10873. /* MPDUs received in-order */
  10874. A_UINT32 deliver_in_order;
  10875. /* Flush due to reorder timer expired */
  10876. A_UINT32 deliver_flush_timeout;
  10877. /* Flush due to move out of window */
  10878. A_UINT32 deliver_flush_oow;
  10879. /* Flush due to DELBA */
  10880. A_UINT32 deliver_flush_delba;
  10881. /* MPDUs dropped due to FCS error */
  10882. A_UINT32 fcs_error;
  10883. /* MPDUs dropped due to monitor mode non-data packet */
  10884. A_UINT32 mgmt_ctrl;
  10885. /* Unicast-data MPDUs dropped due to invalid peer */
  10886. A_UINT32 invalid_peer;
  10887. /* MPDUs dropped due to duplication (non aggregation) */
  10888. A_UINT32 dup_non_aggr;
  10889. /* MPDUs dropped due to processed before */
  10890. A_UINT32 dup_past;
  10891. /* MPDUs dropped due to duplicate in reorder queue */
  10892. A_UINT32 dup_in_reorder;
  10893. /* Reorder timeout happened */
  10894. A_UINT32 reorder_timeout;
  10895. /* invalid bar ssn */
  10896. A_UINT32 invalid_bar_ssn;
  10897. /* reorder reset due to bar ssn */
  10898. A_UINT32 ssn_reset;
  10899. /* Flush due to delete peer */
  10900. A_UINT32 deliver_flush_delpeer;
  10901. /* Flush due to offload*/
  10902. A_UINT32 deliver_flush_offload;
  10903. /* Flush due to out of buffer*/
  10904. A_UINT32 deliver_flush_oob;
  10905. /* MPDUs dropped due to PN check fail */
  10906. A_UINT32 pn_fail;
  10907. /* MPDUs dropped due to unable to allocate memory */
  10908. A_UINT32 store_fail;
  10909. /* Number of times the tid pool alloc succeeded */
  10910. A_UINT32 tid_pool_alloc_succ;
  10911. /* Number of times the MPDU pool alloc succeeded */
  10912. A_UINT32 mpdu_pool_alloc_succ;
  10913. /* Number of times the MSDU pool alloc succeeded */
  10914. A_UINT32 msdu_pool_alloc_succ;
  10915. /* Number of times the tid pool alloc failed */
  10916. A_UINT32 tid_pool_alloc_fail;
  10917. /* Number of times the MPDU pool alloc failed */
  10918. A_UINT32 mpdu_pool_alloc_fail;
  10919. /* Number of times the MSDU pool alloc failed */
  10920. A_UINT32 msdu_pool_alloc_fail;
  10921. /* Number of times the tid pool freed */
  10922. A_UINT32 tid_pool_free;
  10923. /* Number of times the MPDU pool freed */
  10924. A_UINT32 mpdu_pool_free;
  10925. /* Number of times the MSDU pool freed */
  10926. A_UINT32 msdu_pool_free;
  10927. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10928. A_UINT32 msdu_queued;
  10929. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10930. A_UINT32 msdu_recycled;
  10931. /* Number of MPDUs with invalid peer but A2 found in AST */
  10932. A_UINT32 invalid_peer_a2_in_ast;
  10933. /* Number of MPDUs with invalid peer but A3 found in AST */
  10934. A_UINT32 invalid_peer_a3_in_ast;
  10935. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10936. A_UINT32 invalid_peer_bmc_mpdus;
  10937. /* Number of MSDUs with err attention word */
  10938. A_UINT32 rxdesc_err_att;
  10939. /* Number of MSDUs with flag of peer_idx_invalid */
  10940. A_UINT32 rxdesc_err_peer_idx_inv;
  10941. /* Number of MSDUs with flag of peer_idx_timeout */
  10942. A_UINT32 rxdesc_err_peer_idx_to;
  10943. /* Number of MSDUs with flag of overflow */
  10944. A_UINT32 rxdesc_err_ov;
  10945. /* Number of MSDUs with flag of msdu_length_err */
  10946. A_UINT32 rxdesc_err_msdu_len;
  10947. /* Number of MSDUs with flag of mpdu_length_err */
  10948. A_UINT32 rxdesc_err_mpdu_len;
  10949. /* Number of MSDUs with flag of tkip_mic_err */
  10950. A_UINT32 rxdesc_err_tkip_mic;
  10951. /* Number of MSDUs with flag of decrypt_err */
  10952. A_UINT32 rxdesc_err_decrypt;
  10953. /* Number of MSDUs with flag of fcs_err */
  10954. A_UINT32 rxdesc_err_fcs;
  10955. /* Number of Unicast (bc_mc bit is not set in attention word)
  10956. * frames with invalid peer handler
  10957. */
  10958. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10959. /* Number of unicast frame directly (direct bit is set in attention word)
  10960. * to DUT with invalid peer handler
  10961. */
  10962. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10963. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10964. * frames with invalid peer handler
  10965. */
  10966. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10967. /* Number of MSDUs dropped due to no first MSDU flag */
  10968. A_UINT32 rxdesc_no_1st_msdu;
  10969. /* Number of MSDUs droped due to ring overflow */
  10970. A_UINT32 msdu_drop_ring_ov;
  10971. /* Number of MSDUs dropped due to FC mismatch */
  10972. A_UINT32 msdu_drop_fc_mismatch;
  10973. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10974. A_UINT32 msdu_drop_mgmt_remote_ring;
  10975. /* Number of MSDUs dropped due to errors not reported in attention word */
  10976. A_UINT32 msdu_drop_misc;
  10977. /* Number of MSDUs go to offload before reorder */
  10978. A_UINT32 offload_msdu_wal;
  10979. /* Number of data frame dropped by offload after reorder */
  10980. A_UINT32 offload_msdu_reorder;
  10981. /* Number of MPDUs with sequence number in the past and within the BA window */
  10982. A_UINT32 dup_past_within_window;
  10983. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10984. A_UINT32 dup_past_outside_window;
  10985. /* Number of MSDUs with decrypt/MIC error */
  10986. A_UINT32 rxdesc_err_decrypt_mic;
  10987. /* Number of data MSDUs received on both local and remote rings */
  10988. A_UINT32 data_msdus_on_both_rings;
  10989. /* MPDUs never filled */
  10990. A_UINT32 holes_not_filled;
  10991. };
  10992. /*
  10993. * Rx Remote buffer statistics
  10994. * NB: all the fields must be defined in 4 octets size.
  10995. */
  10996. struct rx_remote_buffer_mgmt_stats {
  10997. /* Total number of MSDUs reaped for Rx processing */
  10998. A_UINT32 remote_reaped;
  10999. /* MSDUs recycled within firmware */
  11000. A_UINT32 remote_recycled;
  11001. /* MSDUs stored by Data Rx */
  11002. A_UINT32 data_rx_msdus_stored;
  11003. /* Number of HTT indications from WAL Rx MSDU */
  11004. A_UINT32 wal_rx_ind;
  11005. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11006. A_UINT32 wal_rx_ind_unconsumed;
  11007. /* Number of HTT indications from Data Rx MSDU */
  11008. A_UINT32 data_rx_ind;
  11009. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11010. A_UINT32 data_rx_ind_unconsumed;
  11011. /* Number of HTT indications from ATHBUF */
  11012. A_UINT32 athbuf_rx_ind;
  11013. /* Number of remote buffers requested for refill */
  11014. A_UINT32 refill_buf_req;
  11015. /* Number of remote buffers filled by the host */
  11016. A_UINT32 refill_buf_rsp;
  11017. /* Number of times MAC hw_index = f/w write_index */
  11018. A_INT32 mac_no_bufs;
  11019. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11020. A_INT32 fw_indices_equal;
  11021. /* Number of times f/w finds no buffers to post */
  11022. A_INT32 host_no_bufs;
  11023. };
  11024. /*
  11025. * TXBF MU/SU packets and NDPA statistics
  11026. * NB: all the fields must be defined in 4 octets size.
  11027. */
  11028. struct rx_txbf_musu_ndpa_pkts_stats {
  11029. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11030. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11031. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11032. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11033. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11034. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11035. };
  11036. /*
  11037. * htt_dbg_stats_status -
  11038. * present - The requested stats have been delivered in full.
  11039. * This indicates that either the stats information was contained
  11040. * in its entirety within this message, or else this message
  11041. * completes the delivery of the requested stats info that was
  11042. * partially delivered through earlier STATS_CONF messages.
  11043. * partial - The requested stats have been delivered in part.
  11044. * One or more subsequent STATS_CONF messages with the same
  11045. * cookie value will be sent to deliver the remainder of the
  11046. * information.
  11047. * error - The requested stats could not be delivered, for example due
  11048. * to a shortage of memory to construct a message holding the
  11049. * requested stats.
  11050. * invalid - The requested stat type is either not recognized, or the
  11051. * target is configured to not gather the stats type in question.
  11052. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11053. * series_done - This special value indicates that no further stats info
  11054. * elements are present within a series of stats info elems
  11055. * (within a stats upload confirmation message).
  11056. */
  11057. enum htt_dbg_stats_status {
  11058. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11059. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11060. HTT_DBG_STATS_STATUS_ERROR = 2,
  11061. HTT_DBG_STATS_STATUS_INVALID = 3,
  11062. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11063. };
  11064. /**
  11065. * @brief target -> host statistics upload
  11066. *
  11067. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11068. *
  11069. * @details
  11070. * The following field definitions describe the format of the HTT target
  11071. * to host stats upload confirmation message.
  11072. * The message contains a cookie echoed from the HTT host->target stats
  11073. * upload request, which identifies which request the confirmation is
  11074. * for, and a series of tag-length-value stats information elements.
  11075. * The tag-length header for each stats info element also includes a
  11076. * status field, to indicate whether the request for the stat type in
  11077. * question was fully met, partially met, unable to be met, or invalid
  11078. * (if the stat type in question is disabled in the target).
  11079. * A special value of all 1's in this status field is used to indicate
  11080. * the end of the series of stats info elements.
  11081. *
  11082. *
  11083. * |31 16|15 8|7 5|4 0|
  11084. * |------------------------------------------------------------|
  11085. * | reserved | msg type |
  11086. * |------------------------------------------------------------|
  11087. * | cookie LSBs |
  11088. * |------------------------------------------------------------|
  11089. * | cookie MSBs |
  11090. * |------------------------------------------------------------|
  11091. * | stats entry length | reserved | S |stat type|
  11092. * |------------------------------------------------------------|
  11093. * | |
  11094. * | type-specific stats info |
  11095. * | |
  11096. * |------------------------------------------------------------|
  11097. * | stats entry length | reserved | S |stat type|
  11098. * |------------------------------------------------------------|
  11099. * | |
  11100. * | type-specific stats info |
  11101. * | |
  11102. * |------------------------------------------------------------|
  11103. * | n/a | reserved | 111 | n/a |
  11104. * |------------------------------------------------------------|
  11105. * Header fields:
  11106. * - MSG_TYPE
  11107. * Bits 7:0
  11108. * Purpose: identifies this is a statistics upload confirmation message
  11109. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11110. * - COOKIE_LSBS
  11111. * Bits 31:0
  11112. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11113. * message with its preceding host->target stats request message.
  11114. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11115. * - COOKIE_MSBS
  11116. * Bits 31:0
  11117. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11118. * message with its preceding host->target stats request message.
  11119. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11120. *
  11121. * Stats Information Element tag-length header fields:
  11122. * - STAT_TYPE
  11123. * Bits 4:0
  11124. * Purpose: identifies the type of statistics info held in the
  11125. * following information element
  11126. * Value: htt_dbg_stats_type
  11127. * - STATUS
  11128. * Bits 7:5
  11129. * Purpose: indicate whether the requested stats are present
  11130. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11131. * the completion of the stats entry series
  11132. * - LENGTH
  11133. * Bits 31:16
  11134. * Purpose: indicate the stats information size
  11135. * Value: This field specifies the number of bytes of stats information
  11136. * that follows the element tag-length header.
  11137. * It is expected but not required that this length is a multiple of
  11138. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11139. * subsequent stats entry header will begin on a 4-byte aligned
  11140. * boundary.
  11141. */
  11142. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11143. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11144. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11145. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11146. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11147. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11148. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11149. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11150. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11151. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11152. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11153. do { \
  11154. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11155. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11156. } while (0)
  11157. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11158. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11159. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11160. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11161. do { \
  11162. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11163. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11164. } while (0)
  11165. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11166. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11167. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11168. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11171. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11172. } while (0)
  11173. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11174. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11175. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11176. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11177. #define HTT_MAX_AGGR 64
  11178. #define HTT_HL_MAX_AGGR 18
  11179. /**
  11180. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11181. *
  11182. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11183. *
  11184. * @details
  11185. * The following field definitions describe the format of the HTT host
  11186. * to target frag_desc/msdu_ext bank configuration message.
  11187. * The message contains the based address and the min and max id of the
  11188. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11189. * MSDU_EXT/FRAG_DESC.
  11190. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11191. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11192. * the hardware does the mapping/translation.
  11193. *
  11194. * Total banks that can be configured is configured to 16.
  11195. *
  11196. * This should be called before any TX has be initiated by the HTT
  11197. *
  11198. * |31 16|15 8|7 5|4 0|
  11199. * |------------------------------------------------------------|
  11200. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11201. * |------------------------------------------------------------|
  11202. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11203. #if HTT_PADDR64
  11204. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11205. #endif
  11206. * |------------------------------------------------------------|
  11207. * | ... |
  11208. * |------------------------------------------------------------|
  11209. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11210. #if HTT_PADDR64
  11211. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11212. #endif
  11213. * |------------------------------------------------------------|
  11214. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11215. * |------------------------------------------------------------|
  11216. * | ... |
  11217. * |------------------------------------------------------------|
  11218. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11219. * |------------------------------------------------------------|
  11220. * Header fields:
  11221. * - MSG_TYPE
  11222. * Bits 7:0
  11223. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11224. * for systems with 64-bit format for bus addresses:
  11225. * - BANKx_BASE_ADDRESS_LO
  11226. * Bits 31:0
  11227. * Purpose: Provide a mechanism to specify the base address of the
  11228. * MSDU_EXT bank physical/bus address.
  11229. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11230. * - BANKx_BASE_ADDRESS_HI
  11231. * Bits 31:0
  11232. * Purpose: Provide a mechanism to specify the base address of the
  11233. * MSDU_EXT bank physical/bus address.
  11234. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11235. * for systems with 32-bit format for bus addresses:
  11236. * - BANKx_BASE_ADDRESS
  11237. * Bits 31:0
  11238. * Purpose: Provide a mechanism to specify the base address of the
  11239. * MSDU_EXT bank physical/bus address.
  11240. * Value: MSDU_EXT bank physical / bus address
  11241. * - BANKx_MIN_ID
  11242. * Bits 15:0
  11243. * Purpose: Provide a mechanism to specify the min index that needs to
  11244. * mapped.
  11245. * - BANKx_MAX_ID
  11246. * Bits 31:16
  11247. * Purpose: Provide a mechanism to specify the max index that needs to
  11248. * mapped.
  11249. *
  11250. */
  11251. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11252. * safe value.
  11253. * @note MAX supported banks is 16.
  11254. */
  11255. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11256. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11257. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11258. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11259. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11260. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11261. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11262. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11263. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11264. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11265. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11266. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11267. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11268. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11269. do { \
  11270. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11271. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11272. } while (0)
  11273. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11274. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11275. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11276. do { \
  11277. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11278. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11279. } while (0)
  11280. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11281. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11282. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11283. do { \
  11284. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11285. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11286. } while (0)
  11287. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11288. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11289. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11290. do { \
  11291. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11292. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11293. } while (0)
  11294. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11295. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11296. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11297. do { \
  11298. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11299. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11300. } while (0)
  11301. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11302. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11303. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11304. do { \
  11305. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11306. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11307. } while (0)
  11308. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11309. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11310. /*
  11311. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11312. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11313. * addresses are stored in a XXX-bit field.
  11314. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11315. * htt_tx_frag_desc64_bank_cfg_t structs.
  11316. */
  11317. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11318. _paddr_bits_, \
  11319. _paddr__bank_base_address_) \
  11320. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11321. /** word 0 \
  11322. * msg_type: 8, \
  11323. * pdev_id: 2, \
  11324. * swap: 1, \
  11325. * reserved0: 5, \
  11326. * num_banks: 8, \
  11327. * desc_size: 8; \
  11328. */ \
  11329. A_UINT32 word0; \
  11330. /* \
  11331. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  11332. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  11333. * the second A_UINT32). \
  11334. */ \
  11335. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11336. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11337. } POSTPACK
  11338. /* define htt_tx_frag_desc32_bank_cfg_t */
  11339. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  11340. /* define htt_tx_frag_desc64_bank_cfg_t */
  11341. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  11342. /*
  11343. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  11344. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  11345. */
  11346. #if HTT_PADDR64
  11347. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  11348. #else
  11349. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  11350. #endif
  11351. /**
  11352. * @brief target -> host HTT TX Credit total count update message definition
  11353. *
  11354. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  11355. *
  11356. *|31 16|15|14 9| 8 |7 0 |
  11357. *|---------------------+--+----------+-------+----------|
  11358. *|cur htt credit delta | Q| reserved | sign | msg type |
  11359. *|------------------------------------------------------|
  11360. *
  11361. * Header fields:
  11362. * - MSG_TYPE
  11363. * Bits 7:0
  11364. * Purpose: identifies this as a htt tx credit delta update message
  11365. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  11366. * - SIGN
  11367. * Bits 8
  11368. * identifies whether credit delta is positive or negative
  11369. * Value:
  11370. * - 0x0: credit delta is positive, rebalance in some buffers
  11371. * - 0x1: credit delta is negative, rebalance out some buffers
  11372. * - reserved
  11373. * Bits 14:9
  11374. * Value: 0x0
  11375. * - TXQ_GRP
  11376. * Bit 15
  11377. * Purpose: indicates whether any tx queue group information elements
  11378. * are appended to the tx credit update message
  11379. * Value: 0 -> no tx queue group information element is present
  11380. * 1 -> a tx queue group information element immediately follows
  11381. * - DELTA_COUNT
  11382. * Bits 31:16
  11383. * Purpose: Specify current htt credit delta absolute count
  11384. */
  11385. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  11386. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  11387. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  11388. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  11389. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  11390. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  11391. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  11392. do { \
  11393. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  11394. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  11395. } while (0)
  11396. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  11397. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  11398. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  11399. do { \
  11400. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  11401. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  11402. } while (0)
  11403. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  11404. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  11405. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  11406. do { \
  11407. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  11408. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  11409. } while (0)
  11410. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  11411. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  11412. #define HTT_TX_CREDIT_MSG_BYTES 4
  11413. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  11414. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  11415. /**
  11416. * @brief HTT WDI_IPA Operation Response Message
  11417. *
  11418. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  11419. *
  11420. * @details
  11421. * HTT WDI_IPA Operation Response message is sent by target
  11422. * to host confirming suspend or resume operation.
  11423. * |31 24|23 16|15 8|7 0|
  11424. * |----------------+----------------+----------------+----------------|
  11425. * | op_code | Rsvd | msg_type |
  11426. * |-------------------------------------------------------------------|
  11427. * | Rsvd | Response len |
  11428. * |-------------------------------------------------------------------|
  11429. * | |
  11430. * | Response-type specific info |
  11431. * | |
  11432. * | |
  11433. * |-------------------------------------------------------------------|
  11434. * Header fields:
  11435. * - MSG_TYPE
  11436. * Bits 7:0
  11437. * Purpose: Identifies this as WDI_IPA Operation Response message
  11438. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  11439. * - OP_CODE
  11440. * Bits 31:16
  11441. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  11442. * value: = enum htt_wdi_ipa_op_code
  11443. * - RSP_LEN
  11444. * Bits 16:0
  11445. * Purpose: length for the response-type specific info
  11446. * value: = length in bytes for response-type specific info
  11447. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  11448. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  11449. */
  11450. PREPACK struct htt_wdi_ipa_op_response_t
  11451. {
  11452. /* DWORD 0: flags and meta-data */
  11453. A_UINT32
  11454. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11455. reserved1: 8,
  11456. op_code: 16;
  11457. A_UINT32
  11458. rsp_len: 16,
  11459. reserved2: 16;
  11460. } POSTPACK;
  11461. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  11462. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  11463. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  11464. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  11465. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  11466. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  11467. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  11468. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  11469. do { \
  11470. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  11471. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  11472. } while (0)
  11473. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  11474. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  11475. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  11476. do { \
  11477. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  11478. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  11479. } while (0)
  11480. enum htt_phy_mode {
  11481. htt_phy_mode_11a = 0,
  11482. htt_phy_mode_11g = 1,
  11483. htt_phy_mode_11b = 2,
  11484. htt_phy_mode_11g_only = 3,
  11485. htt_phy_mode_11na_ht20 = 4,
  11486. htt_phy_mode_11ng_ht20 = 5,
  11487. htt_phy_mode_11na_ht40 = 6,
  11488. htt_phy_mode_11ng_ht40 = 7,
  11489. htt_phy_mode_11ac_vht20 = 8,
  11490. htt_phy_mode_11ac_vht40 = 9,
  11491. htt_phy_mode_11ac_vht80 = 10,
  11492. htt_phy_mode_11ac_vht20_2g = 11,
  11493. htt_phy_mode_11ac_vht40_2g = 12,
  11494. htt_phy_mode_11ac_vht80_2g = 13,
  11495. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  11496. htt_phy_mode_11ac_vht160 = 15,
  11497. htt_phy_mode_max,
  11498. };
  11499. /**
  11500. * @brief target -> host HTT channel change indication
  11501. *
  11502. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  11503. *
  11504. * @details
  11505. * Specify when a channel change occurs.
  11506. * This allows the host to precisely determine which rx frames arrived
  11507. * on the old channel and which rx frames arrived on the new channel.
  11508. *
  11509. *|31 |7 0 |
  11510. *|-------------------------------------------+----------|
  11511. *| reserved | msg type |
  11512. *|------------------------------------------------------|
  11513. *| primary_chan_center_freq_mhz |
  11514. *|------------------------------------------------------|
  11515. *| contiguous_chan1_center_freq_mhz |
  11516. *|------------------------------------------------------|
  11517. *| contiguous_chan2_center_freq_mhz |
  11518. *|------------------------------------------------------|
  11519. *| phy_mode |
  11520. *|------------------------------------------------------|
  11521. *
  11522. * Header fields:
  11523. * - MSG_TYPE
  11524. * Bits 7:0
  11525. * Purpose: identifies this as a htt channel change indication message
  11526. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  11527. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  11528. * Bits 31:0
  11529. * Purpose: identify the (center of the) new 20 MHz primary channel
  11530. * Value: center frequency of the 20 MHz primary channel, in MHz units
  11531. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  11532. * Bits 31:0
  11533. * Purpose: identify the (center of the) contiguous frequency range
  11534. * comprising the new channel.
  11535. * For example, if the new channel is a 80 MHz channel extending
  11536. * 60 MHz beyond the primary channel, this field would be 30 larger
  11537. * than the primary channel center frequency field.
  11538. * Value: center frequency of the contiguous frequency range comprising
  11539. * the full channel in MHz units
  11540. * (80+80 channels also use the CONTIG_CHAN2 field)
  11541. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  11542. * Bits 31:0
  11543. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  11544. * within a VHT 80+80 channel.
  11545. * This field is only relevant for VHT 80+80 channels.
  11546. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  11547. * channel (arbitrary value for cases besides VHT 80+80)
  11548. * - PHY_MODE
  11549. * Bits 31:0
  11550. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  11551. * and band
  11552. * Value: htt_phy_mode enum value
  11553. */
  11554. PREPACK struct htt_chan_change_t
  11555. {
  11556. /* DWORD 0: flags and meta-data */
  11557. A_UINT32
  11558. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11559. reserved1: 24;
  11560. A_UINT32 primary_chan_center_freq_mhz;
  11561. A_UINT32 contig_chan1_center_freq_mhz;
  11562. A_UINT32 contig_chan2_center_freq_mhz;
  11563. A_UINT32 phy_mode;
  11564. } POSTPACK;
  11565. /*
  11566. * Due to historical / backwards-compatibility reasons, maintain the
  11567. * below htt_chan_change_msg struct definition, which needs to be
  11568. * consistent with the above htt_chan_change_t struct definition
  11569. * (aside from the htt_chan_change_t definition including the msg_type
  11570. * dword within the message, and the htt_chan_change_msg only containing
  11571. * the payload of the message that follows the msg_type dword).
  11572. */
  11573. PREPACK struct htt_chan_change_msg {
  11574. A_UINT32 chan_mhz; /* frequency in mhz */
  11575. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  11576. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11577. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11578. } POSTPACK;
  11579. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  11580. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  11581. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  11582. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  11583. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  11584. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  11585. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  11586. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  11587. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  11588. do { \
  11589. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  11590. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  11591. } while (0)
  11592. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  11593. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  11594. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  11595. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  11596. do { \
  11597. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  11598. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  11599. } while (0)
  11600. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  11601. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  11602. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  11603. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  11604. do { \
  11605. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  11606. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  11607. } while (0)
  11608. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  11609. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  11610. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  11611. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  11612. do { \
  11613. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  11614. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  11615. } while (0)
  11616. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  11617. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  11618. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  11619. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  11620. /**
  11621. * @brief rx offload packet error message
  11622. *
  11623. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  11624. *
  11625. * @details
  11626. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  11627. * of target payload like mic err.
  11628. *
  11629. * |31 24|23 16|15 8|7 0|
  11630. * |----------------+----------------+----------------+----------------|
  11631. * | tid | vdev_id | msg_sub_type | msg_type |
  11632. * |-------------------------------------------------------------------|
  11633. * : (sub-type dependent content) :
  11634. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11635. * Header fields:
  11636. * - msg_type
  11637. * Bits 7:0
  11638. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  11639. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  11640. * - msg_sub_type
  11641. * Bits 15:8
  11642. * Purpose: Identifies which type of rx error is reported by this message
  11643. * value: htt_rx_ofld_pkt_err_type
  11644. * - vdev_id
  11645. * Bits 23:16
  11646. * Purpose: Identifies which vdev received the erroneous rx frame
  11647. * value:
  11648. * - tid
  11649. * Bits 31:24
  11650. * Purpose: Identifies the traffic type of the rx frame
  11651. * value:
  11652. *
  11653. * - The payload fields used if the sub-type == MIC error are shown below.
  11654. * Note - MIC err is per MSDU, while PN is per MPDU.
  11655. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  11656. * with MIC err in A-MSDU case, so FW will send only one HTT message
  11657. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  11658. * instead of sending separate HTT messages for each wrong MSDU within
  11659. * the MPDU.
  11660. *
  11661. * |31 24|23 16|15 8|7 0|
  11662. * |----------------+----------------+----------------+----------------|
  11663. * | Rsvd | key_id | peer_id |
  11664. * |-------------------------------------------------------------------|
  11665. * | receiver MAC addr 31:0 |
  11666. * |-------------------------------------------------------------------|
  11667. * | Rsvd | receiver MAC addr 47:32 |
  11668. * |-------------------------------------------------------------------|
  11669. * | transmitter MAC addr 31:0 |
  11670. * |-------------------------------------------------------------------|
  11671. * | Rsvd | transmitter MAC addr 47:32 |
  11672. * |-------------------------------------------------------------------|
  11673. * | PN 31:0 |
  11674. * |-------------------------------------------------------------------|
  11675. * | Rsvd | PN 47:32 |
  11676. * |-------------------------------------------------------------------|
  11677. * - peer_id
  11678. * Bits 15:0
  11679. * Purpose: identifies which peer is frame is from
  11680. * value:
  11681. * - key_id
  11682. * Bits 23:16
  11683. * Purpose: identifies key_id of rx frame
  11684. * value:
  11685. * - RA_31_0 (receiver MAC addr 31:0)
  11686. * Bits 31:0
  11687. * Purpose: identifies by MAC address which vdev received the frame
  11688. * value: MAC address lower 4 bytes
  11689. * - RA_47_32 (receiver MAC addr 47:32)
  11690. * Bits 15:0
  11691. * Purpose: identifies by MAC address which vdev received the frame
  11692. * value: MAC address upper 2 bytes
  11693. * - TA_31_0 (transmitter MAC addr 31:0)
  11694. * Bits 31:0
  11695. * Purpose: identifies by MAC address which peer transmitted the frame
  11696. * value: MAC address lower 4 bytes
  11697. * - TA_47_32 (transmitter MAC addr 47:32)
  11698. * Bits 15:0
  11699. * Purpose: identifies by MAC address which peer transmitted the frame
  11700. * value: MAC address upper 2 bytes
  11701. * - PN_31_0
  11702. * Bits 31:0
  11703. * Purpose: Identifies pn of rx frame
  11704. * value: PN lower 4 bytes
  11705. * - PN_47_32
  11706. * Bits 15:0
  11707. * Purpose: Identifies pn of rx frame
  11708. * value:
  11709. * TKIP or CCMP: PN upper 2 bytes
  11710. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  11711. */
  11712. enum htt_rx_ofld_pkt_err_type {
  11713. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  11714. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  11715. };
  11716. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  11717. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  11718. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  11719. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  11720. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  11721. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  11722. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  11723. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  11724. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  11725. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  11726. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  11727. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  11728. do { \
  11729. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  11730. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  11731. } while (0)
  11732. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  11733. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  11734. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  11735. do { \
  11736. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  11737. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  11738. } while (0)
  11739. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  11740. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  11741. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  11742. do { \
  11743. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  11744. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  11745. } while (0)
  11746. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  11747. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  11748. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  11749. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  11750. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  11751. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  11752. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  11753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  11754. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  11755. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  11756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  11757. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  11758. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  11759. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  11760. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  11761. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  11762. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  11763. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  11764. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  11765. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  11766. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  11767. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  11768. do { \
  11769. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  11770. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  11771. } while (0)
  11772. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  11773. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  11774. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  11775. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  11776. do { \
  11777. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  11778. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  11779. } while (0)
  11780. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  11781. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  11782. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  11783. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  11784. do { \
  11785. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  11786. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  11787. } while (0)
  11788. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  11789. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  11790. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  11791. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  11792. do { \
  11793. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  11794. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  11795. } while (0)
  11796. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  11797. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  11798. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  11799. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  11802. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  11803. } while (0)
  11804. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  11805. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  11806. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  11807. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  11810. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  11811. } while (0)
  11812. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  11813. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  11814. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  11815. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  11816. do { \
  11817. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  11818. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  11819. } while (0)
  11820. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  11821. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  11822. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  11823. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  11824. do { \
  11825. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  11826. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  11827. } while (0)
  11828. /**
  11829. * @brief target -> host peer rate report message
  11830. *
  11831. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  11832. *
  11833. * @details
  11834. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  11835. * justified rate of all the peers.
  11836. *
  11837. * |31 24|23 16|15 8|7 0|
  11838. * |----------------+----------------+----------------+----------------|
  11839. * | peer_count | | msg_type |
  11840. * |-------------------------------------------------------------------|
  11841. * : Payload (variant number of peer rate report) :
  11842. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11843. * Header fields:
  11844. * - msg_type
  11845. * Bits 7:0
  11846. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  11847. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  11848. * - reserved
  11849. * Bits 15:8
  11850. * Purpose:
  11851. * value:
  11852. * - peer_count
  11853. * Bits 31:16
  11854. * Purpose: Specify how many peer rate report elements are present in the payload.
  11855. * value:
  11856. *
  11857. * Payload:
  11858. * There are variant number of peer rate report follow the first 32 bits.
  11859. * The peer rate report is defined as follows.
  11860. *
  11861. * |31 20|19 16|15 0|
  11862. * |-----------------------+---------+---------------------------------|-
  11863. * | reserved | phy | peer_id | \
  11864. * |-------------------------------------------------------------------| -> report #0
  11865. * | rate | /
  11866. * |-----------------------+---------+---------------------------------|-
  11867. * | reserved | phy | peer_id | \
  11868. * |-------------------------------------------------------------------| -> report #1
  11869. * | rate | /
  11870. * |-----------------------+---------+---------------------------------|-
  11871. * | reserved | phy | peer_id | \
  11872. * |-------------------------------------------------------------------| -> report #2
  11873. * | rate | /
  11874. * |-------------------------------------------------------------------|-
  11875. * : :
  11876. * : :
  11877. * : :
  11878. * :-------------------------------------------------------------------:
  11879. *
  11880. * - peer_id
  11881. * Bits 15:0
  11882. * Purpose: identify the peer
  11883. * value:
  11884. * - phy
  11885. * Bits 19:16
  11886. * Purpose: identify which phy is in use
  11887. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  11888. * Please see enum htt_peer_report_phy_type for detail.
  11889. * - reserved
  11890. * Bits 31:20
  11891. * Purpose:
  11892. * value:
  11893. * - rate
  11894. * Bits 31:0
  11895. * Purpose: represent the justified rate of the peer specified by peer_id
  11896. * value:
  11897. */
  11898. enum htt_peer_rate_report_phy_type {
  11899. HTT_PEER_RATE_REPORT_11B = 0,
  11900. HTT_PEER_RATE_REPORT_11A_G,
  11901. HTT_PEER_RATE_REPORT_11N,
  11902. HTT_PEER_RATE_REPORT_11AC,
  11903. };
  11904. #define HTT_PEER_RATE_REPORT_SIZE 8
  11905. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  11906. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  11907. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  11908. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  11909. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  11910. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11911. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11912. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11913. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11914. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11915. do { \
  11916. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11917. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11918. } while (0)
  11919. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11920. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11921. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11922. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11923. do { \
  11924. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11925. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11926. } while (0)
  11927. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11928. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11929. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11930. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11931. do { \
  11932. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11933. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11934. } while (0)
  11935. /**
  11936. * @brief target -> host flow pool map message
  11937. *
  11938. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11939. *
  11940. * @details
  11941. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11942. * a flow of descriptors.
  11943. *
  11944. * This message is in TLV format and indicates the parameters to be setup a
  11945. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11946. * receive descriptors from a specified pool.
  11947. *
  11948. * The message would appear as follows:
  11949. *
  11950. * |31 24|23 16|15 8|7 0|
  11951. * |----------------+----------------+----------------+----------------|
  11952. * header | reserved | num_flows | msg_type |
  11953. * |-------------------------------------------------------------------|
  11954. * | |
  11955. * : payload :
  11956. * | |
  11957. * |-------------------------------------------------------------------|
  11958. *
  11959. * The header field is one DWORD long and is interpreted as follows:
  11960. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11961. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11962. * this message
  11963. * b'16-31 - reserved: These bits are reserved for future use
  11964. *
  11965. * Payload:
  11966. * The payload would contain multiple objects of the following structure. Each
  11967. * object represents a flow.
  11968. *
  11969. * |31 24|23 16|15 8|7 0|
  11970. * |----------------+----------------+----------------+----------------|
  11971. * header | reserved | num_flows | msg_type |
  11972. * |-------------------------------------------------------------------|
  11973. * payload0| flow_type |
  11974. * |-------------------------------------------------------------------|
  11975. * | flow_id |
  11976. * |-------------------------------------------------------------------|
  11977. * | reserved0 | flow_pool_id |
  11978. * |-------------------------------------------------------------------|
  11979. * | reserved1 | flow_pool_size |
  11980. * |-------------------------------------------------------------------|
  11981. * | reserved2 |
  11982. * |-------------------------------------------------------------------|
  11983. * payload1| flow_type |
  11984. * |-------------------------------------------------------------------|
  11985. * | flow_id |
  11986. * |-------------------------------------------------------------------|
  11987. * | reserved0 | flow_pool_id |
  11988. * |-------------------------------------------------------------------|
  11989. * | reserved1 | flow_pool_size |
  11990. * |-------------------------------------------------------------------|
  11991. * | reserved2 |
  11992. * |-------------------------------------------------------------------|
  11993. * | . |
  11994. * | . |
  11995. * | . |
  11996. * |-------------------------------------------------------------------|
  11997. *
  11998. * Each payload is 5 DWORDS long and is interpreted as follows:
  11999. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12000. * this flow is associated. It can be VDEV, peer,
  12001. * or tid (AC). Based on enum htt_flow_type.
  12002. *
  12003. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12004. * object. For flow_type vdev it is set to the
  12005. * vdevid, for peer it is peerid and for tid, it is
  12006. * tid_num.
  12007. *
  12008. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12009. * in the host for this flow
  12010. * b'16:31 - reserved0: This field in reserved for the future. In case
  12011. * we have a hierarchical implementation (HCM) of
  12012. * pools, it can be used to indicate the ID of the
  12013. * parent-pool.
  12014. *
  12015. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12016. * Descriptors for this flow will be
  12017. * allocated from this pool in the host.
  12018. * b'16:31 - reserved1: This field in reserved for the future. In case
  12019. * we have a hierarchical implementation of pools,
  12020. * it can be used to indicate the max number of
  12021. * descriptors in the pool. The b'0:15 can be used
  12022. * to indicate min number of descriptors in the
  12023. * HCM scheme.
  12024. *
  12025. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12026. * we have a hierarchical implementation of pools,
  12027. * b'0:15 can be used to indicate the
  12028. * priority-based borrowing (PBB) threshold of
  12029. * the flow's pool. The b'16:31 are still left
  12030. * reserved.
  12031. */
  12032. enum htt_flow_type {
  12033. FLOW_TYPE_VDEV = 0,
  12034. /* Insert new flow types above this line */
  12035. };
  12036. PREPACK struct htt_flow_pool_map_payload_t {
  12037. A_UINT32 flow_type;
  12038. A_UINT32 flow_id;
  12039. A_UINT32 flow_pool_id:16,
  12040. reserved0:16;
  12041. A_UINT32 flow_pool_size:16,
  12042. reserved1:16;
  12043. A_UINT32 reserved2;
  12044. } POSTPACK;
  12045. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12046. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12047. (sizeof(struct htt_flow_pool_map_payload_t))
  12048. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12049. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12050. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12051. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12052. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12053. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12054. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12055. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12056. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12057. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12058. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12059. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12060. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12061. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12062. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12063. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12064. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12065. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12066. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12067. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12068. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12069. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12070. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12071. do { \
  12072. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12073. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12074. } while (0)
  12075. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12076. do { \
  12077. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12078. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12079. } while (0)
  12080. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12083. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12084. } while (0)
  12085. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12088. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12089. } while (0)
  12090. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12093. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12094. } while (0)
  12095. /**
  12096. * @brief target -> host flow pool unmap message
  12097. *
  12098. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12099. *
  12100. * @details
  12101. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12102. * down a flow of descriptors.
  12103. * This message indicates that for the flow (whose ID is provided) is wanting
  12104. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12105. * pool of descriptors from where descriptors are being allocated for this
  12106. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12107. * be unmapped by the host.
  12108. *
  12109. * The message would appear as follows:
  12110. *
  12111. * |31 24|23 16|15 8|7 0|
  12112. * |----------------+----------------+----------------+----------------|
  12113. * | reserved0 | msg_type |
  12114. * |-------------------------------------------------------------------|
  12115. * | flow_type |
  12116. * |-------------------------------------------------------------------|
  12117. * | flow_id |
  12118. * |-------------------------------------------------------------------|
  12119. * | reserved1 | flow_pool_id |
  12120. * |-------------------------------------------------------------------|
  12121. *
  12122. * The message is interpreted as follows:
  12123. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12124. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12125. * b'8:31 - reserved0: Reserved for future use
  12126. *
  12127. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12128. * this flow is associated. It can be VDEV, peer,
  12129. * or tid (AC). Based on enum htt_flow_type.
  12130. *
  12131. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12132. * object. For flow_type vdev it is set to the
  12133. * vdevid, for peer it is peerid and for tid, it is
  12134. * tid_num.
  12135. *
  12136. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12137. * used in the host for this flow
  12138. * b'16:31 - reserved0: This field in reserved for the future.
  12139. *
  12140. */
  12141. PREPACK struct htt_flow_pool_unmap_t {
  12142. A_UINT32 msg_type:8,
  12143. reserved0:24;
  12144. A_UINT32 flow_type;
  12145. A_UINT32 flow_id;
  12146. A_UINT32 flow_pool_id:16,
  12147. reserved1:16;
  12148. } POSTPACK;
  12149. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12150. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12151. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12152. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12153. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12154. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12155. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12156. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12157. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12158. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12159. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12160. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12161. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12162. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12163. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12164. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12165. do { \
  12166. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12167. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12168. } while (0)
  12169. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12170. do { \
  12171. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12172. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12173. } while (0)
  12174. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12175. do { \
  12176. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12177. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12178. } while (0)
  12179. /**
  12180. * @brief target -> host SRING setup done message
  12181. *
  12182. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12183. *
  12184. * @details
  12185. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12186. * SRNG ring setup is done
  12187. *
  12188. * This message indicates whether the last setup operation is successful.
  12189. * It will be sent to host when host set respose_required bit in
  12190. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12191. * The message would appear as follows:
  12192. *
  12193. * |31 24|23 16|15 8|7 0|
  12194. * |--------------- +----------------+----------------+----------------|
  12195. * | setup_status | ring_id | pdev_id | msg_type |
  12196. * |-------------------------------------------------------------------|
  12197. *
  12198. * The message is interpreted as follows:
  12199. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12200. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12201. * b'8:15 - pdev_id:
  12202. * 0 (for rings at SOC/UMAC level),
  12203. * 1/2/3 mac id (for rings at LMAC level)
  12204. * b'16:23 - ring_id: Identify the ring which is set up
  12205. * More details can be got from enum htt_srng_ring_id
  12206. * b'24:31 - setup_status: Indicate status of setup operation
  12207. * Refer to htt_ring_setup_status
  12208. */
  12209. PREPACK struct htt_sring_setup_done_t {
  12210. A_UINT32 msg_type: 8,
  12211. pdev_id: 8,
  12212. ring_id: 8,
  12213. setup_status: 8;
  12214. } POSTPACK;
  12215. enum htt_ring_setup_status {
  12216. htt_ring_setup_status_ok = 0,
  12217. htt_ring_setup_status_error,
  12218. };
  12219. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12220. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12221. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12222. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12223. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12224. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12225. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12226. do { \
  12227. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12228. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12229. } while (0)
  12230. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12231. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12232. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12233. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12234. HTT_SRING_SETUP_DONE_RING_ID_S)
  12235. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12236. do { \
  12237. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12238. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12239. } while (0)
  12240. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12241. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12242. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12243. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12244. HTT_SRING_SETUP_DONE_STATUS_S)
  12245. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12246. do { \
  12247. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12248. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12249. } while (0)
  12250. /**
  12251. * @brief target -> flow map flow info
  12252. *
  12253. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12254. *
  12255. * @details
  12256. * HTT TX map flow entry with tqm flow pointer
  12257. * Sent from firmware to host to add tqm flow pointer in corresponding
  12258. * flow search entry. Flow metadata is replayed back to host as part of this
  12259. * struct to enable host to find the specific flow search entry
  12260. *
  12261. * The message would appear as follows:
  12262. *
  12263. * |31 28|27 18|17 14|13 8|7 0|
  12264. * |-------+------------------------------------------+----------------|
  12265. * | rsvd0 | fse_hsh_idx | msg_type |
  12266. * |-------------------------------------------------------------------|
  12267. * | rsvd1 | tid | peer_id |
  12268. * |-------------------------------------------------------------------|
  12269. * | tqm_flow_pntr_lo |
  12270. * |-------------------------------------------------------------------|
  12271. * | tqm_flow_pntr_hi |
  12272. * |-------------------------------------------------------------------|
  12273. * | fse_meta_data |
  12274. * |-------------------------------------------------------------------|
  12275. *
  12276. * The message is interpreted as follows:
  12277. *
  12278. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12279. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12280. *
  12281. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12282. * for this flow entry
  12283. *
  12284. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12285. *
  12286. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12287. *
  12288. * dword1 - b'14:17 - tid
  12289. *
  12290. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12291. *
  12292. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12293. *
  12294. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12295. *
  12296. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12297. * given by host
  12298. */
  12299. PREPACK struct htt_tx_map_flow_info {
  12300. A_UINT32
  12301. msg_type: 8,
  12302. fse_hsh_idx: 20,
  12303. rsvd0: 4;
  12304. A_UINT32
  12305. peer_id: 14,
  12306. tid: 4,
  12307. rsvd1: 14;
  12308. A_UINT32 tqm_flow_pntr_lo;
  12309. A_UINT32 tqm_flow_pntr_hi;
  12310. struct htt_tx_flow_metadata fse_meta_data;
  12311. } POSTPACK;
  12312. /* DWORD 0 */
  12313. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12314. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12315. /* DWORD 1 */
  12316. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12317. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12318. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12319. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12320. /* DWORD 0 */
  12321. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12322. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12323. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12324. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12325. do { \
  12326. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  12327. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  12328. } while (0)
  12329. /* DWORD 1 */
  12330. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  12331. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  12332. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  12333. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  12334. do { \
  12335. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  12336. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  12337. } while (0)
  12338. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  12339. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  12340. HTT_TX_MAP_FLOW_INFO_TID_S)
  12341. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  12342. do { \
  12343. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  12344. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  12345. } while (0)
  12346. /*
  12347. * htt_dbg_ext_stats_status -
  12348. * present - The requested stats have been delivered in full.
  12349. * This indicates that either the stats information was contained
  12350. * in its entirety within this message, or else this message
  12351. * completes the delivery of the requested stats info that was
  12352. * partially delivered through earlier STATS_CONF messages.
  12353. * partial - The requested stats have been delivered in part.
  12354. * One or more subsequent STATS_CONF messages with the same
  12355. * cookie value will be sent to deliver the remainder of the
  12356. * information.
  12357. * error - The requested stats could not be delivered, for example due
  12358. * to a shortage of memory to construct a message holding the
  12359. * requested stats.
  12360. * invalid - The requested stat type is either not recognized, or the
  12361. * target is configured to not gather the stats type in question.
  12362. */
  12363. enum htt_dbg_ext_stats_status {
  12364. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  12365. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  12366. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  12367. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  12368. };
  12369. /**
  12370. * @brief target -> host ppdu stats upload
  12371. *
  12372. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  12373. *
  12374. * @details
  12375. * The following field definitions describe the format of the HTT target
  12376. * to host ppdu stats indication message.
  12377. *
  12378. *
  12379. * |31 16|15 12|11 10|9 8|7 0 |
  12380. * |----------------------------------------------------------------------|
  12381. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  12382. * |----------------------------------------------------------------------|
  12383. * | ppdu_id |
  12384. * |----------------------------------------------------------------------|
  12385. * | Timestamp in us |
  12386. * |----------------------------------------------------------------------|
  12387. * | reserved |
  12388. * |----------------------------------------------------------------------|
  12389. * | type-specific stats info |
  12390. * | (see htt_ppdu_stats.h) |
  12391. * |----------------------------------------------------------------------|
  12392. * Header fields:
  12393. * - MSG_TYPE
  12394. * Bits 7:0
  12395. * Purpose: Identifies this is a PPDU STATS indication
  12396. * message.
  12397. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  12398. * - mac_id
  12399. * Bits 9:8
  12400. * Purpose: mac_id of this ppdu_id
  12401. * Value: 0-3
  12402. * - pdev_id
  12403. * Bits 11:10
  12404. * Purpose: pdev_id of this ppdu_id
  12405. * Value: 0-3
  12406. * 0 (for rings at SOC level),
  12407. * 1/2/3 PDEV -> 0/1/2
  12408. * - payload_size
  12409. * Bits 31:16
  12410. * Purpose: total tlv size
  12411. * Value: payload_size in bytes
  12412. */
  12413. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  12414. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  12415. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  12416. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  12417. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  12418. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  12419. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  12420. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  12421. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  12422. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  12423. do { \
  12424. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  12425. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  12426. } while (0)
  12427. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  12428. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  12429. HTT_T2H_PPDU_STATS_MAC_ID_S)
  12430. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  12431. do { \
  12432. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  12433. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  12434. } while (0)
  12435. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  12436. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  12437. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  12438. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  12439. do { \
  12440. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  12441. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  12442. } while (0)
  12443. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  12444. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  12445. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  12446. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  12447. do { \
  12448. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  12449. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  12450. } while (0)
  12451. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  12452. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  12453. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  12454. /* htt_t2h_ppdu_stats_ind_hdr_t
  12455. * This struct contains the fields within the header of the
  12456. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  12457. * stats info.
  12458. * This struct assumes little-endian layout, and thus is only
  12459. * suitable for use within processors known to be little-endian
  12460. * (such as the target).
  12461. * In contrast, the above macros provide endian-portable methods
  12462. * to get and set the bitfields within this PPDU_STATS_IND header.
  12463. */
  12464. typedef struct {
  12465. A_UINT32 msg_type: 8, /* bits 7:0 */
  12466. mac_id: 2, /* bits 9:8 */
  12467. pdev_id: 2, /* bits 11:10 */
  12468. reserved1: 4, /* bits 15:12 */
  12469. payload_size: 16; /* bits 31:16 */
  12470. A_UINT32 ppdu_id;
  12471. A_UINT32 timestamp_us;
  12472. A_UINT32 reserved2;
  12473. } htt_t2h_ppdu_stats_ind_hdr_t;
  12474. /**
  12475. * @brief target -> host extended statistics upload
  12476. *
  12477. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  12478. *
  12479. * @details
  12480. * The following field definitions describe the format of the HTT target
  12481. * to host stats upload confirmation message.
  12482. * The message contains a cookie echoed from the HTT host->target stats
  12483. * upload request, which identifies which request the confirmation is
  12484. * for, and a single stats can span over multiple HTT stats indication
  12485. * due to the HTT message size limitation so every HTT ext stats indication
  12486. * will have tag-length-value stats information elements.
  12487. * The tag-length header for each HTT stats IND message also includes a
  12488. * status field, to indicate whether the request for the stat type in
  12489. * question was fully met, partially met, unable to be met, or invalid
  12490. * (if the stat type in question is disabled in the target).
  12491. * A Done bit 1's indicate the end of the of stats info elements.
  12492. *
  12493. *
  12494. * |31 16|15 12|11|10 8|7 5|4 0|
  12495. * |--------------------------------------------------------------|
  12496. * | reserved | msg type |
  12497. * |--------------------------------------------------------------|
  12498. * | cookie LSBs |
  12499. * |--------------------------------------------------------------|
  12500. * | cookie MSBs |
  12501. * |--------------------------------------------------------------|
  12502. * | stats entry length | rsvd | D| S | stat type |
  12503. * |--------------------------------------------------------------|
  12504. * | type-specific stats info |
  12505. * | (see htt_stats.h) |
  12506. * |--------------------------------------------------------------|
  12507. * Header fields:
  12508. * - MSG_TYPE
  12509. * Bits 7:0
  12510. * Purpose: Identifies this is a extended statistics upload confirmation
  12511. * message.
  12512. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  12513. * - COOKIE_LSBS
  12514. * Bits 31:0
  12515. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12516. * message with its preceding host->target stats request message.
  12517. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12518. * - COOKIE_MSBS
  12519. * Bits 31:0
  12520. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12521. * message with its preceding host->target stats request message.
  12522. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12523. *
  12524. * Stats Information Element tag-length header fields:
  12525. * - STAT_TYPE
  12526. * Bits 7:0
  12527. * Purpose: identifies the type of statistics info held in the
  12528. * following information element
  12529. * Value: htt_dbg_ext_stats_type
  12530. * - STATUS
  12531. * Bits 10:8
  12532. * Purpose: indicate whether the requested stats are present
  12533. * Value: htt_dbg_ext_stats_status
  12534. * - DONE
  12535. * Bits 11
  12536. * Purpose:
  12537. * Indicates the completion of the stats entry, this will be the last
  12538. * stats conf HTT segment for the requested stats type.
  12539. * Value:
  12540. * 0 -> the stats retrieval is ongoing
  12541. * 1 -> the stats retrieval is complete
  12542. * - LENGTH
  12543. * Bits 31:16
  12544. * Purpose: indicate the stats information size
  12545. * Value: This field specifies the number of bytes of stats information
  12546. * that follows the element tag-length header.
  12547. * It is expected but not required that this length is a multiple of
  12548. * 4 bytes.
  12549. */
  12550. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  12551. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  12552. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  12553. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  12554. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  12555. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  12556. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  12557. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  12558. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  12559. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12560. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  12561. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  12562. do { \
  12563. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  12564. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  12565. } while (0)
  12566. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  12567. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  12568. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  12569. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  12570. do { \
  12571. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  12572. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  12573. } while (0)
  12574. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  12575. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  12576. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  12577. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  12578. do { \
  12579. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  12580. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  12581. } while (0)
  12582. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  12583. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  12584. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  12585. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12586. do { \
  12587. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  12588. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  12589. } while (0)
  12590. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  12591. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  12592. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  12593. typedef enum {
  12594. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  12595. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  12596. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  12597. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  12598. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  12599. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  12600. /* Reserved from 128 - 255 for target internal use.*/
  12601. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  12602. } HTT_PEER_TYPE;
  12603. /** macro to convert MAC address from char array to HTT word format */
  12604. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  12605. (phtt_mac_addr)->mac_addr31to0 = \
  12606. (((c_macaddr)[0] << 0) | \
  12607. ((c_macaddr)[1] << 8) | \
  12608. ((c_macaddr)[2] << 16) | \
  12609. ((c_macaddr)[3] << 24)); \
  12610. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  12611. } while (0)
  12612. /**
  12613. * @brief target -> host monitor mac header indication message
  12614. *
  12615. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  12616. *
  12617. * @details
  12618. * The following diagram shows the format of the monitor mac header message
  12619. * sent from the target to the host.
  12620. * This message is primarily sent when promiscuous rx mode is enabled.
  12621. * One message is sent per rx PPDU.
  12622. *
  12623. * |31 24|23 16|15 8|7 0|
  12624. * |-------------------------------------------------------------|
  12625. * | peer_id | reserved0 | msg_type |
  12626. * |-------------------------------------------------------------|
  12627. * | reserved1 | num_mpdu |
  12628. * |-------------------------------------------------------------|
  12629. * | struct hw_rx_desc |
  12630. * | (see wal_rx_desc.h) |
  12631. * |-------------------------------------------------------------|
  12632. * | struct ieee80211_frame_addr4 |
  12633. * | (see ieee80211_defs.h) |
  12634. * |-------------------------------------------------------------|
  12635. * | struct ieee80211_frame_addr4 |
  12636. * | (see ieee80211_defs.h) |
  12637. * |-------------------------------------------------------------|
  12638. * | ...... |
  12639. * |-------------------------------------------------------------|
  12640. *
  12641. * Header fields:
  12642. * - msg_type
  12643. * Bits 7:0
  12644. * Purpose: Identifies this is a monitor mac header indication message.
  12645. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  12646. * - peer_id
  12647. * Bits 31:16
  12648. * Purpose: Software peer id given by host during association,
  12649. * During promiscuous mode, the peer ID will be invalid (0xFF)
  12650. * for rx PPDUs received from unassociated peers.
  12651. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  12652. * - num_mpdu
  12653. * Bits 15:0
  12654. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  12655. * delivered within the message.
  12656. * Value: 1 to 32
  12657. * num_mpdu is limited to a maximum value of 32, due to buffer
  12658. * size limits. For PPDUs with more than 32 MPDUs, only the
  12659. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  12660. * the PPDU will be provided.
  12661. */
  12662. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  12663. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  12664. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  12665. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  12666. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  12667. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  12668. do { \
  12669. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  12670. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  12671. } while (0)
  12672. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  12673. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  12674. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  12675. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  12676. do { \
  12677. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  12678. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  12679. } while (0)
  12680. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  12681. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  12682. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  12683. /**
  12684. * @brief target -> host flow pool resize Message
  12685. *
  12686. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  12687. *
  12688. * @details
  12689. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  12690. * the flow pool associated with the specified ID is resized
  12691. *
  12692. * The message would appear as follows:
  12693. *
  12694. * |31 16|15 8|7 0|
  12695. * |---------------------------------+----------------+----------------|
  12696. * | reserved0 | Msg type |
  12697. * |-------------------------------------------------------------------|
  12698. * | flow pool new size | flow pool ID |
  12699. * |-------------------------------------------------------------------|
  12700. *
  12701. * The message is interpreted as follows:
  12702. * b'0:7 - msg_type: This will be set to 0x21
  12703. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  12704. *
  12705. * b'0:15 - flow pool ID: Existing flow pool ID
  12706. *
  12707. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  12708. *
  12709. */
  12710. PREPACK struct htt_flow_pool_resize_t {
  12711. A_UINT32 msg_type:8,
  12712. reserved0:24;
  12713. A_UINT32 flow_pool_id:16,
  12714. flow_pool_new_size:16;
  12715. } POSTPACK;
  12716. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  12717. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  12718. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  12719. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  12720. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  12721. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  12722. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  12723. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  12724. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  12725. do { \
  12726. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  12727. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  12728. } while (0)
  12729. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  12730. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  12731. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  12732. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  12733. do { \
  12734. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  12735. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  12736. } while (0)
  12737. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  12738. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  12739. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  12740. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  12741. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  12742. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  12743. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  12744. /*
  12745. * The read and write indices point to the data within the host buffer.
  12746. * Because the first 4 bytes of the host buffer is used for the read index and
  12747. * the next 4 bytes for the write index, the data itself starts at offset 8.
  12748. * The read index and write index are the byte offsets from the base of the
  12749. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  12750. * Refer the ASCII text picture below.
  12751. */
  12752. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  12753. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  12754. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  12755. /*
  12756. ***************************************************************************
  12757. *
  12758. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12759. *
  12760. ***************************************************************************
  12761. *
  12762. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  12763. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  12764. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  12765. * written into the Host memory region mentioned below.
  12766. *
  12767. * Read index is updated by the Host. At any point of time, the read index will
  12768. * indicate the index that will next be read by the Host. The read index is
  12769. * in units of bytes offset from the base of the meta-data buffer.
  12770. *
  12771. * Write index is updated by the FW. At any point of time, the write index will
  12772. * indicate from where the FW can start writing any new data. The write index is
  12773. * in units of bytes offset from the base of the meta-data buffer.
  12774. *
  12775. * If the Host is not fast enough in reading the CFR data, any new capture data
  12776. * would be dropped if there is no space left to write the new captures.
  12777. *
  12778. * The last 4 bytes of the memory region will have the magic pattern
  12779. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  12780. * not overrun the host buffer.
  12781. *
  12782. * ,--------------------. read and write indices store the
  12783. * | | byte offset from the base of the
  12784. * | ,--------+--------. meta-data buffer to the next
  12785. * | | | | location within the data buffer
  12786. * | | v v that will be read / written
  12787. * ************************************************************************
  12788. * * Read * Write * * Magic *
  12789. * * index * index * CFR data1 ...... CFR data N * pattern *
  12790. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  12791. * ************************************************************************
  12792. * |<---------- data buffer ---------->|
  12793. *
  12794. * |<----------------- meta-data buffer allocated in Host ----------------|
  12795. *
  12796. * Note:
  12797. * - Considering the 4 bytes needed to store the Read index (R) and the
  12798. * Write index (W), the initial value is as follows:
  12799. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  12800. * - Buffer empty condition:
  12801. * R = W
  12802. *
  12803. * Regarding CFR data format:
  12804. * --------------------------
  12805. *
  12806. * Each CFR tone is stored in HW as 16-bits with the following format:
  12807. * {bits[15:12], bits[11:6], bits[5:0]} =
  12808. * {unsigned exponent (4 bits),
  12809. * signed mantissa_real (6 bits),
  12810. * signed mantissa_imag (6 bits)}
  12811. *
  12812. * CFR_real = mantissa_real * 2^(exponent-5)
  12813. * CFR_imag = mantissa_imag * 2^(exponent-5)
  12814. *
  12815. *
  12816. * The CFR data is written to the 16-bit unsigned output array (buff) in
  12817. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  12818. *
  12819. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  12820. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  12821. * .
  12822. * .
  12823. * .
  12824. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  12825. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  12826. */
  12827. /* Bandwidth of peer CFR captures */
  12828. typedef enum {
  12829. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  12830. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  12831. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  12832. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  12833. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  12834. HTT_PEER_CFR_CAPTURE_BW_MAX,
  12835. } HTT_PEER_CFR_CAPTURE_BW;
  12836. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  12837. * was captured
  12838. */
  12839. typedef enum {
  12840. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  12841. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  12842. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  12843. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  12844. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  12845. } HTT_PEER_CFR_CAPTURE_MODE;
  12846. typedef enum {
  12847. /* This message type is currently used for the below purpose:
  12848. *
  12849. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  12850. * wmi_peer_cfr_capture_cmd.
  12851. * If payload_present bit is set to 0 then the associated memory region
  12852. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  12853. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  12854. * message; the CFR dump will be present at the end of the message,
  12855. * after the chan_phy_mode.
  12856. */
  12857. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  12858. /* Always keep this last */
  12859. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  12860. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  12861. /**
  12862. * @brief target -> host CFR dump completion indication message definition
  12863. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  12864. *
  12865. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  12866. *
  12867. * @details
  12868. * The following diagram shows the format of the Channel Frequency Response
  12869. * (CFR) dump completion indication. This inidcation is sent to the Host when
  12870. * the channel capture of a peer is copied by Firmware into the Host memory
  12871. *
  12872. * **************************************************************************
  12873. *
  12874. * Message format when the CFR capture message type is
  12875. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12876. *
  12877. * **************************************************************************
  12878. *
  12879. * |31 16|15 |8|7 0|
  12880. * |----------------------------------------------------------------|
  12881. * header: | reserved |P| msg_type |
  12882. * word 0 | | | |
  12883. * |----------------------------------------------------------------|
  12884. * payload: | cfr_capture_msg_type |
  12885. * word 1 | |
  12886. * |----------------------------------------------------------------|
  12887. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  12888. * word 2 | | | | | | | | |
  12889. * |----------------------------------------------------------------|
  12890. * | mac_addr31to0 |
  12891. * word 3 | |
  12892. * |----------------------------------------------------------------|
  12893. * | unused / reserved | mac_addr47to32 |
  12894. * word 4 | | |
  12895. * |----------------------------------------------------------------|
  12896. * | index |
  12897. * word 5 | |
  12898. * |----------------------------------------------------------------|
  12899. * | length |
  12900. * word 6 | |
  12901. * |----------------------------------------------------------------|
  12902. * | timestamp |
  12903. * word 7 | |
  12904. * |----------------------------------------------------------------|
  12905. * | counter |
  12906. * word 8 | |
  12907. * |----------------------------------------------------------------|
  12908. * | chan_mhz |
  12909. * word 9 | |
  12910. * |----------------------------------------------------------------|
  12911. * | band_center_freq1 |
  12912. * word 10 | |
  12913. * |----------------------------------------------------------------|
  12914. * | band_center_freq2 |
  12915. * word 11 | |
  12916. * |----------------------------------------------------------------|
  12917. * | chan_phy_mode |
  12918. * word 12 | |
  12919. * |----------------------------------------------------------------|
  12920. * where,
  12921. * P - payload present bit (payload_present explained below)
  12922. * req_id - memory request id (mem_req_id explained below)
  12923. * S - status field (status explained below)
  12924. * capbw - capture bandwidth (capture_bw explained below)
  12925. * mode - mode of capture (mode explained below)
  12926. * sts - space time streams (sts_count explained below)
  12927. * chbw - channel bandwidth (channel_bw explained below)
  12928. * captype - capture type (cap_type explained below)
  12929. *
  12930. * The following field definitions describe the format of the CFR dump
  12931. * completion indication sent from the target to the host
  12932. *
  12933. * Header fields:
  12934. *
  12935. * Word 0
  12936. * - msg_type
  12937. * Bits 7:0
  12938. * Purpose: Identifies this as CFR TX completion indication
  12939. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12940. * - payload_present
  12941. * Bit 8
  12942. * Purpose: Identifies how CFR data is sent to host
  12943. * Value: 0 - If CFR Payload is written to host memory
  12944. * 1 - If CFR Payload is sent as part of HTT message
  12945. * (This is the requirement for SDIO/USB where it is
  12946. * not possible to write CFR data to host memory)
  12947. * - reserved
  12948. * Bits 31:9
  12949. * Purpose: Reserved
  12950. * Value: 0
  12951. *
  12952. * Payload fields:
  12953. *
  12954. * Word 1
  12955. * - cfr_capture_msg_type
  12956. * Bits 31:0
  12957. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12958. * to specify the format used for the remainder of the message
  12959. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12960. * (currently only MSG_TYPE_1 is defined)
  12961. *
  12962. * Word 2
  12963. * - mem_req_id
  12964. * Bits 6:0
  12965. * Purpose: Contain the mem request id of the region where the CFR capture
  12966. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12967. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12968. this value is invalid)
  12969. * - status
  12970. * Bit 7
  12971. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12972. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12973. * - capture_bw
  12974. * Bits 10:8
  12975. * Purpose: Carry the bandwidth of the CFR capture
  12976. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12977. * - mode
  12978. * Bits 13:11
  12979. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12980. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12981. * - sts_count
  12982. * Bits 16:14
  12983. * Purpose: Carry the number of space time streams
  12984. * Value: Number of space time streams
  12985. * - channel_bw
  12986. * Bits 19:17
  12987. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12988. * measurement
  12989. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12990. * - cap_type
  12991. * Bits 23:20
  12992. * Purpose: Carry the type of the capture
  12993. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12994. * - vdev_id
  12995. * Bits 31:24
  12996. * Purpose: Carry the virtual device id
  12997. * Value: vdev ID
  12998. *
  12999. * Word 3
  13000. * - mac_addr31to0
  13001. * Bits 31:0
  13002. * Purpose: Contain the bits 31:0 of the peer MAC address
  13003. * Value: Bits 31:0 of the peer MAC address
  13004. *
  13005. * Word 4
  13006. * - mac_addr47to32
  13007. * Bits 15:0
  13008. * Purpose: Contain the bits 47:32 of the peer MAC address
  13009. * Value: Bits 47:32 of the peer MAC address
  13010. *
  13011. * Word 5
  13012. * - index
  13013. * Bits 31:0
  13014. * Purpose: Contain the index at which this CFR dump was written in the Host
  13015. * allocated memory. This index is the number of bytes from the base address.
  13016. * Value: Index position
  13017. *
  13018. * Word 6
  13019. * - length
  13020. * Bits 31:0
  13021. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13022. * Value: Length of the CFR capture of the peer
  13023. *
  13024. * Word 7
  13025. * - timestamp
  13026. * Bits 31:0
  13027. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13028. * clock used for this timestamp is private to the target and not visible to
  13029. * the host i.e., Host can interpret only the relative timestamp deltas from
  13030. * one message to the next, but can't interpret the absolute timestamp from a
  13031. * single message.
  13032. * Value: Timestamp in microseconds
  13033. *
  13034. * Word 8
  13035. * - counter
  13036. * Bits 31:0
  13037. * Purpose: Carry the count of the current CFR capture from FW. This is
  13038. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13039. * in host memory)
  13040. * Value: Count of the current CFR capture
  13041. *
  13042. * Word 9
  13043. * - chan_mhz
  13044. * Bits 31:0
  13045. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13046. * Value: Primary 20 channel frequency
  13047. *
  13048. * Word 10
  13049. * - band_center_freq1
  13050. * Bits 31:0
  13051. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13052. * Value: Center frequency 1 in MHz
  13053. *
  13054. * Word 11
  13055. * - band_center_freq2
  13056. * Bits 31:0
  13057. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13058. * the VDEV
  13059. * 80plus80 mode
  13060. * Value: Center frequency 2 in MHz
  13061. *
  13062. * Word 12
  13063. * - chan_phy_mode
  13064. * Bits 31:0
  13065. * Purpose: Carry the phy mode of the channel, of the VDEV
  13066. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13067. */
  13068. PREPACK struct htt_cfr_dump_ind_type_1 {
  13069. A_UINT32 mem_req_id:7,
  13070. status:1,
  13071. capture_bw:3,
  13072. mode:3,
  13073. sts_count:3,
  13074. channel_bw:3,
  13075. cap_type:4,
  13076. vdev_id:8;
  13077. htt_mac_addr addr;
  13078. A_UINT32 index;
  13079. A_UINT32 length;
  13080. A_UINT32 timestamp;
  13081. A_UINT32 counter;
  13082. struct htt_chan_change_msg chan;
  13083. } POSTPACK;
  13084. PREPACK struct htt_cfr_dump_compl_ind {
  13085. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13086. union {
  13087. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13088. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13089. /* If there is a need to change the memory layout and its associated
  13090. * HTT indication format, a new CFR capture message type can be
  13091. * introduced and added into this union.
  13092. */
  13093. };
  13094. } POSTPACK;
  13095. /*
  13096. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13097. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13098. */
  13099. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13100. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13101. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13102. do { \
  13103. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13104. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13105. } while(0)
  13106. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13107. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13108. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13109. /*
  13110. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13111. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13112. */
  13113. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13114. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13115. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13116. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13117. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13119. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13120. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13121. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13122. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13123. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13124. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13125. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13126. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13127. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13128. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13129. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13130. do { \
  13131. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13132. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13133. } while (0)
  13134. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13135. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13136. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13137. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13138. do { \
  13139. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13140. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13141. } while (0)
  13142. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13143. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13144. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13145. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13146. do { \
  13147. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13148. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13149. } while (0)
  13150. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13151. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13152. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13153. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13156. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13157. } while (0)
  13158. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13159. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13160. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13161. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13162. do { \
  13163. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13164. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13165. } while (0)
  13166. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13167. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13168. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13169. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13170. do { \
  13171. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13172. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13173. } while (0)
  13174. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13175. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13176. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13177. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13178. do { \
  13179. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13180. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13181. } while (0)
  13182. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13183. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13184. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13185. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13186. do { \
  13187. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13188. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13189. } while (0)
  13190. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13191. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13192. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13193. /**
  13194. * @brief target -> host peer (PPDU) stats message
  13195. *
  13196. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13197. *
  13198. * @details
  13199. * This message is generated by FW when FW is sending stats to host
  13200. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13201. * This message is sent autonomously by the target rather than upon request
  13202. * by the host.
  13203. * The following field definitions describe the format of the HTT target
  13204. * to host peer stats indication message.
  13205. *
  13206. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13207. * or more PPDU stats records.
  13208. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13209. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13210. * then the message would start with the
  13211. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13212. * below.
  13213. *
  13214. * |31 16|15|14|13 11|10 9|8|7 0|
  13215. * |-------------------------------------------------------------|
  13216. * | reserved |MSG_TYPE |
  13217. * |-------------------------------------------------------------|
  13218. * rec 0 | TLV header |
  13219. * rec 0 |-------------------------------------------------------------|
  13220. * rec 0 | ppdu successful bytes |
  13221. * rec 0 |-------------------------------------------------------------|
  13222. * rec 0 | ppdu retry bytes |
  13223. * rec 0 |-------------------------------------------------------------|
  13224. * rec 0 | ppdu failed bytes |
  13225. * rec 0 |-------------------------------------------------------------|
  13226. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13227. * rec 0 |-------------------------------------------------------------|
  13228. * rec 0 | retried MSDUs | successful MSDUs |
  13229. * rec 0 |-------------------------------------------------------------|
  13230. * rec 0 | TX duration | failed MSDUs |
  13231. * rec 0 |-------------------------------------------------------------|
  13232. * ...
  13233. * |-------------------------------------------------------------|
  13234. * rec N | TLV header |
  13235. * rec N |-------------------------------------------------------------|
  13236. * rec N | ppdu successful bytes |
  13237. * rec N |-------------------------------------------------------------|
  13238. * rec N | ppdu retry bytes |
  13239. * rec N |-------------------------------------------------------------|
  13240. * rec N | ppdu failed bytes |
  13241. * rec N |-------------------------------------------------------------|
  13242. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13243. * rec N |-------------------------------------------------------------|
  13244. * rec N | retried MSDUs | successful MSDUs |
  13245. * rec N |-------------------------------------------------------------|
  13246. * rec N | TX duration | failed MSDUs |
  13247. * rec N |-------------------------------------------------------------|
  13248. *
  13249. * where:
  13250. * A = is A-MPDU flag
  13251. * BA = block-ack failure flags
  13252. * BW = bandwidth spec
  13253. * SG = SGI enabled spec
  13254. * S = skipped rate ctrl
  13255. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13256. *
  13257. * Header
  13258. * ------
  13259. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13260. * dword0 - b'8:31 - reserved : Reserved for future use
  13261. *
  13262. * payload include below peer_stats information
  13263. * --------------------------------------------
  13264. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13265. * @tx_success_bytes : total successful bytes in the PPDU.
  13266. * @tx_retry_bytes : total retried bytes in the PPDU.
  13267. * @tx_failed_bytes : total failed bytes in the PPDU.
  13268. * @tx_ratecode : rate code used for the PPDU.
  13269. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13270. * @ba_ack_failed : BA/ACK failed for this PPDU
  13271. * b00 -> BA received
  13272. * b01 -> BA failed once
  13273. * b10 -> BA failed twice, when HW retry is enabled.
  13274. * @bw : BW
  13275. * b00 -> 20 MHz
  13276. * b01 -> 40 MHz
  13277. * b10 -> 80 MHz
  13278. * b11 -> 160 MHz (or 80+80)
  13279. * @sg : SGI enabled
  13280. * @s : skipped ratectrl
  13281. * @peer_id : peer id
  13282. * @tx_success_msdus : successful MSDUs
  13283. * @tx_retry_msdus : retried MSDUs
  13284. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13285. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13286. */
  13287. /**
  13288. * @brief target -> host backpressure event
  13289. *
  13290. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13291. *
  13292. * @details
  13293. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13294. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13295. * This message will only be sent if the backpressure condition has existed
  13296. * continuously for an initial period (100 ms).
  13297. * Repeat messages with updated information will be sent after each
  13298. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13299. * This message indicates the ring id along with current head and tail index
  13300. * locations (i.e. write and read indices).
  13301. * The backpressure time indicates the time in ms for which continous
  13302. * backpressure has been observed in the ring.
  13303. *
  13304. * The message format is as follows:
  13305. *
  13306. * |31 24|23 16|15 8|7 0|
  13307. * |----------------+----------------+----------------+----------------|
  13308. * | ring_id | ring_type | pdev_id | msg_type |
  13309. * |-------------------------------------------------------------------|
  13310. * | tail_idx | head_idx |
  13311. * |-------------------------------------------------------------------|
  13312. * | backpressure_time_ms |
  13313. * |-------------------------------------------------------------------|
  13314. *
  13315. * The message is interpreted as follows:
  13316. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13317. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13318. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13319. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13320. the msg is for LMAC ring.
  13321. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13322. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13323. * htt_backpressure_lmac_ring_id. This represents
  13324. * the ring id for which continous backpressure is seen
  13325. *
  13326. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  13327. * the ring indicated by the ring_id
  13328. *
  13329. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  13330. * the ring indicated by the ring id
  13331. *
  13332. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  13333. * backpressure has been seen in the ring
  13334. * indicated by the ring_id.
  13335. * Units = milliseconds
  13336. */
  13337. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  13338. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  13339. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  13340. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  13341. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  13342. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  13343. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  13344. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  13345. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  13346. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  13347. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  13348. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  13349. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  13350. do { \
  13351. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  13352. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  13353. } while (0)
  13354. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  13355. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  13356. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  13357. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  13358. do { \
  13359. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  13360. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  13361. } while (0)
  13362. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  13363. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  13364. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  13365. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  13366. do { \
  13367. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  13368. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  13369. } while (0)
  13370. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  13371. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  13372. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  13373. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  13374. do { \
  13375. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  13376. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  13377. } while (0)
  13378. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  13379. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  13380. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  13381. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  13382. do { \
  13383. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  13384. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  13385. } while (0)
  13386. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  13387. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  13388. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  13389. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  13390. do { \
  13391. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  13392. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  13393. } while (0)
  13394. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  13395. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  13396. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  13397. enum htt_backpressure_ring_type {
  13398. HTT_SW_RING_TYPE_UMAC,
  13399. HTT_SW_RING_TYPE_LMAC,
  13400. HTT_SW_RING_TYPE_MAX,
  13401. };
  13402. /* Ring id for which the message is sent to host */
  13403. enum htt_backpressure_umac_ringid {
  13404. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  13405. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  13406. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  13407. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  13408. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  13409. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  13410. HTT_SW_RING_IDX_REO_REO2FW_RING,
  13411. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  13412. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  13413. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  13414. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  13415. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  13416. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  13417. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  13418. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  13419. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  13420. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  13421. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  13422. HTT_SW_UMAC_RING_IDX_MAX,
  13423. };
  13424. enum htt_backpressure_lmac_ringid {
  13425. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  13426. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  13427. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  13428. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  13429. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  13430. HTT_SW_RING_IDX_RXDMA2FW_RING,
  13431. HTT_SW_RING_IDX_RXDMA2SW_RING,
  13432. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  13433. HTT_SW_RING_IDX_RXDMA2REO_RING,
  13434. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  13435. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  13436. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  13437. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  13438. HTT_SW_LMAC_RING_IDX_MAX,
  13439. };
  13440. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  13441. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  13442. pdev_id: 8,
  13443. ring_type: 8, /* htt_backpressure_ring_type */
  13444. /*
  13445. * ring_id holds an enum value from either
  13446. * htt_backpressure_umac_ringid or
  13447. * htt_backpressure_lmac_ringid, based on
  13448. * the ring_type setting.
  13449. */
  13450. ring_id: 8;
  13451. A_UINT16 head_idx;
  13452. A_UINT16 tail_idx;
  13453. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  13454. } POSTPACK;
  13455. /*
  13456. * Defines two 32 bit words that can be used by the target to indicate a per
  13457. * user RU allocation and rate information.
  13458. *
  13459. * This information is currently provided in the "sw_response_reference_ptr"
  13460. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  13461. * "rx_ppdu_end_user_stats" TLV.
  13462. *
  13463. * VALID:
  13464. * The consumer of these words must explicitly check the valid bit,
  13465. * and only attempt interpretation of any of the remaining fields if
  13466. * the valid bit is set to 1.
  13467. *
  13468. * VERSION:
  13469. * The consumer of these words must also explicitly check the version bit,
  13470. * and only use the V0 definition if the VERSION field is set to 0.
  13471. *
  13472. * Version 1 is currently undefined, with the exception of the VALID and
  13473. * VERSION fields.
  13474. *
  13475. * Version 0:
  13476. *
  13477. * The fields below are duplicated per BW.
  13478. *
  13479. * The consumer must determine which BW field to use, based on the UL OFDMA
  13480. * PPDU BW indicated by HW.
  13481. *
  13482. * RU_START: RU26 start index for the user.
  13483. * Note that this is always using the RU26 index, regardless
  13484. * of the actual RU assigned to the user
  13485. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  13486. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  13487. *
  13488. * For example, 20MHz (the value in the top row is RU_START)
  13489. *
  13490. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  13491. * RU Size 1 (52): | | | | | |
  13492. * RU Size 2 (106): | | | |
  13493. * RU Size 3 (242): | |
  13494. *
  13495. * RU_SIZE: Indicates the RU size, as defined by enum
  13496. * htt_ul_ofdma_user_info_ru_size.
  13497. *
  13498. * LDPC: LDPC enabled (if 0, BCC is used)
  13499. *
  13500. * DCM: DCM enabled
  13501. *
  13502. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  13503. * |---------------------------------+--------------------------------|
  13504. * |Ver|Valid| FW internal |
  13505. * |---------------------------------+--------------------------------|
  13506. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  13507. * |---------------------------------+--------------------------------|
  13508. */
  13509. enum htt_ul_ofdma_user_info_ru_size {
  13510. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  13511. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  13512. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  13513. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  13514. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  13515. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  13516. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  13517. };
  13518. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  13519. struct htt_ul_ofdma_user_info_v0 {
  13520. A_UINT32 word0;
  13521. A_UINT32 word1;
  13522. };
  13523. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  13524. A_UINT32 w0_fw_rsvd:30; \
  13525. A_UINT32 w0_valid:1; \
  13526. A_UINT32 w0_version:1;
  13527. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  13528. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13529. };
  13530. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  13531. A_UINT32 w1_nss:3; \
  13532. A_UINT32 w1_mcs:4; \
  13533. A_UINT32 w1_ldpc:1; \
  13534. A_UINT32 w1_dcm:1; \
  13535. A_UINT32 w1_ru_start:7; \
  13536. A_UINT32 w1_ru_size:3; \
  13537. A_UINT32 w1_trig_type:4; \
  13538. A_UINT32 w1_unused:9;
  13539. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  13540. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13541. };
  13542. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  13543. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  13544. union {
  13545. A_UINT32 word0;
  13546. struct {
  13547. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13548. };
  13549. };
  13550. union {
  13551. A_UINT32 word1;
  13552. struct {
  13553. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13554. };
  13555. };
  13556. } POSTPACK;
  13557. enum HTT_UL_OFDMA_TRIG_TYPE {
  13558. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  13559. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  13560. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  13561. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  13562. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  13563. };
  13564. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  13565. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  13566. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  13567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  13568. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  13569. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  13570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  13571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  13572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  13573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  13574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  13575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  13576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  13577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  13578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  13579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  13580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  13581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  13582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  13583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  13584. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  13585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  13586. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  13587. /*--- word 0 ---*/
  13588. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  13589. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  13590. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  13591. do { \
  13592. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  13593. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  13594. } while (0)
  13595. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  13596. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  13597. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  13598. do { \
  13599. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  13600. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  13601. } while (0)
  13602. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  13603. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  13604. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  13605. do { \
  13606. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  13607. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  13608. } while (0)
  13609. /*--- word 1 ---*/
  13610. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  13611. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  13612. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  13613. do { \
  13614. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  13615. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  13616. } while (0)
  13617. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  13618. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  13619. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  13620. do { \
  13621. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  13622. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  13623. } while (0)
  13624. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  13625. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  13626. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  13627. do { \
  13628. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  13629. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  13630. } while (0)
  13631. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  13632. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  13633. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  13634. do { \
  13635. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  13636. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  13637. } while (0)
  13638. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  13639. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  13640. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  13641. do { \
  13642. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  13643. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  13644. } while (0)
  13645. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  13646. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  13647. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  13648. do { \
  13649. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  13650. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  13651. } while (0)
  13652. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  13653. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  13654. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  13655. do { \
  13656. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  13657. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  13658. } while (0)
  13659. /**
  13660. * @brief target -> host channel calibration data message
  13661. *
  13662. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  13663. *
  13664. * @brief host -> target channel calibration data message
  13665. *
  13666. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  13667. *
  13668. * @details
  13669. * The following field definitions describe the format of the channel
  13670. * calibration data message sent from the target to the host when
  13671. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  13672. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  13673. * The message is defined as htt_chan_caldata_msg followed by a variable
  13674. * number of 32-bit character values.
  13675. *
  13676. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  13677. * |------------------------------------------------------------------|
  13678. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  13679. * |------------------------------------------------------------------|
  13680. * | payload size | mhz |
  13681. * |------------------------------------------------------------------|
  13682. * | center frequency 2 | center frequency 1 |
  13683. * |------------------------------------------------------------------|
  13684. * | check sum |
  13685. * |------------------------------------------------------------------|
  13686. * | payload |
  13687. * |------------------------------------------------------------------|
  13688. * message info field:
  13689. * - MSG_TYPE
  13690. * Bits 7:0
  13691. * Purpose: identifies this as a channel calibration data message
  13692. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  13693. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  13694. * - SUB_TYPE
  13695. * Bits 11:8
  13696. * Purpose: T2H: indicates whether target is providing chan cal data
  13697. * to the host to store, or requesting that the host
  13698. * download previously-stored data.
  13699. * H2T: indicates whether the host is providing the requested
  13700. * channel cal data, or if it is rejecting the data
  13701. * request because it does not have the requested data.
  13702. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  13703. * - CHKSUM_VALID
  13704. * Bit 12
  13705. * Purpose: indicates if the checksum field is valid
  13706. * value:
  13707. * - FRAG
  13708. * Bit 19:16
  13709. * Purpose: indicates the fragment index for message
  13710. * value: 0 for first fragment, 1 for second fragment, ...
  13711. * - APPEND
  13712. * Bit 20
  13713. * Purpose: indicates if this is the last fragment
  13714. * value: 0 = final fragment, 1 = more fragments will be appended
  13715. *
  13716. * channel and payload size field
  13717. * - MHZ
  13718. * Bits 15:0
  13719. * Purpose: indicates the channel primary frequency
  13720. * Value:
  13721. * - PAYLOAD_SIZE
  13722. * Bits 31:16
  13723. * Purpose: indicates the bytes of calibration data in payload
  13724. * Value:
  13725. *
  13726. * center frequency field
  13727. * - CENTER FREQUENCY 1
  13728. * Bits 15:0
  13729. * Purpose: indicates the channel center frequency
  13730. * Value: channel center frequency, in MHz units
  13731. * - CENTER FREQUENCY 2
  13732. * Bits 31:16
  13733. * Purpose: indicates the secondary channel center frequency,
  13734. * only for 11acvht 80plus80 mode
  13735. * Value: secondary channel center frequeny, in MHz units, if applicable
  13736. *
  13737. * checksum field
  13738. * - CHECK_SUM
  13739. * Bits 31:0
  13740. * Purpose: check the payload data, it is just for this fragment.
  13741. * This is intended for the target to check that the channel
  13742. * calibration data returned by the host is the unmodified data
  13743. * that was previously provided to the host by the target.
  13744. * value: checksum of fragment payload
  13745. */
  13746. PREPACK struct htt_chan_caldata_msg {
  13747. /* DWORD 0: message info */
  13748. A_UINT32
  13749. msg_type: 8,
  13750. sub_type: 4 ,
  13751. chksum_valid: 1, /** 1:valid, 0:invalid */
  13752. reserved1: 3,
  13753. frag_idx: 4, /** fragment index for calibration data */
  13754. appending: 1, /** 0: no fragment appending,
  13755. * 1: extra fragment appending */
  13756. reserved2: 11;
  13757. /* DWORD 1: channel and payload size */
  13758. A_UINT32
  13759. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  13760. payload_size: 16; /** unit: bytes */
  13761. /* DWORD 2: center frequency */
  13762. A_UINT32
  13763. band_center_freq1: 16, /** Center frequency 1 in MHz */
  13764. band_center_freq2: 16; /** Center frequency 2 in MHz,
  13765. * valid only for 11acvht 80plus80 mode */
  13766. /* DWORD 3: check sum */
  13767. A_UINT32 chksum;
  13768. /* variable length for calibration data */
  13769. A_UINT32 payload[1/* or more */];
  13770. } POSTPACK;
  13771. /* T2H SUBTYPE */
  13772. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  13773. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  13774. /* H2T SUBTYPE */
  13775. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  13776. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  13777. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  13778. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  13779. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  13780. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  13781. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  13782. do { \
  13783. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  13784. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  13785. } while (0)
  13786. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  13787. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  13788. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  13789. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  13790. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  13791. do { \
  13792. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  13793. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  13794. } while (0)
  13795. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  13796. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  13797. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  13798. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  13799. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  13800. do { \
  13801. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  13802. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  13803. } while (0)
  13804. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  13805. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  13806. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  13807. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  13808. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  13809. do { \
  13810. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  13811. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  13812. } while (0)
  13813. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  13814. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  13815. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  13816. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  13817. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  13818. do { \
  13819. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  13820. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  13821. } while (0)
  13822. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  13823. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  13824. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  13825. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  13826. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  13827. do { \
  13828. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  13829. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  13830. } while (0)
  13831. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  13832. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  13833. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  13834. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  13835. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  13838. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  13839. } while (0)
  13840. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  13841. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  13842. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  13843. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  13844. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  13845. do { \
  13846. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  13847. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  13848. } while (0)
  13849. /**
  13850. * @brief target -> host FSE CMEM based send
  13851. *
  13852. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  13853. *
  13854. * @details
  13855. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  13856. * FSE placement in CMEM is enabled.
  13857. *
  13858. * This message sends the non-secure CMEM base address.
  13859. * It will be sent to host in response to message
  13860. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  13861. * The message would appear as follows:
  13862. *
  13863. * |31 24|23 16|15 8|7 0|
  13864. * |----------------+----------------+----------------+----------------|
  13865. * | reserved | num_entries | msg_type |
  13866. * |----------------+----------------+----------------+----------------|
  13867. * | base_address_lo |
  13868. * |----------------+----------------+----------------+----------------|
  13869. * | base_address_hi |
  13870. * |-------------------------------------------------------------------|
  13871. *
  13872. * The message is interpreted as follows:
  13873. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  13874. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  13875. * b'8:15 - number_entries: Indicated the number of entries
  13876. * programmed.
  13877. * b'16:31 - reserved.
  13878. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  13879. * CMEM base address
  13880. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  13881. * CMEM base address
  13882. */
  13883. PREPACK struct htt_cmem_base_send_t {
  13884. A_UINT32 msg_type: 8,
  13885. num_entries: 8,
  13886. reserved: 16;
  13887. A_UINT32 base_address_lo;
  13888. A_UINT32 base_address_hi;
  13889. } POSTPACK;
  13890. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  13891. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  13892. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  13893. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  13894. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  13895. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  13896. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  13897. do { \
  13898. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  13899. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13900. } while (0)
  13901. /**
  13902. * @brief - HTT PPDU ID format
  13903. *
  13904. * @details
  13905. * The following field definitions describe the format of the PPDU ID.
  13906. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  13907. *
  13908. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  13909. * +--------------------------------------------------------------------------
  13910. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13911. * +--------------------------------------------------------------------------
  13912. *
  13913. * sch id :Schedule command id
  13914. * Bits [11 : 0] : monotonically increasing counter to track the
  13915. * PPDU posted to a specific transmit queue.
  13916. *
  13917. * hwq_id: Hardware Queue ID.
  13918. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13919. *
  13920. * mac_id: MAC ID
  13921. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13922. *
  13923. * seq_idx: Sequence index.
  13924. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13925. * a particular TXOP.
  13926. *
  13927. * tqm_cmd: HWSCH/TQM flag.
  13928. * Bit [23] : Always set to 0.
  13929. *
  13930. * seq_cmd_type: Sequence command type.
  13931. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13932. * Refer to enum HTT_STATS_FTYPE for values.
  13933. */
  13934. PREPACK struct htt_ppdu_id {
  13935. A_UINT32
  13936. sch_id: 12,
  13937. hwq_id: 5,
  13938. mac_id: 2,
  13939. seq_idx: 2,
  13940. reserved1: 2,
  13941. tqm_cmd: 1,
  13942. seq_cmd_type: 6,
  13943. reserved2: 2;
  13944. } POSTPACK;
  13945. #define HTT_PPDU_ID_SCH_ID_S 0
  13946. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13947. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13948. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13949. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13950. do { \
  13951. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13952. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13953. } while (0)
  13954. #define HTT_PPDU_ID_HWQ_ID_S 12
  13955. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13956. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13957. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13958. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13959. do { \
  13960. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13961. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13962. } while (0)
  13963. #define HTT_PPDU_ID_MAC_ID_S 17
  13964. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13965. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13966. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13967. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13968. do { \
  13969. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13970. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13971. } while (0)
  13972. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13973. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13974. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13975. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13976. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13977. do { \
  13978. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13979. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13980. } while (0)
  13981. #define HTT_PPDU_ID_TQM_CMD_S 23
  13982. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13983. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13984. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13985. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13986. do { \
  13987. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13988. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13989. } while (0)
  13990. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13991. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13992. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13993. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13994. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13995. do { \
  13996. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13997. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13998. } while (0)
  13999. /**
  14000. * @brief target -> RX PEER METADATA V0 format
  14001. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14002. * message from target, and will confirm to the target which peer metadata
  14003. * version to use in the wmi_init message.
  14004. *
  14005. * The following diagram shows the format of the RX PEER METADATA.
  14006. *
  14007. * |31 24|23 16|15 8|7 0|
  14008. * |-----------------------------------------------------------------------|
  14009. * | Reserved | VDEV ID | PEER ID |
  14010. * |-----------------------------------------------------------------------|
  14011. */
  14012. PREPACK struct htt_rx_peer_metadata_v0 {
  14013. A_UINT32
  14014. peer_id: 16,
  14015. vdev_id: 8,
  14016. reserved1: 8;
  14017. } POSTPACK;
  14018. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14019. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14020. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14021. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14022. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14023. do { \
  14024. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14025. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14026. } while (0)
  14027. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14028. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14029. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14030. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14031. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14032. do { \
  14033. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14034. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14035. } while (0)
  14036. /**
  14037. * @brief target -> RX PEER METADATA V1 format
  14038. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14039. * message from target, and will confirm to the target which peer metadata
  14040. * version to use in the wmi_init message.
  14041. *
  14042. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14043. *
  14044. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14045. * |-----------------------------------------------------------------------|
  14046. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14047. * |-----------------------------------------------------------------------|
  14048. */
  14049. PREPACK struct htt_rx_peer_metadata_v1 {
  14050. A_UINT32
  14051. peer_id: 13,
  14052. ml_peer_valid: 1,
  14053. reserved1: 2,
  14054. vdev_id: 8,
  14055. lmac_id: 2,
  14056. chip_id: 3,
  14057. reserved2: 3;
  14058. } POSTPACK;
  14059. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14060. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14061. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14062. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14063. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14064. do { \
  14065. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14066. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14067. } while (0)
  14068. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14069. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14070. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14071. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14072. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14073. do { \
  14074. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14075. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14076. } while (0)
  14077. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14078. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14079. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14080. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14081. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14082. do { \
  14083. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14084. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14085. } while (0)
  14086. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14087. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14088. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14089. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14090. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14091. do { \
  14092. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14093. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14094. } while (0)
  14095. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14096. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14097. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14098. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14099. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14100. do { \
  14101. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14102. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14103. } while (0)
  14104. /*
  14105. * In some systems, the host SW wants to specify priorities between
  14106. * different MSDU / flow queues within the same peer-TID.
  14107. * The below enums are used for the host to identify to the target
  14108. * which MSDU queue's priority it wants to adjust.
  14109. */
  14110. /*
  14111. * The MSDUQ index describe index of TCL HW, where each index is
  14112. * used for queuing particular types of MSDUs.
  14113. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14114. */
  14115. enum HTT_MSDUQ_INDEX {
  14116. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14117. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14118. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14119. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14120. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14121. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14122. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14123. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14124. HTT_MSDUQ_MAX_INDEX,
  14125. };
  14126. /* MSDU qtype definition */
  14127. enum HTT_MSDU_QTYPE {
  14128. /*
  14129. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14130. * relative priority. Instead, the relative priority of CRIT_0 versus
  14131. * CRIT_1 is controlled by the FW, through the configuration parameters
  14132. * it applies to the queues.
  14133. */
  14134. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14135. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14136. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14137. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14138. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14139. /* New MSDU_QTYPE should be added above this line */
  14140. /*
  14141. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14142. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14143. * any host/target message definitions. The QTYPE_MAX value can
  14144. * only be used internally within the host or within the target.
  14145. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14146. * it must regard the unexpected value as a default qtype value,
  14147. * or ignore it.
  14148. */
  14149. HTT_MSDU_QTYPE_MAX,
  14150. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14151. };
  14152. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14153. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14154. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14155. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14156. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14157. };
  14158. /**
  14159. * @brief target -> host mlo timestamp offset indication
  14160. *
  14161. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14162. *
  14163. * @details
  14164. * The following field definitions describe the format of the HTT target
  14165. * to host mlo timestamp offset indication message.
  14166. *
  14167. *
  14168. * |31 16|15 12|11 10|9 8|7 0 |
  14169. * |----------------------------------------------------------------------|
  14170. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14171. * |----------------------------------------------------------------------|
  14172. * | Sync time stamp lo in us |
  14173. * |----------------------------------------------------------------------|
  14174. * | Sync time stamp hi in us |
  14175. * |----------------------------------------------------------------------|
  14176. * | mlo time stamp offset lo in us |
  14177. * |----------------------------------------------------------------------|
  14178. * | mlo time stamp offset hi in us |
  14179. * |----------------------------------------------------------------------|
  14180. * | mlo time stamp offset clocks in clock ticks |
  14181. * |----------------------------------------------------------------------|
  14182. * |31 26|25 16|15 0 |
  14183. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14184. * | | compensation in clks | |
  14185. * |----------------------------------------------------------------------|
  14186. * |31 22|21 0 |
  14187. * | rsvd 3 | mlo time stamp comp timer period |
  14188. * |----------------------------------------------------------------------|
  14189. * The message is interpreted as follows:
  14190. *
  14191. * dword0 - b'0:7 - msg_type: This will be set to
  14192. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14193. * value: 0x28
  14194. *
  14195. * dword0 - b'9:8 - pdev_id
  14196. *
  14197. * dword0 - b'11:10 - chip_id
  14198. *
  14199. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14200. *
  14201. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14202. *
  14203. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14204. * which last sync interrupt was received
  14205. *
  14206. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14207. * which last sync interrupt was received
  14208. *
  14209. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14210. *
  14211. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14212. *
  14213. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14214. *
  14215. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14216. *
  14217. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14218. * for sub us resolution
  14219. *
  14220. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14221. *
  14222. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14223. * is applied, in us
  14224. *
  14225. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14226. */
  14227. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14229. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14242. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14243. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14244. do { \
  14245. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14246. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14247. } while (0)
  14248. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14249. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14250. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14251. do { \
  14252. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14253. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14254. } while (0)
  14255. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14256. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14257. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14258. do { \
  14259. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14260. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14261. } while (0)
  14262. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14263. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14264. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14265. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14266. do { \
  14267. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14268. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14269. } while (0)
  14270. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14271. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14272. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14273. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14274. do { \
  14275. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14276. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14277. } while (0)
  14278. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14279. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14280. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14281. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14282. do { \
  14283. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14284. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14285. } while (0)
  14286. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14287. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14288. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14289. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14290. do { \
  14291. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14292. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14293. } while (0)
  14294. typedef struct {
  14295. A_UINT32 msg_type: 8, /* bits 7:0 */
  14296. pdev_id: 2, /* bits 9:8 */
  14297. chip_id: 2, /* bits 11:10 */
  14298. reserved1: 4, /* bits 15:12 */
  14299. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14300. A_UINT32 sync_timestamp_lo_us;
  14301. A_UINT32 sync_timestamp_hi_us;
  14302. A_UINT32 mlo_timestamp_offset_lo_us;
  14303. A_UINT32 mlo_timestamp_offset_hi_us;
  14304. A_UINT32 mlo_timestamp_offset_clks;
  14305. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14306. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14307. reserved2: 6; /* bits 31:26 */
  14308. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14309. reserved3: 10; /* bits 31:22 */
  14310. } htt_t2h_mlo_offset_ind_t;
  14311. /*
  14312. * @brief target -> host VDEV TX RX STATS
  14313. *
  14314. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14315. *
  14316. * @details
  14317. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14318. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  14319. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  14320. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  14321. * periodically by target even in the absence of any further HTT request
  14322. * messages from host.
  14323. *
  14324. * The message is formatted as follows:
  14325. *
  14326. * |31 16|15 8|7 0|
  14327. * |---------------------------------+----------------+----------------|
  14328. * | payload_size | pdev_id | msg_type |
  14329. * |---------------------------------+----------------+----------------|
  14330. * | reserved0 |
  14331. * |-------------------------------------------------------------------|
  14332. * | reserved1 |
  14333. * |-------------------------------------------------------------------|
  14334. * | reserved2 |
  14335. * |-------------------------------------------------------------------|
  14336. * | |
  14337. * | VDEV specific Tx Rx stats info |
  14338. * | |
  14339. * |-------------------------------------------------------------------|
  14340. *
  14341. * The message is interpreted as follows:
  14342. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  14343. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  14344. * b'8:15 - pdev_id
  14345. * b'16:31 - size in bytes of the payload that follows the 16-byte
  14346. * message header fields (msg_type through reserved2)
  14347. * dword1 - b'0:31 - reserved0.
  14348. * dword2 - b'0:31 - reserved1.
  14349. * dword3 - b'0:31 - reserved2.
  14350. */
  14351. typedef struct {
  14352. A_UINT32 msg_type: 8,
  14353. pdev_id: 8,
  14354. payload_size: 16;
  14355. A_UINT32 reserved0;
  14356. A_UINT32 reserved1;
  14357. A_UINT32 reserved2;
  14358. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  14359. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  14360. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  14361. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  14362. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  14363. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  14364. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  14365. do { \
  14366. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  14367. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  14368. } while (0)
  14369. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  14370. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  14371. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  14372. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  14373. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  14374. do { \
  14375. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  14376. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  14377. } while (0)
  14378. /* SOC related stats */
  14379. typedef struct {
  14380. htt_tlv_hdr_t tlv_hdr;
  14381. /* When TQM is not able to find the peers during Tx, then it drops the packets
  14382. * This can be due to either the peer is deleted or deletion is ongoing
  14383. * */
  14384. A_UINT32 inv_peers_msdu_drop_count_lo;
  14385. A_UINT32 inv_peers_msdu_drop_count_hi;
  14386. } htt_t2h_soc_txrx_stats_common_tlv;
  14387. /* VDEV HW Tx/Rx stats */
  14388. typedef struct {
  14389. htt_tlv_hdr_t tlv_hdr;
  14390. A_UINT32 vdev_id;
  14391. /* Rx msdu byte cnt */
  14392. A_UINT32 rx_msdu_byte_cnt_lo;
  14393. A_UINT32 rx_msdu_byte_cnt_hi;
  14394. /* Rx msdu cnt */
  14395. A_UINT32 rx_msdu_cnt_lo;
  14396. A_UINT32 rx_msdu_cnt_hi;
  14397. /* tx msdu byte cnt */
  14398. A_UINT32 tx_msdu_byte_cnt_lo;
  14399. A_UINT32 tx_msdu_byte_cnt_hi;
  14400. /* tx msdu cnt */
  14401. A_UINT32 tx_msdu_cnt_lo;
  14402. A_UINT32 tx_msdu_cnt_hi;
  14403. /* tx excessive retry discarded msdu cnt*/
  14404. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  14405. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  14406. /* TX congestion ctrl msdu drop cnt */
  14407. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  14408. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  14409. /* discarded tx msdus cnt coz of time to live expiry */
  14410. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  14411. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  14412. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  14413. #endif