htt.h 697 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478
  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. */
  212. #define HTT_CURRENT_VERSION_MAJOR 3
  213. #define HTT_CURRENT_VERSION_MINOR 93
  214. #define HTT_NUM_TX_FRAG_DESC 1024
  215. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  216. #define HTT_CHECK_SET_VAL(field, val) \
  217. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  218. /* macros to assist in sign-extending fields from HTT messages */
  219. #define HTT_SIGN_BIT_MASK(field) \
  220. ((field ## _M + (1 << field ## _S)) >> 1)
  221. #define HTT_SIGN_BIT(_val, field) \
  222. (_val & HTT_SIGN_BIT_MASK(field))
  223. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  224. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  225. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  226. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  227. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  228. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  229. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  230. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  231. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  232. /*
  233. * TEMPORARY:
  234. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  235. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  236. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  237. * updated.
  238. */
  239. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  240. /*
  241. * TEMPORARY:
  242. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  243. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  244. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  245. * updated.
  246. */
  247. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  248. /*
  249. * htt_dbg_stats_type -
  250. * bit positions for each stats type within a stats type bitmask
  251. * The bitmask contains 24 bits.
  252. */
  253. enum htt_dbg_stats_type {
  254. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  255. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  256. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  257. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  258. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  259. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  260. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  261. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  262. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  263. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  264. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  265. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  266. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  267. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  268. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  269. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  270. /* bits 16-23 currently reserved */
  271. /* keep this last */
  272. HTT_DBG_NUM_STATS
  273. };
  274. /*=== HTT option selection TLVs ===
  275. * Certain HTT messages have alternatives or options.
  276. * For such cases, the host and target need to agree on which option to use.
  277. * Option specification TLVs can be appended to the VERSION_REQ and
  278. * VERSION_CONF messages to select options other than the default.
  279. * These TLVs are entirely optional - if they are not provided, there is a
  280. * well-defined default for each option. If they are provided, they can be
  281. * provided in any order. Each TLV can be present or absent independent of
  282. * the presence / absence of other TLVs.
  283. *
  284. * The HTT option selection TLVs use the following format:
  285. * |31 16|15 8|7 0|
  286. * |---------------------------------+----------------+----------------|
  287. * | value (payload) | length | tag |
  288. * |-------------------------------------------------------------------|
  289. * The value portion need not be only 2 bytes; it can be extended by any
  290. * integer number of 4-byte units. The total length of the TLV, including
  291. * the tag and length fields, must be a multiple of 4 bytes. The length
  292. * field specifies the total TLV size in 4-byte units. Thus, the typical
  293. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  294. * field, would store 0x1 in its length field, to show that the TLV occupies
  295. * a single 4-byte unit.
  296. */
  297. /*--- TLV header format - applies to all HTT option TLVs ---*/
  298. enum HTT_OPTION_TLV_TAGS {
  299. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  300. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  301. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  302. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  303. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  304. };
  305. PREPACK struct htt_option_tlv_header_t {
  306. A_UINT8 tag;
  307. A_UINT8 length;
  308. } POSTPACK;
  309. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  310. #define HTT_OPTION_TLV_TAG_S 0
  311. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  312. #define HTT_OPTION_TLV_LENGTH_S 8
  313. /*
  314. * value0 - 16 bit value field stored in word0
  315. * The TLV's value field may be longer than 2 bytes, in which case
  316. * the remainder of the value is stored in word1, word2, etc.
  317. */
  318. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  319. #define HTT_OPTION_TLV_VALUE0_S 16
  320. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  321. do { \
  322. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  323. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  324. } while (0)
  325. #define HTT_OPTION_TLV_TAG_GET(word) \
  326. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  327. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  328. do { \
  329. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  330. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  331. } while (0)
  332. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  333. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  334. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  335. do { \
  336. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  337. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  338. } while (0)
  339. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  340. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  341. /*--- format of specific HTT option TLVs ---*/
  342. /*
  343. * HTT option TLV for specifying LL bus address size
  344. * Some chips require bus addresses used by the target to access buffers
  345. * within the host's memory to be 32 bits; others require bus addresses
  346. * used by the target to access buffers within the host's memory to be
  347. * 64 bits.
  348. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  349. * a suffix to the VERSION_CONF message to specify which bus address format
  350. * the target requires.
  351. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  352. * default to providing bus addresses to the target in 32-bit format.
  353. */
  354. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  355. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  356. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  357. };
  358. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  359. struct htt_option_tlv_header_t hdr;
  360. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  361. } POSTPACK;
  362. /*
  363. * HTT option TLV for specifying whether HL systems should indicate
  364. * over-the-air tx completion for individual frames, or should instead
  365. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  366. * requests an OTA tx completion for a particular tx frame.
  367. * This option does not apply to LL systems, where the TX_COMPL_IND
  368. * is mandatory.
  369. * This option is primarily intended for HL systems in which the tx frame
  370. * downloads over the host --> target bus are as slow as or slower than
  371. * the transmissions over the WLAN PHY. For cases where the bus is faster
  372. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  373. * and consquently will send one TX_COMPL_IND message that covers several
  374. * tx frames. For cases where the WLAN PHY is faster than the bus,
  375. * the target will end up transmitting very short A-MPDUs, and consequently
  376. * sending many TX_COMPL_IND messages, which each cover a very small number
  377. * of tx frames.
  378. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  379. * a suffix to the VERSION_REQ message to request whether the host desires to
  380. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  381. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  382. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  383. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  384. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  385. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  386. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  387. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  388. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  389. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  390. * TLV.
  391. */
  392. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  393. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  394. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  395. };
  396. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  397. struct htt_option_tlv_header_t hdr;
  398. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  399. } POSTPACK;
  400. /*
  401. * HTT option TLV for specifying how many tx queue groups the target
  402. * may establish.
  403. * This TLV specifies the maximum value the target may send in the
  404. * txq_group_id field of any TXQ_GROUP information elements sent by
  405. * the target to the host. This allows the host to pre-allocate an
  406. * appropriate number of tx queue group structs.
  407. *
  408. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  409. * a suffix to the VERSION_REQ message to specify whether the host supports
  410. * tx queue groups at all, and if so if there is any limit on the number of
  411. * tx queue groups that the host supports.
  412. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  413. * a suffix to the VERSION_CONF message. If the host has specified in the
  414. * VER_REQ message a limit on the number of tx queue groups the host can
  415. * supprt, the target shall limit its specification of the maximum tx groups
  416. * to be no larger than this host-specified limit.
  417. *
  418. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  419. * shall preallocate 4 tx queue group structs, and the target shall not
  420. * specify a txq_group_id larger than 3.
  421. */
  422. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  423. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  424. /*
  425. * values 1 through N specify the max number of tx queue groups
  426. * the sender supports
  427. */
  428. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  429. };
  430. /* TEMPORARY backwards-compatibility alias for a typo fix -
  431. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  432. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  433. * to support the old name (with the typo) until all references to the
  434. * old name are replaced with the new name.
  435. */
  436. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  437. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  438. struct htt_option_tlv_header_t hdr;
  439. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  440. } POSTPACK;
  441. /*
  442. * HTT option TLV for specifying whether the target supports an extended
  443. * version of the HTT tx descriptor. If the target provides this TLV
  444. * and specifies in the TLV that the target supports an extended version
  445. * of the HTT tx descriptor, the target must check the "extension" bit in
  446. * the HTT tx descriptor, and if the extension bit is set, to expect a
  447. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  448. * descriptor. Furthermore, the target must provide room for the HTT
  449. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  450. * This option is intended for systems where the host needs to explicitly
  451. * control the transmission parameters such as tx power for individual
  452. * tx frames.
  453. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  454. * as a suffix to the VERSION_CONF message to explicitly specify whether
  455. * the target supports the HTT tx MSDU extension descriptor.
  456. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  457. * by the host as lack of target support for the HTT tx MSDU extension
  458. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  459. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  460. * the HTT tx MSDU extension descriptor.
  461. * The host is not required to provide the HTT tx MSDU extension descriptor
  462. * just because the target supports it; the target must check the
  463. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  464. * extension descriptor is present.
  465. */
  466. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  467. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  468. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  469. };
  470. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  471. struct htt_option_tlv_header_t hdr;
  472. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  473. } POSTPACK;
  474. /*=== host -> target messages ===============================================*/
  475. enum htt_h2t_msg_type {
  476. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  477. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  478. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  479. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  480. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  481. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  482. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  483. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  484. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  485. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  486. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  487. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  488. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  489. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  490. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  491. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  492. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  493. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  494. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  495. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  496. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  497. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  498. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  499. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  500. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  501. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  502. /* keep this last */
  503. HTT_H2T_NUM_MSGS
  504. };
  505. /*
  506. * HTT host to target message type -
  507. * stored in bits 7:0 of the first word of the message
  508. */
  509. #define HTT_H2T_MSG_TYPE_M 0xff
  510. #define HTT_H2T_MSG_TYPE_S 0
  511. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  512. do { \
  513. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  514. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  515. } while (0)
  516. #define HTT_H2T_MSG_TYPE_GET(word) \
  517. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  518. /**
  519. * @brief host -> target version number request message definition
  520. *
  521. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  522. *
  523. *
  524. * |31 24|23 16|15 8|7 0|
  525. * |----------------+----------------+----------------+----------------|
  526. * | reserved | msg type |
  527. * |-------------------------------------------------------------------|
  528. * : option request TLV (optional) |
  529. * :...................................................................:
  530. *
  531. * The VER_REQ message may consist of a single 4-byte word, or may be
  532. * extended with TLVs that specify which HTT options the host is requesting
  533. * from the target.
  534. * The following option TLVs may be appended to the VER_REQ message:
  535. * - HL_SUPPRESS_TX_COMPL_IND
  536. * - HL_MAX_TX_QUEUE_GROUPS
  537. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  538. * may be appended to the VER_REQ message (but only one TLV of each type).
  539. *
  540. * Header fields:
  541. * - MSG_TYPE
  542. * Bits 7:0
  543. * Purpose: identifies this as a version number request message
  544. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  545. */
  546. #define HTT_VER_REQ_BYTES 4
  547. /* TBDXXX: figure out a reasonable number */
  548. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  549. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  550. /**
  551. * @brief HTT tx MSDU descriptor
  552. *
  553. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  554. *
  555. * @details
  556. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  557. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  558. * the target firmware needs for the FW's tx processing, particularly
  559. * for creating the HW msdu descriptor.
  560. * The same HTT tx descriptor is used for HL and LL systems, though
  561. * a few fields within the tx descriptor are used only by LL or
  562. * only by HL.
  563. * The HTT tx descriptor is defined in two manners: by a struct with
  564. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  565. * definitions.
  566. * The target should use the struct def, for simplicitly and clarity,
  567. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  568. * neutral. Specifically, the host shall use the get/set macros built
  569. * around the mask + shift defs.
  570. */
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  572. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  573. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  574. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  575. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  576. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  577. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  578. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  579. #define HTT_TX_VDEV_ID_WORD 0
  580. #define HTT_TX_VDEV_ID_MASK 0x3f
  581. #define HTT_TX_VDEV_ID_SHIFT 16
  582. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  583. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  584. #define HTT_TX_MSDU_LEN_DWORD 1
  585. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  586. /*
  587. * HTT_VAR_PADDR macros
  588. * Allow physical / bus addresses to be either a single 32-bit value,
  589. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  590. */
  591. #define HTT_VAR_PADDR32(var_name) \
  592. A_UINT32 var_name
  593. #define HTT_VAR_PADDR64_LE(var_name) \
  594. struct { \
  595. /* little-endian: lo precedes hi */ \
  596. A_UINT32 lo; \
  597. A_UINT32 hi; \
  598. } var_name
  599. /*
  600. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  601. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  602. * addresses are stored in a XXX-bit field.
  603. * This macro is used to define both htt_tx_msdu_desc32_t and
  604. * htt_tx_msdu_desc64_t structs.
  605. */
  606. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  607. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  608. { \
  609. /* DWORD 0: flags and meta-data */ \
  610. A_UINT32 \
  611. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  612. \
  613. /* pkt_subtype - \
  614. * Detailed specification of the tx frame contents, extending the \
  615. * general specification provided by pkt_type. \
  616. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  617. * pkt_type | pkt_subtype \
  618. * ============================================================== \
  619. * 802.3 | bit 0:3 - Reserved \
  620. * | bit 4: 0x0 - Copy-Engine Classification Results \
  621. * | not appended to the HTT message \
  622. * | 0x1 - Copy-Engine Classification Results \
  623. * | appended to the HTT message in the \
  624. * | format: \
  625. * | [HTT tx desc, frame header, \
  626. * | CE classification results] \
  627. * | The CE classification results begin \
  628. * | at the next 4-byte boundary after \
  629. * | the frame header. \
  630. * ------------+------------------------------------------------- \
  631. * Eth2 | bit 0:3 - Reserved \
  632. * | bit 4: 0x0 - Copy-Engine Classification Results \
  633. * | not appended to the HTT message \
  634. * | 0x1 - Copy-Engine Classification Results \
  635. * | appended to the HTT message. \
  636. * | See the above specification of the \
  637. * | CE classification results location. \
  638. * ------------+------------------------------------------------- \
  639. * native WiFi | bit 0:3 - Reserved \
  640. * | bit 4: 0x0 - Copy-Engine Classification Results \
  641. * | not appended to the HTT message \
  642. * | 0x1 - Copy-Engine Classification Results \
  643. * | appended to the HTT message. \
  644. * | See the above specification of the \
  645. * | CE classification results location. \
  646. * ------------+------------------------------------------------- \
  647. * mgmt | 0x0 - 802.11 MAC header absent \
  648. * | 0x1 - 802.11 MAC header present \
  649. * ------------+------------------------------------------------- \
  650. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  651. * | 0x1 - 802.11 MAC header present \
  652. * | bit 1: 0x0 - allow aggregation \
  653. * | 0x1 - don't allow aggregation \
  654. * | bit 2: 0x0 - perform encryption \
  655. * | 0x1 - don't perform encryption \
  656. * | bit 3: 0x0 - perform tx classification / queuing \
  657. * | 0x1 - don't perform tx classification; \
  658. * | insert the frame into the "misc" \
  659. * | tx queue \
  660. * | bit 4: 0x0 - Copy-Engine Classification Results \
  661. * | not appended to the HTT message \
  662. * | 0x1 - Copy-Engine Classification Results \
  663. * | appended to the HTT message. \
  664. * | See the above specification of the \
  665. * | CE classification results location. \
  666. */ \
  667. pkt_subtype: 5, \
  668. \
  669. /* pkt_type - \
  670. * General specification of the tx frame contents. \
  671. * The htt_pkt_type enum should be used to specify and check the \
  672. * value of this field. \
  673. */ \
  674. pkt_type: 3, \
  675. \
  676. /* vdev_id - \
  677. * ID for the vdev that is sending this tx frame. \
  678. * For certain non-standard packet types, e.g. pkt_type == raw \
  679. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  680. * This field is used primarily for determining where to queue \
  681. * broadcast and multicast frames. \
  682. */ \
  683. vdev_id: 6, \
  684. /* ext_tid - \
  685. * The extended traffic ID. \
  686. * If the TID is unknown, the extended TID is set to \
  687. * HTT_TX_EXT_TID_INVALID. \
  688. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  689. * value of the QoS TID. \
  690. * If the tx frame is non-QoS data, then the extended TID is set to \
  691. * HTT_TX_EXT_TID_NON_QOS. \
  692. * If the tx frame is multicast or broadcast, then the extended TID \
  693. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  694. */ \
  695. ext_tid: 5, \
  696. \
  697. /* postponed - \
  698. * This flag indicates whether the tx frame has been downloaded to \
  699. * the target before but discarded by the target, and now is being \
  700. * downloaded again; or if this is a new frame that is being \
  701. * downloaded for the first time. \
  702. * This flag allows the target to determine the correct order for \
  703. * transmitting new vs. old frames. \
  704. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  705. * This flag only applies to HL systems, since in LL systems, \
  706. * the tx flow control is handled entirely within the target. \
  707. */ \
  708. postponed: 1, \
  709. \
  710. /* extension - \
  711. * This flag indicates whether a HTT tx MSDU extension descriptor \
  712. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  713. * \
  714. * 0x0 - no extension MSDU descriptor is present \
  715. * 0x1 - an extension MSDU descriptor immediately follows the \
  716. * regular MSDU descriptor \
  717. */ \
  718. extension: 1, \
  719. \
  720. /* cksum_offload - \
  721. * This flag indicates whether checksum offload is enabled or not \
  722. * for this frame. Target FW use this flag to turn on HW checksumming \
  723. * 0x0 - No checksum offload \
  724. * 0x1 - L3 header checksum only \
  725. * 0x2 - L4 checksum only \
  726. * 0x3 - L3 header checksum + L4 checksum \
  727. */ \
  728. cksum_offload: 2, \
  729. \
  730. /* tx_comp_req - \
  731. * This flag indicates whether Tx Completion \
  732. * from fw is required or not. \
  733. * This flag is only relevant if tx completion is not \
  734. * universally enabled. \
  735. * For all LL systems, tx completion is mandatory, \
  736. * so this flag will be irrelevant. \
  737. * For HL systems tx completion is optional, but HL systems in which \
  738. * the bus throughput exceeds the WLAN throughput will \
  739. * probably want to always use tx completion, and thus \
  740. * would not check this flag. \
  741. * This flag is required when tx completions are not used universally, \
  742. * but are still required for certain tx frames for which \
  743. * an OTA delivery acknowledgment is needed by the host. \
  744. * In practice, this would be for HL systems in which the \
  745. * bus throughput is less than the WLAN throughput. \
  746. * \
  747. * 0x0 - Tx Completion Indication from Fw not required \
  748. * 0x1 - Tx Completion Indication from Fw is required \
  749. */ \
  750. tx_compl_req: 1; \
  751. \
  752. \
  753. /* DWORD 1: MSDU length and ID */ \
  754. A_UINT32 \
  755. len: 16, /* MSDU length, in bytes */ \
  756. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  757. * and this id is used to calculate fragmentation \
  758. * descriptor pointer inside the target based on \
  759. * the base address, configured inside the target. \
  760. */ \
  761. \
  762. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  763. /* frags_desc_ptr - \
  764. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  765. * where the tx frame's fragments reside in memory. \
  766. * This field only applies to LL systems, since in HL systems the \
  767. * (degenerate single-fragment) fragmentation descriptor is created \
  768. * within the target. \
  769. */ \
  770. _paddr__frags_desc_ptr_; \
  771. \
  772. /* DWORD 3 (or 4): peerid, chanfreq */ \
  773. /* \
  774. * Peer ID : Target can use this value to know which peer-id packet \
  775. * destined to. \
  776. * It's intended to be specified by host in case of NAWDS. \
  777. */ \
  778. A_UINT16 peerid; \
  779. \
  780. /* \
  781. * Channel frequency: This identifies the desired channel \
  782. * frequency (in mhz) for tx frames. This is used by FW to help \
  783. * determine when it is safe to transmit or drop frames for \
  784. * off-channel operation. \
  785. * The default value of zero indicates to FW that the corresponding \
  786. * VDEV's home channel (if there is one) is the desired channel \
  787. * frequency. \
  788. */ \
  789. A_UINT16 chanfreq; \
  790. \
  791. /* Reason reserved is commented is increasing the htt structure size \
  792. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  793. * A_UINT32 reserved_dword3_bits0_31; \
  794. */ \
  795. } POSTPACK
  796. /* define a htt_tx_msdu_desc32_t type */
  797. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  798. /* define a htt_tx_msdu_desc64_t type */
  799. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  800. /*
  801. * Make htt_tx_msdu_desc_t be an alias for either
  802. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  803. */
  804. #if HTT_PADDR64
  805. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  806. #else
  807. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  808. #endif
  809. /* decriptor information for Management frame*/
  810. /*
  811. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  812. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  813. */
  814. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  815. extern A_UINT32 mgmt_hdr_len;
  816. PREPACK struct htt_mgmt_tx_desc_t {
  817. A_UINT32 msg_type;
  818. #if HTT_PADDR64
  819. A_UINT64 frag_paddr; /* DMAble address of the data */
  820. #else
  821. A_UINT32 frag_paddr; /* DMAble address of the data */
  822. #endif
  823. A_UINT32 desc_id; /* returned to host during completion
  824. * to free the meory*/
  825. A_UINT32 len; /* Fragment length */
  826. A_UINT32 vdev_id; /* virtual device ID*/
  827. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  828. } POSTPACK;
  829. PREPACK struct htt_mgmt_tx_compl_ind {
  830. A_UINT32 desc_id;
  831. A_UINT32 status;
  832. } POSTPACK;
  833. /*
  834. * This SDU header size comes from the summation of the following:
  835. * 1. Max of:
  836. * a. Native WiFi header, for native WiFi frames: 24 bytes
  837. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  838. * b. 802.11 header, for raw frames: 36 bytes
  839. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  840. * QoS header, HT header)
  841. * c. 802.3 header, for ethernet frames: 14 bytes
  842. * (destination address, source address, ethertype / length)
  843. * 2. Max of:
  844. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  845. * b. IPv6 header, up through the Traffic Class: 2 bytes
  846. * 3. 802.1Q VLAN header: 4 bytes
  847. * 4. LLC/SNAP header: 8 bytes
  848. */
  849. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  850. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  851. #define HTT_TX_HDR_SIZE_ETHERNET 14
  852. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  853. A_COMPILE_TIME_ASSERT(
  854. htt_encap_hdr_size_max_check_nwifi,
  855. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  856. A_COMPILE_TIME_ASSERT(
  857. htt_encap_hdr_size_max_check_enet,
  858. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  859. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  860. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  861. #define HTT_TX_HDR_SIZE_802_1Q 4
  862. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  863. #define HTT_COMMON_TX_FRM_HDR_LEN \
  864. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  865. HTT_TX_HDR_SIZE_802_1Q + \
  866. HTT_TX_HDR_SIZE_LLC_SNAP)
  867. #define HTT_HL_TX_FRM_HDR_LEN \
  868. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  869. #define HTT_LL_TX_FRM_HDR_LEN \
  870. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  871. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  872. /* dword 0 */
  873. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  876. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  877. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  880. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  881. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  882. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  884. #define HTT_TX_DESC_PKT_TYPE_S 13
  885. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  886. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  887. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  888. #define HTT_TX_DESC_VDEV_ID_S 16
  889. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  890. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  892. #define HTT_TX_DESC_EXT_TID_S 22
  893. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  894. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  895. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  896. #define HTT_TX_DESC_POSTPONED_S 27
  897. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  898. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  899. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  900. #define HTT_TX_DESC_EXTENSION_S 28
  901. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  902. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  903. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  904. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  905. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  906. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  907. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  908. #define HTT_TX_DESC_TX_COMP_S 31
  909. /* dword 1 */
  910. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  911. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  912. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  913. #define HTT_TX_DESC_FRM_LEN_S 0
  914. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  915. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  916. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  917. #define HTT_TX_DESC_FRM_ID_S 16
  918. /* dword 2 */
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  921. /* for systems using 64-bit format for bus addresses */
  922. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  923. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  925. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  926. /* for systems using 32-bit format for bus addresses */
  927. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  928. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  929. /* dword 3 */
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  932. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  933. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  934. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  935. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  936. #if HTT_PADDR64
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  938. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  939. #else
  940. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  941. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  942. #endif
  943. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  944. #define HTT_TX_DESC_PEER_ID_S 0
  945. /*
  946. * TEMPORARY:
  947. * The original definitions for the PEER_ID fields contained typos
  948. * (with _DESC_PADDR appended to this PEER_ID field name).
  949. * Retain deprecated original names for PEER_ID fields until all code that
  950. * refers to them has been updated.
  951. */
  952. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  953. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  954. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  955. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  956. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  957. HTT_TX_DESC_PEER_ID_M
  958. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  959. HTT_TX_DESC_PEER_ID_S
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  962. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  963. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  964. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  965. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  966. #if HTT_PADDR64
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  968. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  969. #else
  970. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  971. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  972. #endif
  973. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  974. #define HTT_TX_DESC_CHAN_FREQ_S 16
  975. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  976. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  977. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  983. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  984. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  990. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  991. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  997. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  998. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1005. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1012. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1019. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1026. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1033. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1037. } while (0)
  1038. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1039. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1040. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1041. do { \
  1042. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1043. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1044. } while (0)
  1045. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1046. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1047. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1048. do { \
  1049. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1050. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1051. } while (0)
  1052. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1053. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1054. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1055. do { \
  1056. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1057. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1058. } while (0)
  1059. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1060. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1061. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1062. do { \
  1063. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1064. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1065. } while (0)
  1066. /* enums used in the HTT tx MSDU extension descriptor */
  1067. enum {
  1068. htt_tx_guard_interval_regular = 0,
  1069. htt_tx_guard_interval_short = 1,
  1070. };
  1071. enum {
  1072. htt_tx_preamble_type_ofdm = 0,
  1073. htt_tx_preamble_type_cck = 1,
  1074. htt_tx_preamble_type_ht = 2,
  1075. htt_tx_preamble_type_vht = 3,
  1076. };
  1077. enum {
  1078. htt_tx_bandwidth_5MHz = 0,
  1079. htt_tx_bandwidth_10MHz = 1,
  1080. htt_tx_bandwidth_20MHz = 2,
  1081. htt_tx_bandwidth_40MHz = 3,
  1082. htt_tx_bandwidth_80MHz = 4,
  1083. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1084. };
  1085. /**
  1086. * @brief HTT tx MSDU extension descriptor
  1087. * @details
  1088. * If the target supports HTT tx MSDU extension descriptors, the host has
  1089. * the option of appending the following struct following the regular
  1090. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1091. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1092. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1093. * tx specs for each frame.
  1094. */
  1095. PREPACK struct htt_tx_msdu_desc_ext_t {
  1096. /* DWORD 0: flags */
  1097. A_UINT32
  1098. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1099. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1100. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1101. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1102. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1103. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1104. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1105. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1106. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1107. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1108. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1109. /* DWORD 1: tx power, tx rate, tx BW */
  1110. A_UINT32
  1111. /* pwr -
  1112. * Specify what power the tx frame needs to be transmitted at.
  1113. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1114. * The value needs to be appropriately sign-extended when extracting
  1115. * the value from the message and storing it in a variable that is
  1116. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1117. * automatically handles this sign-extension.)
  1118. * If the transmission uses multiple tx chains, this power spec is
  1119. * the total transmit power, assuming incoherent combination of
  1120. * per-chain power to produce the total power.
  1121. */
  1122. pwr: 8,
  1123. /* mcs_mask -
  1124. * Specify the allowable values for MCS index (modulation and coding)
  1125. * to use for transmitting the frame.
  1126. *
  1127. * For HT / VHT preamble types, this mask directly corresponds to
  1128. * the HT or VHT MCS indices that are allowed. For each bit N set
  1129. * within the mask, MCS index N is allowed for transmitting the frame.
  1130. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1131. * rates versus OFDM rates, so the host has the option of specifying
  1132. * that the target must transmit the frame with CCK or OFDM rates
  1133. * (not HT or VHT), but leaving the decision to the target whether
  1134. * to use CCK or OFDM.
  1135. *
  1136. * For CCK and OFDM, the bits within this mask are interpreted as
  1137. * follows:
  1138. * bit 0 -> CCK 1 Mbps rate is allowed
  1139. * bit 1 -> CCK 2 Mbps rate is allowed
  1140. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1141. * bit 3 -> CCK 11 Mbps rate is allowed
  1142. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1143. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1144. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1145. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1146. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1147. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1148. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1149. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1150. *
  1151. * The MCS index specification needs to be compatible with the
  1152. * bandwidth mask specification. For example, a MCS index == 9
  1153. * specification is inconsistent with a preamble type == VHT,
  1154. * Nss == 1, and channel bandwidth == 20 MHz.
  1155. *
  1156. * Furthermore, the host has only a limited ability to specify to
  1157. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1158. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1159. */
  1160. mcs_mask: 12,
  1161. /* nss_mask -
  1162. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1163. * Each bit in this mask corresponds to a Nss value:
  1164. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1165. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1166. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1167. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1168. * The values in the Nss mask must be suitable for the recipient, e.g.
  1169. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1170. * recipient which only supports 2x2 MIMO.
  1171. */
  1172. nss_mask: 4,
  1173. /* guard_interval -
  1174. * Specify a htt_tx_guard_interval enum value to indicate whether
  1175. * the transmission should use a regular guard interval or a
  1176. * short guard interval.
  1177. */
  1178. guard_interval: 1,
  1179. /* preamble_type_mask -
  1180. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1181. * may choose from for transmitting this frame.
  1182. * The bits in this mask correspond to the values in the
  1183. * htt_tx_preamble_type enum. For example, to allow the target
  1184. * to transmit the frame as either CCK or OFDM, this field would
  1185. * be set to
  1186. * (1 << htt_tx_preamble_type_ofdm) |
  1187. * (1 << htt_tx_preamble_type_cck)
  1188. */
  1189. preamble_type_mask: 4,
  1190. reserved1_31_29: 3; /* unused, set to 0x0 */
  1191. /* DWORD 2: tx chain mask, tx retries */
  1192. A_UINT32
  1193. /* chain_mask - specify which chains to transmit from */
  1194. chain_mask: 4,
  1195. /* retry_limit -
  1196. * Specify the maximum number of transmissions, including the
  1197. * initial transmission, to attempt before giving up if no ack
  1198. * is received.
  1199. * If the tx rate is specified, then all retries shall use the
  1200. * same rate as the initial transmission.
  1201. * If no tx rate is specified, the target can choose whether to
  1202. * retain the original rate during the retransmissions, or to
  1203. * fall back to a more robust rate.
  1204. */
  1205. retry_limit: 4,
  1206. /* bandwidth_mask -
  1207. * Specify what channel widths may be used for the transmission.
  1208. * A value of zero indicates "don't care" - the target may choose
  1209. * the transmission bandwidth.
  1210. * The bits within this mask correspond to the htt_tx_bandwidth
  1211. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1212. * The bandwidth_mask must be consistent with the preamble_type_mask
  1213. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1214. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1215. */
  1216. bandwidth_mask: 6,
  1217. reserved2_31_14: 18; /* unused, set to 0x0 */
  1218. /* DWORD 3: tx expiry time (TSF) LSBs */
  1219. A_UINT32 expire_tsf_lo;
  1220. /* DWORD 4: tx expiry time (TSF) MSBs */
  1221. A_UINT32 expire_tsf_hi;
  1222. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1223. } POSTPACK;
  1224. /* DWORD 0 */
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1245. /* DWORD 1 */
  1246. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1247. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1248. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1249. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1250. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1251. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1252. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1253. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1254. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1255. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1256. /* DWORD 2 */
  1257. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1258. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1259. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1260. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1261. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1262. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1263. /* DWORD 0 */
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL( \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1287. ((_var) |= ((_val) \
  1288. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL( \
  1296. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1297. ((_var) |= ((_val) \
  1298. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1299. } while (0)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1301. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1307. } while (0)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1309. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1310. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1315. } while (0)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1317. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1318. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1323. } while (0)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1325. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1326. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1327. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1331. } while (0)
  1332. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1333. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1334. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1335. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1339. } while (0)
  1340. /* DWORD 1 */
  1341. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1345. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1346. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1347. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1348. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1349. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1350. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1357. } while (0)
  1358. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1365. } while (0)
  1366. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1367. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1368. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1369. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1373. } while (0)
  1374. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1375. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1376. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1377. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1378. do { \
  1379. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1380. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1381. } while (0)
  1382. /* DWORD 2 */
  1383. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1384. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1385. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1386. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1390. } while (0)
  1391. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1392. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1393. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1394. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1395. do { \
  1396. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1397. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1398. } while (0)
  1399. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1400. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1401. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1402. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1403. do { \
  1404. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1405. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1406. } while (0)
  1407. typedef enum {
  1408. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1409. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1410. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1411. } htt_11ax_ltf_subtype_t;
  1412. typedef enum {
  1413. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1414. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1415. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1416. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1417. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1418. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1419. } htt_tx_ext2_preamble_type_t;
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1431. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1432. /**
  1433. * @brief HTT tx MSDU extension descriptor v2
  1434. * @details
  1435. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1436. * is received as tcl_exit_base->host_meta_info in firmware.
  1437. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1438. * are already part of tcl_exit_base.
  1439. */
  1440. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1441. /* DWORD 0: flags */
  1442. A_UINT32
  1443. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1444. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1445. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1446. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1447. valid_retries : 1, /* if set, tx retries spec is valid */
  1448. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1449. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1450. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1451. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1452. valid_key_flags : 1, /* if set, key flags is valid */
  1453. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1454. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1455. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1456. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1457. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1458. 1 = ENCRYPT,
  1459. 2 ~ 3 - Reserved */
  1460. /* retry_limit -
  1461. * Specify the maximum number of transmissions, including the
  1462. * initial transmission, to attempt before giving up if no ack
  1463. * is received.
  1464. * If the tx rate is specified, then all retries shall use the
  1465. * same rate as the initial transmission.
  1466. * If no tx rate is specified, the target can choose whether to
  1467. * retain the original rate during the retransmissions, or to
  1468. * fall back to a more robust rate.
  1469. */
  1470. retry_limit : 4,
  1471. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1472. * Valid only for 11ax preamble types HE_SU
  1473. * and HE_EXT_SU
  1474. */
  1475. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1476. * Valid only for 11ax preamble types HE_SU
  1477. * and HE_EXT_SU
  1478. */
  1479. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1480. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1481. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1482. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1483. */
  1484. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1485. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1486. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1487. * Use cases:
  1488. * Any time firmware uses TQM-BYPASS for Data
  1489. * TID, firmware expect host to set this bit.
  1490. */
  1491. /* DWORD 1: tx power, tx rate */
  1492. A_UINT32
  1493. power : 8, /* unit of the power field is 0.5 dbm
  1494. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1495. * signed value ranging from -64dbm to 63.5 dbm
  1496. */
  1497. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1498. * Setting more than one MCS isn't currently
  1499. * supported by the target (but is supported
  1500. * in the interface in case in the future
  1501. * the target supports specifications of
  1502. * a limited set of MCS values.
  1503. */
  1504. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1505. * Setting more than one Nss isn't currently
  1506. * supported by the target (but is supported
  1507. * in the interface in case in the future
  1508. * the target supports specifications of
  1509. * a limited set of Nss values.
  1510. */
  1511. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1512. update_peer_cache : 1; /* When set these custom values will be
  1513. * used for all packets, until the next
  1514. * update via this ext header.
  1515. * This is to make sure not all packets
  1516. * need to include this header.
  1517. */
  1518. /* DWORD 2: tx chain mask, tx retries */
  1519. A_UINT32
  1520. /* chain_mask - specify which chains to transmit from */
  1521. chain_mask : 8,
  1522. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1523. * TODO: Update Enum values for key_flags
  1524. */
  1525. /*
  1526. * Channel frequency: This identifies the desired channel
  1527. * frequency (in MHz) for tx frames. This is used by FW to help
  1528. * determine when it is safe to transmit or drop frames for
  1529. * off-channel operation.
  1530. * The default value of zero indicates to FW that the corresponding
  1531. * VDEV's home channel (if there is one) is the desired channel
  1532. * frequency.
  1533. */
  1534. chanfreq : 16;
  1535. /* DWORD 3: tx expiry time (TSF) LSBs */
  1536. A_UINT32 expire_tsf_lo;
  1537. /* DWORD 4: tx expiry time (TSF) MSBs */
  1538. A_UINT32 expire_tsf_hi;
  1539. /* DWORD 5: flags to control routing / processing of the MSDU */
  1540. A_UINT32
  1541. /* learning_frame
  1542. * When this flag is set, this frame will be dropped by FW
  1543. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1544. */
  1545. learning_frame : 1,
  1546. /* send_as_standalone
  1547. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1548. * i.e. with no A-MSDU or A-MPDU aggregation.
  1549. * The scope is extended to other use-cases.
  1550. */
  1551. send_as_standalone : 1,
  1552. /* is_host_opaque_valid
  1553. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1554. * with valid information.
  1555. */
  1556. is_host_opaque_valid : 1,
  1557. rsvd0 : 29;
  1558. /* DWORD 6 : Host opaque cookie for special frames */
  1559. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1560. rsvd1 : 16;
  1561. /*
  1562. * This structure can be expanded further up to 40 bytes
  1563. * by adding further DWORDs as needed.
  1564. */
  1565. } POSTPACK;
  1566. /* DWORD 0 */
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1593. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1594. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1595. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1596. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1597. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1598. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1599. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1600. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1601. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1602. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1603. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1604. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1607. /* DWORD 1 */
  1608. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1609. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1610. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1611. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1612. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1613. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1614. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1615. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1616. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1617. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1618. /* DWORD 2 */
  1619. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1620. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1621. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1622. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1623. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1624. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1625. /* DWORD 5 */
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1632. /* DWORD 6 */
  1633. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1634. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1635. /* DWORD 0 */
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1638. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL( \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1667. ((_var) |= ((_val) \
  1668. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1672. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1680. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1681. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL( \
  1692. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1693. ((_var) |= ((_val) \
  1694. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1698. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1706. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1707. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1735. } while (0)
  1736. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1737. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1738. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1739. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1740. do { \
  1741. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1742. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1743. } while (0)
  1744. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1759. } while (0)
  1760. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1766. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1767. } while (0)
  1768. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1769. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1770. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1771. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1774. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1775. } while (0)
  1776. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1777. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1778. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1779. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1780. do { \
  1781. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1782. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1783. } while (0)
  1784. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1785. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1786. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1787. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1788. do { \
  1789. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1790. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1791. } while (0)
  1792. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1793. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1794. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1795. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1796. do { \
  1797. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1798. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1799. } while (0)
  1800. /* DWORD 1 */
  1801. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1802. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1803. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1804. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1805. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1806. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1807. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1808. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1809. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1810. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1817. } while (0)
  1818. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1825. } while (0)
  1826. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1827. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1828. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1829. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1833. } while (0)
  1834. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1835. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1836. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1837. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1838. do { \
  1839. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1840. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1841. } while (0)
  1842. /* DWORD 2 */
  1843. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1844. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1845. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1846. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1849. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1850. } while (0)
  1851. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1852. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1853. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1854. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1857. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1858. } while (0)
  1859. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1860. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1861. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1862. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1865. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1866. } while (0)
  1867. /* DWORD 5 */
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1869. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1870. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1875. } while (0)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1877. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1882. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1883. } while (0)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1885. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1886. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1890. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1891. } while (0)
  1892. /* DWORD 6 */
  1893. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1900. } while (0)
  1901. typedef enum {
  1902. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1903. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1904. } htt_tcl_metadata_type;
  1905. /**
  1906. * @brief HTT TCL command number format
  1907. * @details
  1908. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1909. * available to firmware as tcl_exit_base->tcl_status_number.
  1910. * For regular / multicast packets host will send vdev and mac id and for
  1911. * NAWDS packets, host will send peer id.
  1912. * A_UINT32 is used to avoid endianness conversion problems.
  1913. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1914. */
  1915. typedef struct {
  1916. A_UINT32
  1917. type: 1, /* vdev_id based or peer_id based */
  1918. rsvd: 31;
  1919. } htt_tx_tcl_vdev_or_peer_t;
  1920. typedef struct {
  1921. A_UINT32
  1922. type: 1, /* vdev_id based or peer_id based */
  1923. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1924. vdev_id: 8,
  1925. pdev_id: 2,
  1926. host_inspected:1,
  1927. rsvd: 19;
  1928. } htt_tx_tcl_vdev_metadata;
  1929. typedef struct {
  1930. A_UINT32
  1931. type: 1, /* vdev_id based or peer_id based */
  1932. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1933. peer_id: 14,
  1934. rsvd: 16;
  1935. } htt_tx_tcl_peer_metadata;
  1936. PREPACK struct htt_tx_tcl_metadata {
  1937. union {
  1938. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1939. htt_tx_tcl_vdev_metadata vdev_meta;
  1940. htt_tx_tcl_peer_metadata peer_meta;
  1941. };
  1942. } POSTPACK;
  1943. /* DWORD 0 */
  1944. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1945. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1946. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1947. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1948. /* VDEV metadata */
  1949. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1950. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1951. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1952. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1953. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1954. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1955. /* PEER metadata */
  1956. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1957. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1958. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1959. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1960. HTT_TX_TCL_METADATA_TYPE_S)
  1961. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1965. } while (0)
  1966. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1967. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1968. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1969. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1973. } while (0)
  1974. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1975. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1976. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1977. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1981. } while (0)
  1982. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1983. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1984. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1985. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1989. } while (0)
  1990. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1991. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1992. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1993. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1997. } while (0)
  1998. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1999. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2000. HTT_TX_TCL_METADATA_PEER_ID_S)
  2001. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2005. } while (0)
  2006. typedef enum {
  2007. HTT_TX_FW2WBM_TX_STATUS_OK,
  2008. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2009. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2010. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2011. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2012. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2013. HTT_TX_FW2WBM_TX_STATUS_MAX
  2014. } htt_tx_fw2wbm_tx_status_t;
  2015. typedef enum {
  2016. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2017. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2018. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2019. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2020. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2021. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2022. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2023. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2024. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2025. } htt_tx_fw2wbm_reinject_reason_t;
  2026. /**
  2027. * @brief HTT TX WBM Completion from firmware to host
  2028. * @details
  2029. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2030. * DWORD 3 and 4 for software based completions (Exception frames and
  2031. * TQM bypass frames)
  2032. * For software based completions, wbm_release_ring->release_source_module will
  2033. * be set to release_source_fw
  2034. */
  2035. PREPACK struct htt_tx_wbm_completion {
  2036. A_UINT32
  2037. sch_cmd_id: 24,
  2038. exception_frame: 1, /* If set, this packet was queued via exception path */
  2039. rsvd0_31_25: 7;
  2040. A_UINT32
  2041. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2042. * reception of an ACK or BA, this field indicates
  2043. * the RSSI of the received ACK or BA frame.
  2044. * When the frame is removed as result of a direct
  2045. * remove command from the SW, this field is set
  2046. * to 0x0 (which is never a valid value when real
  2047. * RSSI is available).
  2048. * Units: dB w.r.t noise floor
  2049. */
  2050. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2051. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2052. rsvd1_31_16: 16;
  2053. } POSTPACK;
  2054. /* DWORD 0 */
  2055. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2056. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2057. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2058. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2059. /* DWORD 1 */
  2060. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2061. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2062. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2063. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2064. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2065. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2066. /* DWORD 0 */
  2067. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2068. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2069. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2070. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2074. } while (0)
  2075. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2076. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2077. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2078. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2082. } while (0)
  2083. /* DWORD 1 */
  2084. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2086. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2087. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2091. } while (0)
  2092. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2093. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2094. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2095. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2099. } while (0)
  2100. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2101. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2102. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2103. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2106. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2107. } while (0)
  2108. /**
  2109. * @brief HTT TX WBM Completion from firmware to host
  2110. * @details
  2111. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2112. * (WBM) offload HW.
  2113. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2114. * For software based completions, release_source_module will
  2115. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2116. * struct wbm_release_ring and then switch to this after looking at
  2117. * release_source_module.
  2118. */
  2119. PREPACK struct htt_tx_wbm_completion_v2 {
  2120. A_UINT32
  2121. used_by_hw0; /* Refer to struct wbm_release_ring */
  2122. A_UINT32
  2123. used_by_hw1; /* Refer to struct wbm_release_ring */
  2124. A_UINT32
  2125. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2126. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2127. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2128. exception_frame: 1,
  2129. rsvd0: 12, /* For future use */
  2130. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2131. rsvd1: 1; /* For future use */
  2132. A_UINT32
  2133. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2134. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2135. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2136. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2137. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2138. */
  2139. A_UINT32
  2140. data1: 32;
  2141. A_UINT32
  2142. data2: 32;
  2143. A_UINT32
  2144. used_by_hw3; /* Refer to struct wbm_release_ring */
  2145. } POSTPACK;
  2146. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2147. /* DWORD 3 */
  2148. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2149. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2150. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2151. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2152. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2153. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2154. /* DWORD 3 */
  2155. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2156. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2157. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2158. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2162. } while (0)
  2163. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2164. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2165. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2166. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2170. } while (0)
  2171. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2172. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2173. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2174. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2178. } while (0)
  2179. /**
  2180. * @brief HTT TX WBM transmit status from firmware to host
  2181. * @details
  2182. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2183. * (WBM) offload HW.
  2184. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2185. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2186. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2187. */
  2188. PREPACK struct htt_tx_wbm_transmit_status {
  2189. A_UINT32
  2190. sch_cmd_id: 24,
  2191. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2192. * reception of an ACK or BA, this field indicates
  2193. * the RSSI of the received ACK or BA frame.
  2194. * When the frame is removed as result of a direct
  2195. * remove command from the SW, this field is set
  2196. * to 0x0 (which is never a valid value when real
  2197. * RSSI is available).
  2198. * Units: dB w.r.t noise floor
  2199. */
  2200. A_UINT32
  2201. sw_peer_id: 16,
  2202. tid_num: 5,
  2203. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2204. * and tid_num fields contain valid data.
  2205. * If this "valid" flag is not set, the
  2206. * sw_peer_id and tid_num fields must be ignored.
  2207. */
  2208. mcast: 1,
  2209. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2210. * contains valid data.
  2211. */
  2212. reserved0: 8;
  2213. A_UINT32
  2214. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2215. * packets in the wbm completion path
  2216. */
  2217. } POSTPACK;
  2218. /* DWORD 4 */
  2219. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2220. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2221. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2222. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2223. /* DWORD 5 */
  2224. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2225. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2226. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2227. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2228. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2229. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2230. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2231. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2232. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2233. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2234. /* DWORD 4 */
  2235. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2236. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2237. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2238. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2242. } while (0)
  2243. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2244. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2245. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2246. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2250. } while (0)
  2251. /* DWORD 5 */
  2252. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2253. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2254. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2255. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2258. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2259. } while (0)
  2260. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2261. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2262. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2263. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2267. } while (0)
  2268. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2275. } while (0)
  2276. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2278. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2279. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2283. } while (0)
  2284. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2285. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2286. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2287. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2291. } while (0)
  2292. /**
  2293. * @brief HTT TX WBM reinject status from firmware to host
  2294. * @details
  2295. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2296. * (WBM) offload HW.
  2297. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2298. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2299. */
  2300. PREPACK struct htt_tx_wbm_reinject_status {
  2301. A_UINT32
  2302. reserved0: 32;
  2303. A_UINT32
  2304. reserved1: 32;
  2305. A_UINT32
  2306. reserved2: 32;
  2307. } POSTPACK;
  2308. /**
  2309. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2310. * @details
  2311. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2312. * (WBM) offload HW.
  2313. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2314. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2315. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2316. * STA side.
  2317. */
  2318. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2319. A_UINT32
  2320. mec_sa_addr_31_0;
  2321. A_UINT32
  2322. mec_sa_addr_47_32: 16,
  2323. sa_ast_index: 16;
  2324. A_UINT32
  2325. vdev_id: 8,
  2326. reserved0: 24;
  2327. } POSTPACK;
  2328. /* DWORD 4 - mec_sa_addr_31_0 */
  2329. /* DWORD 5 */
  2330. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2331. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2332. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2333. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2334. /* DWORD 6 */
  2335. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2336. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2337. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2338. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2339. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2340. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2343. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2344. } while (0)
  2345. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2346. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2347. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2348. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2352. } while (0)
  2353. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2354. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2355. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2356. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2360. } while (0)
  2361. typedef enum {
  2362. TX_FLOW_PRIORITY_BE,
  2363. TX_FLOW_PRIORITY_HIGH,
  2364. TX_FLOW_PRIORITY_LOW,
  2365. } htt_tx_flow_priority_t;
  2366. typedef enum {
  2367. TX_FLOW_LATENCY_SENSITIVE,
  2368. TX_FLOW_LATENCY_INSENSITIVE,
  2369. } htt_tx_flow_latency_t;
  2370. typedef enum {
  2371. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2372. TX_FLOW_INTERACTIVE_TRAFFIC,
  2373. TX_FLOW_PERIODIC_TRAFFIC,
  2374. TX_FLOW_BURSTY_TRAFFIC,
  2375. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2376. } htt_tx_flow_traffic_pattern_t;
  2377. /**
  2378. * @brief HTT TX Flow search metadata format
  2379. * @details
  2380. * Host will set this metadata in flow table's flow search entry along with
  2381. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2382. * firmware and TQM ring if the flow search entry wins.
  2383. * This metadata is available to firmware in that first MSDU's
  2384. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2385. * to one of the available flows for specific tid and returns the tqm flow
  2386. * pointer as part of htt_tx_map_flow_info message.
  2387. */
  2388. PREPACK struct htt_tx_flow_metadata {
  2389. A_UINT32
  2390. rsvd0_1_0: 2,
  2391. tid: 4,
  2392. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2393. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2394. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2395. * Else choose final tid based on latency, priority.
  2396. */
  2397. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2398. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2399. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2400. } POSTPACK;
  2401. /* DWORD 0 */
  2402. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2403. #define HTT_TX_FLOW_METADATA_TID_S 2
  2404. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2405. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2406. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2407. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2408. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2409. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2410. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2411. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2412. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2413. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2414. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2415. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2416. /* DWORD 0 */
  2417. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2418. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2419. HTT_TX_FLOW_METADATA_TID_S)
  2420. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2424. } while (0)
  2425. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2426. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2427. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2428. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2432. } while (0)
  2433. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2434. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2435. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2436. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2440. } while (0)
  2441. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2442. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2443. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2444. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2448. } while (0)
  2449. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2450. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2451. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2452. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2456. } while (0)
  2457. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2458. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2459. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2460. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2464. } while (0)
  2465. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2466. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2467. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2468. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2471. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2472. } while (0)
  2473. /**
  2474. * @brief host -> target ADD WDS Entry
  2475. *
  2476. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2477. *
  2478. * @brief host -> target DELETE WDS Entry
  2479. *
  2480. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2481. *
  2482. * @details
  2483. * HTT wds entry from source port learning
  2484. * Host will learn wds entries from rx and send this message to firmware
  2485. * to enable firmware to configure/delete AST entries for wds clients.
  2486. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2487. * and when SA's entry is deleted, firmware removes this AST entry
  2488. *
  2489. * The message would appear as follows:
  2490. *
  2491. * |31 30|29 |17 16|15 8|7 0|
  2492. * |----------------+----------------+----------------+----------------|
  2493. * | rsvd0 |PDVID| vdev_id | msg_type |
  2494. * |-------------------------------------------------------------------|
  2495. * | sa_addr_31_0 |
  2496. * |-------------------------------------------------------------------|
  2497. * | | ta_peer_id | sa_addr_47_32 |
  2498. * |-------------------------------------------------------------------|
  2499. * Where PDVID = pdev_id
  2500. *
  2501. * The message is interpreted as follows:
  2502. *
  2503. * dword0 - b'0:7 - msg_type: This will be set to
  2504. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2505. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2506. *
  2507. * dword0 - b'8:15 - vdev_id
  2508. *
  2509. * dword0 - b'16:17 - pdev_id
  2510. *
  2511. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2512. *
  2513. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2514. *
  2515. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2516. *
  2517. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2518. */
  2519. PREPACK struct htt_wds_entry {
  2520. A_UINT32
  2521. msg_type: 8,
  2522. vdev_id: 8,
  2523. pdev_id: 2,
  2524. rsvd0: 14;
  2525. A_UINT32 sa_addr_31_0;
  2526. A_UINT32
  2527. sa_addr_47_32: 16,
  2528. ta_peer_id: 14,
  2529. rsvd2: 2;
  2530. } POSTPACK;
  2531. /* DWORD 0 */
  2532. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2533. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2534. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2535. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2536. /* DWORD 2 */
  2537. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2538. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2539. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2540. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2541. /* DWORD 0 */
  2542. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2543. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2544. HTT_WDS_ENTRY_VDEV_ID_S)
  2545. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2548. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2549. } while (0)
  2550. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2551. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2552. HTT_WDS_ENTRY_PDEV_ID_S)
  2553. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2556. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2557. } while (0)
  2558. /* DWORD 2 */
  2559. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2560. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2561. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2562. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2563. do { \
  2564. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2565. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2566. } while (0)
  2567. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2568. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2569. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2570. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2571. do { \
  2572. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2573. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2574. } while (0)
  2575. /**
  2576. * @brief MAC DMA rx ring setup specification
  2577. *
  2578. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2579. *
  2580. * @details
  2581. * To allow for dynamic rx ring reconfiguration and to avoid race
  2582. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2583. * it uses. Instead, it sends this message to the target, indicating how
  2584. * the rx ring used by the host should be set up and maintained.
  2585. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2586. * specifications.
  2587. *
  2588. * |31 16|15 8|7 0|
  2589. * |---------------------------------------------------------------|
  2590. * header: | reserved | num rings | msg type |
  2591. * |---------------------------------------------------------------|
  2592. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2593. #if HTT_PADDR64
  2594. * | FW_IDX shadow register physical address (bits 63:32) |
  2595. #endif
  2596. * |---------------------------------------------------------------|
  2597. * | rx ring base physical address (bits 31:0) |
  2598. #if HTT_PADDR64
  2599. * | rx ring base physical address (bits 63:32) |
  2600. #endif
  2601. * |---------------------------------------------------------------|
  2602. * | rx ring buffer size | rx ring length |
  2603. * |---------------------------------------------------------------|
  2604. * | FW_IDX initial value | enabled flags |
  2605. * |---------------------------------------------------------------|
  2606. * | MSDU payload offset | 802.11 header offset |
  2607. * |---------------------------------------------------------------|
  2608. * | PPDU end offset | PPDU start offset |
  2609. * |---------------------------------------------------------------|
  2610. * | MPDU end offset | MPDU start offset |
  2611. * |---------------------------------------------------------------|
  2612. * | MSDU end offset | MSDU start offset |
  2613. * |---------------------------------------------------------------|
  2614. * | frag info offset | rx attention offset |
  2615. * |---------------------------------------------------------------|
  2616. * payload 2, if present, has the same format as payload 1
  2617. * Header fields:
  2618. * - MSG_TYPE
  2619. * Bits 7:0
  2620. * Purpose: identifies this as an rx ring configuration message
  2621. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2622. * - NUM_RINGS
  2623. * Bits 15:8
  2624. * Purpose: indicates whether the host is setting up one rx ring or two
  2625. * Value: 1 or 2
  2626. * Payload:
  2627. * for systems using 64-bit format for bus addresses:
  2628. * - IDX_SHADOW_REG_PADDR_LO
  2629. * Bits 31:0
  2630. * Value: lower 4 bytes of physical address of the host's
  2631. * FW_IDX shadow register
  2632. * - IDX_SHADOW_REG_PADDR_HI
  2633. * Bits 31:0
  2634. * Value: upper 4 bytes of physical address of the host's
  2635. * FW_IDX shadow register
  2636. * - RING_BASE_PADDR_LO
  2637. * Bits 31:0
  2638. * Value: lower 4 bytes of physical address of the host's rx ring
  2639. * - RING_BASE_PADDR_HI
  2640. * Bits 31:0
  2641. * Value: uppper 4 bytes of physical address of the host's rx ring
  2642. * for systems using 32-bit format for bus addresses:
  2643. * - IDX_SHADOW_REG_PADDR
  2644. * Bits 31:0
  2645. * Value: physical address of the host's FW_IDX shadow register
  2646. * - RING_BASE_PADDR
  2647. * Bits 31:0
  2648. * Value: physical address of the host's rx ring
  2649. * - RING_LEN
  2650. * Bits 15:0
  2651. * Value: number of elements in the rx ring
  2652. * - RING_BUF_SZ
  2653. * Bits 31:16
  2654. * Value: size of the buffers referenced by the rx ring, in byte units
  2655. * - ENABLED_FLAGS
  2656. * Bits 15:0
  2657. * Value: 1-bit flags to show whether different rx fields are enabled
  2658. * bit 0: 802.11 header enabled (1) or disabled (0)
  2659. * bit 1: MSDU payload enabled (1) or disabled (0)
  2660. * bit 2: PPDU start enabled (1) or disabled (0)
  2661. * bit 3: PPDU end enabled (1) or disabled (0)
  2662. * bit 4: MPDU start enabled (1) or disabled (0)
  2663. * bit 5: MPDU end enabled (1) or disabled (0)
  2664. * bit 6: MSDU start enabled (1) or disabled (0)
  2665. * bit 7: MSDU end enabled (1) or disabled (0)
  2666. * bit 8: rx attention enabled (1) or disabled (0)
  2667. * bit 9: frag info enabled (1) or disabled (0)
  2668. * bit 10: unicast rx enabled (1) or disabled (0)
  2669. * bit 11: multicast rx enabled (1) or disabled (0)
  2670. * bit 12: ctrl rx enabled (1) or disabled (0)
  2671. * bit 13: mgmt rx enabled (1) or disabled (0)
  2672. * bit 14: null rx enabled (1) or disabled (0)
  2673. * bit 15: phy data rx enabled (1) or disabled (0)
  2674. * - IDX_INIT_VAL
  2675. * Bits 31:16
  2676. * Purpose: Specify the initial value for the FW_IDX.
  2677. * Value: the number of buffers initially present in the host's rx ring
  2678. * - OFFSET_802_11_HDR
  2679. * Bits 15:0
  2680. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2681. * - OFFSET_MSDU_PAYLOAD
  2682. * Bits 31:16
  2683. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2684. * - OFFSET_PPDU_START
  2685. * Bits 15:0
  2686. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2687. * - OFFSET_PPDU_END
  2688. * Bits 31:16
  2689. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2690. * - OFFSET_MPDU_START
  2691. * Bits 15:0
  2692. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2693. * - OFFSET_MPDU_END
  2694. * Bits 31:16
  2695. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2696. * - OFFSET_MSDU_START
  2697. * Bits 15:0
  2698. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2699. * - OFFSET_MSDU_END
  2700. * Bits 31:16
  2701. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2702. * - OFFSET_RX_ATTN
  2703. * Bits 15:0
  2704. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2705. * - OFFSET_FRAG_INFO
  2706. * Bits 31:16
  2707. * Value: offset in QUAD-bytes of frag info table
  2708. */
  2709. /* header fields */
  2710. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2711. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2712. /* payload fields */
  2713. /* for systems using a 64-bit format for bus addresses */
  2714. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2715. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2716. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2717. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2718. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2719. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2720. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2721. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2722. /* for systems using a 32-bit format for bus addresses */
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2725. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2726. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2727. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2728. #define HTT_RX_RING_CFG_LEN_S 0
  2729. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2730. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2731. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2732. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2733. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2734. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2735. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2736. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2737. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2738. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2739. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2740. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2741. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2742. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2743. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2744. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2745. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2746. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2747. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2748. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2749. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2750. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2751. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2752. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2753. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2754. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2755. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2756. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2757. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2758. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2759. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2760. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2761. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2762. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2763. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2764. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2765. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2766. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2767. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2768. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2769. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2770. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2771. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2772. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2773. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2774. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2775. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2776. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2777. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2778. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2779. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2780. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2781. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2782. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2783. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2784. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2785. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2786. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2787. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2788. #if HTT_PADDR64
  2789. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2790. #else
  2791. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2792. #endif
  2793. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2794. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2795. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2796. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2797. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2798. do { \
  2799. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2800. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2801. } while (0)
  2802. /* degenerate case for 32-bit fields */
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2804. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2805. ((_var) = (_val))
  2806. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2807. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2808. ((_var) = (_val))
  2809. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2810. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2811. ((_var) = (_val))
  2812. /* degenerate case for 32-bit fields */
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2814. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2815. ((_var) = (_val))
  2816. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2817. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2818. ((_var) = (_val))
  2819. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2820. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2821. ((_var) = (_val))
  2822. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2824. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2831. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2832. do { \
  2833. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2834. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2835. } while (0)
  2836. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2837. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2838. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2839. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2840. do { \
  2841. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2842. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2843. } while (0)
  2844. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2845. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2846. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2847. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2848. do { \
  2849. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2850. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2851. } while (0)
  2852. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2853. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2854. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2855. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2858. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2859. } while (0)
  2860. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2861. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2862. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2863. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2866. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2867. } while (0)
  2868. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2869. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2870. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2871. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2874. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2875. } while (0)
  2876. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2877. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2878. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2879. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2882. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2883. } while (0)
  2884. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2885. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2886. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2887. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2890. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2891. } while (0)
  2892. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2893. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2894. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2895. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2898. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2899. } while (0)
  2900. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2901. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2902. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2903. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2906. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2907. } while (0)
  2908. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2909. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2910. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2911. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2914. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2915. } while (0)
  2916. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2917. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2918. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2919. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2920. do { \
  2921. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2922. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2923. } while (0)
  2924. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2925. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2926. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2927. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2928. do { \
  2929. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2930. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2931. } while (0)
  2932. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2933. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2934. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2935. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2936. do { \
  2937. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2938. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2939. } while (0)
  2940. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2941. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2942. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2943. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2944. do { \
  2945. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2946. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2947. } while (0)
  2948. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2949. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2950. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2951. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2952. do { \
  2953. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2954. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2955. } while (0)
  2956. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2957. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2958. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2959. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2960. do { \
  2961. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2962. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2963. } while (0)
  2964. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2965. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2966. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2967. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2970. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2971. } while (0)
  2972. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2973. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2974. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2975. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2978. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2979. } while (0)
  2980. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2981. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2982. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2983. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2986. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2987. } while (0)
  2988. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2989. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2990. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2991. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2992. do { \
  2993. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2994. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2995. } while (0)
  2996. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2997. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2998. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2999. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3000. do { \
  3001. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3002. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3003. } while (0)
  3004. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3005. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3006. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3007. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3008. do { \
  3009. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3010. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3011. } while (0)
  3012. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3013. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3014. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3015. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3016. do { \
  3017. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3018. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3019. } while (0)
  3020. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3021. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3022. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3023. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3024. do { \
  3025. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3026. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3027. } while (0)
  3028. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3029. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3030. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3031. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3032. do { \
  3033. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3034. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3035. } while (0)
  3036. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3037. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3038. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3039. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3042. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3043. } while (0)
  3044. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3045. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3046. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3047. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3050. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3051. } while (0)
  3052. /**
  3053. * @brief host -> target FW statistics retrieve
  3054. *
  3055. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3056. *
  3057. * @details
  3058. * The following field definitions describe the format of the HTT host
  3059. * to target FW stats retrieve message. The message specifies the type of
  3060. * stats host wants to retrieve.
  3061. *
  3062. * |31 24|23 16|15 8|7 0|
  3063. * |-----------------------------------------------------------|
  3064. * | stats types request bitmask | msg type |
  3065. * |-----------------------------------------------------------|
  3066. * | stats types reset bitmask | reserved |
  3067. * |-----------------------------------------------------------|
  3068. * | stats type | config value |
  3069. * |-----------------------------------------------------------|
  3070. * | cookie LSBs |
  3071. * |-----------------------------------------------------------|
  3072. * | cookie MSBs |
  3073. * |-----------------------------------------------------------|
  3074. * Header fields:
  3075. * - MSG_TYPE
  3076. * Bits 7:0
  3077. * Purpose: identifies this is a stats upload request message
  3078. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3079. * - UPLOAD_TYPES
  3080. * Bits 31:8
  3081. * Purpose: identifies which types of FW statistics to upload
  3082. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3083. * - RESET_TYPES
  3084. * Bits 31:8
  3085. * Purpose: identifies which types of FW statistics to reset
  3086. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3087. * - CFG_VAL
  3088. * Bits 23:0
  3089. * Purpose: give an opaque configuration value to the specified stats type
  3090. * Value: stats-type specific configuration value
  3091. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3092. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3093. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3094. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3095. * - CFG_STAT_TYPE
  3096. * Bits 31:24
  3097. * Purpose: specify which stats type (if any) the config value applies to
  3098. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3099. * a valid configuration specification
  3100. * - COOKIE_LSBS
  3101. * Bits 31:0
  3102. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3103. * message with its preceding host->target stats request message.
  3104. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3105. * - COOKIE_MSBS
  3106. * Bits 31:0
  3107. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3108. * message with its preceding host->target stats request message.
  3109. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3110. */
  3111. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3112. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3113. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3114. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3115. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3116. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3117. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3118. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3119. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3120. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3121. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3122. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3123. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3124. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3127. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3128. } while (0)
  3129. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3130. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3131. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3132. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3133. do { \
  3134. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3135. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3136. } while (0)
  3137. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3138. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3139. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3140. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3141. do { \
  3142. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3143. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3144. } while (0)
  3145. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3146. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3147. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3148. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3149. do { \
  3150. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3151. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3152. } while (0)
  3153. /**
  3154. * @brief host -> target HTT out-of-band sync request
  3155. *
  3156. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3157. *
  3158. * @details
  3159. * The HTT SYNC tells the target to suspend processing of subsequent
  3160. * HTT host-to-target messages until some other target agent locally
  3161. * informs the target HTT FW that the current sync counter is equal to
  3162. * or greater than (in a modulo sense) the sync counter specified in
  3163. * the SYNC message.
  3164. * This allows other host-target components to synchronize their operation
  3165. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3166. * security key has been downloaded to and activated by the target.
  3167. * In the absence of any explicit synchronization counter value
  3168. * specification, the target HTT FW will use zero as the default current
  3169. * sync value.
  3170. *
  3171. * |31 24|23 16|15 8|7 0|
  3172. * |-----------------------------------------------------------|
  3173. * | reserved | sync count | msg type |
  3174. * |-----------------------------------------------------------|
  3175. * Header fields:
  3176. * - MSG_TYPE
  3177. * Bits 7:0
  3178. * Purpose: identifies this as a sync message
  3179. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3180. * - SYNC_COUNT
  3181. * Bits 15:8
  3182. * Purpose: specifies what sync value the HTT FW will wait for from
  3183. * an out-of-band specification to resume its operation
  3184. * Value: in-band sync counter value to compare against the out-of-band
  3185. * counter spec.
  3186. * The HTT target FW will suspend its host->target message processing
  3187. * as long as
  3188. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3189. */
  3190. #define HTT_H2T_SYNC_MSG_SZ 4
  3191. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3192. #define HTT_H2T_SYNC_COUNT_S 8
  3193. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3194. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3195. HTT_H2T_SYNC_COUNT_S)
  3196. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3199. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3200. } while (0)
  3201. /**
  3202. * @brief host -> target HTT aggregation configuration
  3203. *
  3204. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3205. */
  3206. #define HTT_AGGR_CFG_MSG_SZ 4
  3207. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3208. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3211. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3212. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3213. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3214. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3215. do { \
  3216. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3217. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3218. } while (0)
  3219. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3220. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3221. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3222. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3223. do { \
  3224. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3225. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3226. } while (0)
  3227. /**
  3228. * @brief host -> target HTT configure max amsdu info per vdev
  3229. *
  3230. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3231. *
  3232. * @details
  3233. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3234. *
  3235. * |31 21|20 16|15 8|7 0|
  3236. * |-----------------------------------------------------------|
  3237. * | reserved | vdev id | max amsdu | msg type |
  3238. * |-----------------------------------------------------------|
  3239. * Header fields:
  3240. * - MSG_TYPE
  3241. * Bits 7:0
  3242. * Purpose: identifies this as a aggr cfg ex message
  3243. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3244. * - MAX_NUM_AMSDU_SUBFRM
  3245. * Bits 15:8
  3246. * Purpose: max MSDUs per A-MSDU
  3247. * - VDEV_ID
  3248. * Bits 20:16
  3249. * Purpose: ID of the vdev to which this limit is applied
  3250. */
  3251. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3252. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3253. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3254. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3255. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3256. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3257. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3258. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3259. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3260. do { \
  3261. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3262. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3263. } while (0)
  3264. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3265. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3266. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3267. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3268. do { \
  3269. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3270. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3271. } while (0)
  3272. /**
  3273. * @brief HTT WDI_IPA Config Message
  3274. *
  3275. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3276. *
  3277. * @details
  3278. * The HTT WDI_IPA config message is created/sent by host at driver
  3279. * init time. It contains information about data structures used on
  3280. * WDI_IPA TX and RX path.
  3281. * TX CE ring is used for pushing packet metadata from IPA uC
  3282. * to WLAN FW
  3283. * TX Completion ring is used for generating TX completions from
  3284. * WLAN FW to IPA uC
  3285. * RX Indication ring is used for indicating RX packets from FW
  3286. * to IPA uC
  3287. * RX Ring2 is used as either completion ring or as second
  3288. * indication ring. when Ring2 is used as completion ring, IPA uC
  3289. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3290. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3291. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3292. * indicated in RX Indication ring. Please see WDI_IPA specification
  3293. * for more details.
  3294. * |31 24|23 16|15 8|7 0|
  3295. * |----------------+----------------+----------------+----------------|
  3296. * | tx pkt pool size | Rsvd | msg_type |
  3297. * |-------------------------------------------------------------------|
  3298. * | tx comp ring base (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | tx comp ring base (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * | tx comp ring size |
  3304. * |-------------------------------------------------------------------|
  3305. * | tx comp WR_IDX physical address (bits 31:0) |
  3306. #if HTT_PADDR64
  3307. * | tx comp WR_IDX physical address (bits 63:32) |
  3308. #endif
  3309. * |-------------------------------------------------------------------|
  3310. * | tx CE WR_IDX physical address (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | tx CE WR_IDX physical address (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. * | rx indication ring base (bits 31:0) |
  3316. #if HTT_PADDR64
  3317. * | rx indication ring base (bits 63:32) |
  3318. #endif
  3319. * |-------------------------------------------------------------------|
  3320. * | rx indication ring size |
  3321. * |-------------------------------------------------------------------|
  3322. * | rx ind RD_IDX physical address (bits 31:0) |
  3323. #if HTT_PADDR64
  3324. * | rx ind RD_IDX physical address (bits 63:32) |
  3325. #endif
  3326. * |-------------------------------------------------------------------|
  3327. * | rx ind WR_IDX physical address (bits 31:0) |
  3328. #if HTT_PADDR64
  3329. * | rx ind WR_IDX physical address (bits 63:32) |
  3330. #endif
  3331. * |-------------------------------------------------------------------|
  3332. * |-------------------------------------------------------------------|
  3333. * | rx ring2 base (bits 31:0) |
  3334. #if HTT_PADDR64
  3335. * | rx ring2 base (bits 63:32) |
  3336. #endif
  3337. * |-------------------------------------------------------------------|
  3338. * | rx ring2 size |
  3339. * |-------------------------------------------------------------------|
  3340. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3341. #if HTT_PADDR64
  3342. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3343. #endif
  3344. * |-------------------------------------------------------------------|
  3345. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3346. #if HTT_PADDR64
  3347. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3348. #endif
  3349. * |-------------------------------------------------------------------|
  3350. *
  3351. * Header fields:
  3352. * Header fields:
  3353. * - MSG_TYPE
  3354. * Bits 7:0
  3355. * Purpose: Identifies this as WDI_IPA config message
  3356. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3357. * - TX_PKT_POOL_SIZE
  3358. * Bits 15:0
  3359. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3360. * WDI_IPA TX path
  3361. * For systems using 32-bit format for bus addresses:
  3362. * - TX_COMP_RING_BASE_ADDR
  3363. * Bits 31:0
  3364. * Purpose: TX Completion Ring base address in DDR
  3365. * - TX_COMP_RING_SIZE
  3366. * Bits 31:0
  3367. * Purpose: TX Completion Ring size (must be power of 2)
  3368. * - TX_COMP_WR_IDX_ADDR
  3369. * Bits 31:0
  3370. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3371. * updates the Write Index for WDI_IPA TX completion ring
  3372. * - TX_CE_WR_IDX_ADDR
  3373. * Bits 31:0
  3374. * Purpose: DDR address where IPA uC
  3375. * updates the WR Index for TX CE ring
  3376. * (needed for fusion platforms)
  3377. * - RX_IND_RING_BASE_ADDR
  3378. * Bits 31:0
  3379. * Purpose: RX Indication Ring base address in DDR
  3380. * - RX_IND_RING_SIZE
  3381. * Bits 31:0
  3382. * Purpose: RX Indication Ring size
  3383. * - RX_IND_RD_IDX_ADDR
  3384. * Bits 31:0
  3385. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3386. * RX indication ring
  3387. * - RX_IND_WR_IDX_ADDR
  3388. * Bits 31:0
  3389. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3390. * updates the Write Index for WDI_IPA RX indication ring
  3391. * - RX_RING2_BASE_ADDR
  3392. * Bits 31:0
  3393. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3394. * - RX_RING2_SIZE
  3395. * Bits 31:0
  3396. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3397. * - RX_RING2_RD_IDX_ADDR
  3398. * Bits 31:0
  3399. * Purpose: If Second RX ring is Indication ring, DDR address where
  3400. * IPA uC updates the Read Index for Ring2.
  3401. * If Second RX ring is completion ring, this is NOT used
  3402. * - RX_RING2_WR_IDX_ADDR
  3403. * Bits 31:0
  3404. * Purpose: If Second RX ring is Indication ring, DDR address where
  3405. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3406. * If second RX ring is completion ring, DDR address where
  3407. * IPA uC updates the Write Index for Ring 2.
  3408. * For systems using 64-bit format for bus addresses:
  3409. * - TX_COMP_RING_BASE_ADDR_LO
  3410. * Bits 31:0
  3411. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3412. * - TX_COMP_RING_BASE_ADDR_HI
  3413. * Bits 31:0
  3414. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3415. * - TX_COMP_RING_SIZE
  3416. * Bits 31:0
  3417. * Purpose: TX Completion Ring size (must be power of 2)
  3418. * - TX_COMP_WR_IDX_ADDR_LO
  3419. * Bits 31:0
  3420. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3421. * Lower 4 bytes of DDR address where WIFI FW
  3422. * updates the Write Index for WDI_IPA TX completion ring
  3423. * - TX_COMP_WR_IDX_ADDR_HI
  3424. * Bits 31:0
  3425. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3426. * Higher 4 bytes of DDR address where WIFI FW
  3427. * updates the Write Index for WDI_IPA TX completion ring
  3428. * - TX_CE_WR_IDX_ADDR_LO
  3429. * Bits 31:0
  3430. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3431. * updates the WR Index for TX CE ring
  3432. * (needed for fusion platforms)
  3433. * - TX_CE_WR_IDX_ADDR_HI
  3434. * Bits 31:0
  3435. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3436. * updates the WR Index for TX CE ring
  3437. * (needed for fusion platforms)
  3438. * - RX_IND_RING_BASE_ADDR_LO
  3439. * Bits 31:0
  3440. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3441. * - RX_IND_RING_BASE_ADDR_HI
  3442. * Bits 31:0
  3443. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3444. * - RX_IND_RING_SIZE
  3445. * Bits 31:0
  3446. * Purpose: RX Indication Ring size
  3447. * - RX_IND_RD_IDX_ADDR_LO
  3448. * Bits 31:0
  3449. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3450. * for WDI_IPA RX indication ring
  3451. * - RX_IND_RD_IDX_ADDR_HI
  3452. * Bits 31:0
  3453. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3454. * for WDI_IPA RX indication ring
  3455. * - RX_IND_WR_IDX_ADDR_LO
  3456. * Bits 31:0
  3457. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3458. * Lower 4 bytes of DDR address where WIFI FW
  3459. * updates the Write Index for WDI_IPA RX indication ring
  3460. * - RX_IND_WR_IDX_ADDR_HI
  3461. * Bits 31:0
  3462. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3463. * Higher 4 bytes of DDR address where WIFI FW
  3464. * updates the Write Index for WDI_IPA RX indication ring
  3465. * - RX_RING2_BASE_ADDR_LO
  3466. * Bits 31:0
  3467. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3468. * - RX_RING2_BASE_ADDR_HI
  3469. * Bits 31:0
  3470. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3471. * - RX_RING2_SIZE
  3472. * Bits 31:0
  3473. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3474. * - RX_RING2_RD_IDX_ADDR_LO
  3475. * Bits 31:0
  3476. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3477. * DDR address where IPA uC updates the Read Index for Ring2.
  3478. * If Second RX ring is completion ring, this is NOT used
  3479. * - RX_RING2_RD_IDX_ADDR_HI
  3480. * Bits 31:0
  3481. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3482. * DDR address where IPA uC updates the Read Index for Ring2.
  3483. * If Second RX ring is completion ring, this is NOT used
  3484. * - RX_RING2_WR_IDX_ADDR_LO
  3485. * Bits 31:0
  3486. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3487. * DDR address where WIFI FW updates the Write Index
  3488. * for WDI_IPA RX ring2
  3489. * If second RX ring is completion ring, lower 4 bytes of
  3490. * DDR address where IPA uC updates the Write Index for Ring 2.
  3491. * - RX_RING2_WR_IDX_ADDR_HI
  3492. * Bits 31:0
  3493. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3494. * DDR address where WIFI FW updates the Write Index
  3495. * for WDI_IPA RX ring2
  3496. * If second RX ring is completion ring, higher 4 bytes of
  3497. * DDR address where IPA uC updates the Write Index for Ring 2.
  3498. */
  3499. #if HTT_PADDR64
  3500. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3501. #else
  3502. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3503. #endif
  3504. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3505. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3516. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3518. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3522. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3524. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3562. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3563. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3564. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3565. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3566. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3567. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3568. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3571. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3572. } while (0)
  3573. /* for systems using 32-bit format for bus addr */
  3574. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3575. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3576. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3579. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3580. } while (0)
  3581. /* for systems using 64-bit format for bus addr */
  3582. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3583. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3584. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3587. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3588. } while (0)
  3589. /* for systems using 64-bit format for bus addr */
  3590. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3591. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3592. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3593. do { \
  3594. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3595. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3596. } while (0)
  3597. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3599. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3603. } while (0)
  3604. /* for systems using 32-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3607. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3611. } while (0)
  3612. /* for systems using 64-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3615. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3619. } while (0)
  3620. /* for systems using 64-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3623. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3627. } while (0)
  3628. /* for systems using 32-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3631. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3635. } while (0)
  3636. /* for systems using 64-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3639. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3643. } while (0)
  3644. /* for systems using 64-bit format for bus addr */
  3645. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3646. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3647. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3650. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3651. } while (0)
  3652. /* for systems using 32-bit format for bus addr */
  3653. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3654. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3655. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3658. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3659. } while (0)
  3660. /* for systems using 64-bit format for bus addr */
  3661. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3662. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3663. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3666. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3667. } while (0)
  3668. /* for systems using 64-bit format for bus addr */
  3669. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3670. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3671. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3674. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3675. } while (0)
  3676. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3678. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3682. } while (0)
  3683. /* for systems using 32-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3686. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3690. } while (0)
  3691. /* for systems using 64-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3694. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3698. } while (0)
  3699. /* for systems using 64-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3702. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3706. } while (0)
  3707. /* for systems using 32-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3710. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3714. } while (0)
  3715. /* for systems using 64-bit format for bus addr */
  3716. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3717. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3718. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3721. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3722. } while (0)
  3723. /* for systems using 64-bit format for bus addr */
  3724. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3725. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3726. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3727. do { \
  3728. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3729. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3730. } while (0)
  3731. /* for systems using 32-bit format for bus addr */
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3733. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3735. do { \
  3736. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3737. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3738. } while (0)
  3739. /* for systems using 64-bit format for bus addr */
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3741. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3743. do { \
  3744. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3745. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3746. } while (0)
  3747. /* for systems using 64-bit format for bus addr */
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3749. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3751. do { \
  3752. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3753. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3754. } while (0)
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3756. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3760. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3761. } while (0)
  3762. /* for systems using 32-bit format for bus addr */
  3763. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3769. } while (0)
  3770. /* for systems using 64-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3777. } while (0)
  3778. /* for systems using 64-bit format for bus addr */
  3779. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3780. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3781. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3784. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3785. } while (0)
  3786. /* for systems using 32-bit format for bus addr */
  3787. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3788. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3789. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3792. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3793. } while (0)
  3794. /* for systems using 64-bit format for bus addr */
  3795. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3796. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3797. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3800. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3801. } while (0)
  3802. /* for systems using 64-bit format for bus addr */
  3803. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3804. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3805. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3806. do { \
  3807. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3808. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3809. } while (0)
  3810. /*
  3811. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3812. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3813. * addresses are stored in a XXX-bit field.
  3814. * This macro is used to define both htt_wdi_ipa_config32_t and
  3815. * htt_wdi_ipa_config64_t structs.
  3816. */
  3817. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3818. _paddr__tx_comp_ring_base_addr_, \
  3819. _paddr__tx_comp_wr_idx_addr_, \
  3820. _paddr__tx_ce_wr_idx_addr_, \
  3821. _paddr__rx_ind_ring_base_addr_, \
  3822. _paddr__rx_ind_rd_idx_addr_, \
  3823. _paddr__rx_ind_wr_idx_addr_, \
  3824. _paddr__rx_ring2_base_addr_,\
  3825. _paddr__rx_ring2_rd_idx_addr_,\
  3826. _paddr__rx_ring2_wr_idx_addr_) \
  3827. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3828. { \
  3829. /* DWORD 0: flags and meta-data */ \
  3830. A_UINT32 \
  3831. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3832. reserved: 8, \
  3833. tx_pkt_pool_size: 16;\
  3834. /* DWORD 1 */\
  3835. _paddr__tx_comp_ring_base_addr_;\
  3836. /* DWORD 2 (or 3)*/\
  3837. A_UINT32 tx_comp_ring_size;\
  3838. /* DWORD 3 (or 4)*/\
  3839. _paddr__tx_comp_wr_idx_addr_;\
  3840. /* DWORD 4 (or 6)*/\
  3841. _paddr__tx_ce_wr_idx_addr_;\
  3842. /* DWORD 5 (or 8)*/\
  3843. _paddr__rx_ind_ring_base_addr_;\
  3844. /* DWORD 6 (or 10)*/\
  3845. A_UINT32 rx_ind_ring_size;\
  3846. /* DWORD 7 (or 11)*/\
  3847. _paddr__rx_ind_rd_idx_addr_;\
  3848. /* DWORD 8 (or 13)*/\
  3849. _paddr__rx_ind_wr_idx_addr_;\
  3850. /* DWORD 9 (or 15)*/\
  3851. _paddr__rx_ring2_base_addr_;\
  3852. /* DWORD 10 (or 17) */\
  3853. A_UINT32 rx_ring2_size;\
  3854. /* DWORD 11 (or 18) */\
  3855. _paddr__rx_ring2_rd_idx_addr_;\
  3856. /* DWORD 12 (or 20) */\
  3857. _paddr__rx_ring2_wr_idx_addr_;\
  3858. } POSTPACK
  3859. /* define a htt_wdi_ipa_config32_t type */
  3860. 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));
  3861. /* define a htt_wdi_ipa_config64_t type */
  3862. 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));
  3863. #if HTT_PADDR64
  3864. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3865. #else
  3866. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3867. #endif
  3868. enum htt_wdi_ipa_op_code {
  3869. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3870. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3871. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3872. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3873. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3874. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3875. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3876. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3877. /* keep this last */
  3878. HTT_WDI_IPA_OPCODE_MAX
  3879. };
  3880. /**
  3881. * @brief HTT WDI_IPA Operation Request Message
  3882. *
  3883. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  3884. *
  3885. * @details
  3886. * HTT WDI_IPA Operation Request message is sent by host
  3887. * to either suspend or resume WDI_IPA TX or RX path.
  3888. * |31 24|23 16|15 8|7 0|
  3889. * |----------------+----------------+----------------+----------------|
  3890. * | op_code | Rsvd | msg_type |
  3891. * |-------------------------------------------------------------------|
  3892. *
  3893. * Header fields:
  3894. * - MSG_TYPE
  3895. * Bits 7:0
  3896. * Purpose: Identifies this as WDI_IPA Operation Request message
  3897. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  3898. * - OP_CODE
  3899. * Bits 31:16
  3900. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3901. * value: = enum htt_wdi_ipa_op_code
  3902. */
  3903. PREPACK struct htt_wdi_ipa_op_request_t
  3904. {
  3905. /* DWORD 0: flags and meta-data */
  3906. A_UINT32
  3907. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3908. reserved: 8,
  3909. op_code: 16;
  3910. } POSTPACK;
  3911. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3912. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3913. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3914. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3915. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3916. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3917. do { \
  3918. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3919. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3920. } while (0)
  3921. /*
  3922. * @brief host -> target HTT_SRING_SETUP message
  3923. *
  3924. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  3925. *
  3926. * @details
  3927. * After target is booted up, Host can send SRING setup message for
  3928. * each host facing LMAC SRING. Target setups up HW registers based
  3929. * on setup message and confirms back to Host if response_required is set.
  3930. * Host should wait for confirmation message before sending new SRING
  3931. * setup message
  3932. *
  3933. * The message would appear as follows:
  3934. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3935. * |--------------- +-----------------+-----------------+-----------------|
  3936. * | ring_type | ring_id | pdev_id | msg_type |
  3937. * |----------------------------------------------------------------------|
  3938. * | ring_base_addr_lo |
  3939. * |----------------------------------------------------------------------|
  3940. * | ring_base_addr_hi |
  3941. * |----------------------------------------------------------------------|
  3942. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3943. * |----------------------------------------------------------------------|
  3944. * | ring_head_offset32_remote_addr_lo |
  3945. * |----------------------------------------------------------------------|
  3946. * | ring_head_offset32_remote_addr_hi |
  3947. * |----------------------------------------------------------------------|
  3948. * | ring_tail_offset32_remote_addr_lo |
  3949. * |----------------------------------------------------------------------|
  3950. * | ring_tail_offset32_remote_addr_hi |
  3951. * |----------------------------------------------------------------------|
  3952. * | ring_msi_addr_lo |
  3953. * |----------------------------------------------------------------------|
  3954. * | ring_msi_addr_hi |
  3955. * |----------------------------------------------------------------------|
  3956. * | ring_msi_data |
  3957. * |----------------------------------------------------------------------|
  3958. * | intr_timer_th |IM| intr_batch_counter_th |
  3959. * |----------------------------------------------------------------------|
  3960. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3961. * |----------------------------------------------------------------------|
  3962. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3963. * |----------------------------------------------------------------------|
  3964. * Where
  3965. * IM = sw_intr_mode
  3966. * RR = response_required
  3967. * PTCF = prefetch_timer_cfg
  3968. * IP = IPA drop flag
  3969. *
  3970. * The message is interpreted as follows:
  3971. * dword0 - b'0:7 - msg_type: This will be set to
  3972. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  3973. * b'8:15 - pdev_id:
  3974. * 0 (for rings at SOC/UMAC level),
  3975. * 1/2/3 mac id (for rings at LMAC level)
  3976. * b'16:23 - ring_id: identify which ring is to setup,
  3977. * more details can be got from enum htt_srng_ring_id
  3978. * b'24:31 - ring_type: identify type of host rings,
  3979. * more details can be got from enum htt_srng_ring_type
  3980. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3981. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3982. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3983. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3984. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3985. * SW_TO_HW_RING.
  3986. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3987. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3988. * Lower 32 bits of memory address of the remote variable
  3989. * storing the 4-byte word offset that identifies the head
  3990. * element within the ring.
  3991. * (The head offset variable has type A_UINT32.)
  3992. * Valid for HW_TO_SW and SW_TO_SW rings.
  3993. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3994. * Upper 32 bits of memory address of the remote variable
  3995. * storing the 4-byte word offset that identifies the head
  3996. * element within the ring.
  3997. * (The head offset variable has type A_UINT32.)
  3998. * Valid for HW_TO_SW and SW_TO_SW rings.
  3999. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4000. * Lower 32 bits of memory address of the remote variable
  4001. * storing the 4-byte word offset that identifies the tail
  4002. * element within the ring.
  4003. * (The tail offset variable has type A_UINT32.)
  4004. * Valid for HW_TO_SW and SW_TO_SW rings.
  4005. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4006. * Upper 32 bits of memory address of the remote variable
  4007. * storing the 4-byte word offset that identifies the tail
  4008. * element within the ring.
  4009. * (The tail offset variable has type A_UINT32.)
  4010. * Valid for HW_TO_SW and SW_TO_SW rings.
  4011. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4012. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4013. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4014. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4015. * dword10 - b'0:31 - ring_msi_data: MSI data
  4016. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4017. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4018. * dword11 - b'0:14 - intr_batch_counter_th:
  4019. * batch counter threshold is in units of 4-byte words.
  4020. * HW internally maintains and increments batch count.
  4021. * (see SRING spec for detail description).
  4022. * When batch count reaches threshold value, an interrupt
  4023. * is generated by HW.
  4024. * b'15 - sw_intr_mode:
  4025. * This configuration shall be static.
  4026. * Only programmed at power up.
  4027. * 0: generate pulse style sw interrupts
  4028. * 1: generate level style sw interrupts
  4029. * b'16:31 - intr_timer_th:
  4030. * The timer init value when timer is idle or is
  4031. * initialized to start downcounting.
  4032. * In 8us units (to cover a range of 0 to 524 ms)
  4033. * dword12 - b'0:15 - intr_low_threshold:
  4034. * Used only by Consumer ring to generate ring_sw_int_p.
  4035. * Ring entries low threshold water mark, that is used
  4036. * in combination with the interrupt timer as well as
  4037. * the the clearing of the level interrupt.
  4038. * b'16:18 - prefetch_timer_cfg:
  4039. * Used only by Consumer ring to set timer mode to
  4040. * support Application prefetch handling.
  4041. * The external tail offset/pointer will be updated
  4042. * at following intervals:
  4043. * 3'b000: (Prefetch feature disabled; used only for debug)
  4044. * 3'b001: 1 usec
  4045. * 3'b010: 4 usec
  4046. * 3'b011: 8 usec (default)
  4047. * 3'b100: 16 usec
  4048. * Others: Reserverd
  4049. * b'19 - response_required:
  4050. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4051. * b'20 - ipa_drop_flag:
  4052. Indicates that host will config ipa drop threshold percentage
  4053. * b'21:31 - reserved: reserved for future use
  4054. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4055. * b'8:15 - ipa drop high threshold percentage:
  4056. * b'16:31 - Reserved
  4057. */
  4058. PREPACK struct htt_sring_setup_t {
  4059. A_UINT32 msg_type: 8,
  4060. pdev_id: 8,
  4061. ring_id: 8,
  4062. ring_type: 8;
  4063. A_UINT32 ring_base_addr_lo;
  4064. A_UINT32 ring_base_addr_hi;
  4065. A_UINT32 ring_size: 16,
  4066. ring_entry_size: 8,
  4067. ring_misc_cfg_flag: 8;
  4068. A_UINT32 ring_head_offset32_remote_addr_lo;
  4069. A_UINT32 ring_head_offset32_remote_addr_hi;
  4070. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4071. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4072. A_UINT32 ring_msi_addr_lo;
  4073. A_UINT32 ring_msi_addr_hi;
  4074. A_UINT32 ring_msi_data;
  4075. A_UINT32 intr_batch_counter_th: 15,
  4076. sw_intr_mode: 1,
  4077. intr_timer_th: 16;
  4078. A_UINT32 intr_low_threshold: 16,
  4079. prefetch_timer_cfg: 3,
  4080. response_required: 1,
  4081. ipa_drop_flag: 1,
  4082. reserved1: 11;
  4083. A_UINT32 ipa_drop_low_threshold: 8,
  4084. ipa_drop_high_threshold: 8,
  4085. reserved: 16;
  4086. } POSTPACK;
  4087. enum htt_srng_ring_type {
  4088. HTT_HW_TO_SW_RING = 0,
  4089. HTT_SW_TO_HW_RING,
  4090. HTT_SW_TO_SW_RING,
  4091. /* Insert new ring types above this line */
  4092. };
  4093. enum htt_srng_ring_id {
  4094. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4095. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4096. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4097. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4098. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4099. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4100. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4101. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4102. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4103. /* Add Other SRING which can't be directly configured by host software above this line */
  4104. };
  4105. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4106. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4107. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4108. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4109. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4110. HTT_SRING_SETUP_PDEV_ID_S)
  4111. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4114. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4115. } while (0)
  4116. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4117. #define HTT_SRING_SETUP_RING_ID_S 16
  4118. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4119. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4120. HTT_SRING_SETUP_RING_ID_S)
  4121. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4124. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4125. } while (0)
  4126. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4127. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4128. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4129. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4130. HTT_SRING_SETUP_RING_TYPE_S)
  4131. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4132. do { \
  4133. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4134. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4135. } while (0)
  4136. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4137. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4138. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4139. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4140. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4141. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4144. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4145. } while (0)
  4146. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4147. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4148. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4149. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4150. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4151. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4154. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4155. } while (0)
  4156. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4157. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4158. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4159. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4160. HTT_SRING_SETUP_RING_SIZE_S)
  4161. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4164. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4165. } while (0)
  4166. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4167. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4168. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4169. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4170. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4171. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4172. do { \
  4173. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4174. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4175. } while (0)
  4176. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4177. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4178. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4179. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4180. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4181. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4184. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4185. } while (0)
  4186. /* This control bit is applicable to only Producer, which updates Ring ID field
  4187. * of each descriptor before pushing into the ring.
  4188. * 0: updates ring_id(default)
  4189. * 1: ring_id updating disabled */
  4190. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4192. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4193. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4194. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4195. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4198. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4199. } while (0)
  4200. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4201. * of each descriptor before pushing into the ring.
  4202. * 0: updates Loopcnt(default)
  4203. * 1: Loopcnt updating disabled */
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4206. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4208. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4213. } while (0)
  4214. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4215. * into security_id port of GXI/AXI. */
  4216. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4217. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4218. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4219. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4220. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4224. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4225. } while (0)
  4226. /* During MSI write operation, SRNG drives value of this register bit into
  4227. * swap bit of GXI/AXI. */
  4228. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4230. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4231. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4232. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4236. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4237. } while (0)
  4238. /* During Pointer write operation, SRNG drives value of this register bit into
  4239. * swap bit of GXI/AXI. */
  4240. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4241. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4242. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4243. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4244. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4245. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4248. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4249. } while (0)
  4250. /* During any data or TLV write operation, SRNG drives value of this register
  4251. * bit into swap bit of GXI/AXI. */
  4252. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4253. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4254. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4255. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4256. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4257. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4260. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4261. } while (0)
  4262. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4263. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4264. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4265. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4266. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4267. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4268. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4269. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4272. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4273. } while (0)
  4274. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4275. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4276. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4277. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4278. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4279. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4282. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4283. } while (0)
  4284. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4285. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4286. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4287. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4288. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4289. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4290. do { \
  4291. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4292. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4293. } while (0)
  4294. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4295. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4296. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4297. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4298. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4299. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4302. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4303. } while (0)
  4304. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4305. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4306. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4307. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4308. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4309. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4312. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4313. } while (0)
  4314. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4315. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4316. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4317. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4318. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4319. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4322. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4323. } while (0)
  4324. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4325. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4326. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4327. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4328. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4329. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4332. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4333. } while (0)
  4334. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4335. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4336. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4337. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4338. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4339. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4342. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4343. } while (0)
  4344. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4345. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4346. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4347. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4348. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4349. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4350. do { \
  4351. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4352. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4353. } while (0)
  4354. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4355. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4356. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4357. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4358. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4359. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4360. do { \
  4361. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4362. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4363. } while (0)
  4364. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4365. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4366. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4367. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4368. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4369. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4370. do { \
  4371. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4372. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4373. } while (0)
  4374. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4375. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4376. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4377. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4378. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4379. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4380. do { \
  4381. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4382. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4383. } while (0)
  4384. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4385. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4386. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4387. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4388. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4389. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4390. do { \
  4391. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4392. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4393. } while (0)
  4394. /**
  4395. * @brief host -> target RX ring selection config message
  4396. *
  4397. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4398. *
  4399. * @details
  4400. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4401. * configure RXDMA rings.
  4402. * The configuration is per ring based and includes both packet subtypes
  4403. * and PPDU/MPDU TLVs.
  4404. *
  4405. * The message would appear as follows:
  4406. *
  4407. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4408. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4409. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4410. * |-------------------------------------------------------------------|
  4411. * | rsvd2 | ring_buffer_size |
  4412. * |-------------------------------------------------------------------|
  4413. * | packet_type_enable_flags_0 |
  4414. * |-------------------------------------------------------------------|
  4415. * | packet_type_enable_flags_1 |
  4416. * |-------------------------------------------------------------------|
  4417. * | packet_type_enable_flags_2 |
  4418. * |-------------------------------------------------------------------|
  4419. * | packet_type_enable_flags_3 |
  4420. * |-------------------------------------------------------------------|
  4421. * | tlv_filter_in_flags |
  4422. * |-------------------------------------------------------------------|
  4423. * | rx_header_offset | rx_packet_offset |
  4424. * |-------------------------------------------------------------------|
  4425. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4426. * |-------------------------------------------------------------------|
  4427. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4428. * |-------------------------------------------------------------------|
  4429. * | rsvd3 | rx_attention_offset |
  4430. * |-------------------------------------------------------------------|
  4431. * | rsvd4 | mo| fp| rx_drop_threshold |
  4432. * | |ndp|ndp| |
  4433. * |-------------------------------------------------------------------|
  4434. * Where:
  4435. * PS = pkt_swap
  4436. * SS = status_swap
  4437. * OV = rx_offsets_valid
  4438. * DT = drop_thresh_valid
  4439. * The message is interpreted as follows:
  4440. * dword0 - b'0:7 - msg_type: This will be set to
  4441. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4442. * b'8:15 - pdev_id:
  4443. * 0 (for rings at SOC/UMAC level),
  4444. * 1/2/3 mac id (for rings at LMAC level)
  4445. * b'16:23 - ring_id : Identify the ring to configure.
  4446. * More details can be got from enum htt_srng_ring_id
  4447. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4448. * BUF_RING_CFG_0 defs within HW .h files,
  4449. * e.g. wmac_top_reg_seq_hwioreg.h
  4450. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4451. * BUF_RING_CFG_0 defs within HW .h files,
  4452. * e.g. wmac_top_reg_seq_hwioreg.h
  4453. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4454. * configuration fields are valid
  4455. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4456. * rx_drop_threshold field is valid
  4457. * b'28:31 - rsvd1: reserved for future use
  4458. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4459. * in byte units.
  4460. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4461. * - b'16:31 - rsvd2: Reserved for future use
  4462. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4463. * Enable MGMT packet from 0b0000 to 0b1001
  4464. * bits from low to high: FP, MD, MO - 3 bits
  4465. * FP: Filter_Pass
  4466. * MD: Monitor_Direct
  4467. * MO: Monitor_Other
  4468. * 10 mgmt subtypes * 3 bits -> 30 bits
  4469. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4470. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4471. * Enable MGMT packet from 0b1010 to 0b1111
  4472. * bits from low to high: FP, MD, MO - 3 bits
  4473. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4474. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4475. * Enable CTRL packet from 0b0000 to 0b1001
  4476. * bits from low to high: FP, MD, MO - 3 bits
  4477. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4478. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4479. * Enable CTRL packet from 0b1010 to 0b1111,
  4480. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4481. * bits from low to high: FP, MD, MO - 3 bits
  4482. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4483. * dword6 - b'0:31 - tlv_filter_in_flags:
  4484. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4485. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4486. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4487. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4488. * A value of 0 will be considered as ignore this config.
  4489. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4490. * e.g. wmac_top_reg_seq_hwioreg.h
  4491. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4492. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4493. * A value of 0 will be considered as ignore this config.
  4494. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4495. * e.g. wmac_top_reg_seq_hwioreg.h
  4496. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4497. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4498. * A value of 0 will be considered as ignore this config.
  4499. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4500. * e.g. wmac_top_reg_seq_hwioreg.h
  4501. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4502. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4503. * A value of 0 will be considered as ignore this config.
  4504. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4505. * e.g. wmac_top_reg_seq_hwioreg.h
  4506. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4507. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4508. * A value of 0 will be considered as ignore this config.
  4509. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4510. * e.g. wmac_top_reg_seq_hwioreg.h
  4511. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4512. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4513. * A value of 0 will be considered as ignore this config.
  4514. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4515. * e.g. wmac_top_reg_seq_hwioreg.h
  4516. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4517. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4518. * A value of 0 will be considered as ignore this config.
  4519. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4520. * e.g. wmac_top_reg_seq_hwioreg.h
  4521. * - b'16:31 - rsvd3 for future use
  4522. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4523. * to source rings. Consumer drops packets if the available
  4524. * words in the ring falls below the configured threshold
  4525. * value.
  4526. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4527. * by host. 1 -> subscribed
  4528. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4529. * by host. 1 -> subscribed
  4530. */
  4531. PREPACK struct htt_rx_ring_selection_cfg_t {
  4532. A_UINT32 msg_type: 8,
  4533. pdev_id: 8,
  4534. ring_id: 8,
  4535. status_swap: 1,
  4536. pkt_swap: 1,
  4537. rx_offsets_valid: 1,
  4538. drop_thresh_valid: 1,
  4539. rsvd1: 4;
  4540. A_UINT32 ring_buffer_size: 16,
  4541. rsvd2: 16;
  4542. A_UINT32 packet_type_enable_flags_0;
  4543. A_UINT32 packet_type_enable_flags_1;
  4544. A_UINT32 packet_type_enable_flags_2;
  4545. A_UINT32 packet_type_enable_flags_3;
  4546. A_UINT32 tlv_filter_in_flags;
  4547. A_UINT32 rx_packet_offset: 16,
  4548. rx_header_offset: 16;
  4549. A_UINT32 rx_mpdu_end_offset: 16,
  4550. rx_mpdu_start_offset: 16;
  4551. A_UINT32 rx_msdu_end_offset: 16,
  4552. rx_msdu_start_offset: 16;
  4553. A_UINT32 rx_attn_offset: 16,
  4554. rsvd3: 16;
  4555. A_UINT32 rx_drop_threshold: 10,
  4556. fp_ndp: 1,
  4557. mo_ndp: 1,
  4558. rsvd4: 20;
  4559. } POSTPACK;
  4560. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4561. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4562. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4563. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4564. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4565. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4566. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4570. } while (0)
  4571. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4572. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4573. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4574. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4575. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4576. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4580. } while (0)
  4581. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4582. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4583. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4584. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4585. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4586. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4587. do { \
  4588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4590. } while (0)
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4594. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4595. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4597. do { \
  4598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4600. } while (0)
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4602. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4603. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4604. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4605. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4606. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4607. do { \
  4608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4610. } while (0)
  4611. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4612. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4613. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4614. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4615. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4616. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4617. do { \
  4618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4620. } while (0)
  4621. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4622. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4624. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4625. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4626. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4627. do { \
  4628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4630. } while (0)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4634. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4635. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4650. } while (0)
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4654. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4655. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4657. do { \
  4658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4660. } while (0)
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4664. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4665. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4667. do { \
  4668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4670. } while (0)
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4673. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4674. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4675. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4676. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4677. do { \
  4678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4680. } while (0)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4684. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4685. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4687. do { \
  4688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4690. } while (0)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4695. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4697. do { \
  4698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4700. } while (0)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4705. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4707. do { \
  4708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4710. } while (0)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4714. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4715. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4720. } while (0)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4724. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4725. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4726. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4730. } while (0)
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4734. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4735. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4736. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4739. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4740. } while (0)
  4741. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4742. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4743. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4744. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4745. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4746. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4747. do { \
  4748. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4749. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4750. } while (0)
  4751. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4752. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4753. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4754. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4755. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4756. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4759. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4760. } while (0)
  4761. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4762. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4763. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4764. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4765. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4766. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4769. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4770. } while (0)
  4771. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4772. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4773. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4774. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4775. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4776. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4779. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4780. } while (0)
  4781. /*
  4782. * Subtype based MGMT frames enable bits.
  4783. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4784. */
  4785. /* association request */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4792. /* association response */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4799. /* Reassociation request */
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4806. /* Reassociation response */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4813. /* Probe request */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4820. /* Probe response */
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4827. /* Timing Advertisement */
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4834. /* Reserved */
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4841. /* Beacon */
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4848. /* ATIM */
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4855. /* Disassociation */
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4862. /* Authentication */
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4869. /* Deauthentication */
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4876. /* Action */
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4883. /* Action No Ack */
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4890. /* Reserved */
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4897. /*
  4898. * Subtype based CTRL frames enable bits.
  4899. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4900. */
  4901. /* Reserved */
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4908. /* Reserved */
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4915. /* Reserved */
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4922. /* Reserved */
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4929. /* Reserved */
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4936. /* Reserved */
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4943. /* Reserved */
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4950. /* Control Wrapper */
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4957. /* Block Ack Request */
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4964. /* Block Ack*/
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4971. /* PS-POLL */
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4978. /* RTS */
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4985. /* CTS */
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4992. /* ACK */
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4999. /* CF-END */
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5006. /* CF-END + CF-ACK */
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5013. /* Multicast data */
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5020. /* Unicast data */
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5027. /* NULL data */
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5035. do { \
  5036. HTT_CHECK_SET_VAL(httsym, value); \
  5037. (word) |= (value) << httsym##_S; \
  5038. } while (0)
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5040. (((word) & httsym##_M) >> httsym##_S)
  5041. #define htt_rx_ring_pkt_enable_subtype_set( \
  5042. word, flag, mode, type, subtype, val) \
  5043. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5044. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5045. #define htt_rx_ring_pkt_enable_subtype_get( \
  5046. word, flag, mode, type, subtype) \
  5047. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5048. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5049. /* Definition to filter in TLVs */
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5070. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5071. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5072. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5073. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5074. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5075. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5076. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5077. do { \
  5078. HTT_CHECK_SET_VAL(httsym, enable); \
  5079. (word) |= (enable) << httsym##_S; \
  5080. } while (0)
  5081. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5082. (((word) & httsym##_M) >> httsym##_S)
  5083. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5084. HTT_RX_RING_TLV_ENABLE_SET( \
  5085. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5086. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5087. HTT_RX_RING_TLV_ENABLE_GET( \
  5088. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5089. /**
  5090. * @brief host --> target Receive Flow Steering configuration message definition
  5091. *
  5092. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5093. *
  5094. * host --> target Receive Flow Steering configuration message definition.
  5095. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5096. * The reason for this is we want RFS to be configured and ready before MAC
  5097. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5098. *
  5099. * |31 24|23 16|15 9|8|7 0|
  5100. * |----------------+----------------+----------------+----------------|
  5101. * | reserved |E| msg type |
  5102. * |-------------------------------------------------------------------|
  5103. * Where E = RFS enable flag
  5104. *
  5105. * The RFS_CONFIG message consists of a single 4-byte word.
  5106. *
  5107. * Header fields:
  5108. * - MSG_TYPE
  5109. * Bits 7:0
  5110. * Purpose: identifies this as a RFS config msg
  5111. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5112. * - RFS_CONFIG
  5113. * Bit 8
  5114. * Purpose: Tells target whether to enable (1) or disable (0)
  5115. * flow steering feature when sending rx indication messages to host
  5116. */
  5117. #define HTT_H2T_RFS_CONFIG_M 0x100
  5118. #define HTT_H2T_RFS_CONFIG_S 8
  5119. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5120. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5121. HTT_H2T_RFS_CONFIG_S)
  5122. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5123. do { \
  5124. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5125. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5126. } while (0)
  5127. #define HTT_RFS_CFG_REQ_BYTES 4
  5128. /**
  5129. * @brief host -> target FW extended statistics retrieve
  5130. *
  5131. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5132. *
  5133. * @details
  5134. * The following field definitions describe the format of the HTT host
  5135. * to target FW extended stats retrieve message.
  5136. * The message specifies the type of stats the host wants to retrieve.
  5137. *
  5138. * |31 24|23 16|15 8|7 0|
  5139. * |-----------------------------------------------------------|
  5140. * | reserved | stats type | pdev_mask | msg type |
  5141. * |-----------------------------------------------------------|
  5142. * | config param [0] |
  5143. * |-----------------------------------------------------------|
  5144. * | config param [1] |
  5145. * |-----------------------------------------------------------|
  5146. * | config param [2] |
  5147. * |-----------------------------------------------------------|
  5148. * | config param [3] |
  5149. * |-----------------------------------------------------------|
  5150. * | reserved |
  5151. * |-----------------------------------------------------------|
  5152. * | cookie LSBs |
  5153. * |-----------------------------------------------------------|
  5154. * | cookie MSBs |
  5155. * |-----------------------------------------------------------|
  5156. * Header fields:
  5157. * - MSG_TYPE
  5158. * Bits 7:0
  5159. * Purpose: identifies this is a extended stats upload request message
  5160. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5161. * - PDEV_MASK
  5162. * Bits 8:15
  5163. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5164. * Value: This is a overloaded field, refer to usage and interpretation of
  5165. * PDEV in interface document.
  5166. * Bit 8 : Reserved for SOC stats
  5167. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5168. * Indicates MACID_MASK in DBS
  5169. * - STATS_TYPE
  5170. * Bits 23:16
  5171. * Purpose: identifies which FW statistics to upload
  5172. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5173. * - Reserved
  5174. * Bits 31:24
  5175. * - CONFIG_PARAM [0]
  5176. * Bits 31:0
  5177. * Purpose: give an opaque configuration value to the specified stats type
  5178. * Value: stats-type specific configuration value
  5179. * Refer to htt_stats.h for interpretation for each stats sub_type
  5180. * - CONFIG_PARAM [1]
  5181. * Bits 31:0
  5182. * Purpose: give an opaque configuration value to the specified stats type
  5183. * Value: stats-type specific configuration value
  5184. * Refer to htt_stats.h for interpretation for each stats sub_type
  5185. * - CONFIG_PARAM [2]
  5186. * Bits 31:0
  5187. * Purpose: give an opaque configuration value to the specified stats type
  5188. * Value: stats-type specific configuration value
  5189. * Refer to htt_stats.h for interpretation for each stats sub_type
  5190. * - CONFIG_PARAM [3]
  5191. * Bits 31:0
  5192. * Purpose: give an opaque configuration value to the specified stats type
  5193. * Value: stats-type specific configuration value
  5194. * Refer to htt_stats.h for interpretation for each stats sub_type
  5195. * - Reserved [31:0] for future use.
  5196. * - COOKIE_LSBS
  5197. * Bits 31:0
  5198. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5199. * message with its preceding host->target stats request message.
  5200. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5201. * - COOKIE_MSBS
  5202. * Bits 31:0
  5203. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5204. * message with its preceding host->target stats request message.
  5205. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5206. */
  5207. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5208. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5209. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5210. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5211. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5212. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5213. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5214. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5215. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5216. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5217. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5218. do { \
  5219. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5220. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5221. } while (0)
  5222. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5223. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5224. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5225. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5228. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5229. } while (0)
  5230. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5231. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5232. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5233. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5234. do { \
  5235. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5236. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5237. } while (0)
  5238. /**
  5239. * @brief host -> target FW PPDU_STATS request message
  5240. *
  5241. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5242. *
  5243. * @details
  5244. * The following field definitions describe the format of the HTT host
  5245. * to target FW for PPDU_STATS_CFG msg.
  5246. * The message allows the host to configure the PPDU_STATS_IND messages
  5247. * produced by the target.
  5248. *
  5249. * |31 24|23 16|15 8|7 0|
  5250. * |-----------------------------------------------------------|
  5251. * | REQ bit mask | pdev_mask | msg type |
  5252. * |-----------------------------------------------------------|
  5253. * Header fields:
  5254. * - MSG_TYPE
  5255. * Bits 7:0
  5256. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5257. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5258. * - PDEV_MASK
  5259. * Bits 8:15
  5260. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5261. * Value: This is a overloaded field, refer to usage and interpretation of
  5262. * PDEV in interface document.
  5263. * Bit 8 : Reserved for SOC stats
  5264. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5265. * Indicates MACID_MASK in DBS
  5266. * - REQ_TLV_BIT_MASK
  5267. * Bits 16:31
  5268. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5269. * needs to be included in the target's PPDU_STATS_IND messages.
  5270. * Value: refer htt_ppdu_stats_tlv_tag_t
  5271. *
  5272. */
  5273. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5274. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5275. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5276. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5277. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5278. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5279. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5280. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5281. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5284. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5285. } while (0)
  5286. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5287. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5288. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5289. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5290. do { \
  5291. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5292. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5293. } while (0)
  5294. /**
  5295. * @brief Host-->target HTT RX FSE setup message
  5296. *
  5297. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5298. *
  5299. * @details
  5300. * Through this message, the host will provide details of the flow tables
  5301. * in host DDR along with hash keys.
  5302. * This message can be sent per SOC or per PDEV, which is differentiated
  5303. * by pdev id values.
  5304. * The host will allocate flow search table and sends table size,
  5305. * physical DMA address of flow table, and hash keys to firmware to
  5306. * program into the RXOLE FSE HW block.
  5307. *
  5308. * The following field definitions describe the format of the RX FSE setup
  5309. * message sent from the host to target
  5310. *
  5311. * Header fields:
  5312. * dword0 - b'7:0 - msg_type: This will be set to
  5313. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5314. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5315. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5316. * pdev's LMAC ring.
  5317. * b'31:16 - reserved : Reserved for future use
  5318. * dword1 - b'19:0 - number of records: This field indicates the number of
  5319. * entries in the flow table. For example: 8k number of
  5320. * records is equivalent to
  5321. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5322. * b'27:20 - max search: This field specifies the skid length to FSE
  5323. * parser HW module whenever match is not found at the
  5324. * exact index pointed by hash.
  5325. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5326. * Refer htt_ip_da_sa_prefix below for more details.
  5327. * b'31:30 - reserved: Reserved for future use
  5328. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5329. * table allocated by host in DDR
  5330. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5331. * table allocated by host in DDR
  5332. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5333. * entry hashing
  5334. *
  5335. *
  5336. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5337. * |---------------------------------------------------------------|
  5338. * | reserved | pdev_id | MSG_TYPE |
  5339. * |---------------------------------------------------------------|
  5340. * |resvd|IPDSA| max_search | Number of records |
  5341. * |---------------------------------------------------------------|
  5342. * | base address lo |
  5343. * |---------------------------------------------------------------|
  5344. * | base address high |
  5345. * |---------------------------------------------------------------|
  5346. * | toeplitz key 31_0 |
  5347. * |---------------------------------------------------------------|
  5348. * | toeplitz key 63_32 |
  5349. * |---------------------------------------------------------------|
  5350. * | toeplitz key 95_64 |
  5351. * |---------------------------------------------------------------|
  5352. * | toeplitz key 127_96 |
  5353. * |---------------------------------------------------------------|
  5354. * | toeplitz key 159_128 |
  5355. * |---------------------------------------------------------------|
  5356. * | toeplitz key 191_160 |
  5357. * |---------------------------------------------------------------|
  5358. * | toeplitz key 223_192 |
  5359. * |---------------------------------------------------------------|
  5360. * | toeplitz key 255_224 |
  5361. * |---------------------------------------------------------------|
  5362. * | toeplitz key 287_256 |
  5363. * |---------------------------------------------------------------|
  5364. * | reserved | toeplitz key 314_288(26:0 bits) |
  5365. * |---------------------------------------------------------------|
  5366. * where:
  5367. * IPDSA = ip_da_sa
  5368. */
  5369. /**
  5370. * @brief: htt_ip_da_sa_prefix
  5371. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5372. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5373. * documentation per RFC3849
  5374. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5375. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5376. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5377. */
  5378. enum htt_ip_da_sa_prefix {
  5379. HTT_RX_IPV6_20010db8,
  5380. HTT_RX_IPV4_MAPPED_IPV6,
  5381. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5382. HTT_RX_IPV6_64FF9B,
  5383. };
  5384. /**
  5385. * @brief Host-->target HTT RX FISA configure and enable
  5386. *
  5387. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5388. *
  5389. * @details
  5390. * The host will send this command down to configure and enable the FISA
  5391. * operational params.
  5392. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5393. * register.
  5394. * Should configure both the MACs.
  5395. *
  5396. * dword0 - b'7:0 - msg_type:
  5397. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5398. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5399. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5400. * pdev's LMAC ring.
  5401. * b'31:16 - reserved : Reserved for future use
  5402. *
  5403. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5404. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5405. * packets. 1 flow search will be skipped
  5406. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5407. * tcp,udp packets
  5408. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5409. * calculation
  5410. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5411. * calculation
  5412. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5413. * calculation
  5414. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5415. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5416. * length
  5417. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5418. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5419. * length
  5420. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5421. * num jump
  5422. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5423. * num jump
  5424. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5425. * data type switch has happend for MPDU Sequence num jump
  5426. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5427. * for MPDU Sequence num jump
  5428. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5429. * for decrypt errors
  5430. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5431. * while aggregating a msdu
  5432. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5433. * The aggregation is done until (number of MSDUs aggregated
  5434. * < LIMIT + 1)
  5435. * b'31:18 - Reserved
  5436. *
  5437. * fisa_control_value - 32bit value FW can write to register
  5438. *
  5439. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5440. * Threshold value for FISA timeout (units are microseconds).
  5441. * When the global timestamp exceeds this threshold, FISA
  5442. * aggregation will be restarted.
  5443. * A value of 0 means timeout is disabled.
  5444. * Compare the threshold register with timestamp field in
  5445. * flow entry to generate timeout for the flow.
  5446. *
  5447. * |31 18 |17 16|15 8|7 0|
  5448. * |-------------------------------------------------------------|
  5449. * | reserved | pdev_mask | msg type |
  5450. * |-------------------------------------------------------------|
  5451. * | reserved | FISA_CTRL |
  5452. * |-------------------------------------------------------------|
  5453. * | FISA_TIMEOUT_THRESH |
  5454. * |-------------------------------------------------------------|
  5455. */
  5456. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5457. A_UINT32 msg_type:8,
  5458. pdev_id:8,
  5459. reserved0:16;
  5460. /**
  5461. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5462. * [17:0]
  5463. */
  5464. union {
  5465. /*
  5466. * fisa_control_bits structure is deprecated.
  5467. * Please use fisa_control_bits_v2 going forward.
  5468. */
  5469. struct {
  5470. A_UINT32 fisa_enable: 1,
  5471. ipsec_skip_search: 1,
  5472. nontcp_skip_search: 1,
  5473. add_ipv4_fixed_hdr_len: 1,
  5474. add_ipv6_fixed_hdr_len: 1,
  5475. add_tcp_fixed_hdr_len: 1,
  5476. add_udp_hdr_len: 1,
  5477. chksum_cum_ip_len_en: 1,
  5478. disable_tid_check: 1,
  5479. disable_ta_check: 1,
  5480. disable_qos_check: 1,
  5481. disable_raw_check: 1,
  5482. disable_decrypt_err_check: 1,
  5483. disable_msdu_drop_check: 1,
  5484. fisa_aggr_limit: 4,
  5485. reserved: 14;
  5486. } fisa_control_bits;
  5487. struct {
  5488. A_UINT32 fisa_enable: 1,
  5489. fisa_aggr_limit: 4,
  5490. reserved: 27;
  5491. } fisa_control_bits_v2;
  5492. A_UINT32 fisa_control_value;
  5493. } u_fisa_control;
  5494. /**
  5495. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5496. * timeout threshold for aggregation. Unit in usec.
  5497. * [31:0]
  5498. */
  5499. A_UINT32 fisa_timeout_threshold;
  5500. } POSTPACK;
  5501. /* DWord 0: pdev-ID */
  5502. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5503. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5504. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5505. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5506. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5507. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5508. do { \
  5509. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5510. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5511. } while (0)
  5512. /* Dword 1: fisa_control_value fisa config */
  5513. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5514. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5515. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5516. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5517. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5518. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5522. } while (0)
  5523. /* Dword 1: fisa_control_value ipsec_skip_search */
  5524. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5525. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5526. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5527. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5528. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5529. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5533. } while (0)
  5534. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5535. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5536. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5537. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5538. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5539. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5540. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5543. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5544. } while (0)
  5545. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5546. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5547. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5548. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5549. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5550. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5551. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5555. } while (0)
  5556. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5557. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5558. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5559. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5560. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5561. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5562. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5565. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5566. } while (0)
  5567. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5568. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5569. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5570. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5571. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5572. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5573. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5577. } while (0)
  5578. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5579. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5580. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5581. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5582. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5583. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5584. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5587. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5588. } while (0)
  5589. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5590. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5591. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5592. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5593. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5594. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5595. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5596. do { \
  5597. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5598. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5599. } while (0)
  5600. /* Dword 1: fisa_control_value disable_tid_check */
  5601. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5604. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5605. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5606. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5609. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5610. } while (0)
  5611. /* Dword 1: fisa_control_value disable_ta_check */
  5612. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5615. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5616. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5617. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5618. do { \
  5619. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5620. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5621. } while (0)
  5622. /* Dword 1: fisa_control_value disable_qos_check */
  5623. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5624. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5625. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5626. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5627. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5628. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5631. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5632. } while (0)
  5633. /* Dword 1: fisa_control_value disable_raw_check */
  5634. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5635. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5636. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5637. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5638. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5639. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5640. do { \
  5641. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5642. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5643. } while (0)
  5644. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5645. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5646. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5647. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5648. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5649. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5650. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5651. do { \
  5652. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5653. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5654. } while (0)
  5655. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5656. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5657. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5658. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5659. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5660. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5661. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5664. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5665. } while (0)
  5666. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5667. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5668. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5669. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5670. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5671. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5672. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5673. do { \
  5674. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5675. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5676. } while (0)
  5677. /* Dword 1: fisa_control_value fisa config */
  5678. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5679. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5680. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5681. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5682. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5683. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5686. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5687. } while (0)
  5688. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5689. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5690. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5691. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5692. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5693. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5694. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5695. do { \
  5696. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5697. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5698. } while (0)
  5699. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5700. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5701. pdev_id:8,
  5702. reserved0:16;
  5703. A_UINT32 num_records:20,
  5704. max_search:8,
  5705. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5706. reserved1:2;
  5707. A_UINT32 base_addr_lo;
  5708. A_UINT32 base_addr_hi;
  5709. A_UINT32 toeplitz31_0;
  5710. A_UINT32 toeplitz63_32;
  5711. A_UINT32 toeplitz95_64;
  5712. A_UINT32 toeplitz127_96;
  5713. A_UINT32 toeplitz159_128;
  5714. A_UINT32 toeplitz191_160;
  5715. A_UINT32 toeplitz223_192;
  5716. A_UINT32 toeplitz255_224;
  5717. A_UINT32 toeplitz287_256;
  5718. A_UINT32 toeplitz314_288:27,
  5719. reserved2:5;
  5720. } POSTPACK;
  5721. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5722. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5723. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5724. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5725. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5726. /* DWORD 0: Pdev ID */
  5727. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5728. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5729. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5730. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5731. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5732. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5733. do { \
  5734. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5735. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5736. } while (0)
  5737. /* DWORD 1:num of records */
  5738. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5739. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5740. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5741. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5742. HTT_RX_FSE_SETUP_NUM_REC_S)
  5743. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5746. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5747. } while (0)
  5748. /* DWORD 1:max_search */
  5749. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5750. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5751. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5752. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5753. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5754. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5755. do { \
  5756. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5757. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5758. } while (0)
  5759. /* DWORD 1:ip_da_sa prefix */
  5760. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5761. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5762. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5763. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5764. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5765. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5766. do { \
  5767. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5768. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5769. } while (0)
  5770. /* DWORD 2: Base Address LO */
  5771. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5772. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5773. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5774. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5775. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5776. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5777. do { \
  5778. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5779. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5780. } while (0)
  5781. /* DWORD 3: Base Address High */
  5782. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5783. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5784. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5785. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5786. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5787. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5788. do { \
  5789. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5790. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5791. } while (0)
  5792. /* DWORD 4-12: Hash Value */
  5793. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5794. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5795. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5796. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5797. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5798. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5799. do { \
  5800. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5801. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5802. } while (0)
  5803. /* DWORD 13: Hash Value 314:288 bits */
  5804. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5805. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5806. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5807. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5808. do { \
  5809. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5810. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5811. } while (0)
  5812. /**
  5813. * @brief Host-->target HTT RX FSE operation message
  5814. *
  5815. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5816. *
  5817. * @details
  5818. * The host will send this Flow Search Engine (FSE) operation message for
  5819. * every flow add/delete operation.
  5820. * The FSE operation includes FSE full cache invalidation or individual entry
  5821. * invalidation.
  5822. * This message can be sent per SOC or per PDEV which is differentiated
  5823. * by pdev id values.
  5824. *
  5825. * |31 16|15 8|7 1|0|
  5826. * |-------------------------------------------------------------|
  5827. * | reserved | pdev_id | MSG_TYPE |
  5828. * |-------------------------------------------------------------|
  5829. * | reserved | operation |I|
  5830. * |-------------------------------------------------------------|
  5831. * | ip_src_addr_31_0 |
  5832. * |-------------------------------------------------------------|
  5833. * | ip_src_addr_63_32 |
  5834. * |-------------------------------------------------------------|
  5835. * | ip_src_addr_95_64 |
  5836. * |-------------------------------------------------------------|
  5837. * | ip_src_addr_127_96 |
  5838. * |-------------------------------------------------------------|
  5839. * | ip_dst_addr_31_0 |
  5840. * |-------------------------------------------------------------|
  5841. * | ip_dst_addr_63_32 |
  5842. * |-------------------------------------------------------------|
  5843. * | ip_dst_addr_95_64 |
  5844. * |-------------------------------------------------------------|
  5845. * | ip_dst_addr_127_96 |
  5846. * |-------------------------------------------------------------|
  5847. * | l4_dst_port | l4_src_port |
  5848. * | (32-bit SPI incase of IPsec) |
  5849. * |-------------------------------------------------------------|
  5850. * | reserved | l4_proto |
  5851. * |-------------------------------------------------------------|
  5852. *
  5853. * where I is 1-bit ipsec_valid.
  5854. *
  5855. * The following field definitions describe the format of the RX FSE operation
  5856. * message sent from the host to target for every add/delete flow entry to flow
  5857. * table.
  5858. *
  5859. * Header fields:
  5860. * dword0 - b'7:0 - msg_type: This will be set to
  5861. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  5862. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5863. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5864. * specified pdev's LMAC ring.
  5865. * b'31:16 - reserved : Reserved for future use
  5866. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5867. * (Internet Protocol Security).
  5868. * IPsec describes the framework for providing security at
  5869. * IP layer. IPsec is defined for both versions of IP:
  5870. * IPV4 and IPV6.
  5871. * Please refer to htt_rx_flow_proto enumeration below for
  5872. * more info.
  5873. * ipsec_valid = 1 for IPSEC packets
  5874. * ipsec_valid = 0 for IP Packets
  5875. * b'7:1 - operation: This indicates types of FSE operation.
  5876. * Refer to htt_rx_fse_operation enumeration:
  5877. * 0 - No Cache Invalidation required
  5878. * 1 - Cache invalidate only one entry given by IP
  5879. * src/dest address at DWORD[2:9]
  5880. * 2 - Complete FSE Cache Invalidation
  5881. * 3 - FSE Disable
  5882. * 4 - FSE Enable
  5883. * b'31:8 - reserved: Reserved for future use
  5884. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5885. * for per flow addition/deletion
  5886. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5887. * and the subsequent 3 A_UINT32 will be padding bytes.
  5888. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5889. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5890. * from 0 to 65535 but only 0 to 1023 are designated as
  5891. * well-known ports. Refer to [RFC1700] for more details.
  5892. * This field is valid only if
  5893. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5894. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5895. * range from 0 to 65535 but only 0 to 1023 are designated
  5896. * as well-known ports. Refer to [RFC1700] for more details.
  5897. * This field is valid only if
  5898. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5899. * - SPI (31:0): Security Parameters Index is an
  5900. * identification tag added to the header while using IPsec
  5901. * for tunneling the IP traffici.
  5902. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5903. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5904. * Assigned Internet Protocol Numbers.
  5905. * l4_proto numbers for standard protocol like UDP/TCP
  5906. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5907. * l4_proto = 17 for UDP etc.
  5908. * b'31:8 - reserved: Reserved for future use.
  5909. *
  5910. */
  5911. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5912. A_UINT32 msg_type:8,
  5913. pdev_id:8,
  5914. reserved0:16;
  5915. A_UINT32 ipsec_valid:1,
  5916. operation:7,
  5917. reserved1:24;
  5918. A_UINT32 ip_src_addr_31_0;
  5919. A_UINT32 ip_src_addr_63_32;
  5920. A_UINT32 ip_src_addr_95_64;
  5921. A_UINT32 ip_src_addr_127_96;
  5922. A_UINT32 ip_dest_addr_31_0;
  5923. A_UINT32 ip_dest_addr_63_32;
  5924. A_UINT32 ip_dest_addr_95_64;
  5925. A_UINT32 ip_dest_addr_127_96;
  5926. union {
  5927. A_UINT32 spi;
  5928. struct {
  5929. A_UINT32 l4_src_port:16,
  5930. l4_dest_port:16;
  5931. } ip;
  5932. } u;
  5933. A_UINT32 l4_proto:8,
  5934. reserved:24;
  5935. } POSTPACK;
  5936. /**
  5937. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5938. *
  5939. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  5940. *
  5941. * @details
  5942. * The host will send this Full monitor mode register configuration message.
  5943. * This message can be sent per SOC or per PDEV which is differentiated
  5944. * by pdev id values.
  5945. *
  5946. * |31 16|15 11|10 8|7 3|2|1|0|
  5947. * |-------------------------------------------------------------|
  5948. * | reserved | pdev_id | MSG_TYPE |
  5949. * |-------------------------------------------------------------|
  5950. * | reserved |Release Ring |N|Z|E|
  5951. * |-------------------------------------------------------------|
  5952. *
  5953. * where E is 1-bit full monitor mode enable/disable.
  5954. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5955. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5956. *
  5957. * The following field definitions describe the format of the full monitor
  5958. * mode configuration message sent from the host to target for each pdev.
  5959. *
  5960. * Header fields:
  5961. * dword0 - b'7:0 - msg_type: This will be set to
  5962. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  5963. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5964. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5965. * specified pdev's LMAC ring.
  5966. * b'31:16 - reserved : Reserved for future use.
  5967. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5968. * monitor mode rxdma register is to be enabled or disabled.
  5969. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5970. * additional descriptors at ppdu end for zero mpdus
  5971. * enabled or disabled.
  5972. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5973. * additional descriptors at ppdu end for non zero mpdus
  5974. * enabled or disabled.
  5975. * b'10:3 - release_ring: This indicates the destination ring
  5976. * selection for the descriptor at the end of PPDU
  5977. * 0 - REO ring select
  5978. * 1 - FW ring select
  5979. * 2 - SW ring select
  5980. * 3 - Release ring select
  5981. * Refer to htt_rx_full_mon_release_ring.
  5982. * b'31:11 - reserved for future use
  5983. */
  5984. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5985. A_UINT32 msg_type:8,
  5986. pdev_id:8,
  5987. reserved0:16;
  5988. A_UINT32 full_monitor_mode_enable:1,
  5989. addnl_descs_zero_mpdus_end:1,
  5990. addnl_descs_non_zero_mpdus_end:1,
  5991. release_ring:8,
  5992. reserved1:21;
  5993. } POSTPACK;
  5994. /**
  5995. * Enumeration for full monitor mode destination ring select
  5996. * 0 - REO destination ring select
  5997. * 1 - FW destination ring select
  5998. * 2 - SW destination ring select
  5999. * 3 - Release destination ring select
  6000. */
  6001. enum htt_rx_full_mon_release_ring {
  6002. HTT_RX_MON_RING_REO,
  6003. HTT_RX_MON_RING_FW,
  6004. HTT_RX_MON_RING_SW,
  6005. HTT_RX_MON_RING_RELEASE,
  6006. };
  6007. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6008. /* DWORD 0: Pdev ID */
  6009. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6010. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6011. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6012. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6013. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6014. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6015. do { \
  6016. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6017. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6018. } while (0)
  6019. /* DWORD 1:ENABLE */
  6020. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6021. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6022. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6025. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6026. } while (0)
  6027. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6028. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6029. /* DWORD 1:ZERO_MPDU */
  6030. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6031. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6032. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6035. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6036. } while (0)
  6037. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6038. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6039. /* DWORD 1:NON_ZERO_MPDU */
  6040. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6041. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6042. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6045. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6046. } while (0)
  6047. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6048. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6049. /* DWORD 1:RELEASE_RINGS */
  6050. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6051. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6052. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6055. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6056. } while (0)
  6057. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6058. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6059. /**
  6060. * Enumeration for IP Protocol or IPSEC Protocol
  6061. * IPsec describes the framework for providing security at IP layer.
  6062. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6063. */
  6064. enum htt_rx_flow_proto {
  6065. HTT_RX_FLOW_IP_PROTO,
  6066. HTT_RX_FLOW_IPSEC_PROTO,
  6067. };
  6068. /**
  6069. * Enumeration for FSE Cache Invalidation
  6070. * 0 - No Cache Invalidation required
  6071. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6072. * 2 - Complete FSE Cache Invalidation
  6073. * 3 - FSE Disable
  6074. * 4 - FSE Enable
  6075. */
  6076. enum htt_rx_fse_operation {
  6077. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6078. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6079. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6080. HTT_RX_FSE_DISABLE,
  6081. HTT_RX_FSE_ENABLE,
  6082. };
  6083. /* DWORD 0: Pdev ID */
  6084. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6085. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6086. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6087. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6088. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6089. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6090. do { \
  6091. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6092. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6093. } while (0)
  6094. /* DWORD 1:IP PROTO or IPSEC */
  6095. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6096. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6097. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6098. do { \
  6099. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6100. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6101. } while (0)
  6102. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6103. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6104. /* DWORD 1:FSE Operation */
  6105. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6106. #define HTT_RX_FSE_OPERATION_S 1
  6107. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6108. do { \
  6109. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6110. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6111. } while (0)
  6112. #define HTT_RX_FSE_OPERATION_GET(word) \
  6113. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6114. /* DWORD 2-9:IP Address */
  6115. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6116. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6117. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6118. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6119. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6120. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6121. do { \
  6122. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6123. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6124. } while (0)
  6125. /* DWORD 10:Source Port Number */
  6126. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6127. #define HTT_RX_FSE_SOURCEPORT_S 0
  6128. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6129. do { \
  6130. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6131. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6132. } while (0)
  6133. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6134. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6135. /* DWORD 11:Destination Port Number */
  6136. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6137. #define HTT_RX_FSE_DESTPORT_S 16
  6138. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6139. do { \
  6140. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6141. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6142. } while (0)
  6143. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6144. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6145. /* DWORD 10-11:SPI (In case of IPSEC) */
  6146. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6147. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6148. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6149. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6150. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6151. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6152. do { \
  6153. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6154. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6155. } while (0)
  6156. /* DWORD 12:L4 PROTO */
  6157. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6158. #define HTT_RX_FSE_L4_PROTO_S 0
  6159. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6160. do { \
  6161. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6162. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6163. } while (0)
  6164. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6165. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6166. /**
  6167. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6168. *
  6169. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6170. *
  6171. * |31 24|23 |15 8|7 2|1|0|
  6172. * |----------------+----------------+----------------+----------------|
  6173. * | reserved | pdev_id | msg_type |
  6174. * |---------------------------------+----------------+----------------|
  6175. * | reserved |E|F|
  6176. * |---------------------------------+----------------+----------------|
  6177. * Where E = Configure the target to provide the 3-tuple hash value in
  6178. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6179. * F = Configure the target to provide the 3-tuple hash value in
  6180. * flow_id_toeplitz field of rx_msdu_start tlv
  6181. *
  6182. * The following field definitions describe the format of the 3 tuple hash value
  6183. * message sent from the host to target as part of initialization sequence.
  6184. *
  6185. * Header fields:
  6186. * dword0 - b'7:0 - msg_type: This will be set to
  6187. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6188. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6189. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6190. * specified pdev's LMAC ring.
  6191. * b'31:16 - reserved : Reserved for future use
  6192. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6193. * b'1 - toeplitz_hash_2_or_4_field_enable
  6194. * b'31:2 - reserved : Reserved for future use
  6195. * ---------+------+----------------------------------------------------------
  6196. * bit1 | bit0 | Functionality
  6197. * ---------+------+----------------------------------------------------------
  6198. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6199. * | | in flow_id_toeplitz field
  6200. * ---------+------+----------------------------------------------------------
  6201. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6202. * | | in toeplitz_hash_2_or_4 field
  6203. * ---------+------+----------------------------------------------------------
  6204. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6205. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6206. * ---------+------+----------------------------------------------------------
  6207. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6208. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6209. * | | toeplitz_hash_2_or_4 field
  6210. *----------------------------------------------------------------------------
  6211. */
  6212. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6213. A_UINT32 msg_type :8,
  6214. pdev_id :8,
  6215. reserved0 :16;
  6216. A_UINT32 flow_id_toeplitz_field_enable :1,
  6217. toeplitz_hash_2_or_4_field_enable :1,
  6218. reserved1 :30;
  6219. } POSTPACK;
  6220. /* DWORD0 : pdev_id configuration Macros */
  6221. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6222. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6223. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6224. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6225. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6226. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6229. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6230. } while (0)
  6231. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6232. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6233. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6234. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6235. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6236. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6237. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6238. do { \
  6239. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6240. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6241. } while (0)
  6242. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6243. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6244. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6245. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6246. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6247. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6250. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6251. } while (0)
  6252. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6253. /**
  6254. * @brief host --> target Host PA Address Size
  6255. *
  6256. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6257. *
  6258. * @details
  6259. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6260. * provide the physical start address and size of each of the memory
  6261. * areas within host DDR that the target FW may need to access.
  6262. *
  6263. * For example, the host can use this message to allow the target FW
  6264. * to set up access to the host's pools of TQM link descriptors.
  6265. * The message would appear as follows:
  6266. *
  6267. * |31 24|23 16|15 8|7 0|
  6268. * |----------------+----------------+----------------+----------------|
  6269. * | reserved | num_entries | msg_type |
  6270. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6271. * | mem area 0 size |
  6272. * |----------------+----------------+----------------+----------------|
  6273. * | mem area 0 physical_address_lo |
  6274. * |----------------+----------------+----------------+----------------|
  6275. * | mem area 0 physical_address_hi |
  6276. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6277. * | mem area 1 size |
  6278. * |----------------+----------------+----------------+----------------|
  6279. * | mem area 1 physical_address_lo |
  6280. * |----------------+----------------+----------------+----------------|
  6281. * | mem area 1 physical_address_hi |
  6282. * |----------------+----------------+----------------+----------------|
  6283. * ...
  6284. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6285. * | mem area N size |
  6286. * |----------------+----------------+----------------+----------------|
  6287. * | mem area N physical_address_lo |
  6288. * |----------------+----------------+----------------+----------------|
  6289. * | mem area N physical_address_hi |
  6290. * |----------------+----------------+----------------+----------------|
  6291. *
  6292. * The message is interpreted as follows:
  6293. * dword0 - b'0:7 - msg_type: This will be set to
  6294. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6295. * b'8:15 - number_entries: Indicated the number of host memory
  6296. * areas specified within the remainder of the message
  6297. * b'16:31 - reserved.
  6298. * dword1 - b'0:31 - memory area 0 size in bytes
  6299. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6300. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6301. * and similar for memory area 1 through memory area N.
  6302. */
  6303. PREPACK struct htt_h2t_host_paddr_size {
  6304. A_UINT32 msg_type: 8,
  6305. num_entries: 8,
  6306. reserved: 16;
  6307. } POSTPACK;
  6308. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6309. A_UINT32 size;
  6310. A_UINT32 physical_address_lo;
  6311. A_UINT32 physical_address_hi;
  6312. } POSTPACK;
  6313. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6314. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6315. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6316. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6317. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6318. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6319. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6320. do { \
  6321. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6322. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6323. } while (0)
  6324. /**
  6325. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  6326. *
  6327. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  6328. *
  6329. * @details
  6330. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  6331. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  6332. *
  6333. * The message would appear as follows:
  6334. *
  6335. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  6336. * |---------------------------------+---+---+----------+-+-----------|
  6337. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  6338. * |---------------------+---+---+---+---+---+----------+-+-----------|
  6339. *
  6340. *
  6341. * The message is interpreted as follows:
  6342. * dword0 - b'0:7 - msg_type: This will be set to
  6343. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  6344. * b'8 - override bit to drive MSDUs to PPE ring
  6345. * b'9:13 - REO destination ring indication
  6346. * b'14 - Multi buffer msdu override enable bit
  6347. * b'15 - Intra BSS override
  6348. * b'16 - Decap raw override
  6349. * b'17 - Decap Native wifi override
  6350. * b'18 - IP frag override
  6351. * b'19:31 - reserved
  6352. */
  6353. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  6354. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  6355. override: 1,
  6356. reo_destination_indication: 5,
  6357. multi_buffer_msdu_override_en: 1,
  6358. intra_bss_override: 1,
  6359. decap_raw_override: 1,
  6360. decap_nwifi_override: 1,
  6361. ip_frag_override: 1,
  6362. reserved: 13;
  6363. } POSTPACK;
  6364. /* DWORD 0: Override */
  6365. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  6366. #define HTT_PPE_CFG_OVERRIDE_S 8
  6367. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  6368. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  6369. HTT_PPE_CFG_OVERRIDE_S)
  6370. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  6373. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  6374. } while (0)
  6375. /* DWORD 0: REO Destination Indication*/
  6376. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  6377. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  6378. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  6379. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  6380. HTT_PPE_CFG_REO_DEST_IND_S)
  6381. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  6384. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  6385. } while (0)
  6386. /* DWORD 0: Multi buffer MSDU override */
  6387. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  6388. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  6389. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  6390. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  6391. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  6392. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  6393. do { \
  6394. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  6395. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  6396. } while (0)
  6397. /* DWORD 0: Intra BSS override */
  6398. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  6399. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  6400. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  6401. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  6402. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  6403. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  6406. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  6407. } while (0)
  6408. /* DWORD 0: Decap RAW override */
  6409. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  6410. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  6411. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  6412. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  6413. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  6414. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  6415. do { \
  6416. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  6417. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  6418. } while (0)
  6419. /* DWORD 0: Decap NWIFI override */
  6420. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  6421. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  6422. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  6423. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  6424. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  6425. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  6426. do { \
  6427. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  6428. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  6429. } while (0)
  6430. /* DWORD 0: IP frag override */
  6431. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  6432. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  6433. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  6434. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  6435. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  6436. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  6437. do { \
  6438. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  6439. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  6440. } while (0)
  6441. /*=== target -> host messages ===============================================*/
  6442. enum htt_t2h_msg_type {
  6443. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6444. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6445. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6446. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6447. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6448. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6449. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6450. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6451. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6452. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6453. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6454. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6455. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6456. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6457. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6458. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6459. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6460. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6461. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6462. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6463. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6464. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6465. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6466. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6467. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6468. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6469. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6470. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6471. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6472. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6473. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6474. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6475. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6476. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6477. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6478. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6479. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6480. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6481. /* TX_OFFLOAD_DELIVER_IND:
  6482. * Forward the target's locally-generated packets to the host,
  6483. * to provide to the monitor mode interface.
  6484. */
  6485. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6486. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6487. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6488. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6489. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  6490. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  6491. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  6492. HTT_T2H_MSG_TYPE_TEST,
  6493. /* keep this last */
  6494. HTT_T2H_NUM_MSGS
  6495. };
  6496. /*
  6497. * HTT target to host message type -
  6498. * stored in bits 7:0 of the first word of the message
  6499. */
  6500. #define HTT_T2H_MSG_TYPE_M 0xff
  6501. #define HTT_T2H_MSG_TYPE_S 0
  6502. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6503. do { \
  6504. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6505. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6506. } while (0)
  6507. #define HTT_T2H_MSG_TYPE_GET(word) \
  6508. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6509. /**
  6510. * @brief target -> host version number confirmation message definition
  6511. *
  6512. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6513. *
  6514. * |31 24|23 16|15 8|7 0|
  6515. * |----------------+----------------+----------------+----------------|
  6516. * | reserved | major number | minor number | msg type |
  6517. * |-------------------------------------------------------------------|
  6518. * : option request TLV (optional) |
  6519. * :...................................................................:
  6520. *
  6521. * The VER_CONF message may consist of a single 4-byte word, or may be
  6522. * extended with TLVs that specify HTT options selected by the target.
  6523. * The following option TLVs may be appended to the VER_CONF message:
  6524. * - LL_BUS_ADDR_SIZE
  6525. * - HL_SUPPRESS_TX_COMPL_IND
  6526. * - MAX_TX_QUEUE_GROUPS
  6527. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6528. * may be appended to the VER_CONF message (but only one TLV of each type).
  6529. *
  6530. * Header fields:
  6531. * - MSG_TYPE
  6532. * Bits 7:0
  6533. * Purpose: identifies this as a version number confirmation message
  6534. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6535. * - VER_MINOR
  6536. * Bits 15:8
  6537. * Purpose: Specify the minor number of the HTT message library version
  6538. * in use by the target firmware.
  6539. * The minor number specifies the specific revision within a range
  6540. * of fundamentally compatible HTT message definition revisions.
  6541. * Compatible revisions involve adding new messages or perhaps
  6542. * adding new fields to existing messages, in a backwards-compatible
  6543. * manner.
  6544. * Incompatible revisions involve changing the message type values,
  6545. * or redefining existing messages.
  6546. * Value: minor number
  6547. * - VER_MAJOR
  6548. * Bits 15:8
  6549. * Purpose: Specify the major number of the HTT message library version
  6550. * in use by the target firmware.
  6551. * The major number specifies the family of minor revisions that are
  6552. * fundamentally compatible with each other, but not with prior or
  6553. * later families.
  6554. * Value: major number
  6555. */
  6556. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6557. #define HTT_VER_CONF_MINOR_S 8
  6558. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6559. #define HTT_VER_CONF_MAJOR_S 16
  6560. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6563. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6564. } while (0)
  6565. #define HTT_VER_CONF_MINOR_GET(word) \
  6566. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6567. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6568. do { \
  6569. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6570. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6571. } while (0)
  6572. #define HTT_VER_CONF_MAJOR_GET(word) \
  6573. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6574. #define HTT_VER_CONF_BYTES 4
  6575. /**
  6576. * @brief - target -> host HTT Rx In order indication message
  6577. *
  6578. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6579. *
  6580. * @details
  6581. *
  6582. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6583. * |----------------+-------------------+---------------------+---------------|
  6584. * | peer ID | P| F| O| ext TID | msg type |
  6585. * |--------------------------------------------------------------------------|
  6586. * | MSDU count | Reserved | vdev id |
  6587. * |--------------------------------------------------------------------------|
  6588. * | MSDU 0 bus address (bits 31:0) |
  6589. #if HTT_PADDR64
  6590. * | MSDU 0 bus address (bits 63:32) |
  6591. #endif
  6592. * |--------------------------------------------------------------------------|
  6593. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6594. * |--------------------------------------------------------------------------|
  6595. * | MSDU 1 bus address (bits 31:0) |
  6596. #if HTT_PADDR64
  6597. * | MSDU 1 bus address (bits 63:32) |
  6598. #endif
  6599. * |--------------------------------------------------------------------------|
  6600. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6601. * |--------------------------------------------------------------------------|
  6602. */
  6603. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6604. *
  6605. * @details
  6606. * bits
  6607. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6608. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6609. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6610. * | | frag | | | | fail |chksum fail|
  6611. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6612. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6613. */
  6614. struct htt_rx_in_ord_paddr_ind_hdr_t
  6615. {
  6616. A_UINT32 /* word 0 */
  6617. msg_type: 8,
  6618. ext_tid: 5,
  6619. offload: 1,
  6620. frag: 1,
  6621. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6622. peer_id: 16;
  6623. A_UINT32 /* word 1 */
  6624. vap_id: 8,
  6625. /* NOTE:
  6626. * This reserved_1 field is not truly reserved - certain targets use
  6627. * this field internally to store debug information, and do not zero
  6628. * out the contents of the field before uploading the message to the
  6629. * host. Thus, any host-target communication supported by this field
  6630. * is limited to using values that are never used by the debug
  6631. * information stored by certain targets in the reserved_1 field.
  6632. * In particular, the targets in question don't use the value 0x3
  6633. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6634. * so this previously-unused value within these bits is available to
  6635. * use as the host / target PKT_CAPTURE_MODE flag.
  6636. */
  6637. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6638. /* if pkt_capture_mode == 0x3, host should
  6639. * send rx frames to monitor mode interface
  6640. */
  6641. msdu_cnt: 16;
  6642. };
  6643. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6644. {
  6645. A_UINT32 dma_addr;
  6646. A_UINT32
  6647. length: 16,
  6648. fw_desc: 8,
  6649. msdu_info:8;
  6650. };
  6651. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6652. {
  6653. A_UINT32 dma_addr_lo;
  6654. A_UINT32 dma_addr_hi;
  6655. A_UINT32
  6656. length: 16,
  6657. fw_desc: 8,
  6658. msdu_info:8;
  6659. };
  6660. #if HTT_PADDR64
  6661. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6662. #else
  6663. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6664. #endif
  6665. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6666. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6667. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6668. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6669. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6670. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6671. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6672. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6673. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6674. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6675. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6676. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6677. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6678. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6679. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6680. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6681. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6682. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6683. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6684. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6685. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6686. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6687. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6688. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6689. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6690. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6691. /* for systems using 64-bit format for bus addresses */
  6692. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6693. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6694. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6695. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6696. /* for systems using 32-bit format for bus addresses */
  6697. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6698. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6699. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6701. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6702. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6704. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6705. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6706. do { \
  6707. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6708. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6709. } while (0)
  6710. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6711. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6712. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6713. do { \
  6714. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6715. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6716. } while (0)
  6717. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6718. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6719. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6720. do { \
  6721. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6722. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6723. } while (0)
  6724. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6725. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6726. /*
  6727. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6728. * deliver the rx frames to the monitor mode interface.
  6729. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6730. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6731. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6732. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6733. */
  6734. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6735. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6736. do { \
  6737. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6738. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6739. } while (0)
  6740. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6741. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6742. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6743. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6744. do { \
  6745. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6746. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6747. } while (0)
  6748. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6749. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6750. /* for systems using 64-bit format for bus addresses */
  6751. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6752. do { \
  6753. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6754. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6755. } while (0)
  6756. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6757. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6758. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6759. do { \
  6760. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6761. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6762. } while (0)
  6763. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6764. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6765. /* for systems using 32-bit format for bus addresses */
  6766. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6769. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6770. } while (0)
  6771. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6772. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6773. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6774. do { \
  6775. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6776. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6777. } while (0)
  6778. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6779. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6780. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6783. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6784. } while (0)
  6785. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6786. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6787. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6788. do { \
  6789. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6790. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6791. } while (0)
  6792. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6793. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6794. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6795. do { \
  6796. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6797. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6798. } while (0)
  6799. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6800. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6801. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6802. do { \
  6803. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6804. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6805. } while (0)
  6806. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6807. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6808. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6809. do { \
  6810. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6811. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6812. } while (0)
  6813. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6814. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6815. /* definitions used within target -> host rx indication message */
  6816. PREPACK struct htt_rx_ind_hdr_prefix_t
  6817. {
  6818. A_UINT32 /* word 0 */
  6819. msg_type: 8,
  6820. ext_tid: 5,
  6821. release_valid: 1,
  6822. flush_valid: 1,
  6823. reserved0: 1,
  6824. peer_id: 16;
  6825. A_UINT32 /* word 1 */
  6826. flush_start_seq_num: 6,
  6827. flush_end_seq_num: 6,
  6828. release_start_seq_num: 6,
  6829. release_end_seq_num: 6,
  6830. num_mpdu_ranges: 8;
  6831. } POSTPACK;
  6832. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6833. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6834. #define HTT_TGT_RSSI_INVALID 0x80
  6835. PREPACK struct htt_rx_ppdu_desc_t
  6836. {
  6837. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6838. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6839. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6840. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6841. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6842. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6843. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6844. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6845. A_UINT32 /* word 0 */
  6846. rssi_cmb: 8,
  6847. timestamp_submicrosec: 8,
  6848. phy_err_code: 8,
  6849. phy_err: 1,
  6850. legacy_rate: 4,
  6851. legacy_rate_sel: 1,
  6852. end_valid: 1,
  6853. start_valid: 1;
  6854. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6855. union {
  6856. A_UINT32 /* word 1 */
  6857. rssi0_pri20: 8,
  6858. rssi0_ext20: 8,
  6859. rssi0_ext40: 8,
  6860. rssi0_ext80: 8;
  6861. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6862. } u0;
  6863. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6864. union {
  6865. A_UINT32 /* word 2 */
  6866. rssi1_pri20: 8,
  6867. rssi1_ext20: 8,
  6868. rssi1_ext40: 8,
  6869. rssi1_ext80: 8;
  6870. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6871. } u1;
  6872. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6873. union {
  6874. A_UINT32 /* word 3 */
  6875. rssi2_pri20: 8,
  6876. rssi2_ext20: 8,
  6877. rssi2_ext40: 8,
  6878. rssi2_ext80: 8;
  6879. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6880. } u2;
  6881. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6882. union {
  6883. A_UINT32 /* word 4 */
  6884. rssi3_pri20: 8,
  6885. rssi3_ext20: 8,
  6886. rssi3_ext40: 8,
  6887. rssi3_ext80: 8;
  6888. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6889. } u3;
  6890. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6891. A_UINT32 tsf32; /* word 5 */
  6892. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6893. A_UINT32 timestamp_microsec; /* word 6 */
  6894. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6895. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6896. A_UINT32 /* word 7 */
  6897. vht_sig_a1: 24,
  6898. preamble_type: 8;
  6899. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6900. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6901. A_UINT32 /* word 8 */
  6902. vht_sig_a2: 24,
  6903. /* sa_ant_matrix
  6904. * For cases where a single rx chain has options to be connected to
  6905. * different rx antennas, show which rx antennas were in use during
  6906. * receipt of a given PPDU.
  6907. * This sa_ant_matrix provides a bitmask of the antennas used while
  6908. * receiving this frame.
  6909. */
  6910. sa_ant_matrix: 8;
  6911. } POSTPACK;
  6912. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6913. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6914. PREPACK struct htt_rx_ind_hdr_suffix_t
  6915. {
  6916. A_UINT32 /* word 0 */
  6917. fw_rx_desc_bytes: 16,
  6918. reserved0: 16;
  6919. } POSTPACK;
  6920. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6921. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6922. PREPACK struct htt_rx_ind_hdr_t
  6923. {
  6924. struct htt_rx_ind_hdr_prefix_t prefix;
  6925. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6926. struct htt_rx_ind_hdr_suffix_t suffix;
  6927. } POSTPACK;
  6928. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6929. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6930. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6931. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6932. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6933. /*
  6934. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6935. * the offset into the HTT rx indication message at which the
  6936. * FW rx PPDU descriptor resides
  6937. */
  6938. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6939. /*
  6940. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6941. * the offset into the HTT rx indication message at which the
  6942. * header suffix (FW rx MSDU byte count) resides
  6943. */
  6944. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6945. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6946. /*
  6947. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6948. * the offset into the HTT rx indication message at which the per-MSDU
  6949. * information starts
  6950. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6951. * per-MSDU information portion of the message. The per-MSDU info itself
  6952. * starts at byte 12.
  6953. */
  6954. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6955. /**
  6956. * @brief target -> host rx indication message definition
  6957. *
  6958. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  6959. *
  6960. * @details
  6961. * The following field definitions describe the format of the rx indication
  6962. * message sent from the target to the host.
  6963. * The message consists of three major sections:
  6964. * 1. a fixed-length header
  6965. * 2. a variable-length list of firmware rx MSDU descriptors
  6966. * 3. one or more 4-octet MPDU range information elements
  6967. * The fixed length header itself has two sub-sections
  6968. * 1. the message meta-information, including identification of the
  6969. * sender and type of the received data, and a 4-octet flush/release IE
  6970. * 2. the firmware rx PPDU descriptor
  6971. *
  6972. * The format of the message is depicted below.
  6973. * in this depiction, the following abbreviations are used for information
  6974. * elements within the message:
  6975. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6976. * elements associated with the PPDU start are valid.
  6977. * Specifically, the following fields are valid only if SV is set:
  6978. * RSSI (all variants), L, legacy rate, preamble type, service,
  6979. * VHT-SIG-A
  6980. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6981. * elements associated with the PPDU end are valid.
  6982. * Specifically, the following fields are valid only if EV is set:
  6983. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6984. * - L - Legacy rate selector - if legacy rates are used, this flag
  6985. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6986. * (L == 0) PHY.
  6987. * - P - PHY error flag - boolean indication of whether the rx frame had
  6988. * a PHY error
  6989. *
  6990. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6991. * |----------------+-------------------+---------------------+---------------|
  6992. * | peer ID | |RV|FV| ext TID | msg type |
  6993. * |--------------------------------------------------------------------------|
  6994. * | num | release | release | flush | flush |
  6995. * | MPDU | end | start | end | start |
  6996. * | ranges | seq num | seq num | seq num | seq num |
  6997. * |==========================================================================|
  6998. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6999. * |V|V| | rate | | | timestamp | RSSI |
  7000. * |--------------------------------------------------------------------------|
  7001. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7002. * |--------------------------------------------------------------------------|
  7003. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7004. * |--------------------------------------------------------------------------|
  7005. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7006. * |--------------------------------------------------------------------------|
  7007. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7008. * |--------------------------------------------------------------------------|
  7009. * | TSF LSBs |
  7010. * |--------------------------------------------------------------------------|
  7011. * | microsec timestamp |
  7012. * |--------------------------------------------------------------------------|
  7013. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7014. * |--------------------------------------------------------------------------|
  7015. * | service | HT-SIG / VHT-SIG-A2 |
  7016. * |==========================================================================|
  7017. * | reserved | FW rx desc bytes |
  7018. * |--------------------------------------------------------------------------|
  7019. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7020. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7021. * |--------------------------------------------------------------------------|
  7022. * : : :
  7023. * |--------------------------------------------------------------------------|
  7024. * | alignment | MSDU Rx |
  7025. * | padding | desc Bn |
  7026. * |--------------------------------------------------------------------------|
  7027. * | reserved | MPDU range status | MPDU count |
  7028. * |--------------------------------------------------------------------------|
  7029. * : reserved : MPDU range status : MPDU count :
  7030. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7031. *
  7032. * Header fields:
  7033. * - MSG_TYPE
  7034. * Bits 7:0
  7035. * Purpose: identifies this as an rx indication message
  7036. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7037. * - EXT_TID
  7038. * Bits 12:8
  7039. * Purpose: identify the traffic ID of the rx data, including
  7040. * special "extended" TID values for multicast, broadcast, and
  7041. * non-QoS data frames
  7042. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7043. * - FLUSH_VALID (FV)
  7044. * Bit 13
  7045. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7046. * is valid
  7047. * Value:
  7048. * 1 -> flush IE is valid and needs to be processed
  7049. * 0 -> flush IE is not valid and should be ignored
  7050. * - REL_VALID (RV)
  7051. * Bit 13
  7052. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7053. * is valid
  7054. * Value:
  7055. * 1 -> release IE is valid and needs to be processed
  7056. * 0 -> release IE is not valid and should be ignored
  7057. * - PEER_ID
  7058. * Bits 31:16
  7059. * Purpose: Identify, by ID, which peer sent the rx data
  7060. * Value: ID of the peer who sent the rx data
  7061. * - FLUSH_SEQ_NUM_START
  7062. * Bits 5:0
  7063. * Purpose: Indicate the start of a series of MPDUs to flush
  7064. * Not all MPDUs within this series are necessarily valid - the host
  7065. * must check each sequence number within this range to see if the
  7066. * corresponding MPDU is actually present.
  7067. * This field is only valid if the FV bit is set.
  7068. * Value:
  7069. * The sequence number for the first MPDUs to check to flush.
  7070. * The sequence number is masked by 0x3f.
  7071. * - FLUSH_SEQ_NUM_END
  7072. * Bits 11:6
  7073. * Purpose: Indicate the end of a series of MPDUs to flush
  7074. * Value:
  7075. * The sequence number one larger than the sequence number of the
  7076. * last MPDU to check to flush.
  7077. * The sequence number is masked by 0x3f.
  7078. * Not all MPDUs within this series are necessarily valid - the host
  7079. * must check each sequence number within this range to see if the
  7080. * corresponding MPDU is actually present.
  7081. * This field is only valid if the FV bit is set.
  7082. * - REL_SEQ_NUM_START
  7083. * Bits 17:12
  7084. * Purpose: Indicate the start of a series of MPDUs to release.
  7085. * All MPDUs within this series are present and valid - the host
  7086. * need not check each sequence number within this range to see if
  7087. * the corresponding MPDU is actually present.
  7088. * This field is only valid if the RV bit is set.
  7089. * Value:
  7090. * The sequence number for the first MPDUs to check to release.
  7091. * The sequence number is masked by 0x3f.
  7092. * - REL_SEQ_NUM_END
  7093. * Bits 23:18
  7094. * Purpose: Indicate the end of a series of MPDUs to release.
  7095. * Value:
  7096. * The sequence number one larger than the sequence number of the
  7097. * last MPDU to check to release.
  7098. * The sequence number is masked by 0x3f.
  7099. * All MPDUs within this series are present and valid - the host
  7100. * need not check each sequence number within this range to see if
  7101. * the corresponding MPDU is actually present.
  7102. * This field is only valid if the RV bit is set.
  7103. * - NUM_MPDU_RANGES
  7104. * Bits 31:24
  7105. * Purpose: Indicate how many ranges of MPDUs are present.
  7106. * Each MPDU range consists of a series of contiguous MPDUs within the
  7107. * rx frame sequence which all have the same MPDU status.
  7108. * Value: 1-63 (typically a small number, like 1-3)
  7109. *
  7110. * Rx PPDU descriptor fields:
  7111. * - RSSI_CMB
  7112. * Bits 7:0
  7113. * Purpose: Combined RSSI from all active rx chains, across the active
  7114. * bandwidth.
  7115. * Value: RSSI dB units w.r.t. noise floor
  7116. * - TIMESTAMP_SUBMICROSEC
  7117. * Bits 15:8
  7118. * Purpose: high-resolution timestamp
  7119. * Value:
  7120. * Sub-microsecond time of PPDU reception.
  7121. * This timestamp ranges from [0,MAC clock MHz).
  7122. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  7123. * to form a high-resolution, large range rx timestamp.
  7124. * - PHY_ERR_CODE
  7125. * Bits 23:16
  7126. * Purpose:
  7127. * If the rx frame processing resulted in a PHY error, indicate what
  7128. * type of rx PHY error occurred.
  7129. * Value:
  7130. * This field is valid if the "P" (PHY_ERR) flag is set.
  7131. * TBD: document/specify the values for this field
  7132. * - PHY_ERR
  7133. * Bit 24
  7134. * Purpose: indicate whether the rx PPDU had a PHY error
  7135. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7136. * - LEGACY_RATE
  7137. * Bits 28:25
  7138. * Purpose:
  7139. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7140. * specify which rate was used.
  7141. * Value:
  7142. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7143. * flag.
  7144. * If LEGACY_RATE_SEL is 0:
  7145. * 0x8: OFDM 48 Mbps
  7146. * 0x9: OFDM 24 Mbps
  7147. * 0xA: OFDM 12 Mbps
  7148. * 0xB: OFDM 6 Mbps
  7149. * 0xC: OFDM 54 Mbps
  7150. * 0xD: OFDM 36 Mbps
  7151. * 0xE: OFDM 18 Mbps
  7152. * 0xF: OFDM 9 Mbps
  7153. * If LEGACY_RATE_SEL is 1:
  7154. * 0x8: CCK 11 Mbps long preamble
  7155. * 0x9: CCK 5.5 Mbps long preamble
  7156. * 0xA: CCK 2 Mbps long preamble
  7157. * 0xB: CCK 1 Mbps long preamble
  7158. * 0xC: CCK 11 Mbps short preamble
  7159. * 0xD: CCK 5.5 Mbps short preamble
  7160. * 0xE: CCK 2 Mbps short preamble
  7161. * - LEGACY_RATE_SEL
  7162. * Bit 29
  7163. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7164. * Value:
  7165. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7166. * used a legacy rate.
  7167. * 0 -> OFDM, 1 -> CCK
  7168. * - END_VALID
  7169. * Bit 30
  7170. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7171. * the start of the PPDU are valid. Specifically, the following
  7172. * fields are only valid if END_VALID is set:
  7173. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7174. * TIMESTAMP_SUBMICROSEC
  7175. * Value:
  7176. * 0 -> rx PPDU desc end fields are not valid
  7177. * 1 -> rx PPDU desc end fields are valid
  7178. * - START_VALID
  7179. * Bit 31
  7180. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7181. * the end of the PPDU are valid. Specifically, the following
  7182. * fields are only valid if START_VALID is set:
  7183. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7184. * VHT-SIG-A
  7185. * Value:
  7186. * 0 -> rx PPDU desc start fields are not valid
  7187. * 1 -> rx PPDU desc start fields are valid
  7188. * - RSSI0_PRI20
  7189. * Bits 7:0
  7190. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7191. * Value: RSSI dB units w.r.t. noise floor
  7192. *
  7193. * - RSSI0_EXT20
  7194. * Bits 7:0
  7195. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7196. * (if the rx bandwidth was >= 40 MHz)
  7197. * Value: RSSI dB units w.r.t. noise floor
  7198. * - RSSI0_EXT40
  7199. * Bits 7:0
  7200. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7201. * (if the rx bandwidth was >= 80 MHz)
  7202. * Value: RSSI dB units w.r.t. noise floor
  7203. * - RSSI0_EXT80
  7204. * Bits 7:0
  7205. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7206. * (if the rx bandwidth was >= 160 MHz)
  7207. * Value: RSSI dB units w.r.t. noise floor
  7208. *
  7209. * - RSSI1_PRI20
  7210. * Bits 7:0
  7211. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7212. * Value: RSSI dB units w.r.t. noise floor
  7213. * - RSSI1_EXT20
  7214. * Bits 7:0
  7215. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7216. * (if the rx bandwidth was >= 40 MHz)
  7217. * Value: RSSI dB units w.r.t. noise floor
  7218. * - RSSI1_EXT40
  7219. * Bits 7:0
  7220. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7221. * (if the rx bandwidth was >= 80 MHz)
  7222. * Value: RSSI dB units w.r.t. noise floor
  7223. * - RSSI1_EXT80
  7224. * Bits 7:0
  7225. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7226. * (if the rx bandwidth was >= 160 MHz)
  7227. * Value: RSSI dB units w.r.t. noise floor
  7228. *
  7229. * - RSSI2_PRI20
  7230. * Bits 7:0
  7231. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7232. * Value: RSSI dB units w.r.t. noise floor
  7233. * - RSSI2_EXT20
  7234. * Bits 7:0
  7235. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7236. * (if the rx bandwidth was >= 40 MHz)
  7237. * Value: RSSI dB units w.r.t. noise floor
  7238. * - RSSI2_EXT40
  7239. * Bits 7:0
  7240. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7241. * (if the rx bandwidth was >= 80 MHz)
  7242. * Value: RSSI dB units w.r.t. noise floor
  7243. * - RSSI2_EXT80
  7244. * Bits 7:0
  7245. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7246. * (if the rx bandwidth was >= 160 MHz)
  7247. * Value: RSSI dB units w.r.t. noise floor
  7248. *
  7249. * - RSSI3_PRI20
  7250. * Bits 7:0
  7251. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7252. * Value: RSSI dB units w.r.t. noise floor
  7253. * - RSSI3_EXT20
  7254. * Bits 7:0
  7255. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7256. * (if the rx bandwidth was >= 40 MHz)
  7257. * Value: RSSI dB units w.r.t. noise floor
  7258. * - RSSI3_EXT40
  7259. * Bits 7:0
  7260. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7261. * (if the rx bandwidth was >= 80 MHz)
  7262. * Value: RSSI dB units w.r.t. noise floor
  7263. * - RSSI3_EXT80
  7264. * Bits 7:0
  7265. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7266. * (if the rx bandwidth was >= 160 MHz)
  7267. * Value: RSSI dB units w.r.t. noise floor
  7268. *
  7269. * - TSF32
  7270. * Bits 31:0
  7271. * Purpose: specify the time the rx PPDU was received, in TSF units
  7272. * Value: 32 LSBs of the TSF
  7273. * - TIMESTAMP_MICROSEC
  7274. * Bits 31:0
  7275. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7276. * Value: PPDU rx time, in microseconds
  7277. * - VHT_SIG_A1
  7278. * Bits 23:0
  7279. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7280. * from the rx PPDU
  7281. * Value:
  7282. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7283. * VHT-SIG-A1 data.
  7284. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7285. * first 24 bits of the HT-SIG data.
  7286. * Otherwise, this field is invalid.
  7287. * Refer to the the 802.11 protocol for the definition of the
  7288. * HT-SIG and VHT-SIG-A1 fields
  7289. * - VHT_SIG_A2
  7290. * Bits 23:0
  7291. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7292. * from the rx PPDU
  7293. * Value:
  7294. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7295. * VHT-SIG-A2 data.
  7296. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7297. * last 24 bits of the HT-SIG data.
  7298. * Otherwise, this field is invalid.
  7299. * Refer to the the 802.11 protocol for the definition of the
  7300. * HT-SIG and VHT-SIG-A2 fields
  7301. * - PREAMBLE_TYPE
  7302. * Bits 31:24
  7303. * Purpose: indicate the PHY format of the received burst
  7304. * Value:
  7305. * 0x4: Legacy (OFDM/CCK)
  7306. * 0x8: HT
  7307. * 0x9: HT with TxBF
  7308. * 0xC: VHT
  7309. * 0xD: VHT with TxBF
  7310. * - SERVICE
  7311. * Bits 31:24
  7312. * Purpose: TBD
  7313. * Value: TBD
  7314. *
  7315. * Rx MSDU descriptor fields:
  7316. * - FW_RX_DESC_BYTES
  7317. * Bits 15:0
  7318. * Purpose: Indicate how many bytes in the Rx indication are used for
  7319. * FW Rx descriptors
  7320. *
  7321. * Payload fields:
  7322. * - MPDU_COUNT
  7323. * Bits 7:0
  7324. * Purpose: Indicate how many sequential MPDUs share the same status.
  7325. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7326. * - MPDU_STATUS
  7327. * Bits 15:8
  7328. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7329. * received successfully.
  7330. * Value:
  7331. * 0x1: success
  7332. * 0x2: FCS error
  7333. * 0x3: duplicate error
  7334. * 0x4: replay error
  7335. * 0x5: invalid peer
  7336. */
  7337. /* header fields */
  7338. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7339. #define HTT_RX_IND_EXT_TID_S 8
  7340. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7341. #define HTT_RX_IND_FLUSH_VALID_S 13
  7342. #define HTT_RX_IND_REL_VALID_M 0x4000
  7343. #define HTT_RX_IND_REL_VALID_S 14
  7344. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7345. #define HTT_RX_IND_PEER_ID_S 16
  7346. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7347. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7348. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7349. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7350. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7351. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7352. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7353. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7354. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7355. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7356. /* rx PPDU descriptor fields */
  7357. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7358. #define HTT_RX_IND_RSSI_CMB_S 0
  7359. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7360. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7361. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7362. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7363. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7364. #define HTT_RX_IND_PHY_ERR_S 24
  7365. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7366. #define HTT_RX_IND_LEGACY_RATE_S 25
  7367. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7368. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7369. #define HTT_RX_IND_END_VALID_M 0x40000000
  7370. #define HTT_RX_IND_END_VALID_S 30
  7371. #define HTT_RX_IND_START_VALID_M 0x80000000
  7372. #define HTT_RX_IND_START_VALID_S 31
  7373. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7374. #define HTT_RX_IND_RSSI_PRI20_S 0
  7375. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7376. #define HTT_RX_IND_RSSI_EXT20_S 8
  7377. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7378. #define HTT_RX_IND_RSSI_EXT40_S 16
  7379. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7380. #define HTT_RX_IND_RSSI_EXT80_S 24
  7381. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7382. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7383. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7384. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7385. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7386. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7387. #define HTT_RX_IND_SERVICE_M 0xff000000
  7388. #define HTT_RX_IND_SERVICE_S 24
  7389. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7390. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7391. /* rx MSDU descriptor fields */
  7392. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7393. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7394. /* payload fields */
  7395. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7396. #define HTT_RX_IND_MPDU_COUNT_S 0
  7397. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7398. #define HTT_RX_IND_MPDU_STATUS_S 8
  7399. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7400. do { \
  7401. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7402. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7403. } while (0)
  7404. #define HTT_RX_IND_EXT_TID_GET(word) \
  7405. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7406. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7407. do { \
  7408. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7409. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7410. } while (0)
  7411. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7412. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7413. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7416. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7417. } while (0)
  7418. #define HTT_RX_IND_REL_VALID_GET(word) \
  7419. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7420. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7421. do { \
  7422. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7423. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7424. } while (0)
  7425. #define HTT_RX_IND_PEER_ID_GET(word) \
  7426. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7427. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7428. do { \
  7429. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7430. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7431. } while (0)
  7432. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7433. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7434. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7435. do { \
  7436. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7437. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7438. } while (0)
  7439. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7440. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7441. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7442. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7443. do { \
  7444. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7445. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7446. } while (0)
  7447. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7448. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7449. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7450. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7451. do { \
  7452. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7453. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7454. } while (0)
  7455. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7456. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7457. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7458. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7461. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7462. } while (0)
  7463. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7464. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7465. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7466. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7467. do { \
  7468. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7469. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7470. } while (0)
  7471. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7472. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7473. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7474. /* FW rx PPDU descriptor fields */
  7475. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7476. do { \
  7477. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7478. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7479. } while (0)
  7480. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7481. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7482. HTT_RX_IND_RSSI_CMB_S)
  7483. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7486. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7487. } while (0)
  7488. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7489. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7490. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7491. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7492. do { \
  7493. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7494. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7495. } while (0)
  7496. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7497. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7498. HTT_RX_IND_PHY_ERR_CODE_S)
  7499. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7500. do { \
  7501. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7502. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7503. } while (0)
  7504. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7505. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7506. HTT_RX_IND_PHY_ERR_S)
  7507. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7508. do { \
  7509. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7510. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7511. } while (0)
  7512. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7513. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7514. HTT_RX_IND_LEGACY_RATE_S)
  7515. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7516. do { \
  7517. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7518. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7519. } while (0)
  7520. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7521. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7522. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7523. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7524. do { \
  7525. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7526. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7527. } while (0)
  7528. #define HTT_RX_IND_END_VALID_GET(word) \
  7529. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7530. HTT_RX_IND_END_VALID_S)
  7531. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7534. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7535. } while (0)
  7536. #define HTT_RX_IND_START_VALID_GET(word) \
  7537. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7538. HTT_RX_IND_START_VALID_S)
  7539. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7540. do { \
  7541. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7542. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7543. } while (0)
  7544. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7545. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7546. HTT_RX_IND_RSSI_PRI20_S)
  7547. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7548. do { \
  7549. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7550. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7551. } while (0)
  7552. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7553. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7554. HTT_RX_IND_RSSI_EXT20_S)
  7555. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7558. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7559. } while (0)
  7560. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7561. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7562. HTT_RX_IND_RSSI_EXT40_S)
  7563. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7564. do { \
  7565. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7566. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7567. } while (0)
  7568. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7569. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7570. HTT_RX_IND_RSSI_EXT80_S)
  7571. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7572. do { \
  7573. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7574. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7575. } while (0)
  7576. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7577. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7578. HTT_RX_IND_VHT_SIG_A1_S)
  7579. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7580. do { \
  7581. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7582. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7583. } while (0)
  7584. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7585. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7586. HTT_RX_IND_VHT_SIG_A2_S)
  7587. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7588. do { \
  7589. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7590. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7591. } while (0)
  7592. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7593. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7594. HTT_RX_IND_PREAMBLE_TYPE_S)
  7595. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7598. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7599. } while (0)
  7600. #define HTT_RX_IND_SERVICE_GET(word) \
  7601. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7602. HTT_RX_IND_SERVICE_S)
  7603. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7604. do { \
  7605. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7606. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7607. } while (0)
  7608. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7609. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7610. HTT_RX_IND_SA_ANT_MATRIX_S)
  7611. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7612. do { \
  7613. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7614. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7615. } while (0)
  7616. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7617. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7618. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7619. do { \
  7620. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7621. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7622. } while (0)
  7623. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7624. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7625. #define HTT_RX_IND_HL_BYTES \
  7626. (HTT_RX_IND_HDR_BYTES + \
  7627. 4 /* single FW rx MSDU descriptor */ + \
  7628. 4 /* single MPDU range information element */)
  7629. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7630. /* Could we use one macro entry? */
  7631. #define HTT_WORD_SET(word, field, value) \
  7632. do { \
  7633. HTT_CHECK_SET_VAL(field, value); \
  7634. (word) |= ((value) << field ## _S); \
  7635. } while (0)
  7636. #define HTT_WORD_GET(word, field) \
  7637. (((word) & field ## _M) >> field ## _S)
  7638. PREPACK struct hl_htt_rx_ind_base {
  7639. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7640. } POSTPACK;
  7641. /*
  7642. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7643. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7644. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7645. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7646. * htt_rx_ind_hl_rx_desc_t.
  7647. */
  7648. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7649. struct htt_rx_ind_hl_rx_desc_t {
  7650. A_UINT8 ver;
  7651. A_UINT8 len;
  7652. struct {
  7653. A_UINT8
  7654. first_msdu: 1,
  7655. last_msdu: 1,
  7656. c3_failed: 1,
  7657. c4_failed: 1,
  7658. ipv6: 1,
  7659. tcp: 1,
  7660. udp: 1,
  7661. reserved: 1;
  7662. } flags;
  7663. /* NOTE: no reserved space - don't append any new fields here */
  7664. };
  7665. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7666. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7667. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7668. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7669. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7670. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7671. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7672. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7673. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7674. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7675. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7676. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7677. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7678. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7679. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7680. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7681. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7682. /* This structure is used in HL, the basic descriptor information
  7683. * used by host. the structure is translated by FW from HW desc
  7684. * or generated by FW. But in HL monitor mode, the host would use
  7685. * the same structure with LL.
  7686. */
  7687. PREPACK struct hl_htt_rx_desc_base {
  7688. A_UINT32
  7689. seq_num:12,
  7690. encrypted:1,
  7691. chan_info_present:1,
  7692. resv0:2,
  7693. mcast_bcast:1,
  7694. fragment:1,
  7695. key_id_oct:8,
  7696. resv1:6;
  7697. A_UINT32
  7698. pn_31_0;
  7699. union {
  7700. struct {
  7701. A_UINT16 pn_47_32;
  7702. A_UINT16 pn_63_48;
  7703. } pn16;
  7704. A_UINT32 pn_63_32;
  7705. } u0;
  7706. A_UINT32
  7707. pn_95_64;
  7708. A_UINT32
  7709. pn_127_96;
  7710. } POSTPACK;
  7711. /*
  7712. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7713. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7714. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7715. * Please see htt_chan_change_t for description of the fields.
  7716. */
  7717. PREPACK struct htt_chan_info_t
  7718. {
  7719. A_UINT32 primary_chan_center_freq_mhz: 16,
  7720. contig_chan1_center_freq_mhz: 16;
  7721. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7722. phy_mode: 8,
  7723. reserved: 8;
  7724. } POSTPACK;
  7725. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7726. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7727. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7728. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7729. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7730. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7731. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7732. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7733. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7734. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7735. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7736. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7737. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7738. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7739. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7740. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7741. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7742. /* Channel information */
  7743. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7744. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7745. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7746. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7747. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7748. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7749. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7750. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7751. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7754. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7755. } while (0)
  7756. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7757. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7758. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7761. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7762. } while (0)
  7763. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7764. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7765. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7766. do { \
  7767. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7768. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7769. } while (0)
  7770. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7771. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7772. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7775. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7776. } while (0)
  7777. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7778. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7779. /*
  7780. * @brief target -> host message definition for FW offloaded pkts
  7781. *
  7782. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7783. *
  7784. * @details
  7785. * The following field definitions describe the format of the firmware
  7786. * offload deliver message sent from the target to the host.
  7787. *
  7788. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7789. *
  7790. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7791. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7792. * | reserved_1 | msg type |
  7793. * |--------------------------------------------------------------------------|
  7794. * | phy_timestamp_l32 |
  7795. * |--------------------------------------------------------------------------|
  7796. * | WORD2 (see below) |
  7797. * |--------------------------------------------------------------------------|
  7798. * | seqno | framectrl |
  7799. * |--------------------------------------------------------------------------|
  7800. * | reserved_3 | vdev_id | tid_num|
  7801. * |--------------------------------------------------------------------------|
  7802. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7803. * |--------------------------------------------------------------------------|
  7804. *
  7805. * where:
  7806. * STAT = status
  7807. * F = format (802.3 vs. 802.11)
  7808. *
  7809. * definition for word 2
  7810. *
  7811. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7812. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7813. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7814. * |--------------------------------------------------------------------------|
  7815. *
  7816. * where:
  7817. * PR = preamble
  7818. * BF = beamformed
  7819. */
  7820. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7821. {
  7822. A_UINT32 /* word 0 */
  7823. msg_type:8, /* [ 7: 0] */
  7824. reserved_1:24; /* [31: 8] */
  7825. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7826. A_UINT32 /* word 2 */
  7827. /* preamble:
  7828. * 0-OFDM,
  7829. * 1-CCk,
  7830. * 2-HT,
  7831. * 3-VHT
  7832. */
  7833. preamble: 2, /* [1:0] */
  7834. /* mcs:
  7835. * In case of HT preamble interpret
  7836. * MCS along with NSS.
  7837. * Valid values for HT are 0 to 7.
  7838. * HT mcs 0 with NSS 2 is mcs 8.
  7839. * Valid values for VHT are 0 to 9.
  7840. */
  7841. mcs: 4, /* [5:2] */
  7842. /* rate:
  7843. * This is applicable only for
  7844. * CCK and OFDM preamble type
  7845. * rate 0: OFDM 48 Mbps,
  7846. * 1: OFDM 24 Mbps,
  7847. * 2: OFDM 12 Mbps
  7848. * 3: OFDM 6 Mbps
  7849. * 4: OFDM 54 Mbps
  7850. * 5: OFDM 36 Mbps
  7851. * 6: OFDM 18 Mbps
  7852. * 7: OFDM 9 Mbps
  7853. * rate 0: CCK 11 Mbps Long
  7854. * 1: CCK 5.5 Mbps Long
  7855. * 2: CCK 2 Mbps Long
  7856. * 3: CCK 1 Mbps Long
  7857. * 4: CCK 11 Mbps Short
  7858. * 5: CCK 5.5 Mbps Short
  7859. * 6: CCK 2 Mbps Short
  7860. */
  7861. rate : 3, /* [ 8: 6] */
  7862. rssi : 8, /* [16: 9] units=dBm */
  7863. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7864. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7865. stbc : 1, /* [22] */
  7866. sgi : 1, /* [23] */
  7867. ldpc : 1, /* [24] */
  7868. beamformed: 1, /* [25] */
  7869. reserved_2: 6; /* [31:26] */
  7870. A_UINT32 /* word 3 */
  7871. framectrl:16, /* [15: 0] */
  7872. seqno:16; /* [31:16] */
  7873. A_UINT32 /* word 4 */
  7874. tid_num:5, /* [ 4: 0] actual TID number */
  7875. vdev_id:8, /* [12: 5] */
  7876. reserved_3:19; /* [31:13] */
  7877. A_UINT32 /* word 5 */
  7878. /* status:
  7879. * 0: tx_ok
  7880. * 1: retry
  7881. * 2: drop
  7882. * 3: filtered
  7883. * 4: abort
  7884. * 5: tid delete
  7885. * 6: sw abort
  7886. * 7: dropped by peer migration
  7887. */
  7888. status:3, /* [2:0] */
  7889. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7890. tx_mpdu_bytes:16, /* [19:4] */
  7891. /* Indicates retry count of offloaded/local generated Data tx frames */
  7892. tx_retry_cnt:6, /* [25:20] */
  7893. reserved_4:6; /* [31:26] */
  7894. } POSTPACK;
  7895. /* FW offload deliver ind message header fields */
  7896. /* DWORD one */
  7897. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7898. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7899. /* DWORD two */
  7900. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7901. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7902. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7903. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7904. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7905. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7906. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7907. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7908. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7909. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7910. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7911. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7912. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7913. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7914. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7915. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7916. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7917. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7918. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7919. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7920. /* DWORD three*/
  7921. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7922. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7923. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7924. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7925. /* DWORD four */
  7926. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7927. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7928. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7929. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7930. /* DWORD five */
  7931. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7932. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7933. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7934. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7935. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7936. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7937. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7938. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7939. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7942. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7943. } while (0)
  7944. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7945. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7946. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7947. do { \
  7948. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7949. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7950. } while (0)
  7951. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7952. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7953. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7954. do { \
  7955. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7956. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7957. } while (0)
  7958. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7959. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7960. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7961. do { \
  7962. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7963. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7964. } while (0)
  7965. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7966. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7967. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7970. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7971. } while (0)
  7972. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7973. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7974. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7975. do { \
  7976. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7977. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7978. } while (0)
  7979. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7980. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7981. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7982. do { \
  7983. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7984. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7985. } while (0)
  7986. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7987. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7988. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7989. do { \
  7990. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7991. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7992. } while (0)
  7993. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7994. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7995. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7996. do { \
  7997. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7998. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7999. } while (0)
  8000. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8001. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8002. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8003. do { \
  8004. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8005. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8006. } while (0)
  8007. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8008. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8009. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8010. do { \
  8011. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8012. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8013. } while (0)
  8014. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8015. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8016. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8017. do { \
  8018. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8019. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8020. } while (0)
  8021. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8022. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8023. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8024. do { \
  8025. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8026. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8027. } while (0)
  8028. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8029. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8030. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8031. do { \
  8032. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8033. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8034. } while (0)
  8035. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8036. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8037. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8038. do { \
  8039. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8040. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8041. } while (0)
  8042. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8043. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8044. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8045. do { \
  8046. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8047. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8048. } while (0)
  8049. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8050. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8051. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8052. do { \
  8053. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8054. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8055. } while (0)
  8056. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8057. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8058. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8061. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8062. } while (0)
  8063. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8064. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8065. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8066. do { \
  8067. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8068. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8069. } while (0)
  8070. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  8071. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  8072. /*
  8073. * @brief target -> host rx reorder flush message definition
  8074. *
  8075. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  8076. *
  8077. * @details
  8078. * The following field definitions describe the format of the rx flush
  8079. * message sent from the target to the host.
  8080. * The message consists of a 4-octet header, followed by one or more
  8081. * 4-octet payload information elements.
  8082. *
  8083. * |31 24|23 8|7 0|
  8084. * |--------------------------------------------------------------|
  8085. * | TID | peer ID | msg type |
  8086. * |--------------------------------------------------------------|
  8087. * | seq num end | seq num start | MPDU status | reserved |
  8088. * |--------------------------------------------------------------|
  8089. * First DWORD:
  8090. * - MSG_TYPE
  8091. * Bits 7:0
  8092. * Purpose: identifies this as an rx flush message
  8093. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  8094. * - PEER_ID
  8095. * Bits 23:8 (only bits 18:8 actually used)
  8096. * Purpose: identify which peer's rx data is being flushed
  8097. * Value: (rx) peer ID
  8098. * - TID
  8099. * Bits 31:24 (only bits 27:24 actually used)
  8100. * Purpose: Specifies which traffic identifier's rx data is being flushed
  8101. * Value: traffic identifier
  8102. * Second DWORD:
  8103. * - MPDU_STATUS
  8104. * Bits 15:8
  8105. * Purpose:
  8106. * Indicate whether the flushed MPDUs should be discarded or processed.
  8107. * Value:
  8108. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  8109. * stages of rx processing
  8110. * other: discard the MPDUs
  8111. * It is anticipated that flush messages will always have
  8112. * MPDU status == 1, but the status flag is included for
  8113. * flexibility.
  8114. * - SEQ_NUM_START
  8115. * Bits 23:16
  8116. * Purpose:
  8117. * Indicate the start of a series of consecutive MPDUs being flushed.
  8118. * Not all MPDUs within this range are necessarily valid - the host
  8119. * must check each sequence number within this range to see if the
  8120. * corresponding MPDU is actually present.
  8121. * Value:
  8122. * The sequence number for the first MPDU in the sequence.
  8123. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8124. * - SEQ_NUM_END
  8125. * Bits 30:24
  8126. * Purpose:
  8127. * Indicate the end of a series of consecutive MPDUs being flushed.
  8128. * Value:
  8129. * The sequence number one larger than the sequence number of the
  8130. * last MPDU being flushed.
  8131. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8132. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8133. * are to be released for further rx processing.
  8134. * Not all MPDUs within this range are necessarily valid - the host
  8135. * must check each sequence number within this range to see if the
  8136. * corresponding MPDU is actually present.
  8137. */
  8138. /* first DWORD */
  8139. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8140. #define HTT_RX_FLUSH_PEER_ID_S 8
  8141. #define HTT_RX_FLUSH_TID_M 0xff000000
  8142. #define HTT_RX_FLUSH_TID_S 24
  8143. /* second DWORD */
  8144. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8145. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8146. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8147. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8148. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8149. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8150. #define HTT_RX_FLUSH_BYTES 8
  8151. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8152. do { \
  8153. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8154. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8155. } while (0)
  8156. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8157. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8158. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8159. do { \
  8160. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8161. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8162. } while (0)
  8163. #define HTT_RX_FLUSH_TID_GET(word) \
  8164. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8165. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8166. do { \
  8167. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8168. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8169. } while (0)
  8170. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8171. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8172. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8173. do { \
  8174. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8175. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8176. } while (0)
  8177. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8178. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8179. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8180. do { \
  8181. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8182. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8183. } while (0)
  8184. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8185. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8186. /*
  8187. * @brief target -> host rx pn check indication message
  8188. *
  8189. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8190. *
  8191. * @details
  8192. * The following field definitions describe the format of the Rx PN check
  8193. * indication message sent from the target to the host.
  8194. * The message consists of a 4-octet header, followed by the start and
  8195. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8196. * IE is one octet containing the sequence number that failed the PN
  8197. * check.
  8198. *
  8199. * |31 24|23 8|7 0|
  8200. * |--------------------------------------------------------------|
  8201. * | TID | peer ID | msg type |
  8202. * |--------------------------------------------------------------|
  8203. * | Reserved | PN IE count | seq num end | seq num start|
  8204. * |--------------------------------------------------------------|
  8205. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8206. * |--------------------------------------------------------------|
  8207. * First DWORD:
  8208. * - MSG_TYPE
  8209. * Bits 7:0
  8210. * Purpose: Identifies this as an rx pn check indication message
  8211. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8212. * - PEER_ID
  8213. * Bits 23:8 (only bits 18:8 actually used)
  8214. * Purpose: identify which peer
  8215. * Value: (rx) peer ID
  8216. * - TID
  8217. * Bits 31:24 (only bits 27:24 actually used)
  8218. * Purpose: identify traffic identifier
  8219. * Value: traffic identifier
  8220. * Second DWORD:
  8221. * - SEQ_NUM_START
  8222. * Bits 7:0
  8223. * Purpose:
  8224. * Indicates the starting sequence number of the MPDU in this
  8225. * series of MPDUs that went though PN check.
  8226. * Value:
  8227. * The sequence number for the first MPDU in the sequence.
  8228. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8229. * - SEQ_NUM_END
  8230. * Bits 15:8
  8231. * Purpose:
  8232. * Indicates the ending sequence number of the MPDU in this
  8233. * series of MPDUs that went though PN check.
  8234. * Value:
  8235. * The sequence number one larger then the sequence number of the last
  8236. * MPDU being flushed.
  8237. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8238. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8239. * for invalid PN numbers and are ready to be released for further processing.
  8240. * Not all MPDUs within this range are necessarily valid - the host
  8241. * must check each sequence number within this range to see if the
  8242. * corresponding MPDU is actually present.
  8243. * - PN_IE_COUNT
  8244. * Bits 23:16
  8245. * Purpose:
  8246. * Used to determine the variable number of PN information elements in this
  8247. * message
  8248. *
  8249. * PN information elements:
  8250. * - PN_IE_x-
  8251. * Purpose:
  8252. * Each PN information element contains the sequence number of the MPDU that
  8253. * has failed the target PN check.
  8254. * Value:
  8255. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8256. * that failed the PN check.
  8257. */
  8258. /* first DWORD */
  8259. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8260. #define HTT_RX_PN_IND_PEER_ID_S 8
  8261. #define HTT_RX_PN_IND_TID_M 0xff000000
  8262. #define HTT_RX_PN_IND_TID_S 24
  8263. /* second DWORD */
  8264. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8265. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8266. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8267. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8268. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8269. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8270. #define HTT_RX_PN_IND_BYTES 8
  8271. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8272. do { \
  8273. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8274. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8275. } while (0)
  8276. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8277. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8278. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8279. do { \
  8280. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8281. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8282. } while (0)
  8283. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8284. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8285. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8286. do { \
  8287. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8288. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8289. } while (0)
  8290. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8291. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8292. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8293. do { \
  8294. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8295. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8296. } while (0)
  8297. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8298. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8299. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8300. do { \
  8301. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8302. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8303. } while (0)
  8304. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8305. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8306. /*
  8307. * @brief target -> host rx offload deliver message for LL system
  8308. *
  8309. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8310. *
  8311. * @details
  8312. * In a low latency system this message is sent whenever the offload
  8313. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8314. * The DMA of the actual packets into host memory is done before sending out
  8315. * this message. This message indicates only how many MSDUs to reap. The
  8316. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8317. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8318. * DMA'd by the MAC directly into host memory these packets do not contain
  8319. * the MAC descriptors in the header portion of the packet. Instead they contain
  8320. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8321. * message, the packets are delivered directly to the NW stack without going
  8322. * through the regular reorder buffering and PN checking path since it has
  8323. * already been done in target.
  8324. *
  8325. * |31 24|23 16|15 8|7 0|
  8326. * |-----------------------------------------------------------------------|
  8327. * | Total MSDU count | reserved | msg type |
  8328. * |-----------------------------------------------------------------------|
  8329. *
  8330. * @brief target -> host rx offload deliver message for HL system
  8331. *
  8332. * @details
  8333. * In a high latency system this message is sent whenever the offload manager
  8334. * flushes out the packets it has coalesced in its coalescing buffer. The
  8335. * actual packets are also carried along with this message. When the host
  8336. * receives this message, it is expected to deliver these packets to the NW
  8337. * stack directly instead of routing them through the reorder buffering and
  8338. * PN checking path since it has already been done in target.
  8339. *
  8340. * |31 24|23 16|15 8|7 0|
  8341. * |-----------------------------------------------------------------------|
  8342. * | Total MSDU count | reserved | msg type |
  8343. * |-----------------------------------------------------------------------|
  8344. * | peer ID | MSDU length |
  8345. * |-----------------------------------------------------------------------|
  8346. * | MSDU payload | FW Desc | tid | vdev ID |
  8347. * |-----------------------------------------------------------------------|
  8348. * | MSDU payload contd. |
  8349. * |-----------------------------------------------------------------------|
  8350. * | peer ID | MSDU length |
  8351. * |-----------------------------------------------------------------------|
  8352. * | MSDU payload | FW Desc | tid | vdev ID |
  8353. * |-----------------------------------------------------------------------|
  8354. * | MSDU payload contd. |
  8355. * |-----------------------------------------------------------------------|
  8356. *
  8357. */
  8358. /* first DWORD */
  8359. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8360. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8361. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8362. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8363. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8364. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8365. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8366. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8367. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8368. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8369. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8370. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8371. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8372. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8373. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8374. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8375. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8376. do { \
  8377. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8378. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8379. } while (0)
  8380. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8381. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8382. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8383. do { \
  8384. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8385. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8386. } while (0)
  8387. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8388. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8389. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8390. do { \
  8391. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8392. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8393. } while (0)
  8394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8395. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8397. do { \
  8398. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8399. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8400. } while (0)
  8401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8402. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8403. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8404. do { \
  8405. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8406. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8407. } while (0)
  8408. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8409. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8410. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8413. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8414. } while (0)
  8415. /**
  8416. * @brief target -> host rx peer map/unmap message definition
  8417. *
  8418. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8419. *
  8420. * @details
  8421. * The following diagram shows the format of the rx peer map message sent
  8422. * from the target to the host. This layout assumes the target operates
  8423. * as little-endian.
  8424. *
  8425. * This message always contains a SW peer ID. The main purpose of the
  8426. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8427. * with, so that the host can use that peer ID to determine which peer
  8428. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8429. * other purposes, such as identifying during tx completions which peer
  8430. * the tx frames in question were transmitted to.
  8431. *
  8432. * In certain generations of chips, the peer map message also contains
  8433. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8434. * to identify which peer the frame needs to be forwarded to (i.e. the
  8435. * peer assocated with the Destination MAC Address within the packet),
  8436. * and particularly which vdev needs to transmit the frame (for cases
  8437. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8438. * meaning as AST_INDEX_0.
  8439. * This DA-based peer ID that is provided for certain rx frames
  8440. * (the rx frames that need to be re-transmitted as tx frames)
  8441. * is the ID that the HW uses for referring to the peer in question,
  8442. * rather than the peer ID that the SW+FW use to refer to the peer.
  8443. *
  8444. *
  8445. * |31 24|23 16|15 8|7 0|
  8446. * |-----------------------------------------------------------------------|
  8447. * | SW peer ID | VDEV ID | msg type |
  8448. * |-----------------------------------------------------------------------|
  8449. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8450. * |-----------------------------------------------------------------------|
  8451. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8452. * |-----------------------------------------------------------------------|
  8453. *
  8454. *
  8455. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8456. *
  8457. * The following diagram shows the format of the rx peer unmap message sent
  8458. * from the target to the host.
  8459. *
  8460. * |31 24|23 16|15 8|7 0|
  8461. * |-----------------------------------------------------------------------|
  8462. * | SW peer ID | VDEV ID | msg type |
  8463. * |-----------------------------------------------------------------------|
  8464. *
  8465. * The following field definitions describe the format of the rx peer map
  8466. * and peer unmap messages sent from the target to the host.
  8467. * - MSG_TYPE
  8468. * Bits 7:0
  8469. * Purpose: identifies this as an rx peer map or peer unmap message
  8470. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8471. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8472. * - VDEV_ID
  8473. * Bits 15:8
  8474. * Purpose: Indicates which virtual device the peer is associated
  8475. * with.
  8476. * Value: vdev ID (used in the host to look up the vdev object)
  8477. * - PEER_ID (a.k.a. SW_PEER_ID)
  8478. * Bits 31:16
  8479. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8480. * freeing (unmap)
  8481. * Value: (rx) peer ID
  8482. * - MAC_ADDR_L32 (peer map only)
  8483. * Bits 31:0
  8484. * Purpose: Identifies which peer node the peer ID is for.
  8485. * Value: lower 4 bytes of peer node's MAC address
  8486. * - MAC_ADDR_U16 (peer map only)
  8487. * Bits 15:0
  8488. * Purpose: Identifies which peer node the peer ID is for.
  8489. * Value: upper 2 bytes of peer node's MAC address
  8490. * - HW_PEER_ID
  8491. * Bits 31:16
  8492. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8493. * address, so for rx frames marked for rx --> tx forwarding, the
  8494. * host can determine from the HW peer ID provided as meta-data with
  8495. * the rx frame which peer the frame is supposed to be forwarded to.
  8496. * Value: ID used by the MAC HW to identify the peer
  8497. */
  8498. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8499. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8500. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8501. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8502. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8503. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8504. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8505. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8506. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8507. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8508. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8509. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8510. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8511. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8512. do { \
  8513. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8514. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8515. } while (0)
  8516. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8517. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8518. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8519. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8520. do { \
  8521. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8522. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8523. } while (0)
  8524. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8525. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8526. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8527. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8528. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8529. do { \
  8530. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8531. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8532. } while (0)
  8533. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8534. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8535. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8536. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8537. #define HTT_RX_PEER_MAP_BYTES 12
  8538. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8539. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8540. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8541. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8542. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8543. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8544. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8545. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8546. #define HTT_RX_PEER_UNMAP_BYTES 4
  8547. /**
  8548. * @brief target -> host rx peer map V2 message definition
  8549. *
  8550. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8551. *
  8552. * @details
  8553. * The following diagram shows the format of the rx peer map v2 message sent
  8554. * from the target to the host. This layout assumes the target operates
  8555. * as little-endian.
  8556. *
  8557. * This message always contains a SW peer ID. The main purpose of the
  8558. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8559. * with, so that the host can use that peer ID to determine which peer
  8560. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8561. * other purposes, such as identifying during tx completions which peer
  8562. * the tx frames in question were transmitted to.
  8563. *
  8564. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8565. * is used during rx --> tx frame forwarding to identify which peer the
  8566. * frame needs to be forwarded to (i.e. the peer assocated with the
  8567. * Destination MAC Address within the packet), and particularly which vdev
  8568. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8569. * This DA-based peer ID that is provided for certain rx frames
  8570. * (the rx frames that need to be re-transmitted as tx frames)
  8571. * is the ID that the HW uses for referring to the peer in question,
  8572. * rather than the peer ID that the SW+FW use to refer to the peer.
  8573. *
  8574. * The HW peer id here is the same meaning as AST_INDEX_0.
  8575. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8576. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8577. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8578. * AST is valid.
  8579. *
  8580. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8581. * |-------------------------------------------------------------------------|
  8582. * | SW peer ID | VDEV ID | msg type |
  8583. * |-------------------------------------------------------------------------|
  8584. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8585. * |-------------------------------------------------------------------------|
  8586. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8587. * |-------------------------------------------------------------------------|
  8588. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8589. * |-------------------------------------------------------------------------|
  8590. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8591. * |-------------------------------------------------------------------------|
  8592. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8593. * |-------------------------------------------------------------------------|
  8594. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8595. * |-------------------------------------------------------------------------|
  8596. * | Reserved_2 |
  8597. * |-------------------------------------------------------------------------|
  8598. * Where:
  8599. * NH = Next Hop
  8600. * ASTVM = AST valid mask
  8601. * OA = on-chip AST valid bit
  8602. * ASTFM = AST flow mask
  8603. *
  8604. * The following field definitions describe the format of the rx peer map v2
  8605. * messages sent from the target to the host.
  8606. * - MSG_TYPE
  8607. * Bits 7:0
  8608. * Purpose: identifies this as an rx peer map v2 message
  8609. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8610. * - VDEV_ID
  8611. * Bits 15:8
  8612. * Purpose: Indicates which virtual device the peer is associated with.
  8613. * Value: vdev ID (used in the host to look up the vdev object)
  8614. * - SW_PEER_ID
  8615. * Bits 31:16
  8616. * Purpose: The peer ID (index) that WAL is allocating
  8617. * Value: (rx) peer ID
  8618. * - MAC_ADDR_L32
  8619. * Bits 31:0
  8620. * Purpose: Identifies which peer node the peer ID is for.
  8621. * Value: lower 4 bytes of peer node's MAC address
  8622. * - MAC_ADDR_U16
  8623. * Bits 15:0
  8624. * Purpose: Identifies which peer node the peer ID is for.
  8625. * Value: upper 2 bytes of peer node's MAC address
  8626. * - HW_PEER_ID / AST_INDEX_0
  8627. * Bits 31:16
  8628. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8629. * address, so for rx frames marked for rx --> tx forwarding, the
  8630. * host can determine from the HW peer ID provided as meta-data with
  8631. * the rx frame which peer the frame is supposed to be forwarded to.
  8632. * Value: ID used by the MAC HW to identify the peer
  8633. * - AST_HASH_VALUE
  8634. * Bits 15:0
  8635. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8636. * override feature.
  8637. * - NEXT_HOP
  8638. * Bit 16
  8639. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8640. * (Wireless Distribution System).
  8641. * - AST_VALID_MASK
  8642. * Bits 19:17
  8643. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8644. * - ONCHIP_AST_VALID_FLAG
  8645. * Bit 20
  8646. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8647. * is valid.
  8648. * - AST_INDEX_1
  8649. * Bits 15:0
  8650. * Purpose: indicate the second AST index for this peer
  8651. * - AST_0_FLOW_MASK
  8652. * Bits 19:16
  8653. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8654. * - AST_1_FLOW_MASK
  8655. * Bits 23:20
  8656. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8657. * - AST_2_FLOW_MASK
  8658. * Bits 27:24
  8659. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8660. * - AST_3_FLOW_MASK
  8661. * Bits 31:28
  8662. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8663. * - AST_INDEX_2
  8664. * Bits 15:0
  8665. * Purpose: indicate the third AST index for this peer
  8666. * - TID_VALID_HI_PRI
  8667. * Bits 23:16
  8668. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8669. * - TID_VALID_LOW_PRI
  8670. * Bits 31:24
  8671. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8672. * - AST_INDEX_3
  8673. * Bits 15:0
  8674. * Purpose: indicate the fourth AST index for this peer
  8675. * - ONCHIP_AST_IDX / RESERVED
  8676. * Bits 31:16
  8677. * Purpose: This field is valid only when split AST feature is enabled.
  8678. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8679. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8680. * address, this ast_idx is used for LMAC modules for RXPCU.
  8681. * Value: ID used by the LMAC HW to identify the peer
  8682. */
  8683. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8684. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8685. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8686. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8687. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8688. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8689. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8690. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8691. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8692. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8693. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8694. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8695. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8696. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8697. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8698. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8699. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8700. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8701. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8702. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8703. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8704. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8705. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8706. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8707. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8708. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8709. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8710. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8711. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8712. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8713. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8714. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8715. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8716. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8717. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8718. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8719. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8720. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8721. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8722. do { \
  8723. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8724. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8725. } while (0)
  8726. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8727. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8728. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8729. do { \
  8730. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8731. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8732. } while (0)
  8733. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8734. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8735. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8736. do { \
  8737. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8738. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8739. } while (0)
  8740. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8741. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8742. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8743. do { \
  8744. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8745. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8746. } while (0)
  8747. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8748. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8749. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8750. do { \
  8751. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8752. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8753. } while (0)
  8754. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8755. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8756. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8757. do { \
  8758. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8759. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8760. } while (0)
  8761. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8762. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8763. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8766. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8767. } while (0)
  8768. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8769. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8770. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8771. do { \
  8772. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8773. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8774. } while (0)
  8775. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8776. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8777. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8778. do { \
  8779. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8780. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8781. } while (0)
  8782. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8783. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8784. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8785. do { \
  8786. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8787. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8788. } while (0)
  8789. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8790. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8791. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8792. do { \
  8793. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8794. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8795. } while (0)
  8796. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8797. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8798. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8799. do { \
  8800. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8801. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8802. } while (0)
  8803. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8804. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8805. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8806. do { \
  8807. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8808. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8809. } while (0)
  8810. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8811. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8812. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8815. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8816. } while (0)
  8817. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8818. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8819. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8822. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8823. } while (0)
  8824. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8825. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8826. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8829. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8830. } while (0)
  8831. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8832. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8833. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8834. do { \
  8835. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8836. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8837. } while (0)
  8838. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8839. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8840. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8841. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8842. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8843. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8844. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8845. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8846. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8847. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8848. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8849. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8850. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8851. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8852. /**
  8853. * @brief target -> host rx peer map V3 message definition
  8854. *
  8855. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  8856. *
  8857. * @details
  8858. * The following diagram shows the format of the rx peer map v3 message sent
  8859. * from the target to the host.
  8860. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  8861. * This layout assumes the target operates as little-endian.
  8862. *
  8863. * |31 24|23 20|19|18|17|16|15 8|7 0|
  8864. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  8865. * | SW peer ID | VDEV ID | msg type |
  8866. * |-----------------+--------------------+-----------------+-----------------|
  8867. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8868. * |-----------------+--------------------+-----------------+-----------------|
  8869. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  8870. * |-----------------+--------+-----------+-----------------+-----------------|
  8871. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  8872. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  8873. * | (8bits) | | (4bits) | |
  8874. * |-----------------+--------+--+--+--+--------------------------------------|
  8875. * | RESERVED |E |O | | |
  8876. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  8877. * | |V |V | | |
  8878. * |-----------------+--------------------+-----------------------------------|
  8879. * | HTT_MSDU_IDX_ | RESERVED | |
  8880. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  8881. * | (8bits) | | |
  8882. * |-----------------+--------------------+-----------------------------------|
  8883. * | Reserved_2 |
  8884. * |--------------------------------------------------------------------------|
  8885. * | Reserved_3 |
  8886. * |--------------------------------------------------------------------------|
  8887. *
  8888. * Where:
  8889. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  8890. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  8891. * NH = Next Hop
  8892. * The following field definitions describe the format of the rx peer map v3
  8893. * messages sent from the target to the host.
  8894. * - MSG_TYPE
  8895. * Bits 7:0
  8896. * Purpose: identifies this as a peer map v3 message
  8897. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  8898. * - VDEV_ID
  8899. * Bits 15:8
  8900. * Purpose: Indicates which virtual device the peer is associated with.
  8901. * - SW_PEER_ID
  8902. * Bits 31:16
  8903. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  8904. * - MAC_ADDR_L32
  8905. * Bits 31:0
  8906. * Purpose: Identifies which peer node the peer ID is for.
  8907. * Value: lower 4 bytes of peer node's MAC address
  8908. * - MAC_ADDR_U16
  8909. * Bits 15:0
  8910. * Purpose: Identifies which peer node the peer ID is for.
  8911. * Value: upper 2 bytes of peer node's MAC address
  8912. * - MULTICAST_SW_PEER_ID
  8913. * Bits 31:16
  8914. * Purpose: The multicast peer ID (index)
  8915. * Value: set to HTT_INVALID_PEER if not valid
  8916. * - HW_PEER_ID / AST_INDEX
  8917. * Bits 15:0
  8918. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8919. * address, so for rx frames marked for rx --> tx forwarding, the
  8920. * host can determine from the HW peer ID provided as meta-data with
  8921. * the rx frame which peer the frame is supposed to be forwarded to.
  8922. * - CACHE_SET_NUM
  8923. * Bits 19:16
  8924. * Purpose: Cache Set Number for AST_INDEX
  8925. * Cache set number that should be used to cache the index based
  8926. * search results, for address and flow search.
  8927. * This value should be equal to LSB 4 bits of the hash value
  8928. * of match data, in case of search index points to an entry which
  8929. * may be used in content based search also. The value can be
  8930. * anything when the entry pointed by search index will not be
  8931. * used for content based search.
  8932. * - HTT_MSDU_IDX_VALID_MASK
  8933. * Bits 31:24
  8934. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  8935. * - ONCHIP_AST_IDX / RESERVED
  8936. * Bits 15:0
  8937. * Purpose: This field is valid only when split AST feature is enabled.
  8938. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  8939. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8940. * address, this ast_idx is used for LMAC modules for RXPCU.
  8941. * - NEXT_HOP
  8942. * Bits 16
  8943. * Purpose: Flag indicates next_hop AST entry used for WDS
  8944. * (Wireless Distribution System).
  8945. * - ONCHIP_AST_VALID
  8946. * Bits 17
  8947. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  8948. * - EXT_AST_VALID
  8949. * Bits 18
  8950. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  8951. * - EXT_AST_INDEX
  8952. * Bits 15:0
  8953. * Purpose: This field describes Extended AST index
  8954. * Valid if EXT_AST_VALID flag set
  8955. * - HTT_MSDU_IDX_VALID_MASK_EXT
  8956. * Bits 31:24
  8957. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  8958. */
  8959. /* dword 0 */
  8960. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  8961. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  8962. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  8963. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  8964. /* dword 1 */
  8965. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  8966. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  8967. /* dword 2 */
  8968. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  8969. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  8970. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  8971. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  8972. /* dword 3 */
  8973. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  8974. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  8975. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  8976. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  8977. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  8978. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  8979. /* dword 4 */
  8980. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  8981. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  8982. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  8983. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  8984. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  8985. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  8986. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  8987. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  8988. /* dword 5 */
  8989. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  8990. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  8991. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  8992. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  8993. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  8996. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  8997. } while (0)
  8998. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  8999. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9000. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9003. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9004. } while (0)
  9005. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9006. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9007. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9008. do { \
  9009. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9010. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9011. } while (0)
  9012. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9013. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9014. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9015. do { \
  9016. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9017. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9018. } while (0)
  9019. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9020. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9021. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9022. do { \
  9023. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9024. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9025. } while (0)
  9026. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9027. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9028. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9029. do { \
  9030. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9031. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9032. } while (0)
  9033. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9034. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9035. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9036. do { \
  9037. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9038. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9039. } while (0)
  9040. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9041. (((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)
  9042. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9043. do { \
  9044. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9045. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9046. } while (0)
  9047. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9048. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9049. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9050. do { \
  9051. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9052. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9053. } while (0)
  9054. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9055. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9056. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9057. do { \
  9058. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9059. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9060. } while (0)
  9061. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9062. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9063. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9064. do { \
  9065. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9066. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9067. } while (0)
  9068. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9069. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  9070. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  9073. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  9074. } while (0)
  9075. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  9076. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  9077. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  9078. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  9079. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  9080. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  9081. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  9082. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  9083. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  9084. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9085. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  9086. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  9087. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  9088. #define HTT_RX_PEER_MAP_V3_BYTES 32
  9089. /**
  9090. * @brief target -> host rx peer unmap V2 message definition
  9091. *
  9092. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  9093. *
  9094. * The following diagram shows the format of the rx peer unmap message sent
  9095. * from the target to the host.
  9096. *
  9097. * |31 24|23 16|15 8|7 0|
  9098. * |-----------------------------------------------------------------------|
  9099. * | SW peer ID | VDEV ID | msg type |
  9100. * |-----------------------------------------------------------------------|
  9101. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9102. * |-----------------------------------------------------------------------|
  9103. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  9104. * |-----------------------------------------------------------------------|
  9105. * | Peer Delete Duration |
  9106. * |-----------------------------------------------------------------------|
  9107. * | Reserved_0 | WDS Free Count |
  9108. * |-----------------------------------------------------------------------|
  9109. * | Reserved_1 |
  9110. * |-----------------------------------------------------------------------|
  9111. * | Reserved_2 |
  9112. * |-----------------------------------------------------------------------|
  9113. *
  9114. *
  9115. * The following field definitions describe the format of the rx peer unmap
  9116. * messages sent from the target to the host.
  9117. * - MSG_TYPE
  9118. * Bits 7:0
  9119. * Purpose: identifies this as an rx peer unmap v2 message
  9120. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  9121. * - VDEV_ID
  9122. * Bits 15:8
  9123. * Purpose: Indicates which virtual device the peer is associated
  9124. * with.
  9125. * Value: vdev ID (used in the host to look up the vdev object)
  9126. * - SW_PEER_ID
  9127. * Bits 31:16
  9128. * Purpose: The peer ID (index) that WAL is freeing
  9129. * Value: (rx) peer ID
  9130. * - MAC_ADDR_L32
  9131. * Bits 31:0
  9132. * Purpose: Identifies which peer node the peer ID is for.
  9133. * Value: lower 4 bytes of peer node's MAC address
  9134. * - MAC_ADDR_U16
  9135. * Bits 15:0
  9136. * Purpose: Identifies which peer node the peer ID is for.
  9137. * Value: upper 2 bytes of peer node's MAC address
  9138. * - NEXT_HOP
  9139. * Bits 16
  9140. * Purpose: Bit indicates next_hop AST entry used for WDS
  9141. * (Wireless Distribution System).
  9142. * - PEER_DELETE_DURATION
  9143. * Bits 31:0
  9144. * Purpose: Time taken to delete peer, in msec,
  9145. * Used for monitoring / debugging PEER delete response delay
  9146. * - PEER_WDS_FREE_COUNT
  9147. * Bits 15:0
  9148. * Purpose: Count of WDS entries deleted associated to peer deleted
  9149. */
  9150. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  9151. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  9152. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  9153. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  9154. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  9155. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  9156. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  9157. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  9158. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  9159. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  9160. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  9161. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  9162. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  9163. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  9164. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  9165. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  9166. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  9167. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  9168. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  9169. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  9170. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  9171. do { \
  9172. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  9173. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  9174. } while (0)
  9175. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  9176. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  9177. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  9178. do { \
  9179. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  9180. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  9181. } while (0)
  9182. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  9183. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  9184. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9185. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  9186. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  9187. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  9188. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  9189. /**
  9190. * @brief target -> host rx peer mlo map message definition
  9191. *
  9192. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  9193. *
  9194. * @details
  9195. * The following diagram shows the format of the rx mlo peer map message sent
  9196. * from the target to the host. This layout assumes the target operates
  9197. * as little-endian.
  9198. *
  9199. * MCC:
  9200. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  9201. *
  9202. * WIN:
  9203. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  9204. * It will be sent on the Assoc Link.
  9205. *
  9206. * This message always contains a MLO peer ID. The main purpose of the
  9207. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  9208. * with, so that the host can use that MLO peer ID to determine which peer
  9209. * transmitted the rx frame.
  9210. *
  9211. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  9212. * |-------------------------------------------------------------------------|
  9213. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  9214. * |-------------------------------------------------------------------------|
  9215. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9216. * |-------------------------------------------------------------------------|
  9217. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  9218. * |-------------------------------------------------------------------------|
  9219. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  9220. * |-------------------------------------------------------------------------|
  9221. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  9222. * |-------------------------------------------------------------------------|
  9223. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  9224. * |-------------------------------------------------------------------------|
  9225. * |RSVD |
  9226. * |-------------------------------------------------------------------------|
  9227. * |RSVD |
  9228. * |-------------------------------------------------------------------------|
  9229. * | htt_tlv_hdr_t |
  9230. * |-------------------------------------------------------------------------|
  9231. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9232. * |-------------------------------------------------------------------------|
  9233. * | htt_tlv_hdr_t |
  9234. * |-------------------------------------------------------------------------|
  9235. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9236. * |-------------------------------------------------------------------------|
  9237. * | htt_tlv_hdr_t |
  9238. * |-------------------------------------------------------------------------|
  9239. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9240. * |-------------------------------------------------------------------------|
  9241. *
  9242. * Where:
  9243. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  9244. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  9245. * V (valid) - 1 Bit Bit17
  9246. * CHIPID - 3 Bits
  9247. * TIDMASK - 8 Bits
  9248. * CACHE_SET_NUM - 8 Bits
  9249. *
  9250. * The following field definitions describe the format of the rx MLO peer map
  9251. * messages sent from the target to the host.
  9252. * - MSG_TYPE
  9253. * Bits 7:0
  9254. * Purpose: identifies this as an rx mlo peer map message
  9255. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  9256. *
  9257. * - MLO_PEER_ID
  9258. * Bits 23:8
  9259. * Purpose: The MLO peer ID (index).
  9260. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  9261. * Value: MLO peer ID
  9262. *
  9263. * - NUMLINK
  9264. * Bits: 26:24 (3Bits)
  9265. * Purpose: Indicate the max number of logical links supported per client.
  9266. * Value: number of logical links
  9267. *
  9268. * - PRC
  9269. * Bits: 29:27 (3Bits)
  9270. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  9271. * if there is migration of the primary chip.
  9272. * Value: Primary REO CHIPID
  9273. *
  9274. * - MAC_ADDR_L32
  9275. * Bits 31:0
  9276. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  9277. * Value: lower 4 bytes of peer node's MAC address
  9278. *
  9279. * - MAC_ADDR_U16
  9280. * Bits 15:0
  9281. * Purpose: Identifies which peer node the peer ID is for.
  9282. * Value: upper 2 bytes of peer node's MAC address
  9283. *
  9284. * - PRIMARY_TCL_AST_IDX
  9285. * Bits 15:0
  9286. * Purpose: Primary TCL AST index for this peer.
  9287. *
  9288. * - V
  9289. * 1 Bit Position 16
  9290. * Purpose: If the ast idx is valid.
  9291. *
  9292. * - CHIPID
  9293. * Bits 19:17
  9294. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  9295. *
  9296. * - TIDMASK
  9297. * Bits 27:20
  9298. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  9299. *
  9300. * - CACHE_SET_NUM
  9301. * Bits 31:28
  9302. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  9303. * Cache set number that should be used to cache the index based
  9304. * search results, for address and flow search.
  9305. * This value should be equal to LSB four bits of the hash value
  9306. * of match data, in case of search index points to an entry which
  9307. * may be used in content based search also. The value can be
  9308. * anything when the entry pointed by search index will not be
  9309. * used for content based search.
  9310. *
  9311. * - htt_tlv_hdr_t
  9312. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  9313. *
  9314. * Bits 11:0
  9315. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  9316. *
  9317. * Bits 23:12
  9318. * Purpose: Length, Length of the value that follows the header
  9319. *
  9320. * Bits 31:28
  9321. * Purpose: Reserved.
  9322. *
  9323. *
  9324. * - SW_PEER_ID
  9325. * Bits 15:0
  9326. * Purpose: The peer ID (index) that WAL is allocating
  9327. * Value: (rx) peer ID
  9328. *
  9329. * - VDEV_ID
  9330. * Bits 23:16
  9331. * Purpose: Indicates which virtual device the peer is associated with.
  9332. * Value: vdev ID (used in the host to look up the vdev object)
  9333. *
  9334. * - CHIPID
  9335. * Bits 26:24
  9336. * Purpose: Indicates which Chip id the peer is associated with.
  9337. * Value: chip ID (Provided by Host as part of QMI exchange)
  9338. */
  9339. typedef enum {
  9340. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  9341. } MLO_PEER_MAP_TLV_TAG_ID;
  9342. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  9343. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  9344. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  9345. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  9346. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  9347. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  9348. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9349. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  9350. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  9351. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  9352. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  9353. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  9354. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  9355. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  9356. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  9357. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  9358. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  9359. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  9360. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  9361. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  9362. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  9363. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  9364. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  9365. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  9366. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  9367. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  9368. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  9369. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  9370. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  9371. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  9372. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  9373. do { \
  9374. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  9375. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  9376. } while (0)
  9377. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  9378. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  9379. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  9380. do { \
  9381. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  9382. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  9383. } while (0)
  9384. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  9385. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  9386. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  9387. do { \
  9388. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  9389. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  9390. } while (0)
  9391. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  9392. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  9393. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  9394. do { \
  9395. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  9396. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  9397. } while (0)
  9398. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  9399. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  9400. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  9401. do { \
  9402. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  9403. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  9404. } while (0)
  9405. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  9406. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  9407. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  9410. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  9411. } while (0)
  9412. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  9413. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  9414. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  9415. do { \
  9416. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  9417. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  9418. } while (0)
  9419. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  9420. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  9421. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  9424. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  9425. } while (0)
  9426. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  9427. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  9428. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  9429. do { \
  9430. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  9431. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  9432. } while (0)
  9433. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  9434. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  9435. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  9436. do { \
  9437. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  9438. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  9439. } while (0)
  9440. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  9441. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  9442. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  9443. do { \
  9444. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  9445. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  9446. } while (0)
  9447. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  9448. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  9449. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  9450. do { \
  9451. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  9452. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  9453. } while (0)
  9454. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  9455. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  9456. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  9459. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  9460. } while (0)
  9461. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  9462. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  9463. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9464. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  9465. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  9466. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  9467. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  9468. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  9469. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  9470. *
  9471. * The following diagram shows the format of the rx mlo peer unmap message sent
  9472. * from the target to the host.
  9473. *
  9474. * |31 24|23 16|15 8|7 0|
  9475. * |-----------------------------------------------------------------------|
  9476. * | RSVD_24_31 | MLO peer ID | msg type |
  9477. * |-----------------------------------------------------------------------|
  9478. */
  9479. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  9480. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  9481. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  9482. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  9483. /**
  9484. * @brief target -> host message specifying security parameters
  9485. *
  9486. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  9487. *
  9488. * @details
  9489. * The following diagram shows the format of the security specification
  9490. * message sent from the target to the host.
  9491. * This security specification message tells the host whether a PN check is
  9492. * necessary on rx data frames, and if so, how large the PN counter is.
  9493. * This message also tells the host about the security processing to apply
  9494. * to defragmented rx frames - specifically, whether a Message Integrity
  9495. * Check is required, and the Michael key to use.
  9496. *
  9497. * |31 24|23 16|15|14 8|7 0|
  9498. * |-----------------------------------------------------------------------|
  9499. * | peer ID | U| security type | msg type |
  9500. * |-----------------------------------------------------------------------|
  9501. * | Michael Key K0 |
  9502. * |-----------------------------------------------------------------------|
  9503. * | Michael Key K1 |
  9504. * |-----------------------------------------------------------------------|
  9505. * | WAPI RSC Low0 |
  9506. * |-----------------------------------------------------------------------|
  9507. * | WAPI RSC Low1 |
  9508. * |-----------------------------------------------------------------------|
  9509. * | WAPI RSC Hi0 |
  9510. * |-----------------------------------------------------------------------|
  9511. * | WAPI RSC Hi1 |
  9512. * |-----------------------------------------------------------------------|
  9513. *
  9514. * The following field definitions describe the format of the security
  9515. * indication message sent from the target to the host.
  9516. * - MSG_TYPE
  9517. * Bits 7:0
  9518. * Purpose: identifies this as a security specification message
  9519. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  9520. * - SEC_TYPE
  9521. * Bits 14:8
  9522. * Purpose: specifies which type of security applies to the peer
  9523. * Value: htt_sec_type enum value
  9524. * - UNICAST
  9525. * Bit 15
  9526. * Purpose: whether this security is applied to unicast or multicast data
  9527. * Value: 1 -> unicast, 0 -> multicast
  9528. * - PEER_ID
  9529. * Bits 31:16
  9530. * Purpose: The ID number for the peer the security specification is for
  9531. * Value: peer ID
  9532. * - MICHAEL_KEY_K0
  9533. * Bits 31:0
  9534. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  9535. * Value: Michael Key K0 (if security type is TKIP)
  9536. * - MICHAEL_KEY_K1
  9537. * Bits 31:0
  9538. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  9539. * Value: Michael Key K1 (if security type is TKIP)
  9540. * - WAPI_RSC_LOW0
  9541. * Bits 31:0
  9542. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  9543. * Value: WAPI RSC Low0 (if security type is WAPI)
  9544. * - WAPI_RSC_LOW1
  9545. * Bits 31:0
  9546. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  9547. * Value: WAPI RSC Low1 (if security type is WAPI)
  9548. * - WAPI_RSC_HI0
  9549. * Bits 31:0
  9550. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  9551. * Value: WAPI RSC Hi0 (if security type is WAPI)
  9552. * - WAPI_RSC_HI1
  9553. * Bits 31:0
  9554. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  9555. * Value: WAPI RSC Hi1 (if security type is WAPI)
  9556. */
  9557. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  9558. #define HTT_SEC_IND_SEC_TYPE_S 8
  9559. #define HTT_SEC_IND_UNICAST_M 0x00008000
  9560. #define HTT_SEC_IND_UNICAST_S 15
  9561. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  9562. #define HTT_SEC_IND_PEER_ID_S 16
  9563. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  9564. do { \
  9565. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  9566. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  9567. } while (0)
  9568. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  9569. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  9570. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  9571. do { \
  9572. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  9573. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  9574. } while (0)
  9575. #define HTT_SEC_IND_UNICAST_GET(word) \
  9576. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  9577. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  9578. do { \
  9579. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  9580. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  9581. } while (0)
  9582. #define HTT_SEC_IND_PEER_ID_GET(word) \
  9583. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  9584. #define HTT_SEC_IND_BYTES 28
  9585. /**
  9586. * @brief target -> host rx ADDBA / DELBA message definitions
  9587. *
  9588. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  9589. *
  9590. * @details
  9591. * The following diagram shows the format of the rx ADDBA message sent
  9592. * from the target to the host:
  9593. *
  9594. * |31 20|19 16|15 8|7 0|
  9595. * |---------------------------------------------------------------------|
  9596. * | peer ID | TID | window size | msg type |
  9597. * |---------------------------------------------------------------------|
  9598. *
  9599. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  9600. *
  9601. * The following diagram shows the format of the rx DELBA message sent
  9602. * from the target to the host:
  9603. *
  9604. * |31 20|19 16|15 10|9 8|7 0|
  9605. * |---------------------------------------------------------------------|
  9606. * | peer ID | TID | window size | IR| msg type |
  9607. * |---------------------------------------------------------------------|
  9608. *
  9609. * The following field definitions describe the format of the rx ADDBA
  9610. * and DELBA messages sent from the target to the host.
  9611. * - MSG_TYPE
  9612. * Bits 7:0
  9613. * Purpose: identifies this as an rx ADDBA or DELBA message
  9614. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  9615. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  9616. * - IR (initiator / recipient)
  9617. * Bits 9:8 (DELBA only)
  9618. * Purpose: specify whether the DELBA handshake was initiated by the
  9619. * local STA/AP, or by the peer STA/AP
  9620. * Value:
  9621. * 0 - unspecified
  9622. * 1 - initiator (a.k.a. originator)
  9623. * 2 - recipient (a.k.a. responder)
  9624. * 3 - unused / reserved
  9625. * - WIN_SIZE
  9626. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  9627. * Purpose: Specifies the length of the block ack window (max = 64).
  9628. * Value:
  9629. * block ack window length specified by the received ADDBA/DELBA
  9630. * management message.
  9631. * - TID
  9632. * Bits 19:16
  9633. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  9634. * Value:
  9635. * TID specified by the received ADDBA or DELBA management message.
  9636. * - PEER_ID
  9637. * Bits 31:20
  9638. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  9639. * Value:
  9640. * ID (hash value) used by the host for fast, direct lookup of
  9641. * host SW peer info, including rx reorder states.
  9642. */
  9643. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  9644. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  9645. #define HTT_RX_ADDBA_TID_M 0xf0000
  9646. #define HTT_RX_ADDBA_TID_S 16
  9647. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  9648. #define HTT_RX_ADDBA_PEER_ID_S 20
  9649. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  9650. do { \
  9651. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  9652. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  9653. } while (0)
  9654. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9655. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9656. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9657. do { \
  9658. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9659. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9660. } while (0)
  9661. #define HTT_RX_ADDBA_TID_GET(word) \
  9662. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9663. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9664. do { \
  9665. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9666. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9667. } while (0)
  9668. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9669. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9670. #define HTT_RX_ADDBA_BYTES 4
  9671. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9672. #define HTT_RX_DELBA_INITIATOR_S 8
  9673. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9674. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9675. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9676. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9677. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9678. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9679. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9680. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9681. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9682. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9683. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9684. do { \
  9685. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9686. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9687. } while (0)
  9688. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9689. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9690. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9691. do { \
  9692. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9693. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9694. } while (0)
  9695. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9696. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9697. #define HTT_RX_DELBA_BYTES 4
  9698. /**
  9699. * @brief tx queue group information element definition
  9700. *
  9701. * @details
  9702. * The following diagram shows the format of the tx queue group
  9703. * information element, which can be included in target --> host
  9704. * messages to specify the number of tx "credits" (tx descriptors
  9705. * for LL, or tx buffers for HL) available to a particular group
  9706. * of host-side tx queues, and which host-side tx queues belong to
  9707. * the group.
  9708. *
  9709. * |31|30 24|23 16|15|14|13 0|
  9710. * |------------------------------------------------------------------------|
  9711. * | X| reserved | tx queue grp ID | A| S| credit count |
  9712. * |------------------------------------------------------------------------|
  9713. * | vdev ID mask | AC mask |
  9714. * |------------------------------------------------------------------------|
  9715. *
  9716. * The following definitions describe the fields within the tx queue group
  9717. * information element:
  9718. * - credit_count
  9719. * Bits 13:1
  9720. * Purpose: specify how many tx credits are available to the tx queue group
  9721. * Value: An absolute or relative, positive or negative credit value
  9722. * The 'A' bit specifies whether the value is absolute or relative.
  9723. * The 'S' bit specifies whether the value is positive or negative.
  9724. * A negative value can only be relative, not absolute.
  9725. * An absolute value replaces any prior credit value the host has for
  9726. * the tx queue group in question.
  9727. * A relative value is added to the prior credit value the host has for
  9728. * the tx queue group in question.
  9729. * - sign
  9730. * Bit 14
  9731. * Purpose: specify whether the credit count is positive or negative
  9732. * Value: 0 -> positive, 1 -> negative
  9733. * - absolute
  9734. * Bit 15
  9735. * Purpose: specify whether the credit count is absolute or relative
  9736. * Value: 0 -> relative, 1 -> absolute
  9737. * - txq_group_id
  9738. * Bits 23:16
  9739. * Purpose: indicate which tx queue group's credit and/or membership are
  9740. * being specified
  9741. * Value: 0 to max_tx_queue_groups-1
  9742. * - reserved
  9743. * Bits 30:16
  9744. * Value: 0x0
  9745. * - eXtension
  9746. * Bit 31
  9747. * Purpose: specify whether another tx queue group info element follows
  9748. * Value: 0 -> no more tx queue group information elements
  9749. * 1 -> another tx queue group information element immediately follows
  9750. * - ac_mask
  9751. * Bits 15:0
  9752. * Purpose: specify which Access Categories belong to the tx queue group
  9753. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9754. * the tx queue group.
  9755. * The AC bit-mask values are obtained by left-shifting by the
  9756. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9757. * - vdev_id_mask
  9758. * Bits 31:16
  9759. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9760. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9761. * belong to the tx queue group.
  9762. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9763. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9764. */
  9765. PREPACK struct htt_txq_group {
  9766. A_UINT32
  9767. credit_count: 14,
  9768. sign: 1,
  9769. absolute: 1,
  9770. tx_queue_group_id: 8,
  9771. reserved0: 7,
  9772. extension: 1;
  9773. A_UINT32
  9774. ac_mask: 16,
  9775. vdev_id_mask: 16;
  9776. } POSTPACK;
  9777. /* first word */
  9778. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9779. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9780. #define HTT_TXQ_GROUP_SIGN_S 14
  9781. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9782. #define HTT_TXQ_GROUP_ABS_S 15
  9783. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9784. #define HTT_TXQ_GROUP_ID_S 16
  9785. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9786. #define HTT_TXQ_GROUP_EXT_S 31
  9787. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9788. /* second word */
  9789. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9790. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9791. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9792. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9793. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9794. do { \
  9795. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9796. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9797. } while (0)
  9798. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9799. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9800. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9803. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9804. } while (0)
  9805. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9806. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9807. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9808. do { \
  9809. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9810. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9811. } while (0)
  9812. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9813. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9814. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9815. do { \
  9816. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9817. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9818. } while (0)
  9819. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9820. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9821. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9822. do { \
  9823. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9824. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9825. } while (0)
  9826. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9827. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9828. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9829. do { \
  9830. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9831. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9832. } while (0)
  9833. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9834. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9835. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9836. do { \
  9837. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9838. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9839. } while (0)
  9840. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9841. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9842. /**
  9843. * @brief target -> host TX completion indication message definition
  9844. *
  9845. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  9846. *
  9847. * @details
  9848. * The following diagram shows the format of the TX completion indication sent
  9849. * from the target to the host
  9850. *
  9851. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9852. * |-------------------------------------------------------------------|
  9853. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9854. * |-------------------------------------------------------------------|
  9855. * payload:| MSDU1 ID | MSDU0 ID |
  9856. * |-------------------------------------------------------------------|
  9857. * : MSDU3 ID | MSDU2 ID :
  9858. * |-------------------------------------------------------------------|
  9859. * | struct htt_tx_compl_ind_append_retries |
  9860. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9861. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9862. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9863. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9864. * |-------------------------------------------------------------------|
  9865. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9866. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9867. * | MSDU0 tx_tsf64_low |
  9868. * |-------------------------------------------------------------------|
  9869. * | MSDU0 tx_tsf64_high |
  9870. * |-------------------------------------------------------------------|
  9871. * | MSDU1 tx_tsf64_low |
  9872. * |-------------------------------------------------------------------|
  9873. * | MSDU1 tx_tsf64_high |
  9874. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9875. * | phy_timestamp |
  9876. * |-------------------------------------------------------------------|
  9877. * | rate specs (see below) |
  9878. * |-------------------------------------------------------------------|
  9879. * | seqctrl | framectrl |
  9880. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9881. * Where:
  9882. * A0 = append (a.k.a. append0)
  9883. * A1 = append1
  9884. * TP = MSDU tx power presence
  9885. * A2 = append2
  9886. * A3 = append3
  9887. * A4 = append4
  9888. *
  9889. * The following field definitions describe the format of the TX completion
  9890. * indication sent from the target to the host
  9891. * Header fields:
  9892. * - msg_type
  9893. * Bits 7:0
  9894. * Purpose: identifies this as HTT TX completion indication
  9895. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  9896. * - status
  9897. * Bits 10:8
  9898. * Purpose: the TX completion status of payload fragmentations descriptors
  9899. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9900. * - tid
  9901. * Bits 14:11
  9902. * Purpose: the tid associated with those fragmentation descriptors. It is
  9903. * valid or not, depending on the tid_invalid bit.
  9904. * Value: 0 to 15
  9905. * - tid_invalid
  9906. * Bits 15:15
  9907. * Purpose: this bit indicates whether the tid field is valid or not
  9908. * Value: 0 indicates valid; 1 indicates invalid
  9909. * - num
  9910. * Bits 23:16
  9911. * Purpose: the number of payload in this indication
  9912. * Value: 1 to 255
  9913. * - append (a.k.a. append0)
  9914. * Bits 24:24
  9915. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9916. * the number of tx retries for one MSDU at the end of this message
  9917. * Value: 0 indicates no appending; 1 indicates appending
  9918. * - append1
  9919. * Bits 25:25
  9920. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9921. * contains the timestamp info for each TX msdu id in payload.
  9922. * The order of the timestamps matches the order of the MSDU IDs.
  9923. * Note that a big-endian host needs to account for the reordering
  9924. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9925. * conversion) when determining which tx timestamp corresponds to
  9926. * which MSDU ID.
  9927. * Value: 0 indicates no appending; 1 indicates appending
  9928. * - msdu_tx_power_presence
  9929. * Bits 26:26
  9930. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9931. * for each MSDU referenced by the TX_COMPL_IND message.
  9932. * The tx power is reported in 0.5 dBm units.
  9933. * The order of the per-MSDU tx power reports matches the order
  9934. * of the MSDU IDs.
  9935. * Note that a big-endian host needs to account for the reordering
  9936. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9937. * conversion) when determining which Tx Power corresponds to
  9938. * which MSDU ID.
  9939. * Value: 0 indicates MSDU tx power reports are not appended,
  9940. * 1 indicates MSDU tx power reports are appended
  9941. * - append2
  9942. * Bits 27:27
  9943. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9944. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9945. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9946. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9947. * for each MSDU, for convenience.
  9948. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9949. * this append2 bit is set).
  9950. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9951. * dB above the noise floor.
  9952. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9953. * 1 indicates MSDU ACK RSSI values are appended.
  9954. * - append3
  9955. * Bits 28:28
  9956. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9957. * contains the tx tsf info based on wlan global TSF for
  9958. * each TX msdu id in payload.
  9959. * The order of the tx tsf matches the order of the MSDU IDs.
  9960. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9961. * values to indicate the the lower 32 bits and higher 32 bits of
  9962. * the tx tsf.
  9963. * The tx_tsf64 here represents the time MSDU was acked and the
  9964. * tx_tsf64 has microseconds units.
  9965. * Value: 0 indicates no appending; 1 indicates appending
  9966. * - append4
  9967. * Bits 29:29
  9968. * Purpose: Indicate whether data frame control fields and fields required
  9969. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9970. * message. The order of the this message matches the order of
  9971. * the MSDU IDs.
  9972. * Value: 0 indicates frame control fields and fields required for
  9973. * radio tap header values are not appended,
  9974. * 1 indicates frame control fields and fields required for
  9975. * radio tap header values are appended.
  9976. * Payload fields:
  9977. * - hmsdu_id
  9978. * Bits 15:0
  9979. * Purpose: this ID is used to track the Tx buffer in host
  9980. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9981. */
  9982. PREPACK struct htt_tx_data_hdr_information {
  9983. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9984. A_UINT32 /* word 1 */
  9985. /* preamble:
  9986. * 0-OFDM,
  9987. * 1-CCk,
  9988. * 2-HT,
  9989. * 3-VHT
  9990. */
  9991. preamble: 2, /* [1:0] */
  9992. /* mcs:
  9993. * In case of HT preamble interpret
  9994. * MCS along with NSS.
  9995. * Valid values for HT are 0 to 7.
  9996. * HT mcs 0 with NSS 2 is mcs 8.
  9997. * Valid values for VHT are 0 to 9.
  9998. */
  9999. mcs: 4, /* [5:2] */
  10000. /* rate:
  10001. * This is applicable only for
  10002. * CCK and OFDM preamble type
  10003. * rate 0: OFDM 48 Mbps,
  10004. * 1: OFDM 24 Mbps,
  10005. * 2: OFDM 12 Mbps
  10006. * 3: OFDM 6 Mbps
  10007. * 4: OFDM 54 Mbps
  10008. * 5: OFDM 36 Mbps
  10009. * 6: OFDM 18 Mbps
  10010. * 7: OFDM 9 Mbps
  10011. * rate 0: CCK 11 Mbps Long
  10012. * 1: CCK 5.5 Mbps Long
  10013. * 2: CCK 2 Mbps Long
  10014. * 3: CCK 1 Mbps Long
  10015. * 4: CCK 11 Mbps Short
  10016. * 5: CCK 5.5 Mbps Short
  10017. * 6: CCK 2 Mbps Short
  10018. */
  10019. rate : 3, /* [ 8: 6] */
  10020. rssi : 8, /* [16: 9] units=dBm */
  10021. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10022. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10023. stbc : 1, /* [22] */
  10024. sgi : 1, /* [23] */
  10025. ldpc : 1, /* [24] */
  10026. beamformed: 1, /* [25] */
  10027. /* tx_retry_cnt:
  10028. * Indicates retry count of data tx frames provided by the host.
  10029. */
  10030. tx_retry_cnt: 6; /* [31:26] */
  10031. A_UINT32 /* word 2 */
  10032. framectrl:16, /* [15: 0] */
  10033. seqno:16; /* [31:16] */
  10034. } POSTPACK;
  10035. #define HTT_TX_COMPL_IND_STATUS_S 8
  10036. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10037. #define HTT_TX_COMPL_IND_TID_S 11
  10038. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10039. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10040. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10041. #define HTT_TX_COMPL_IND_NUM_S 16
  10042. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10043. #define HTT_TX_COMPL_IND_APPEND_S 24
  10044. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10045. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10046. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10047. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10048. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10049. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10050. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10051. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10052. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10053. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10054. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10055. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10056. do { \
  10057. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10058. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10059. } while (0)
  10060. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10061. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10062. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10063. do { \
  10064. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10065. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10066. } while (0)
  10067. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10068. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10069. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  10070. do { \
  10071. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  10072. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  10073. } while (0)
  10074. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  10075. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  10076. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  10077. do { \
  10078. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  10079. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  10080. } while (0)
  10081. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  10082. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  10083. HTT_TX_COMPL_IND_TID_INV_S)
  10084. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  10085. do { \
  10086. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  10087. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  10088. } while (0)
  10089. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  10090. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  10091. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  10092. do { \
  10093. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  10094. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  10095. } while (0)
  10096. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  10097. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  10098. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  10099. do { \
  10100. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  10101. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  10102. } while (0)
  10103. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  10104. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  10105. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  10106. do { \
  10107. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  10108. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  10109. } while (0)
  10110. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  10111. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  10112. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  10113. do { \
  10114. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  10115. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  10116. } while (0)
  10117. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  10118. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  10119. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  10120. do { \
  10121. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  10122. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  10123. } while (0)
  10124. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  10125. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  10126. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  10127. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  10128. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  10129. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  10130. #define HTT_TX_COMPL_IND_STAT_OK 0
  10131. /* DISCARD:
  10132. * current meaning:
  10133. * MSDUs were queued for transmission but filtered by HW or SW
  10134. * without any over the air attempts
  10135. * legacy meaning (HL Rome):
  10136. * MSDUs were discarded by the target FW without any over the air
  10137. * attempts due to lack of space
  10138. */
  10139. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  10140. /* NO_ACK:
  10141. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  10142. */
  10143. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  10144. /* POSTPONE:
  10145. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  10146. * be downloaded again later (in the appropriate order), when they are
  10147. * deliverable.
  10148. */
  10149. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  10150. /*
  10151. * The PEER_DEL tx completion status is used for HL cases
  10152. * where the peer the frame is for has been deleted.
  10153. * The host has already discarded its copy of the frame, but
  10154. * it still needs the tx completion to restore its credit.
  10155. */
  10156. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  10157. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  10158. #define HTT_TX_COMPL_IND_STAT_DROP 5
  10159. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  10160. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  10161. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  10162. PREPACK struct htt_tx_compl_ind_base {
  10163. A_UINT32 hdr;
  10164. A_UINT16 payload[1/*or more*/];
  10165. } POSTPACK;
  10166. PREPACK struct htt_tx_compl_ind_append_retries {
  10167. A_UINT16 msdu_id;
  10168. A_UINT8 tx_retries;
  10169. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  10170. 0: this is the last append_retries struct */
  10171. } POSTPACK;
  10172. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  10173. A_UINT32 timestamp[1/*or more*/];
  10174. } POSTPACK;
  10175. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  10176. A_UINT32 tx_tsf64_low;
  10177. A_UINT32 tx_tsf64_high;
  10178. } POSTPACK;
  10179. /* htt_tx_data_hdr_information payload extension fields: */
  10180. /* DWORD zero */
  10181. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  10182. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  10183. /* DWORD one */
  10184. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  10185. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  10186. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  10187. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  10188. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  10189. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  10190. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  10191. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  10192. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  10193. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  10194. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  10195. #define HTT_FW_TX_DATA_HDR_BW_S 19
  10196. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  10197. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  10198. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  10199. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  10200. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  10201. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  10202. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  10203. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  10204. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  10205. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  10206. /* DWORD two */
  10207. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  10208. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  10209. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  10210. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  10211. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  10212. do { \
  10213. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  10214. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  10215. } while (0)
  10216. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  10217. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  10218. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  10219. do { \
  10220. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  10221. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  10222. } while (0)
  10223. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  10224. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  10225. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  10226. do { \
  10227. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  10228. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  10229. } while (0)
  10230. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  10231. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  10232. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  10233. do { \
  10234. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  10235. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  10236. } while (0)
  10237. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  10238. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  10239. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  10240. do { \
  10241. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  10242. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  10243. } while (0)
  10244. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  10245. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  10246. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  10247. do { \
  10248. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  10249. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  10250. } while (0)
  10251. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  10252. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  10253. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  10254. do { \
  10255. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  10256. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  10257. } while (0)
  10258. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  10259. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  10260. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  10261. do { \
  10262. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  10263. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  10264. } while (0)
  10265. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  10266. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  10267. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  10268. do { \
  10269. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  10270. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  10271. } while (0)
  10272. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  10273. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  10274. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  10275. do { \
  10276. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  10277. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  10278. } while (0)
  10279. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  10280. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  10281. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  10282. do { \
  10283. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  10284. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  10285. } while (0)
  10286. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  10287. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  10288. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  10289. do { \
  10290. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  10291. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  10292. } while (0)
  10293. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  10294. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  10295. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  10296. do { \
  10297. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  10298. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  10299. } while (0)
  10300. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  10301. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  10302. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  10303. do { \
  10304. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  10305. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  10306. } while (0)
  10307. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  10308. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  10309. /**
  10310. * @brief target -> host rate-control update indication message
  10311. *
  10312. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  10313. *
  10314. * @details
  10315. * The following diagram shows the format of the RC Update message
  10316. * sent from the target to the host, while processing the tx-completion
  10317. * of a transmitted PPDU.
  10318. *
  10319. * |31 24|23 16|15 8|7 0|
  10320. * |-------------------------------------------------------------|
  10321. * | peer ID | vdev ID | msg_type |
  10322. * |-------------------------------------------------------------|
  10323. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10324. * |-------------------------------------------------------------|
  10325. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  10326. * |-------------------------------------------------------------|
  10327. * | : |
  10328. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10329. * | : |
  10330. * |-------------------------------------------------------------|
  10331. * | : |
  10332. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10333. * | : |
  10334. * |-------------------------------------------------------------|
  10335. * : :
  10336. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10337. *
  10338. */
  10339. typedef struct {
  10340. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  10341. A_UINT32 rate_code_flags;
  10342. A_UINT32 flags; /* Encodes information such as excessive
  10343. retransmission, aggregate, some info
  10344. from .11 frame control,
  10345. STBC, LDPC, (SGI and Tx Chain Mask
  10346. are encoded in ptx_rc->flags field),
  10347. AMPDU truncation (BT/time based etc.),
  10348. RTS/CTS attempt */
  10349. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  10350. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  10351. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  10352. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  10353. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  10354. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  10355. } HTT_RC_TX_DONE_PARAMS;
  10356. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  10357. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  10358. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  10359. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  10360. #define HTT_RC_UPDATE_VDEVID_S 8
  10361. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  10362. #define HTT_RC_UPDATE_PEERID_S 16
  10363. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  10364. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  10365. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  10366. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  10367. do { \
  10368. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  10369. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  10370. } while (0)
  10371. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  10372. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  10373. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  10374. do { \
  10375. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  10376. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  10377. } while (0)
  10378. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  10379. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  10380. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  10381. do { \
  10382. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  10383. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  10384. } while (0)
  10385. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  10386. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  10387. /**
  10388. * @brief target -> host rx fragment indication message definition
  10389. *
  10390. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  10391. *
  10392. * @details
  10393. * The following field definitions describe the format of the rx fragment
  10394. * indication message sent from the target to the host.
  10395. * The rx fragment indication message shares the format of the
  10396. * rx indication message, but not all fields from the rx indication message
  10397. * are relevant to the rx fragment indication message.
  10398. *
  10399. *
  10400. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10401. * |-----------+-------------------+---------------------+-------------|
  10402. * | peer ID | |FV| ext TID | msg type |
  10403. * |-------------------------------------------------------------------|
  10404. * | | flush | flush |
  10405. * | | end | start |
  10406. * | | seq num | seq num |
  10407. * |-------------------------------------------------------------------|
  10408. * | reserved | FW rx desc bytes |
  10409. * |-------------------------------------------------------------------|
  10410. * | | FW MSDU Rx |
  10411. * | | desc B0 |
  10412. * |-------------------------------------------------------------------|
  10413. * Header fields:
  10414. * - MSG_TYPE
  10415. * Bits 7:0
  10416. * Purpose: identifies this as an rx fragment indication message
  10417. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  10418. * - EXT_TID
  10419. * Bits 12:8
  10420. * Purpose: identify the traffic ID of the rx data, including
  10421. * special "extended" TID values for multicast, broadcast, and
  10422. * non-QoS data frames
  10423. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10424. * - FLUSH_VALID (FV)
  10425. * Bit 13
  10426. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10427. * is valid
  10428. * Value:
  10429. * 1 -> flush IE is valid and needs to be processed
  10430. * 0 -> flush IE is not valid and should be ignored
  10431. * - PEER_ID
  10432. * Bits 31:16
  10433. * Purpose: Identify, by ID, which peer sent the rx data
  10434. * Value: ID of the peer who sent the rx data
  10435. * - FLUSH_SEQ_NUM_START
  10436. * Bits 5:0
  10437. * Purpose: Indicate the start of a series of MPDUs to flush
  10438. * Not all MPDUs within this series are necessarily valid - the host
  10439. * must check each sequence number within this range to see if the
  10440. * corresponding MPDU is actually present.
  10441. * This field is only valid if the FV bit is set.
  10442. * Value:
  10443. * The sequence number for the first MPDUs to check to flush.
  10444. * The sequence number is masked by 0x3f.
  10445. * - FLUSH_SEQ_NUM_END
  10446. * Bits 11:6
  10447. * Purpose: Indicate the end of a series of MPDUs to flush
  10448. * Value:
  10449. * The sequence number one larger than the sequence number of the
  10450. * last MPDU to check to flush.
  10451. * The sequence number is masked by 0x3f.
  10452. * Not all MPDUs within this series are necessarily valid - the host
  10453. * must check each sequence number within this range to see if the
  10454. * corresponding MPDU is actually present.
  10455. * This field is only valid if the FV bit is set.
  10456. * Rx descriptor fields:
  10457. * - FW_RX_DESC_BYTES
  10458. * Bits 15:0
  10459. * Purpose: Indicate how many bytes in the Rx indication are used for
  10460. * FW Rx descriptors
  10461. * Value: 1
  10462. */
  10463. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  10464. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  10465. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  10466. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  10467. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  10468. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  10469. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  10470. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  10471. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  10472. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  10473. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  10474. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  10475. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  10476. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  10477. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  10478. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  10479. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  10480. #define HTT_RX_FRAG_IND_BYTES \
  10481. (4 /* msg hdr */ + \
  10482. 4 /* flush spec */ + \
  10483. 4 /* (unused) FW rx desc bytes spec */ + \
  10484. 4 /* FW rx desc */)
  10485. /**
  10486. * @brief target -> host test message definition
  10487. *
  10488. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  10489. *
  10490. * @details
  10491. * The following field definitions describe the format of the test
  10492. * message sent from the target to the host.
  10493. * The message consists of a 4-octet header, followed by a variable
  10494. * number of 32-bit integer values, followed by a variable number
  10495. * of 8-bit character values.
  10496. *
  10497. * |31 16|15 8|7 0|
  10498. * |-----------------------------------------------------------|
  10499. * | num chars | num ints | msg type |
  10500. * |-----------------------------------------------------------|
  10501. * | int 0 |
  10502. * |-----------------------------------------------------------|
  10503. * | int 1 |
  10504. * |-----------------------------------------------------------|
  10505. * | ... |
  10506. * |-----------------------------------------------------------|
  10507. * | char 3 | char 2 | char 1 | char 0 |
  10508. * |-----------------------------------------------------------|
  10509. * | | | ... | char 4 |
  10510. * |-----------------------------------------------------------|
  10511. * - MSG_TYPE
  10512. * Bits 7:0
  10513. * Purpose: identifies this as a test message
  10514. * Value: HTT_MSG_TYPE_TEST
  10515. * - NUM_INTS
  10516. * Bits 15:8
  10517. * Purpose: indicate how many 32-bit integers follow the message header
  10518. * - NUM_CHARS
  10519. * Bits 31:16
  10520. * Purpose: indicate how many 8-bit charaters follow the series of integers
  10521. */
  10522. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  10523. #define HTT_RX_TEST_NUM_INTS_S 8
  10524. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  10525. #define HTT_RX_TEST_NUM_CHARS_S 16
  10526. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  10527. do { \
  10528. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  10529. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  10530. } while (0)
  10531. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  10532. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  10533. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  10534. do { \
  10535. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  10536. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  10537. } while (0)
  10538. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  10539. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  10540. /**
  10541. * @brief target -> host packet log message
  10542. *
  10543. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  10544. *
  10545. * @details
  10546. * The following field definitions describe the format of the packet log
  10547. * message sent from the target to the host.
  10548. * The message consists of a 4-octet header,followed by a variable number
  10549. * of 32-bit character values.
  10550. *
  10551. * |31 16|15 12|11 10|9 8|7 0|
  10552. * |------------------------------------------------------------------|
  10553. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  10554. * |------------------------------------------------------------------|
  10555. * | payload |
  10556. * |------------------------------------------------------------------|
  10557. * - MSG_TYPE
  10558. * Bits 7:0
  10559. * Purpose: identifies this as a pktlog message
  10560. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  10561. * - mac_id
  10562. * Bits 9:8
  10563. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  10564. * Value: 0-3
  10565. * - pdev_id
  10566. * Bits 11:10
  10567. * Purpose: pdev_id
  10568. * Value: 0-3
  10569. * 0 (for rings at SOC level),
  10570. * 1/2/3 PDEV -> 0/1/2
  10571. * - payload_size
  10572. * Bits 31:16
  10573. * Purpose: explicitly specify the payload size
  10574. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  10575. */
  10576. PREPACK struct htt_pktlog_msg {
  10577. A_UINT32 header;
  10578. A_UINT32 payload[1/* or more */];
  10579. } POSTPACK;
  10580. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  10581. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  10582. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  10583. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  10584. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  10585. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  10586. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  10589. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  10590. } while (0)
  10591. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  10592. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  10593. HTT_T2H_PKTLOG_MAC_ID_S)
  10594. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  10595. do { \
  10596. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  10597. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  10598. } while (0)
  10599. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  10600. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  10601. HTT_T2H_PKTLOG_PDEV_ID_S)
  10602. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  10603. do { \
  10604. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  10605. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  10606. } while (0)
  10607. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  10608. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  10609. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  10610. /*
  10611. * Rx reorder statistics
  10612. * NB: all the fields must be defined in 4 octets size.
  10613. */
  10614. struct rx_reorder_stats {
  10615. /* Non QoS MPDUs received */
  10616. A_UINT32 deliver_non_qos;
  10617. /* MPDUs received in-order */
  10618. A_UINT32 deliver_in_order;
  10619. /* Flush due to reorder timer expired */
  10620. A_UINT32 deliver_flush_timeout;
  10621. /* Flush due to move out of window */
  10622. A_UINT32 deliver_flush_oow;
  10623. /* Flush due to DELBA */
  10624. A_UINT32 deliver_flush_delba;
  10625. /* MPDUs dropped due to FCS error */
  10626. A_UINT32 fcs_error;
  10627. /* MPDUs dropped due to monitor mode non-data packet */
  10628. A_UINT32 mgmt_ctrl;
  10629. /* Unicast-data MPDUs dropped due to invalid peer */
  10630. A_UINT32 invalid_peer;
  10631. /* MPDUs dropped due to duplication (non aggregation) */
  10632. A_UINT32 dup_non_aggr;
  10633. /* MPDUs dropped due to processed before */
  10634. A_UINT32 dup_past;
  10635. /* MPDUs dropped due to duplicate in reorder queue */
  10636. A_UINT32 dup_in_reorder;
  10637. /* Reorder timeout happened */
  10638. A_UINT32 reorder_timeout;
  10639. /* invalid bar ssn */
  10640. A_UINT32 invalid_bar_ssn;
  10641. /* reorder reset due to bar ssn */
  10642. A_UINT32 ssn_reset;
  10643. /* Flush due to delete peer */
  10644. A_UINT32 deliver_flush_delpeer;
  10645. /* Flush due to offload*/
  10646. A_UINT32 deliver_flush_offload;
  10647. /* Flush due to out of buffer*/
  10648. A_UINT32 deliver_flush_oob;
  10649. /* MPDUs dropped due to PN check fail */
  10650. A_UINT32 pn_fail;
  10651. /* MPDUs dropped due to unable to allocate memory */
  10652. A_UINT32 store_fail;
  10653. /* Number of times the tid pool alloc succeeded */
  10654. A_UINT32 tid_pool_alloc_succ;
  10655. /* Number of times the MPDU pool alloc succeeded */
  10656. A_UINT32 mpdu_pool_alloc_succ;
  10657. /* Number of times the MSDU pool alloc succeeded */
  10658. A_UINT32 msdu_pool_alloc_succ;
  10659. /* Number of times the tid pool alloc failed */
  10660. A_UINT32 tid_pool_alloc_fail;
  10661. /* Number of times the MPDU pool alloc failed */
  10662. A_UINT32 mpdu_pool_alloc_fail;
  10663. /* Number of times the MSDU pool alloc failed */
  10664. A_UINT32 msdu_pool_alloc_fail;
  10665. /* Number of times the tid pool freed */
  10666. A_UINT32 tid_pool_free;
  10667. /* Number of times the MPDU pool freed */
  10668. A_UINT32 mpdu_pool_free;
  10669. /* Number of times the MSDU pool freed */
  10670. A_UINT32 msdu_pool_free;
  10671. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10672. A_UINT32 msdu_queued;
  10673. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10674. A_UINT32 msdu_recycled;
  10675. /* Number of MPDUs with invalid peer but A2 found in AST */
  10676. A_UINT32 invalid_peer_a2_in_ast;
  10677. /* Number of MPDUs with invalid peer but A3 found in AST */
  10678. A_UINT32 invalid_peer_a3_in_ast;
  10679. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10680. A_UINT32 invalid_peer_bmc_mpdus;
  10681. /* Number of MSDUs with err attention word */
  10682. A_UINT32 rxdesc_err_att;
  10683. /* Number of MSDUs with flag of peer_idx_invalid */
  10684. A_UINT32 rxdesc_err_peer_idx_inv;
  10685. /* Number of MSDUs with flag of peer_idx_timeout */
  10686. A_UINT32 rxdesc_err_peer_idx_to;
  10687. /* Number of MSDUs with flag of overflow */
  10688. A_UINT32 rxdesc_err_ov;
  10689. /* Number of MSDUs with flag of msdu_length_err */
  10690. A_UINT32 rxdesc_err_msdu_len;
  10691. /* Number of MSDUs with flag of mpdu_length_err */
  10692. A_UINT32 rxdesc_err_mpdu_len;
  10693. /* Number of MSDUs with flag of tkip_mic_err */
  10694. A_UINT32 rxdesc_err_tkip_mic;
  10695. /* Number of MSDUs with flag of decrypt_err */
  10696. A_UINT32 rxdesc_err_decrypt;
  10697. /* Number of MSDUs with flag of fcs_err */
  10698. A_UINT32 rxdesc_err_fcs;
  10699. /* Number of Unicast (bc_mc bit is not set in attention word)
  10700. * frames with invalid peer handler
  10701. */
  10702. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10703. /* Number of unicast frame directly (direct bit is set in attention word)
  10704. * to DUT with invalid peer handler
  10705. */
  10706. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10707. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10708. * frames with invalid peer handler
  10709. */
  10710. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10711. /* Number of MSDUs dropped due to no first MSDU flag */
  10712. A_UINT32 rxdesc_no_1st_msdu;
  10713. /* Number of MSDUs droped due to ring overflow */
  10714. A_UINT32 msdu_drop_ring_ov;
  10715. /* Number of MSDUs dropped due to FC mismatch */
  10716. A_UINT32 msdu_drop_fc_mismatch;
  10717. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10718. A_UINT32 msdu_drop_mgmt_remote_ring;
  10719. /* Number of MSDUs dropped due to errors not reported in attention word */
  10720. A_UINT32 msdu_drop_misc;
  10721. /* Number of MSDUs go to offload before reorder */
  10722. A_UINT32 offload_msdu_wal;
  10723. /* Number of data frame dropped by offload after reorder */
  10724. A_UINT32 offload_msdu_reorder;
  10725. /* Number of MPDUs with sequence number in the past and within the BA window */
  10726. A_UINT32 dup_past_within_window;
  10727. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10728. A_UINT32 dup_past_outside_window;
  10729. /* Number of MSDUs with decrypt/MIC error */
  10730. A_UINT32 rxdesc_err_decrypt_mic;
  10731. /* Number of data MSDUs received on both local and remote rings */
  10732. A_UINT32 data_msdus_on_both_rings;
  10733. /* MPDUs never filled */
  10734. A_UINT32 holes_not_filled;
  10735. };
  10736. /*
  10737. * Rx Remote buffer statistics
  10738. * NB: all the fields must be defined in 4 octets size.
  10739. */
  10740. struct rx_remote_buffer_mgmt_stats {
  10741. /* Total number of MSDUs reaped for Rx processing */
  10742. A_UINT32 remote_reaped;
  10743. /* MSDUs recycled within firmware */
  10744. A_UINT32 remote_recycled;
  10745. /* MSDUs stored by Data Rx */
  10746. A_UINT32 data_rx_msdus_stored;
  10747. /* Number of HTT indications from WAL Rx MSDU */
  10748. A_UINT32 wal_rx_ind;
  10749. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10750. A_UINT32 wal_rx_ind_unconsumed;
  10751. /* Number of HTT indications from Data Rx MSDU */
  10752. A_UINT32 data_rx_ind;
  10753. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10754. A_UINT32 data_rx_ind_unconsumed;
  10755. /* Number of HTT indications from ATHBUF */
  10756. A_UINT32 athbuf_rx_ind;
  10757. /* Number of remote buffers requested for refill */
  10758. A_UINT32 refill_buf_req;
  10759. /* Number of remote buffers filled by the host */
  10760. A_UINT32 refill_buf_rsp;
  10761. /* Number of times MAC hw_index = f/w write_index */
  10762. A_INT32 mac_no_bufs;
  10763. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10764. A_INT32 fw_indices_equal;
  10765. /* Number of times f/w finds no buffers to post */
  10766. A_INT32 host_no_bufs;
  10767. };
  10768. /*
  10769. * TXBF MU/SU packets and NDPA statistics
  10770. * NB: all the fields must be defined in 4 octets size.
  10771. */
  10772. struct rx_txbf_musu_ndpa_pkts_stats {
  10773. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10774. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10775. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10776. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10777. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10778. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10779. };
  10780. /*
  10781. * htt_dbg_stats_status -
  10782. * present - The requested stats have been delivered in full.
  10783. * This indicates that either the stats information was contained
  10784. * in its entirety within this message, or else this message
  10785. * completes the delivery of the requested stats info that was
  10786. * partially delivered through earlier STATS_CONF messages.
  10787. * partial - The requested stats have been delivered in part.
  10788. * One or more subsequent STATS_CONF messages with the same
  10789. * cookie value will be sent to deliver the remainder of the
  10790. * information.
  10791. * error - The requested stats could not be delivered, for example due
  10792. * to a shortage of memory to construct a message holding the
  10793. * requested stats.
  10794. * invalid - The requested stat type is either not recognized, or the
  10795. * target is configured to not gather the stats type in question.
  10796. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10797. * series_done - This special value indicates that no further stats info
  10798. * elements are present within a series of stats info elems
  10799. * (within a stats upload confirmation message).
  10800. */
  10801. enum htt_dbg_stats_status {
  10802. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10803. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10804. HTT_DBG_STATS_STATUS_ERROR = 2,
  10805. HTT_DBG_STATS_STATUS_INVALID = 3,
  10806. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10807. };
  10808. /**
  10809. * @brief target -> host statistics upload
  10810. *
  10811. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  10812. *
  10813. * @details
  10814. * The following field definitions describe the format of the HTT target
  10815. * to host stats upload confirmation message.
  10816. * The message contains a cookie echoed from the HTT host->target stats
  10817. * upload request, which identifies which request the confirmation is
  10818. * for, and a series of tag-length-value stats information elements.
  10819. * The tag-length header for each stats info element also includes a
  10820. * status field, to indicate whether the request for the stat type in
  10821. * question was fully met, partially met, unable to be met, or invalid
  10822. * (if the stat type in question is disabled in the target).
  10823. * A special value of all 1's in this status field is used to indicate
  10824. * the end of the series of stats info elements.
  10825. *
  10826. *
  10827. * |31 16|15 8|7 5|4 0|
  10828. * |------------------------------------------------------------|
  10829. * | reserved | msg type |
  10830. * |------------------------------------------------------------|
  10831. * | cookie LSBs |
  10832. * |------------------------------------------------------------|
  10833. * | cookie MSBs |
  10834. * |------------------------------------------------------------|
  10835. * | stats entry length | reserved | S |stat type|
  10836. * |------------------------------------------------------------|
  10837. * | |
  10838. * | type-specific stats info |
  10839. * | |
  10840. * |------------------------------------------------------------|
  10841. * | stats entry length | reserved | S |stat type|
  10842. * |------------------------------------------------------------|
  10843. * | |
  10844. * | type-specific stats info |
  10845. * | |
  10846. * |------------------------------------------------------------|
  10847. * | n/a | reserved | 111 | n/a |
  10848. * |------------------------------------------------------------|
  10849. * Header fields:
  10850. * - MSG_TYPE
  10851. * Bits 7:0
  10852. * Purpose: identifies this is a statistics upload confirmation message
  10853. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  10854. * - COOKIE_LSBS
  10855. * Bits 31:0
  10856. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10857. * message with its preceding host->target stats request message.
  10858. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10859. * - COOKIE_MSBS
  10860. * Bits 31:0
  10861. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10862. * message with its preceding host->target stats request message.
  10863. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10864. *
  10865. * Stats Information Element tag-length header fields:
  10866. * - STAT_TYPE
  10867. * Bits 4:0
  10868. * Purpose: identifies the type of statistics info held in the
  10869. * following information element
  10870. * Value: htt_dbg_stats_type
  10871. * - STATUS
  10872. * Bits 7:5
  10873. * Purpose: indicate whether the requested stats are present
  10874. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10875. * the completion of the stats entry series
  10876. * - LENGTH
  10877. * Bits 31:16
  10878. * Purpose: indicate the stats information size
  10879. * Value: This field specifies the number of bytes of stats information
  10880. * that follows the element tag-length header.
  10881. * It is expected but not required that this length is a multiple of
  10882. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10883. * subsequent stats entry header will begin on a 4-byte aligned
  10884. * boundary.
  10885. */
  10886. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10887. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10888. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10889. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10890. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10891. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10892. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10893. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10894. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10895. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10896. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10897. do { \
  10898. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10899. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10900. } while (0)
  10901. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10902. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10903. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10904. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10905. do { \
  10906. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10907. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10908. } while (0)
  10909. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10910. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10911. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10912. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10913. do { \
  10914. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10915. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10916. } while (0)
  10917. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10918. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10919. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10920. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10921. #define HTT_MAX_AGGR 64
  10922. #define HTT_HL_MAX_AGGR 18
  10923. /**
  10924. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10925. *
  10926. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  10927. *
  10928. * @details
  10929. * The following field definitions describe the format of the HTT host
  10930. * to target frag_desc/msdu_ext bank configuration message.
  10931. * The message contains the based address and the min and max id of the
  10932. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10933. * MSDU_EXT/FRAG_DESC.
  10934. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10935. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10936. * the hardware does the mapping/translation.
  10937. *
  10938. * Total banks that can be configured is configured to 16.
  10939. *
  10940. * This should be called before any TX has be initiated by the HTT
  10941. *
  10942. * |31 16|15 8|7 5|4 0|
  10943. * |------------------------------------------------------------|
  10944. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10945. * |------------------------------------------------------------|
  10946. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10947. #if HTT_PADDR64
  10948. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10949. #endif
  10950. * |------------------------------------------------------------|
  10951. * | ... |
  10952. * |------------------------------------------------------------|
  10953. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10954. #if HTT_PADDR64
  10955. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10956. #endif
  10957. * |------------------------------------------------------------|
  10958. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10959. * |------------------------------------------------------------|
  10960. * | ... |
  10961. * |------------------------------------------------------------|
  10962. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10963. * |------------------------------------------------------------|
  10964. * Header fields:
  10965. * - MSG_TYPE
  10966. * Bits 7:0
  10967. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  10968. * for systems with 64-bit format for bus addresses:
  10969. * - BANKx_BASE_ADDRESS_LO
  10970. * Bits 31:0
  10971. * Purpose: Provide a mechanism to specify the base address of the
  10972. * MSDU_EXT bank physical/bus address.
  10973. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10974. * - BANKx_BASE_ADDRESS_HI
  10975. * Bits 31:0
  10976. * Purpose: Provide a mechanism to specify the base address of the
  10977. * MSDU_EXT bank physical/bus address.
  10978. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10979. * for systems with 32-bit format for bus addresses:
  10980. * - BANKx_BASE_ADDRESS
  10981. * Bits 31:0
  10982. * Purpose: Provide a mechanism to specify the base address of the
  10983. * MSDU_EXT bank physical/bus address.
  10984. * Value: MSDU_EXT bank physical / bus address
  10985. * - BANKx_MIN_ID
  10986. * Bits 15:0
  10987. * Purpose: Provide a mechanism to specify the min index that needs to
  10988. * mapped.
  10989. * - BANKx_MAX_ID
  10990. * Bits 31:16
  10991. * Purpose: Provide a mechanism to specify the max index that needs to
  10992. * mapped.
  10993. *
  10994. */
  10995. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10996. * safe value.
  10997. * @note MAX supported banks is 16.
  10998. */
  10999. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11000. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11001. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11002. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11003. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11004. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11005. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11006. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11007. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11008. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11009. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11010. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11011. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11012. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11013. do { \
  11014. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11015. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11016. } while (0)
  11017. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11018. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11019. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11020. do { \
  11021. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11022. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11023. } while (0)
  11024. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11025. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11026. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11027. do { \
  11028. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11029. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11030. } while (0)
  11031. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11032. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11033. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11034. do { \
  11035. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11036. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11037. } while (0)
  11038. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11039. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11040. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11041. do { \
  11042. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11043. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11044. } while (0)
  11045. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11046. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11047. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11048. do { \
  11049. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11050. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11051. } while (0)
  11052. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11053. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11054. /*
  11055. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11056. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11057. * addresses are stored in a XXX-bit field.
  11058. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11059. * htt_tx_frag_desc64_bank_cfg_t structs.
  11060. */
  11061. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11062. _paddr_bits_, \
  11063. _paddr__bank_base_address_) \
  11064. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11065. /** word 0 \
  11066. * msg_type: 8, \
  11067. * pdev_id: 2, \
  11068. * swap: 1, \
  11069. * reserved0: 5, \
  11070. * num_banks: 8, \
  11071. * desc_size: 8; \
  11072. */ \
  11073. A_UINT32 word0; \
  11074. /* \
  11075. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  11076. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  11077. * the second A_UINT32). \
  11078. */ \
  11079. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11080. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  11081. } POSTPACK
  11082. /* define htt_tx_frag_desc32_bank_cfg_t */
  11083. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  11084. /* define htt_tx_frag_desc64_bank_cfg_t */
  11085. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  11086. /*
  11087. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  11088. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  11089. */
  11090. #if HTT_PADDR64
  11091. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  11092. #else
  11093. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  11094. #endif
  11095. /**
  11096. * @brief target -> host HTT TX Credit total count update message definition
  11097. *
  11098. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  11099. *
  11100. *|31 16|15|14 9| 8 |7 0 |
  11101. *|---------------------+--+----------+-------+----------|
  11102. *|cur htt credit delta | Q| reserved | sign | msg type |
  11103. *|------------------------------------------------------|
  11104. *
  11105. * Header fields:
  11106. * - MSG_TYPE
  11107. * Bits 7:0
  11108. * Purpose: identifies this as a htt tx credit delta update message
  11109. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  11110. * - SIGN
  11111. * Bits 8
  11112. * identifies whether credit delta is positive or negative
  11113. * Value:
  11114. * - 0x0: credit delta is positive, rebalance in some buffers
  11115. * - 0x1: credit delta is negative, rebalance out some buffers
  11116. * - reserved
  11117. * Bits 14:9
  11118. * Value: 0x0
  11119. * - TXQ_GRP
  11120. * Bit 15
  11121. * Purpose: indicates whether any tx queue group information elements
  11122. * are appended to the tx credit update message
  11123. * Value: 0 -> no tx queue group information element is present
  11124. * 1 -> a tx queue group information element immediately follows
  11125. * - DELTA_COUNT
  11126. * Bits 31:16
  11127. * Purpose: Specify current htt credit delta absolute count
  11128. */
  11129. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  11130. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  11131. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  11132. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  11133. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  11134. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  11135. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  11136. do { \
  11137. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  11138. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  11139. } while (0)
  11140. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  11141. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  11142. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  11143. do { \
  11144. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  11145. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  11146. } while (0)
  11147. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  11148. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  11149. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  11150. do { \
  11151. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  11152. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  11153. } while (0)
  11154. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  11155. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  11156. #define HTT_TX_CREDIT_MSG_BYTES 4
  11157. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  11158. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  11159. /**
  11160. * @brief HTT WDI_IPA Operation Response Message
  11161. *
  11162. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  11163. *
  11164. * @details
  11165. * HTT WDI_IPA Operation Response message is sent by target
  11166. * to host confirming suspend or resume operation.
  11167. * |31 24|23 16|15 8|7 0|
  11168. * |----------------+----------------+----------------+----------------|
  11169. * | op_code | Rsvd | msg_type |
  11170. * |-------------------------------------------------------------------|
  11171. * | Rsvd | Response len |
  11172. * |-------------------------------------------------------------------|
  11173. * | |
  11174. * | Response-type specific info |
  11175. * | |
  11176. * | |
  11177. * |-------------------------------------------------------------------|
  11178. * Header fields:
  11179. * - MSG_TYPE
  11180. * Bits 7:0
  11181. * Purpose: Identifies this as WDI_IPA Operation Response message
  11182. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  11183. * - OP_CODE
  11184. * Bits 31:16
  11185. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  11186. * value: = enum htt_wdi_ipa_op_code
  11187. * - RSP_LEN
  11188. * Bits 16:0
  11189. * Purpose: length for the response-type specific info
  11190. * value: = length in bytes for response-type specific info
  11191. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  11192. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  11193. */
  11194. PREPACK struct htt_wdi_ipa_op_response_t
  11195. {
  11196. /* DWORD 0: flags and meta-data */
  11197. A_UINT32
  11198. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11199. reserved1: 8,
  11200. op_code: 16;
  11201. A_UINT32
  11202. rsp_len: 16,
  11203. reserved2: 16;
  11204. } POSTPACK;
  11205. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  11206. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  11207. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  11208. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  11209. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  11210. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  11211. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  11212. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  11215. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  11216. } while (0)
  11217. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  11218. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  11219. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  11220. do { \
  11221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  11222. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  11223. } while (0)
  11224. enum htt_phy_mode {
  11225. htt_phy_mode_11a = 0,
  11226. htt_phy_mode_11g = 1,
  11227. htt_phy_mode_11b = 2,
  11228. htt_phy_mode_11g_only = 3,
  11229. htt_phy_mode_11na_ht20 = 4,
  11230. htt_phy_mode_11ng_ht20 = 5,
  11231. htt_phy_mode_11na_ht40 = 6,
  11232. htt_phy_mode_11ng_ht40 = 7,
  11233. htt_phy_mode_11ac_vht20 = 8,
  11234. htt_phy_mode_11ac_vht40 = 9,
  11235. htt_phy_mode_11ac_vht80 = 10,
  11236. htt_phy_mode_11ac_vht20_2g = 11,
  11237. htt_phy_mode_11ac_vht40_2g = 12,
  11238. htt_phy_mode_11ac_vht80_2g = 13,
  11239. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  11240. htt_phy_mode_11ac_vht160 = 15,
  11241. htt_phy_mode_max,
  11242. };
  11243. /**
  11244. * @brief target -> host HTT channel change indication
  11245. *
  11246. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  11247. *
  11248. * @details
  11249. * Specify when a channel change occurs.
  11250. * This allows the host to precisely determine which rx frames arrived
  11251. * on the old channel and which rx frames arrived on the new channel.
  11252. *
  11253. *|31 |7 0 |
  11254. *|-------------------------------------------+----------|
  11255. *| reserved | msg type |
  11256. *|------------------------------------------------------|
  11257. *| primary_chan_center_freq_mhz |
  11258. *|------------------------------------------------------|
  11259. *| contiguous_chan1_center_freq_mhz |
  11260. *|------------------------------------------------------|
  11261. *| contiguous_chan2_center_freq_mhz |
  11262. *|------------------------------------------------------|
  11263. *| phy_mode |
  11264. *|------------------------------------------------------|
  11265. *
  11266. * Header fields:
  11267. * - MSG_TYPE
  11268. * Bits 7:0
  11269. * Purpose: identifies this as a htt channel change indication message
  11270. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  11271. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  11272. * Bits 31:0
  11273. * Purpose: identify the (center of the) new 20 MHz primary channel
  11274. * Value: center frequency of the 20 MHz primary channel, in MHz units
  11275. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  11276. * Bits 31:0
  11277. * Purpose: identify the (center of the) contiguous frequency range
  11278. * comprising the new channel.
  11279. * For example, if the new channel is a 80 MHz channel extending
  11280. * 60 MHz beyond the primary channel, this field would be 30 larger
  11281. * than the primary channel center frequency field.
  11282. * Value: center frequency of the contiguous frequency range comprising
  11283. * the full channel in MHz units
  11284. * (80+80 channels also use the CONTIG_CHAN2 field)
  11285. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  11286. * Bits 31:0
  11287. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  11288. * within a VHT 80+80 channel.
  11289. * This field is only relevant for VHT 80+80 channels.
  11290. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  11291. * channel (arbitrary value for cases besides VHT 80+80)
  11292. * - PHY_MODE
  11293. * Bits 31:0
  11294. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  11295. * and band
  11296. * Value: htt_phy_mode enum value
  11297. */
  11298. PREPACK struct htt_chan_change_t
  11299. {
  11300. /* DWORD 0: flags and meta-data */
  11301. A_UINT32
  11302. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11303. reserved1: 24;
  11304. A_UINT32 primary_chan_center_freq_mhz;
  11305. A_UINT32 contig_chan1_center_freq_mhz;
  11306. A_UINT32 contig_chan2_center_freq_mhz;
  11307. A_UINT32 phy_mode;
  11308. } POSTPACK;
  11309. /*
  11310. * Due to historical / backwards-compatibility reasons, maintain the
  11311. * below htt_chan_change_msg struct definition, which needs to be
  11312. * consistent with the above htt_chan_change_t struct definition
  11313. * (aside from the htt_chan_change_t definition including the msg_type
  11314. * dword within the message, and the htt_chan_change_msg only containing
  11315. * the payload of the message that follows the msg_type dword).
  11316. */
  11317. PREPACK struct htt_chan_change_msg {
  11318. A_UINT32 chan_mhz; /* frequency in mhz */
  11319. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  11320. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11321. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11322. } POSTPACK;
  11323. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  11324. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  11325. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  11326. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  11327. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  11328. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  11329. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  11330. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  11331. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  11332. do { \
  11333. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  11334. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  11335. } while (0)
  11336. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  11337. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  11338. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  11339. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  11340. do { \
  11341. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  11342. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  11343. } while (0)
  11344. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  11345. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  11346. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  11347. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  11348. do { \
  11349. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  11350. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  11351. } while (0)
  11352. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  11353. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  11354. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  11355. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  11356. do { \
  11357. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  11358. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  11359. } while (0)
  11360. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  11361. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  11362. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  11363. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  11364. /**
  11365. * @brief rx offload packet error message
  11366. *
  11367. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  11368. *
  11369. * @details
  11370. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  11371. * of target payload like mic err.
  11372. *
  11373. * |31 24|23 16|15 8|7 0|
  11374. * |----------------+----------------+----------------+----------------|
  11375. * | tid | vdev_id | msg_sub_type | msg_type |
  11376. * |-------------------------------------------------------------------|
  11377. * : (sub-type dependent content) :
  11378. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11379. * Header fields:
  11380. * - msg_type
  11381. * Bits 7:0
  11382. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  11383. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  11384. * - msg_sub_type
  11385. * Bits 15:8
  11386. * Purpose: Identifies which type of rx error is reported by this message
  11387. * value: htt_rx_ofld_pkt_err_type
  11388. * - vdev_id
  11389. * Bits 23:16
  11390. * Purpose: Identifies which vdev received the erroneous rx frame
  11391. * value:
  11392. * - tid
  11393. * Bits 31:24
  11394. * Purpose: Identifies the traffic type of the rx frame
  11395. * value:
  11396. *
  11397. * - The payload fields used if the sub-type == MIC error are shown below.
  11398. * Note - MIC err is per MSDU, while PN is per MPDU.
  11399. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  11400. * with MIC err in A-MSDU case, so FW will send only one HTT message
  11401. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  11402. * instead of sending separate HTT messages for each wrong MSDU within
  11403. * the MPDU.
  11404. *
  11405. * |31 24|23 16|15 8|7 0|
  11406. * |----------------+----------------+----------------+----------------|
  11407. * | Rsvd | key_id | peer_id |
  11408. * |-------------------------------------------------------------------|
  11409. * | receiver MAC addr 31:0 |
  11410. * |-------------------------------------------------------------------|
  11411. * | Rsvd | receiver MAC addr 47:32 |
  11412. * |-------------------------------------------------------------------|
  11413. * | transmitter MAC addr 31:0 |
  11414. * |-------------------------------------------------------------------|
  11415. * | Rsvd | transmitter MAC addr 47:32 |
  11416. * |-------------------------------------------------------------------|
  11417. * | PN 31:0 |
  11418. * |-------------------------------------------------------------------|
  11419. * | Rsvd | PN 47:32 |
  11420. * |-------------------------------------------------------------------|
  11421. * - peer_id
  11422. * Bits 15:0
  11423. * Purpose: identifies which peer is frame is from
  11424. * value:
  11425. * - key_id
  11426. * Bits 23:16
  11427. * Purpose: identifies key_id of rx frame
  11428. * value:
  11429. * - RA_31_0 (receiver MAC addr 31:0)
  11430. * Bits 31:0
  11431. * Purpose: identifies by MAC address which vdev received the frame
  11432. * value: MAC address lower 4 bytes
  11433. * - RA_47_32 (receiver MAC addr 47:32)
  11434. * Bits 15:0
  11435. * Purpose: identifies by MAC address which vdev received the frame
  11436. * value: MAC address upper 2 bytes
  11437. * - TA_31_0 (transmitter MAC addr 31:0)
  11438. * Bits 31:0
  11439. * Purpose: identifies by MAC address which peer transmitted the frame
  11440. * value: MAC address lower 4 bytes
  11441. * - TA_47_32 (transmitter MAC addr 47:32)
  11442. * Bits 15:0
  11443. * Purpose: identifies by MAC address which peer transmitted the frame
  11444. * value: MAC address upper 2 bytes
  11445. * - PN_31_0
  11446. * Bits 31:0
  11447. * Purpose: Identifies pn of rx frame
  11448. * value: PN lower 4 bytes
  11449. * - PN_47_32
  11450. * Bits 15:0
  11451. * Purpose: Identifies pn of rx frame
  11452. * value:
  11453. * TKIP or CCMP: PN upper 2 bytes
  11454. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  11455. */
  11456. enum htt_rx_ofld_pkt_err_type {
  11457. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  11458. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  11459. };
  11460. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  11461. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  11462. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  11463. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  11464. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  11465. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  11466. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  11467. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  11468. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  11469. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  11470. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  11471. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  11472. do { \
  11473. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  11474. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  11475. } while (0)
  11476. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  11477. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  11478. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  11479. do { \
  11480. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  11481. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  11482. } while (0)
  11483. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  11484. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  11485. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  11486. do { \
  11487. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  11488. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  11489. } while (0)
  11490. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  11491. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  11492. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  11493. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  11494. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  11495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  11496. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  11497. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  11498. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  11499. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  11500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  11501. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  11502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  11503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  11504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  11505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  11506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  11507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  11508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  11509. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  11510. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  11511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  11512. do { \
  11513. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  11514. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  11515. } while (0)
  11516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  11517. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  11518. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  11519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  11520. do { \
  11521. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  11522. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  11523. } while (0)
  11524. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  11525. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  11526. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  11527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  11528. do { \
  11529. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  11530. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  11531. } while (0)
  11532. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  11533. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  11534. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  11535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  11536. do { \
  11537. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  11538. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  11539. } while (0)
  11540. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  11541. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  11542. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  11543. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  11544. do { \
  11545. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  11546. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  11547. } while (0)
  11548. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  11549. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  11550. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  11551. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  11552. do { \
  11553. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  11554. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  11555. } while (0)
  11556. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  11557. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  11558. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  11559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  11560. do { \
  11561. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  11562. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  11563. } while (0)
  11564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  11565. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  11566. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  11567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  11568. do { \
  11569. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  11570. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  11571. } while (0)
  11572. /**
  11573. * @brief target -> host peer rate report message
  11574. *
  11575. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  11576. *
  11577. * @details
  11578. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  11579. * justified rate of all the peers.
  11580. *
  11581. * |31 24|23 16|15 8|7 0|
  11582. * |----------------+----------------+----------------+----------------|
  11583. * | peer_count | | msg_type |
  11584. * |-------------------------------------------------------------------|
  11585. * : Payload (variant number of peer rate report) :
  11586. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11587. * Header fields:
  11588. * - msg_type
  11589. * Bits 7:0
  11590. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  11591. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  11592. * - reserved
  11593. * Bits 15:8
  11594. * Purpose:
  11595. * value:
  11596. * - peer_count
  11597. * Bits 31:16
  11598. * Purpose: Specify how many peer rate report elements are present in the payload.
  11599. * value:
  11600. *
  11601. * Payload:
  11602. * There are variant number of peer rate report follow the first 32 bits.
  11603. * The peer rate report is defined as follows.
  11604. *
  11605. * |31 20|19 16|15 0|
  11606. * |-----------------------+---------+---------------------------------|-
  11607. * | reserved | phy | peer_id | \
  11608. * |-------------------------------------------------------------------| -> report #0
  11609. * | rate | /
  11610. * |-----------------------+---------+---------------------------------|-
  11611. * | reserved | phy | peer_id | \
  11612. * |-------------------------------------------------------------------| -> report #1
  11613. * | rate | /
  11614. * |-----------------------+---------+---------------------------------|-
  11615. * | reserved | phy | peer_id | \
  11616. * |-------------------------------------------------------------------| -> report #2
  11617. * | rate | /
  11618. * |-------------------------------------------------------------------|-
  11619. * : :
  11620. * : :
  11621. * : :
  11622. * :-------------------------------------------------------------------:
  11623. *
  11624. * - peer_id
  11625. * Bits 15:0
  11626. * Purpose: identify the peer
  11627. * value:
  11628. * - phy
  11629. * Bits 19:16
  11630. * Purpose: identify which phy is in use
  11631. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  11632. * Please see enum htt_peer_report_phy_type for detail.
  11633. * - reserved
  11634. * Bits 31:20
  11635. * Purpose:
  11636. * value:
  11637. * - rate
  11638. * Bits 31:0
  11639. * Purpose: represent the justified rate of the peer specified by peer_id
  11640. * value:
  11641. */
  11642. enum htt_peer_rate_report_phy_type {
  11643. HTT_PEER_RATE_REPORT_11B = 0,
  11644. HTT_PEER_RATE_REPORT_11A_G,
  11645. HTT_PEER_RATE_REPORT_11N,
  11646. HTT_PEER_RATE_REPORT_11AC,
  11647. };
  11648. #define HTT_PEER_RATE_REPORT_SIZE 8
  11649. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  11650. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  11651. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  11652. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  11653. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  11654. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11655. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11656. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11657. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11658. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11659. do { \
  11660. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11661. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11662. } while (0)
  11663. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11664. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11665. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11666. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11667. do { \
  11668. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11669. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11670. } while (0)
  11671. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11672. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11673. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11674. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11675. do { \
  11676. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11677. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11678. } while (0)
  11679. /**
  11680. * @brief target -> host flow pool map message
  11681. *
  11682. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11683. *
  11684. * @details
  11685. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11686. * a flow of descriptors.
  11687. *
  11688. * This message is in TLV format and indicates the parameters to be setup a
  11689. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11690. * receive descriptors from a specified pool.
  11691. *
  11692. * The message would appear as follows:
  11693. *
  11694. * |31 24|23 16|15 8|7 0|
  11695. * |----------------+----------------+----------------+----------------|
  11696. * header | reserved | num_flows | msg_type |
  11697. * |-------------------------------------------------------------------|
  11698. * | |
  11699. * : payload :
  11700. * | |
  11701. * |-------------------------------------------------------------------|
  11702. *
  11703. * The header field is one DWORD long and is interpreted as follows:
  11704. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11705. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11706. * this message
  11707. * b'16-31 - reserved: These bits are reserved for future use
  11708. *
  11709. * Payload:
  11710. * The payload would contain multiple objects of the following structure. Each
  11711. * object represents a flow.
  11712. *
  11713. * |31 24|23 16|15 8|7 0|
  11714. * |----------------+----------------+----------------+----------------|
  11715. * header | reserved | num_flows | msg_type |
  11716. * |-------------------------------------------------------------------|
  11717. * payload0| flow_type |
  11718. * |-------------------------------------------------------------------|
  11719. * | flow_id |
  11720. * |-------------------------------------------------------------------|
  11721. * | reserved0 | flow_pool_id |
  11722. * |-------------------------------------------------------------------|
  11723. * | reserved1 | flow_pool_size |
  11724. * |-------------------------------------------------------------------|
  11725. * | reserved2 |
  11726. * |-------------------------------------------------------------------|
  11727. * payload1| flow_type |
  11728. * |-------------------------------------------------------------------|
  11729. * | flow_id |
  11730. * |-------------------------------------------------------------------|
  11731. * | reserved0 | flow_pool_id |
  11732. * |-------------------------------------------------------------------|
  11733. * | reserved1 | flow_pool_size |
  11734. * |-------------------------------------------------------------------|
  11735. * | reserved2 |
  11736. * |-------------------------------------------------------------------|
  11737. * | . |
  11738. * | . |
  11739. * | . |
  11740. * |-------------------------------------------------------------------|
  11741. *
  11742. * Each payload is 5 DWORDS long and is interpreted as follows:
  11743. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  11744. * this flow is associated. It can be VDEV, peer,
  11745. * or tid (AC). Based on enum htt_flow_type.
  11746. *
  11747. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11748. * object. For flow_type vdev it is set to the
  11749. * vdevid, for peer it is peerid and for tid, it is
  11750. * tid_num.
  11751. *
  11752. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  11753. * in the host for this flow
  11754. * b'16:31 - reserved0: This field in reserved for the future. In case
  11755. * we have a hierarchical implementation (HCM) of
  11756. * pools, it can be used to indicate the ID of the
  11757. * parent-pool.
  11758. *
  11759. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  11760. * Descriptors for this flow will be
  11761. * allocated from this pool in the host.
  11762. * b'16:31 - reserved1: This field in reserved for the future. In case
  11763. * we have a hierarchical implementation of pools,
  11764. * it can be used to indicate the max number of
  11765. * descriptors in the pool. The b'0:15 can be used
  11766. * to indicate min number of descriptors in the
  11767. * HCM scheme.
  11768. *
  11769. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  11770. * we have a hierarchical implementation of pools,
  11771. * b'0:15 can be used to indicate the
  11772. * priority-based borrowing (PBB) threshold of
  11773. * the flow's pool. The b'16:31 are still left
  11774. * reserved.
  11775. */
  11776. enum htt_flow_type {
  11777. FLOW_TYPE_VDEV = 0,
  11778. /* Insert new flow types above this line */
  11779. };
  11780. PREPACK struct htt_flow_pool_map_payload_t {
  11781. A_UINT32 flow_type;
  11782. A_UINT32 flow_id;
  11783. A_UINT32 flow_pool_id:16,
  11784. reserved0:16;
  11785. A_UINT32 flow_pool_size:16,
  11786. reserved1:16;
  11787. A_UINT32 reserved2;
  11788. } POSTPACK;
  11789. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11790. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11791. (sizeof(struct htt_flow_pool_map_payload_t))
  11792. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11793. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11794. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11795. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11796. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11797. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11798. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11799. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11800. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11801. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11802. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11803. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11804. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11805. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11806. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11807. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11808. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11809. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11810. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11811. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11812. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11813. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11814. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11815. do { \
  11816. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11817. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11818. } while (0)
  11819. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11820. do { \
  11821. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11822. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11823. } while (0)
  11824. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11827. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11828. } while (0)
  11829. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11830. do { \
  11831. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11832. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11833. } while (0)
  11834. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11837. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11838. } while (0)
  11839. /**
  11840. * @brief target -> host flow pool unmap message
  11841. *
  11842. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11843. *
  11844. * @details
  11845. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11846. * down a flow of descriptors.
  11847. * This message indicates that for the flow (whose ID is provided) is wanting
  11848. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11849. * pool of descriptors from where descriptors are being allocated for this
  11850. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11851. * be unmapped by the host.
  11852. *
  11853. * The message would appear as follows:
  11854. *
  11855. * |31 24|23 16|15 8|7 0|
  11856. * |----------------+----------------+----------------+----------------|
  11857. * | reserved0 | msg_type |
  11858. * |-------------------------------------------------------------------|
  11859. * | flow_type |
  11860. * |-------------------------------------------------------------------|
  11861. * | flow_id |
  11862. * |-------------------------------------------------------------------|
  11863. * | reserved1 | flow_pool_id |
  11864. * |-------------------------------------------------------------------|
  11865. *
  11866. * The message is interpreted as follows:
  11867. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  11868. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  11869. * b'8:31 - reserved0: Reserved for future use
  11870. *
  11871. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11872. * this flow is associated. It can be VDEV, peer,
  11873. * or tid (AC). Based on enum htt_flow_type.
  11874. *
  11875. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11876. * object. For flow_type vdev it is set to the
  11877. * vdevid, for peer it is peerid and for tid, it is
  11878. * tid_num.
  11879. *
  11880. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11881. * used in the host for this flow
  11882. * b'16:31 - reserved0: This field in reserved for the future.
  11883. *
  11884. */
  11885. PREPACK struct htt_flow_pool_unmap_t {
  11886. A_UINT32 msg_type:8,
  11887. reserved0:24;
  11888. A_UINT32 flow_type;
  11889. A_UINT32 flow_id;
  11890. A_UINT32 flow_pool_id:16,
  11891. reserved1:16;
  11892. } POSTPACK;
  11893. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11894. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11895. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11896. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11897. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11898. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11899. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11900. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11901. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11902. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11903. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11904. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11905. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11906. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11907. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11908. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11909. do { \
  11910. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11911. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11912. } while (0)
  11913. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11914. do { \
  11915. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11916. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11917. } while (0)
  11918. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11919. do { \
  11920. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11921. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11922. } while (0)
  11923. /**
  11924. * @brief target -> host SRING setup done message
  11925. *
  11926. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11927. *
  11928. * @details
  11929. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11930. * SRNG ring setup is done
  11931. *
  11932. * This message indicates whether the last setup operation is successful.
  11933. * It will be sent to host when host set respose_required bit in
  11934. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11935. * The message would appear as follows:
  11936. *
  11937. * |31 24|23 16|15 8|7 0|
  11938. * |--------------- +----------------+----------------+----------------|
  11939. * | setup_status | ring_id | pdev_id | msg_type |
  11940. * |-------------------------------------------------------------------|
  11941. *
  11942. * The message is interpreted as follows:
  11943. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  11944. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  11945. * b'8:15 - pdev_id:
  11946. * 0 (for rings at SOC/UMAC level),
  11947. * 1/2/3 mac id (for rings at LMAC level)
  11948. * b'16:23 - ring_id: Identify the ring which is set up
  11949. * More details can be got from enum htt_srng_ring_id
  11950. * b'24:31 - setup_status: Indicate status of setup operation
  11951. * Refer to htt_ring_setup_status
  11952. */
  11953. PREPACK struct htt_sring_setup_done_t {
  11954. A_UINT32 msg_type: 8,
  11955. pdev_id: 8,
  11956. ring_id: 8,
  11957. setup_status: 8;
  11958. } POSTPACK;
  11959. enum htt_ring_setup_status {
  11960. htt_ring_setup_status_ok = 0,
  11961. htt_ring_setup_status_error,
  11962. };
  11963. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11964. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11965. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11966. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11967. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11968. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11969. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11970. do { \
  11971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11972. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11973. } while (0)
  11974. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11975. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11976. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11977. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11978. HTT_SRING_SETUP_DONE_RING_ID_S)
  11979. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11982. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11983. } while (0)
  11984. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11985. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11986. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11987. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11988. HTT_SRING_SETUP_DONE_STATUS_S)
  11989. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11990. do { \
  11991. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11992. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11993. } while (0)
  11994. /**
  11995. * @brief target -> flow map flow info
  11996. *
  11997. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11998. *
  11999. * @details
  12000. * HTT TX map flow entry with tqm flow pointer
  12001. * Sent from firmware to host to add tqm flow pointer in corresponding
  12002. * flow search entry. Flow metadata is replayed back to host as part of this
  12003. * struct to enable host to find the specific flow search entry
  12004. *
  12005. * The message would appear as follows:
  12006. *
  12007. * |31 28|27 18|17 14|13 8|7 0|
  12008. * |-------+------------------------------------------+----------------|
  12009. * | rsvd0 | fse_hsh_idx | msg_type |
  12010. * |-------------------------------------------------------------------|
  12011. * | rsvd1 | tid | peer_id |
  12012. * |-------------------------------------------------------------------|
  12013. * | tqm_flow_pntr_lo |
  12014. * |-------------------------------------------------------------------|
  12015. * | tqm_flow_pntr_hi |
  12016. * |-------------------------------------------------------------------|
  12017. * | fse_meta_data |
  12018. * |-------------------------------------------------------------------|
  12019. *
  12020. * The message is interpreted as follows:
  12021. *
  12022. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12023. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12024. *
  12025. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12026. * for this flow entry
  12027. *
  12028. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12029. *
  12030. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12031. *
  12032. * dword1 - b'14:17 - tid
  12033. *
  12034. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12035. *
  12036. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12037. *
  12038. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12039. *
  12040. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12041. * given by host
  12042. */
  12043. PREPACK struct htt_tx_map_flow_info {
  12044. A_UINT32
  12045. msg_type: 8,
  12046. fse_hsh_idx: 20,
  12047. rsvd0: 4;
  12048. A_UINT32
  12049. peer_id: 14,
  12050. tid: 4,
  12051. rsvd1: 14;
  12052. A_UINT32 tqm_flow_pntr_lo;
  12053. A_UINT32 tqm_flow_pntr_hi;
  12054. struct htt_tx_flow_metadata fse_meta_data;
  12055. } POSTPACK;
  12056. /* DWORD 0 */
  12057. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12058. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12059. /* DWORD 1 */
  12060. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12061. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12062. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12063. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12064. /* DWORD 0 */
  12065. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12066. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12067. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12068. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12069. do { \
  12070. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  12071. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  12072. } while (0)
  12073. /* DWORD 1 */
  12074. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  12075. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  12076. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  12077. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  12078. do { \
  12079. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  12080. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  12081. } while (0)
  12082. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  12083. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  12084. HTT_TX_MAP_FLOW_INFO_TID_S)
  12085. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  12088. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  12089. } while (0)
  12090. /*
  12091. * htt_dbg_ext_stats_status -
  12092. * present - The requested stats have been delivered in full.
  12093. * This indicates that either the stats information was contained
  12094. * in its entirety within this message, or else this message
  12095. * completes the delivery of the requested stats info that was
  12096. * partially delivered through earlier STATS_CONF messages.
  12097. * partial - The requested stats have been delivered in part.
  12098. * One or more subsequent STATS_CONF messages with the same
  12099. * cookie value will be sent to deliver the remainder of the
  12100. * information.
  12101. * error - The requested stats could not be delivered, for example due
  12102. * to a shortage of memory to construct a message holding the
  12103. * requested stats.
  12104. * invalid - The requested stat type is either not recognized, or the
  12105. * target is configured to not gather the stats type in question.
  12106. */
  12107. enum htt_dbg_ext_stats_status {
  12108. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  12109. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  12110. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  12111. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  12112. };
  12113. /**
  12114. * @brief target -> host ppdu stats upload
  12115. *
  12116. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  12117. *
  12118. * @details
  12119. * The following field definitions describe the format of the HTT target
  12120. * to host ppdu stats indication message.
  12121. *
  12122. *
  12123. * |31 16|15 12|11 10|9 8|7 0 |
  12124. * |----------------------------------------------------------------------|
  12125. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  12126. * |----------------------------------------------------------------------|
  12127. * | ppdu_id |
  12128. * |----------------------------------------------------------------------|
  12129. * | Timestamp in us |
  12130. * |----------------------------------------------------------------------|
  12131. * | reserved |
  12132. * |----------------------------------------------------------------------|
  12133. * | type-specific stats info |
  12134. * | (see htt_ppdu_stats.h) |
  12135. * |----------------------------------------------------------------------|
  12136. * Header fields:
  12137. * - MSG_TYPE
  12138. * Bits 7:0
  12139. * Purpose: Identifies this is a PPDU STATS indication
  12140. * message.
  12141. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  12142. * - mac_id
  12143. * Bits 9:8
  12144. * Purpose: mac_id of this ppdu_id
  12145. * Value: 0-3
  12146. * - pdev_id
  12147. * Bits 11:10
  12148. * Purpose: pdev_id of this ppdu_id
  12149. * Value: 0-3
  12150. * 0 (for rings at SOC level),
  12151. * 1/2/3 PDEV -> 0/1/2
  12152. * - payload_size
  12153. * Bits 31:16
  12154. * Purpose: total tlv size
  12155. * Value: payload_size in bytes
  12156. */
  12157. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  12158. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  12159. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  12160. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  12161. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  12162. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  12163. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  12164. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  12165. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  12166. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  12167. do { \
  12168. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  12169. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  12170. } while (0)
  12171. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  12172. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  12173. HTT_T2H_PPDU_STATS_MAC_ID_S)
  12174. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  12175. do { \
  12176. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  12177. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  12178. } while (0)
  12179. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  12180. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  12181. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  12182. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  12183. do { \
  12184. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  12185. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  12186. } while (0)
  12187. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  12188. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  12189. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  12190. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  12191. do { \
  12192. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  12193. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  12194. } while (0)
  12195. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  12196. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  12197. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  12198. /* htt_t2h_ppdu_stats_ind_hdr_t
  12199. * This struct contains the fields within the header of the
  12200. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  12201. * stats info.
  12202. * This struct assumes little-endian layout, and thus is only
  12203. * suitable for use within processors known to be little-endian
  12204. * (such as the target).
  12205. * In contrast, the above macros provide endian-portable methods
  12206. * to get and set the bitfields within this PPDU_STATS_IND header.
  12207. */
  12208. typedef struct {
  12209. A_UINT32 msg_type: 8, /* bits 7:0 */
  12210. mac_id: 2, /* bits 9:8 */
  12211. pdev_id: 2, /* bits 11:10 */
  12212. reserved1: 4, /* bits 15:12 */
  12213. payload_size: 16; /* bits 31:16 */
  12214. A_UINT32 ppdu_id;
  12215. A_UINT32 timestamp_us;
  12216. A_UINT32 reserved2;
  12217. } htt_t2h_ppdu_stats_ind_hdr_t;
  12218. /**
  12219. * @brief target -> host extended statistics upload
  12220. *
  12221. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  12222. *
  12223. * @details
  12224. * The following field definitions describe the format of the HTT target
  12225. * to host stats upload confirmation message.
  12226. * The message contains a cookie echoed from the HTT host->target stats
  12227. * upload request, which identifies which request the confirmation is
  12228. * for, and a single stats can span over multiple HTT stats indication
  12229. * due to the HTT message size limitation so every HTT ext stats indication
  12230. * will have tag-length-value stats information elements.
  12231. * The tag-length header for each HTT stats IND message also includes a
  12232. * status field, to indicate whether the request for the stat type in
  12233. * question was fully met, partially met, unable to be met, or invalid
  12234. * (if the stat type in question is disabled in the target).
  12235. * A Done bit 1's indicate the end of the of stats info elements.
  12236. *
  12237. *
  12238. * |31 16|15 12|11|10 8|7 5|4 0|
  12239. * |--------------------------------------------------------------|
  12240. * | reserved | msg type |
  12241. * |--------------------------------------------------------------|
  12242. * | cookie LSBs |
  12243. * |--------------------------------------------------------------|
  12244. * | cookie MSBs |
  12245. * |--------------------------------------------------------------|
  12246. * | stats entry length | rsvd | D| S | stat type |
  12247. * |--------------------------------------------------------------|
  12248. * | type-specific stats info |
  12249. * | (see htt_stats.h) |
  12250. * |--------------------------------------------------------------|
  12251. * Header fields:
  12252. * - MSG_TYPE
  12253. * Bits 7:0
  12254. * Purpose: Identifies this is a extended statistics upload confirmation
  12255. * message.
  12256. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  12257. * - COOKIE_LSBS
  12258. * Bits 31:0
  12259. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12260. * message with its preceding host->target stats request message.
  12261. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12262. * - COOKIE_MSBS
  12263. * Bits 31:0
  12264. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12265. * message with its preceding host->target stats request message.
  12266. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12267. *
  12268. * Stats Information Element tag-length header fields:
  12269. * - STAT_TYPE
  12270. * Bits 7:0
  12271. * Purpose: identifies the type of statistics info held in the
  12272. * following information element
  12273. * Value: htt_dbg_ext_stats_type
  12274. * - STATUS
  12275. * Bits 10:8
  12276. * Purpose: indicate whether the requested stats are present
  12277. * Value: htt_dbg_ext_stats_status
  12278. * - DONE
  12279. * Bits 11
  12280. * Purpose:
  12281. * Indicates the completion of the stats entry, this will be the last
  12282. * stats conf HTT segment for the requested stats type.
  12283. * Value:
  12284. * 0 -> the stats retrieval is ongoing
  12285. * 1 -> the stats retrieval is complete
  12286. * - LENGTH
  12287. * Bits 31:16
  12288. * Purpose: indicate the stats information size
  12289. * Value: This field specifies the number of bytes of stats information
  12290. * that follows the element tag-length header.
  12291. * It is expected but not required that this length is a multiple of
  12292. * 4 bytes.
  12293. */
  12294. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  12295. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  12296. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  12297. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  12298. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  12299. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  12300. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  12301. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  12302. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  12303. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12304. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  12305. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  12306. do { \
  12307. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  12308. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  12309. } while (0)
  12310. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  12311. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  12312. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  12313. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  12314. do { \
  12315. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  12316. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  12317. } while (0)
  12318. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  12319. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  12320. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  12321. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  12322. do { \
  12323. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  12324. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  12325. } while (0)
  12326. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  12327. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  12328. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  12329. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12330. do { \
  12331. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  12332. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  12333. } while (0)
  12334. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  12335. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  12336. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  12337. typedef enum {
  12338. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  12339. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  12340. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  12341. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  12342. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  12343. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  12344. /* Reserved from 128 - 255 for target internal use.*/
  12345. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  12346. } HTT_PEER_TYPE;
  12347. /** macro to convert MAC address from char array to HTT word format */
  12348. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  12349. (phtt_mac_addr)->mac_addr31to0 = \
  12350. (((c_macaddr)[0] << 0) | \
  12351. ((c_macaddr)[1] << 8) | \
  12352. ((c_macaddr)[2] << 16) | \
  12353. ((c_macaddr)[3] << 24)); \
  12354. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  12355. } while (0)
  12356. /**
  12357. * @brief target -> host monitor mac header indication message
  12358. *
  12359. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  12360. *
  12361. * @details
  12362. * The following diagram shows the format of the monitor mac header message
  12363. * sent from the target to the host.
  12364. * This message is primarily sent when promiscuous rx mode is enabled.
  12365. * One message is sent per rx PPDU.
  12366. *
  12367. * |31 24|23 16|15 8|7 0|
  12368. * |-------------------------------------------------------------|
  12369. * | peer_id | reserved0 | msg_type |
  12370. * |-------------------------------------------------------------|
  12371. * | reserved1 | num_mpdu |
  12372. * |-------------------------------------------------------------|
  12373. * | struct hw_rx_desc |
  12374. * | (see wal_rx_desc.h) |
  12375. * |-------------------------------------------------------------|
  12376. * | struct ieee80211_frame_addr4 |
  12377. * | (see ieee80211_defs.h) |
  12378. * |-------------------------------------------------------------|
  12379. * | struct ieee80211_frame_addr4 |
  12380. * | (see ieee80211_defs.h) |
  12381. * |-------------------------------------------------------------|
  12382. * | ...... |
  12383. * |-------------------------------------------------------------|
  12384. *
  12385. * Header fields:
  12386. * - msg_type
  12387. * Bits 7:0
  12388. * Purpose: Identifies this is a monitor mac header indication message.
  12389. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  12390. * - peer_id
  12391. * Bits 31:16
  12392. * Purpose: Software peer id given by host during association,
  12393. * During promiscuous mode, the peer ID will be invalid (0xFF)
  12394. * for rx PPDUs received from unassociated peers.
  12395. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  12396. * - num_mpdu
  12397. * Bits 15:0
  12398. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  12399. * delivered within the message.
  12400. * Value: 1 to 32
  12401. * num_mpdu is limited to a maximum value of 32, due to buffer
  12402. * size limits. For PPDUs with more than 32 MPDUs, only the
  12403. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  12404. * the PPDU will be provided.
  12405. */
  12406. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  12407. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  12408. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  12409. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  12410. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  12411. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  12412. do { \
  12413. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  12414. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  12415. } while (0)
  12416. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  12417. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  12418. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  12419. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  12420. do { \
  12421. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  12422. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  12423. } while (0)
  12424. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  12425. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  12426. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  12427. /**
  12428. * @brief target -> host flow pool resize Message
  12429. *
  12430. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  12431. *
  12432. * @details
  12433. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  12434. * the flow pool associated with the specified ID is resized
  12435. *
  12436. * The message would appear as follows:
  12437. *
  12438. * |31 16|15 8|7 0|
  12439. * |---------------------------------+----------------+----------------|
  12440. * | reserved0 | Msg type |
  12441. * |-------------------------------------------------------------------|
  12442. * | flow pool new size | flow pool ID |
  12443. * |-------------------------------------------------------------------|
  12444. *
  12445. * The message is interpreted as follows:
  12446. * b'0:7 - msg_type: This will be set to 0x21
  12447. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  12448. *
  12449. * b'0:15 - flow pool ID: Existing flow pool ID
  12450. *
  12451. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  12452. *
  12453. */
  12454. PREPACK struct htt_flow_pool_resize_t {
  12455. A_UINT32 msg_type:8,
  12456. reserved0:24;
  12457. A_UINT32 flow_pool_id:16,
  12458. flow_pool_new_size:16;
  12459. } POSTPACK;
  12460. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  12461. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  12462. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  12463. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  12464. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  12465. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  12466. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  12467. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  12468. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  12469. do { \
  12470. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  12471. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  12472. } while (0)
  12473. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  12474. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  12475. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  12476. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  12477. do { \
  12478. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  12479. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  12480. } while (0)
  12481. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  12482. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  12483. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  12484. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  12485. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  12486. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  12487. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  12488. /*
  12489. * The read and write indices point to the data within the host buffer.
  12490. * Because the first 4 bytes of the host buffer is used for the read index and
  12491. * the next 4 bytes for the write index, the data itself starts at offset 8.
  12492. * The read index and write index are the byte offsets from the base of the
  12493. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  12494. * Refer the ASCII text picture below.
  12495. */
  12496. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  12497. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  12498. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  12499. /*
  12500. ***************************************************************************
  12501. *
  12502. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12503. *
  12504. ***************************************************************************
  12505. *
  12506. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  12507. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  12508. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  12509. * written into the Host memory region mentioned below.
  12510. *
  12511. * Read index is updated by the Host. At any point of time, the read index will
  12512. * indicate the index that will next be read by the Host. The read index is
  12513. * in units of bytes offset from the base of the meta-data buffer.
  12514. *
  12515. * Write index is updated by the FW. At any point of time, the write index will
  12516. * indicate from where the FW can start writing any new data. The write index is
  12517. * in units of bytes offset from the base of the meta-data buffer.
  12518. *
  12519. * If the Host is not fast enough in reading the CFR data, any new capture data
  12520. * would be dropped if there is no space left to write the new captures.
  12521. *
  12522. * The last 4 bytes of the memory region will have the magic pattern
  12523. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  12524. * not overrun the host buffer.
  12525. *
  12526. * ,--------------------. read and write indices store the
  12527. * | | byte offset from the base of the
  12528. * | ,--------+--------. meta-data buffer to the next
  12529. * | | | | location within the data buffer
  12530. * | | v v that will be read / written
  12531. * ************************************************************************
  12532. * * Read * Write * * Magic *
  12533. * * index * index * CFR data1 ...... CFR data N * pattern *
  12534. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  12535. * ************************************************************************
  12536. * |<---------- data buffer ---------->|
  12537. *
  12538. * |<----------------- meta-data buffer allocated in Host ----------------|
  12539. *
  12540. * Note:
  12541. * - Considering the 4 bytes needed to store the Read index (R) and the
  12542. * Write index (W), the initial value is as follows:
  12543. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  12544. * - Buffer empty condition:
  12545. * R = W
  12546. *
  12547. * Regarding CFR data format:
  12548. * --------------------------
  12549. *
  12550. * Each CFR tone is stored in HW as 16-bits with the following format:
  12551. * {bits[15:12], bits[11:6], bits[5:0]} =
  12552. * {unsigned exponent (4 bits),
  12553. * signed mantissa_real (6 bits),
  12554. * signed mantissa_imag (6 bits)}
  12555. *
  12556. * CFR_real = mantissa_real * 2^(exponent-5)
  12557. * CFR_imag = mantissa_imag * 2^(exponent-5)
  12558. *
  12559. *
  12560. * The CFR data is written to the 16-bit unsigned output array (buff) in
  12561. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  12562. *
  12563. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  12564. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  12565. * .
  12566. * .
  12567. * .
  12568. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  12569. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  12570. */
  12571. /* Bandwidth of peer CFR captures */
  12572. typedef enum {
  12573. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  12574. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  12575. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  12576. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  12577. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  12578. HTT_PEER_CFR_CAPTURE_BW_MAX,
  12579. } HTT_PEER_CFR_CAPTURE_BW;
  12580. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  12581. * was captured
  12582. */
  12583. typedef enum {
  12584. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  12585. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  12586. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  12587. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  12588. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  12589. } HTT_PEER_CFR_CAPTURE_MODE;
  12590. typedef enum {
  12591. /* This message type is currently used for the below purpose:
  12592. *
  12593. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  12594. * wmi_peer_cfr_capture_cmd.
  12595. * If payload_present bit is set to 0 then the associated memory region
  12596. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  12597. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  12598. * message; the CFR dump will be present at the end of the message,
  12599. * after the chan_phy_mode.
  12600. */
  12601. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  12602. /* Always keep this last */
  12603. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  12604. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  12605. /**
  12606. * @brief target -> host CFR dump completion indication message definition
  12607. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  12608. *
  12609. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  12610. *
  12611. * @details
  12612. * The following diagram shows the format of the Channel Frequency Response
  12613. * (CFR) dump completion indication. This inidcation is sent to the Host when
  12614. * the channel capture of a peer is copied by Firmware into the Host memory
  12615. *
  12616. * **************************************************************************
  12617. *
  12618. * Message format when the CFR capture message type is
  12619. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12620. *
  12621. * **************************************************************************
  12622. *
  12623. * |31 16|15 |8|7 0|
  12624. * |----------------------------------------------------------------|
  12625. * header: | reserved |P| msg_type |
  12626. * word 0 | | | |
  12627. * |----------------------------------------------------------------|
  12628. * payload: | cfr_capture_msg_type |
  12629. * word 1 | |
  12630. * |----------------------------------------------------------------|
  12631. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  12632. * word 2 | | | | | | | | |
  12633. * |----------------------------------------------------------------|
  12634. * | mac_addr31to0 |
  12635. * word 3 | |
  12636. * |----------------------------------------------------------------|
  12637. * | unused / reserved | mac_addr47to32 |
  12638. * word 4 | | |
  12639. * |----------------------------------------------------------------|
  12640. * | index |
  12641. * word 5 | |
  12642. * |----------------------------------------------------------------|
  12643. * | length |
  12644. * word 6 | |
  12645. * |----------------------------------------------------------------|
  12646. * | timestamp |
  12647. * word 7 | |
  12648. * |----------------------------------------------------------------|
  12649. * | counter |
  12650. * word 8 | |
  12651. * |----------------------------------------------------------------|
  12652. * | chan_mhz |
  12653. * word 9 | |
  12654. * |----------------------------------------------------------------|
  12655. * | band_center_freq1 |
  12656. * word 10 | |
  12657. * |----------------------------------------------------------------|
  12658. * | band_center_freq2 |
  12659. * word 11 | |
  12660. * |----------------------------------------------------------------|
  12661. * | chan_phy_mode |
  12662. * word 12 | |
  12663. * |----------------------------------------------------------------|
  12664. * where,
  12665. * P - payload present bit (payload_present explained below)
  12666. * req_id - memory request id (mem_req_id explained below)
  12667. * S - status field (status explained below)
  12668. * capbw - capture bandwidth (capture_bw explained below)
  12669. * mode - mode of capture (mode explained below)
  12670. * sts - space time streams (sts_count explained below)
  12671. * chbw - channel bandwidth (channel_bw explained below)
  12672. * captype - capture type (cap_type explained below)
  12673. *
  12674. * The following field definitions describe the format of the CFR dump
  12675. * completion indication sent from the target to the host
  12676. *
  12677. * Header fields:
  12678. *
  12679. * Word 0
  12680. * - msg_type
  12681. * Bits 7:0
  12682. * Purpose: Identifies this as CFR TX completion indication
  12683. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12684. * - payload_present
  12685. * Bit 8
  12686. * Purpose: Identifies how CFR data is sent to host
  12687. * Value: 0 - If CFR Payload is written to host memory
  12688. * 1 - If CFR Payload is sent as part of HTT message
  12689. * (This is the requirement for SDIO/USB where it is
  12690. * not possible to write CFR data to host memory)
  12691. * - reserved
  12692. * Bits 31:9
  12693. * Purpose: Reserved
  12694. * Value: 0
  12695. *
  12696. * Payload fields:
  12697. *
  12698. * Word 1
  12699. * - cfr_capture_msg_type
  12700. * Bits 31:0
  12701. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12702. * to specify the format used for the remainder of the message
  12703. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12704. * (currently only MSG_TYPE_1 is defined)
  12705. *
  12706. * Word 2
  12707. * - mem_req_id
  12708. * Bits 6:0
  12709. * Purpose: Contain the mem request id of the region where the CFR capture
  12710. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12711. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12712. this value is invalid)
  12713. * - status
  12714. * Bit 7
  12715. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12716. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12717. * - capture_bw
  12718. * Bits 10:8
  12719. * Purpose: Carry the bandwidth of the CFR capture
  12720. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12721. * - mode
  12722. * Bits 13:11
  12723. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12724. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12725. * - sts_count
  12726. * Bits 16:14
  12727. * Purpose: Carry the number of space time streams
  12728. * Value: Number of space time streams
  12729. * - channel_bw
  12730. * Bits 19:17
  12731. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12732. * measurement
  12733. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12734. * - cap_type
  12735. * Bits 23:20
  12736. * Purpose: Carry the type of the capture
  12737. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12738. * - vdev_id
  12739. * Bits 31:24
  12740. * Purpose: Carry the virtual device id
  12741. * Value: vdev ID
  12742. *
  12743. * Word 3
  12744. * - mac_addr31to0
  12745. * Bits 31:0
  12746. * Purpose: Contain the bits 31:0 of the peer MAC address
  12747. * Value: Bits 31:0 of the peer MAC address
  12748. *
  12749. * Word 4
  12750. * - mac_addr47to32
  12751. * Bits 15:0
  12752. * Purpose: Contain the bits 47:32 of the peer MAC address
  12753. * Value: Bits 47:32 of the peer MAC address
  12754. *
  12755. * Word 5
  12756. * - index
  12757. * Bits 31:0
  12758. * Purpose: Contain the index at which this CFR dump was written in the Host
  12759. * allocated memory. This index is the number of bytes from the base address.
  12760. * Value: Index position
  12761. *
  12762. * Word 6
  12763. * - length
  12764. * Bits 31:0
  12765. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12766. * Value: Length of the CFR capture of the peer
  12767. *
  12768. * Word 7
  12769. * - timestamp
  12770. * Bits 31:0
  12771. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12772. * clock used for this timestamp is private to the target and not visible to
  12773. * the host i.e., Host can interpret only the relative timestamp deltas from
  12774. * one message to the next, but can't interpret the absolute timestamp from a
  12775. * single message.
  12776. * Value: Timestamp in microseconds
  12777. *
  12778. * Word 8
  12779. * - counter
  12780. * Bits 31:0
  12781. * Purpose: Carry the count of the current CFR capture from FW. This is
  12782. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12783. * in host memory)
  12784. * Value: Count of the current CFR capture
  12785. *
  12786. * Word 9
  12787. * - chan_mhz
  12788. * Bits 31:0
  12789. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12790. * Value: Primary 20 channel frequency
  12791. *
  12792. * Word 10
  12793. * - band_center_freq1
  12794. * Bits 31:0
  12795. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12796. * Value: Center frequency 1 in MHz
  12797. *
  12798. * Word 11
  12799. * - band_center_freq2
  12800. * Bits 31:0
  12801. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12802. * the VDEV
  12803. * 80plus80 mode
  12804. * Value: Center frequency 2 in MHz
  12805. *
  12806. * Word 12
  12807. * - chan_phy_mode
  12808. * Bits 31:0
  12809. * Purpose: Carry the phy mode of the channel, of the VDEV
  12810. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12811. */
  12812. PREPACK struct htt_cfr_dump_ind_type_1 {
  12813. A_UINT32 mem_req_id:7,
  12814. status:1,
  12815. capture_bw:3,
  12816. mode:3,
  12817. sts_count:3,
  12818. channel_bw:3,
  12819. cap_type:4,
  12820. vdev_id:8;
  12821. htt_mac_addr addr;
  12822. A_UINT32 index;
  12823. A_UINT32 length;
  12824. A_UINT32 timestamp;
  12825. A_UINT32 counter;
  12826. struct htt_chan_change_msg chan;
  12827. } POSTPACK;
  12828. PREPACK struct htt_cfr_dump_compl_ind {
  12829. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12830. union {
  12831. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12832. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12833. /* If there is a need to change the memory layout and its associated
  12834. * HTT indication format, a new CFR capture message type can be
  12835. * introduced and added into this union.
  12836. */
  12837. };
  12838. } POSTPACK;
  12839. /*
  12840. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12841. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12842. */
  12843. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12844. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12845. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12846. do { \
  12847. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12848. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12849. } while(0)
  12850. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12851. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12852. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12853. /*
  12854. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12855. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12856. */
  12857. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12858. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12859. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12860. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12861. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12862. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12863. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12864. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12865. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12866. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12867. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12868. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12869. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12870. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12871. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12872. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12873. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12874. do { \
  12875. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12876. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12877. } while (0)
  12878. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12879. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12880. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12881. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12882. do { \
  12883. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12884. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12885. } while (0)
  12886. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12887. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12888. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12889. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12890. do { \
  12891. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12892. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12893. } while (0)
  12894. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12895. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12896. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12897. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12898. do { \
  12899. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12900. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12901. } while (0)
  12902. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12903. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12904. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12905. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12906. do { \
  12907. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12908. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12909. } while (0)
  12910. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12911. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12912. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12913. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12914. do { \
  12915. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12916. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12917. } while (0)
  12918. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12919. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12920. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12921. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12922. do { \
  12923. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12924. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12925. } while (0)
  12926. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12927. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12928. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12929. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12930. do { \
  12931. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12932. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12933. } while (0)
  12934. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12935. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12936. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12937. /**
  12938. * @brief target -> host peer (PPDU) stats message
  12939. *
  12940. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12941. *
  12942. * @details
  12943. * This message is generated by FW when FW is sending stats to host
  12944. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12945. * This message is sent autonomously by the target rather than upon request
  12946. * by the host.
  12947. * The following field definitions describe the format of the HTT target
  12948. * to host peer stats indication message.
  12949. *
  12950. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12951. * or more PPDU stats records.
  12952. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12953. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12954. * then the message would start with the
  12955. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12956. * below.
  12957. *
  12958. * |31 16|15|14|13 11|10 9|8|7 0|
  12959. * |-------------------------------------------------------------|
  12960. * | reserved |MSG_TYPE |
  12961. * |-------------------------------------------------------------|
  12962. * rec 0 | TLV header |
  12963. * rec 0 |-------------------------------------------------------------|
  12964. * rec 0 | ppdu successful bytes |
  12965. * rec 0 |-------------------------------------------------------------|
  12966. * rec 0 | ppdu retry bytes |
  12967. * rec 0 |-------------------------------------------------------------|
  12968. * rec 0 | ppdu failed bytes |
  12969. * rec 0 |-------------------------------------------------------------|
  12970. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12971. * rec 0 |-------------------------------------------------------------|
  12972. * rec 0 | retried MSDUs | successful MSDUs |
  12973. * rec 0 |-------------------------------------------------------------|
  12974. * rec 0 | TX duration | failed MSDUs |
  12975. * rec 0 |-------------------------------------------------------------|
  12976. * ...
  12977. * |-------------------------------------------------------------|
  12978. * rec N | TLV header |
  12979. * rec N |-------------------------------------------------------------|
  12980. * rec N | ppdu successful bytes |
  12981. * rec N |-------------------------------------------------------------|
  12982. * rec N | ppdu retry bytes |
  12983. * rec N |-------------------------------------------------------------|
  12984. * rec N | ppdu failed bytes |
  12985. * rec N |-------------------------------------------------------------|
  12986. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12987. * rec N |-------------------------------------------------------------|
  12988. * rec N | retried MSDUs | successful MSDUs |
  12989. * rec N |-------------------------------------------------------------|
  12990. * rec N | TX duration | failed MSDUs |
  12991. * rec N |-------------------------------------------------------------|
  12992. *
  12993. * where:
  12994. * A = is A-MPDU flag
  12995. * BA = block-ack failure flags
  12996. * BW = bandwidth spec
  12997. * SG = SGI enabled spec
  12998. * S = skipped rate ctrl
  12999. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13000. *
  13001. * Header
  13002. * ------
  13003. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13004. * dword0 - b'8:31 - reserved : Reserved for future use
  13005. *
  13006. * payload include below peer_stats information
  13007. * --------------------------------------------
  13008. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13009. * @tx_success_bytes : total successful bytes in the PPDU.
  13010. * @tx_retry_bytes : total retried bytes in the PPDU.
  13011. * @tx_failed_bytes : total failed bytes in the PPDU.
  13012. * @tx_ratecode : rate code used for the PPDU.
  13013. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13014. * @ba_ack_failed : BA/ACK failed for this PPDU
  13015. * b00 -> BA received
  13016. * b01 -> BA failed once
  13017. * b10 -> BA failed twice, when HW retry is enabled.
  13018. * @bw : BW
  13019. * b00 -> 20 MHz
  13020. * b01 -> 40 MHz
  13021. * b10 -> 80 MHz
  13022. * b11 -> 160 MHz (or 80+80)
  13023. * @sg : SGI enabled
  13024. * @s : skipped ratectrl
  13025. * @peer_id : peer id
  13026. * @tx_success_msdus : successful MSDUs
  13027. * @tx_retry_msdus : retried MSDUs
  13028. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13029. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13030. */
  13031. /**
  13032. * @brief target -> host backpressure event
  13033. *
  13034. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13035. *
  13036. * @details
  13037. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13038. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13039. * This message will only be sent if the backpressure condition has existed
  13040. * continuously for an initial period (100 ms).
  13041. * Repeat messages with updated information will be sent after each
  13042. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13043. * This message indicates the ring id along with current head and tail index
  13044. * locations (i.e. write and read indices).
  13045. * The backpressure time indicates the time in ms for which continous
  13046. * backpressure has been observed in the ring.
  13047. *
  13048. * The message format is as follows:
  13049. *
  13050. * |31 24|23 16|15 8|7 0|
  13051. * |----------------+----------------+----------------+----------------|
  13052. * | ring_id | ring_type | pdev_id | msg_type |
  13053. * |-------------------------------------------------------------------|
  13054. * | tail_idx | head_idx |
  13055. * |-------------------------------------------------------------------|
  13056. * | backpressure_time_ms |
  13057. * |-------------------------------------------------------------------|
  13058. *
  13059. * The message is interpreted as follows:
  13060. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13061. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13062. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13063. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13064. the msg is for LMAC ring.
  13065. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13066. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13067. * htt_backpressure_lmac_ring_id. This represents
  13068. * the ring id for which continous backpressure is seen
  13069. *
  13070. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  13071. * the ring indicated by the ring_id
  13072. *
  13073. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  13074. * the ring indicated by the ring id
  13075. *
  13076. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  13077. * backpressure has been seen in the ring
  13078. * indicated by the ring_id.
  13079. * Units = milliseconds
  13080. */
  13081. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  13082. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  13083. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  13084. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  13085. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  13086. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  13087. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  13088. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  13089. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  13090. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  13091. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  13092. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  13093. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  13094. do { \
  13095. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  13096. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  13097. } while (0)
  13098. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  13099. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  13100. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  13101. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  13102. do { \
  13103. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  13104. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  13105. } while (0)
  13106. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  13107. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  13108. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  13109. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  13112. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  13113. } while (0)
  13114. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  13115. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  13116. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  13117. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  13118. do { \
  13119. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  13120. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  13121. } while (0)
  13122. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  13123. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  13124. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  13125. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  13126. do { \
  13127. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  13128. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  13129. } while (0)
  13130. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  13131. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  13132. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  13133. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  13134. do { \
  13135. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  13136. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  13137. } while (0)
  13138. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  13139. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  13140. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  13141. enum htt_backpressure_ring_type {
  13142. HTT_SW_RING_TYPE_UMAC,
  13143. HTT_SW_RING_TYPE_LMAC,
  13144. HTT_SW_RING_TYPE_MAX,
  13145. };
  13146. /* Ring id for which the message is sent to host */
  13147. enum htt_backpressure_umac_ringid {
  13148. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  13149. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  13150. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  13151. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  13152. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  13153. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  13154. HTT_SW_RING_IDX_REO_REO2FW_RING,
  13155. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  13156. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  13157. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  13158. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  13159. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  13160. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  13161. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  13162. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  13163. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  13164. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  13165. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  13166. HTT_SW_UMAC_RING_IDX_MAX,
  13167. };
  13168. enum htt_backpressure_lmac_ringid {
  13169. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  13170. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  13171. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  13172. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  13173. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  13174. HTT_SW_RING_IDX_RXDMA2FW_RING,
  13175. HTT_SW_RING_IDX_RXDMA2SW_RING,
  13176. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  13177. HTT_SW_RING_IDX_RXDMA2REO_RING,
  13178. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  13179. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  13180. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  13181. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  13182. HTT_SW_LMAC_RING_IDX_MAX,
  13183. };
  13184. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  13185. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  13186. pdev_id: 8,
  13187. ring_type: 8, /* htt_backpressure_ring_type */
  13188. /*
  13189. * ring_id holds an enum value from either
  13190. * htt_backpressure_umac_ringid or
  13191. * htt_backpressure_lmac_ringid, based on
  13192. * the ring_type setting.
  13193. */
  13194. ring_id: 8;
  13195. A_UINT16 head_idx;
  13196. A_UINT16 tail_idx;
  13197. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  13198. } POSTPACK;
  13199. /*
  13200. * Defines two 32 bit words that can be used by the target to indicate a per
  13201. * user RU allocation and rate information.
  13202. *
  13203. * This information is currently provided in the "sw_response_reference_ptr"
  13204. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  13205. * "rx_ppdu_end_user_stats" TLV.
  13206. *
  13207. * VALID:
  13208. * The consumer of these words must explicitly check the valid bit,
  13209. * and only attempt interpretation of any of the remaining fields if
  13210. * the valid bit is set to 1.
  13211. *
  13212. * VERSION:
  13213. * The consumer of these words must also explicitly check the version bit,
  13214. * and only use the V0 definition if the VERSION field is set to 0.
  13215. *
  13216. * Version 1 is currently undefined, with the exception of the VALID and
  13217. * VERSION fields.
  13218. *
  13219. * Version 0:
  13220. *
  13221. * The fields below are duplicated per BW.
  13222. *
  13223. * The consumer must determine which BW field to use, based on the UL OFDMA
  13224. * PPDU BW indicated by HW.
  13225. *
  13226. * RU_START: RU26 start index for the user.
  13227. * Note that this is always using the RU26 index, regardless
  13228. * of the actual RU assigned to the user
  13229. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  13230. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  13231. *
  13232. * For example, 20MHz (the value in the top row is RU_START)
  13233. *
  13234. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  13235. * RU Size 1 (52): | | | | | |
  13236. * RU Size 2 (106): | | | |
  13237. * RU Size 3 (242): | |
  13238. *
  13239. * RU_SIZE: Indicates the RU size, as defined by enum
  13240. * htt_ul_ofdma_user_info_ru_size.
  13241. *
  13242. * LDPC: LDPC enabled (if 0, BCC is used)
  13243. *
  13244. * DCM: DCM enabled
  13245. *
  13246. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  13247. * |---------------------------------+--------------------------------|
  13248. * |Ver|Valid| FW internal |
  13249. * |---------------------------------+--------------------------------|
  13250. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  13251. * |---------------------------------+--------------------------------|
  13252. */
  13253. enum htt_ul_ofdma_user_info_ru_size {
  13254. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  13255. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  13256. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  13257. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  13258. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  13259. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  13260. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  13261. };
  13262. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  13263. struct htt_ul_ofdma_user_info_v0 {
  13264. A_UINT32 word0;
  13265. A_UINT32 word1;
  13266. };
  13267. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  13268. A_UINT32 w0_fw_rsvd:30; \
  13269. A_UINT32 w0_valid:1; \
  13270. A_UINT32 w0_version:1;
  13271. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  13272. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13273. };
  13274. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  13275. A_UINT32 w1_nss:3; \
  13276. A_UINT32 w1_mcs:4; \
  13277. A_UINT32 w1_ldpc:1; \
  13278. A_UINT32 w1_dcm:1; \
  13279. A_UINT32 w1_ru_start:7; \
  13280. A_UINT32 w1_ru_size:3; \
  13281. A_UINT32 w1_trig_type:4; \
  13282. A_UINT32 w1_unused:9;
  13283. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  13284. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13285. };
  13286. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  13287. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  13288. union {
  13289. A_UINT32 word0;
  13290. struct {
  13291. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13292. };
  13293. };
  13294. union {
  13295. A_UINT32 word1;
  13296. struct {
  13297. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13298. };
  13299. };
  13300. } POSTPACK;
  13301. enum HTT_UL_OFDMA_TRIG_TYPE {
  13302. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  13303. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  13304. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  13305. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  13306. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  13307. };
  13308. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  13309. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  13310. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  13311. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  13312. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  13313. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  13314. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  13315. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  13316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  13317. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  13318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  13319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  13320. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  13321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  13322. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  13323. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  13324. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  13325. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  13326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  13327. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  13328. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  13329. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  13330. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  13331. /*--- word 0 ---*/
  13332. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  13333. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  13334. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  13335. do { \
  13336. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  13337. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  13338. } while (0)
  13339. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  13340. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  13341. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  13342. do { \
  13343. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  13344. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  13345. } while (0)
  13346. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  13347. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  13348. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  13349. do { \
  13350. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  13351. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  13352. } while (0)
  13353. /*--- word 1 ---*/
  13354. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  13355. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  13356. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  13357. do { \
  13358. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  13359. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  13360. } while (0)
  13361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  13362. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  13363. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  13364. do { \
  13365. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  13366. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  13367. } while (0)
  13368. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  13369. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  13370. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  13371. do { \
  13372. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  13373. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  13374. } while (0)
  13375. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  13376. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  13377. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  13378. do { \
  13379. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  13380. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  13381. } while (0)
  13382. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  13383. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  13384. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  13385. do { \
  13386. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  13387. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  13388. } while (0)
  13389. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  13390. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  13391. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  13392. do { \
  13393. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  13394. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  13395. } while (0)
  13396. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  13397. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  13398. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  13399. do { \
  13400. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  13401. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  13402. } while (0)
  13403. /**
  13404. * @brief target -> host channel calibration data message
  13405. *
  13406. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  13407. *
  13408. * @brief host -> target channel calibration data message
  13409. *
  13410. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  13411. *
  13412. * @details
  13413. * The following field definitions describe the format of the channel
  13414. * calibration data message sent from the target to the host when
  13415. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  13416. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  13417. * The message is defined as htt_chan_caldata_msg followed by a variable
  13418. * number of 32-bit character values.
  13419. *
  13420. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  13421. * |------------------------------------------------------------------|
  13422. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  13423. * |------------------------------------------------------------------|
  13424. * | payload size | mhz |
  13425. * |------------------------------------------------------------------|
  13426. * | center frequency 2 | center frequency 1 |
  13427. * |------------------------------------------------------------------|
  13428. * | check sum |
  13429. * |------------------------------------------------------------------|
  13430. * | payload |
  13431. * |------------------------------------------------------------------|
  13432. * message info field:
  13433. * - MSG_TYPE
  13434. * Bits 7:0
  13435. * Purpose: identifies this as a channel calibration data message
  13436. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  13437. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  13438. * - SUB_TYPE
  13439. * Bits 11:8
  13440. * Purpose: T2H: indicates whether target is providing chan cal data
  13441. * to the host to store, or requesting that the host
  13442. * download previously-stored data.
  13443. * H2T: indicates whether the host is providing the requested
  13444. * channel cal data, or if it is rejecting the data
  13445. * request because it does not have the requested data.
  13446. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  13447. * - CHKSUM_VALID
  13448. * Bit 12
  13449. * Purpose: indicates if the checksum field is valid
  13450. * value:
  13451. * - FRAG
  13452. * Bit 19:16
  13453. * Purpose: indicates the fragment index for message
  13454. * value: 0 for first fragment, 1 for second fragment, ...
  13455. * - APPEND
  13456. * Bit 20
  13457. * Purpose: indicates if this is the last fragment
  13458. * value: 0 = final fragment, 1 = more fragments will be appended
  13459. *
  13460. * channel and payload size field
  13461. * - MHZ
  13462. * Bits 15:0
  13463. * Purpose: indicates the channel primary frequency
  13464. * Value:
  13465. * - PAYLOAD_SIZE
  13466. * Bits 31:16
  13467. * Purpose: indicates the bytes of calibration data in payload
  13468. * Value:
  13469. *
  13470. * center frequency field
  13471. * - CENTER FREQUENCY 1
  13472. * Bits 15:0
  13473. * Purpose: indicates the channel center frequency
  13474. * Value: channel center frequency, in MHz units
  13475. * - CENTER FREQUENCY 2
  13476. * Bits 31:16
  13477. * Purpose: indicates the secondary channel center frequency,
  13478. * only for 11acvht 80plus80 mode
  13479. * Value: secondary channel center frequeny, in MHz units, if applicable
  13480. *
  13481. * checksum field
  13482. * - CHECK_SUM
  13483. * Bits 31:0
  13484. * Purpose: check the payload data, it is just for this fragment.
  13485. * This is intended for the target to check that the channel
  13486. * calibration data returned by the host is the unmodified data
  13487. * that was previously provided to the host by the target.
  13488. * value: checksum of fragment payload
  13489. */
  13490. PREPACK struct htt_chan_caldata_msg {
  13491. /* DWORD 0: message info */
  13492. A_UINT32
  13493. msg_type: 8,
  13494. sub_type: 4 ,
  13495. chksum_valid: 1, /** 1:valid, 0:invalid */
  13496. reserved1: 3,
  13497. frag_idx: 4, /** fragment index for calibration data */
  13498. appending: 1, /** 0: no fragment appending,
  13499. * 1: extra fragment appending */
  13500. reserved2: 11;
  13501. /* DWORD 1: channel and payload size */
  13502. A_UINT32
  13503. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  13504. payload_size: 16; /** unit: bytes */
  13505. /* DWORD 2: center frequency */
  13506. A_UINT32
  13507. band_center_freq1: 16, /** Center frequency 1 in MHz */
  13508. band_center_freq2: 16; /** Center frequency 2 in MHz,
  13509. * valid only for 11acvht 80plus80 mode */
  13510. /* DWORD 3: check sum */
  13511. A_UINT32 chksum;
  13512. /* variable length for calibration data */
  13513. A_UINT32 payload[1/* or more */];
  13514. } POSTPACK;
  13515. /* T2H SUBTYPE */
  13516. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  13517. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  13518. /* H2T SUBTYPE */
  13519. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  13520. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  13521. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  13522. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  13523. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  13524. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  13525. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  13526. do { \
  13527. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  13528. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  13529. } while (0)
  13530. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  13531. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  13532. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  13533. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  13534. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  13535. do { \
  13536. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  13537. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  13538. } while (0)
  13539. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  13540. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  13541. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  13542. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  13543. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  13544. do { \
  13545. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  13546. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  13547. } while (0)
  13548. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  13549. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  13550. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  13551. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  13552. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  13553. do { \
  13554. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  13555. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  13556. } while (0)
  13557. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  13558. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  13559. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  13560. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  13561. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  13562. do { \
  13563. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  13564. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  13565. } while (0)
  13566. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  13567. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  13568. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  13569. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  13570. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  13571. do { \
  13572. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  13573. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  13574. } while (0)
  13575. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  13576. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  13577. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  13578. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  13579. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  13580. do { \
  13581. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  13582. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  13583. } while (0)
  13584. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  13585. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  13586. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  13587. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  13588. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  13589. do { \
  13590. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  13591. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  13592. } while (0)
  13593. /**
  13594. * @brief target -> host FSE CMEM based send
  13595. *
  13596. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  13597. *
  13598. * @details
  13599. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  13600. * FSE placement in CMEM is enabled.
  13601. *
  13602. * This message sends the non-secure CMEM base address.
  13603. * It will be sent to host in response to message
  13604. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  13605. * The message would appear as follows:
  13606. *
  13607. * |31 24|23 16|15 8|7 0|
  13608. * |----------------+----------------+----------------+----------------|
  13609. * | reserved | num_entries | msg_type |
  13610. * |----------------+----------------+----------------+----------------|
  13611. * | base_address_lo |
  13612. * |----------------+----------------+----------------+----------------|
  13613. * | base_address_hi |
  13614. * |-------------------------------------------------------------------|
  13615. *
  13616. * The message is interpreted as follows:
  13617. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  13618. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  13619. * b'8:15 - number_entries: Indicated the number of entries
  13620. * programmed.
  13621. * b'16:31 - reserved.
  13622. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  13623. * CMEM base address
  13624. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  13625. * CMEM base address
  13626. */
  13627. PREPACK struct htt_cmem_base_send_t {
  13628. A_UINT32 msg_type: 8,
  13629. num_entries: 8,
  13630. reserved: 16;
  13631. A_UINT32 base_address_lo;
  13632. A_UINT32 base_address_hi;
  13633. } POSTPACK;
  13634. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  13635. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  13636. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  13637. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  13638. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  13639. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  13640. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  13641. do { \
  13642. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  13643. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13644. } while (0)
  13645. /**
  13646. * @brief - HTT PPDU ID format
  13647. *
  13648. * @details
  13649. * The following field definitions describe the format of the PPDU ID.
  13650. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  13651. *
  13652. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  13653. * +--------------------------------------------------------------------------
  13654. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13655. * +--------------------------------------------------------------------------
  13656. *
  13657. * sch id :Schedule command id
  13658. * Bits [11 : 0] : monotonically increasing counter to track the
  13659. * PPDU posted to a specific transmit queue.
  13660. *
  13661. * hwq_id: Hardware Queue ID.
  13662. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13663. *
  13664. * mac_id: MAC ID
  13665. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13666. *
  13667. * seq_idx: Sequence index.
  13668. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13669. * a particular TXOP.
  13670. *
  13671. * tqm_cmd: HWSCH/TQM flag.
  13672. * Bit [23] : Always set to 0.
  13673. *
  13674. * seq_cmd_type: Sequence command type.
  13675. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13676. * Refer to enum HTT_STATS_FTYPE for values.
  13677. */
  13678. PREPACK struct htt_ppdu_id {
  13679. A_UINT32
  13680. sch_id: 12,
  13681. hwq_id: 5,
  13682. mac_id: 2,
  13683. seq_idx: 2,
  13684. reserved1: 2,
  13685. tqm_cmd: 1,
  13686. seq_cmd_type: 6,
  13687. reserved2: 2;
  13688. } POSTPACK;
  13689. #define HTT_PPDU_ID_SCH_ID_S 0
  13690. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13691. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13692. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13693. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13694. do { \
  13695. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13696. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13697. } while (0)
  13698. #define HTT_PPDU_ID_HWQ_ID_S 12
  13699. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13700. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13701. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13702. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13703. do { \
  13704. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13705. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13706. } while (0)
  13707. #define HTT_PPDU_ID_MAC_ID_S 17
  13708. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13709. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13710. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13711. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13712. do { \
  13713. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13714. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13715. } while (0)
  13716. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13717. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13718. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13719. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13720. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13721. do { \
  13722. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13723. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13724. } while (0)
  13725. #define HTT_PPDU_ID_TQM_CMD_S 23
  13726. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13727. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13728. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13729. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13730. do { \
  13731. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13732. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13733. } while (0)
  13734. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13735. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13736. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13737. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13738. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13739. do { \
  13740. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13741. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13742. } while (0)
  13743. /**
  13744. * @brief target -> RX PEER METADATA V0 format
  13745. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13746. * message from target, and will confirm to the target which peer metadata
  13747. * version to use in the wmi_init message.
  13748. *
  13749. * The following diagram shows the format of the RX PEER METADATA.
  13750. *
  13751. * |31 24|23 16|15 8|7 0|
  13752. * |-----------------------------------------------------------------------|
  13753. * | Reserved | VDEV ID | PEER ID |
  13754. * |-----------------------------------------------------------------------|
  13755. */
  13756. PREPACK struct htt_rx_peer_metadata_v0 {
  13757. A_UINT32
  13758. peer_id: 16,
  13759. vdev_id: 8,
  13760. reserved1: 8;
  13761. } POSTPACK;
  13762. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13763. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13764. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13765. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13766. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13767. do { \
  13768. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13769. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13770. } while (0)
  13771. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13772. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13773. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13774. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13775. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13776. do { \
  13777. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13778. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13779. } while (0)
  13780. /**
  13781. * @brief target -> RX PEER METADATA V1 format
  13782. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13783. * message from target, and will confirm to the target which peer metadata
  13784. * version to use in the wmi_init message.
  13785. *
  13786. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13787. *
  13788. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13789. * |-----------------------------------------------------------------------|
  13790. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13791. * |-----------------------------------------------------------------------|
  13792. */
  13793. PREPACK struct htt_rx_peer_metadata_v1 {
  13794. A_UINT32
  13795. peer_id: 13,
  13796. ml_peer_valid: 1,
  13797. reserved1: 2,
  13798. vdev_id: 8,
  13799. lmac_id: 2,
  13800. chip_id: 3,
  13801. reserved2: 3;
  13802. } POSTPACK;
  13803. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13804. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13805. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13806. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13807. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13808. do { \
  13809. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13810. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13811. } while (0)
  13812. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13813. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13814. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13815. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13816. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13817. do { \
  13818. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13819. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13820. } while (0)
  13821. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13822. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13823. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13824. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13825. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13826. do { \
  13827. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13828. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13829. } while (0)
  13830. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13831. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13832. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13833. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13834. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13835. do { \
  13836. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13837. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13838. } while (0)
  13839. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13840. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13841. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13842. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13843. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13844. do { \
  13845. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13846. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13847. } while (0)
  13848. /*
  13849. * In some systems, the host SW wants to specify priorities between
  13850. * different MSDU / flow queues within the same peer-TID.
  13851. * The below enums are used for the host to identify to the target
  13852. * which MSDU queue's priority it wants to adjust.
  13853. */
  13854. /*
  13855. * The MSDUQ index describe index of TCL HW, where each index is
  13856. * used for queuing particular types of MSDUs.
  13857. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  13858. */
  13859. enum HTT_MSDUQ_INDEX {
  13860. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  13861. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  13862. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  13863. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  13864. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  13865. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  13866. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  13867. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  13868. HTT_MSDUQ_MAX_INDEX,
  13869. };
  13870. /* MSDU qtype definition */
  13871. enum HTT_MSDU_QTYPE {
  13872. /*
  13873. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  13874. * relative priority. Instead, the relative priority of CRIT_0 versus
  13875. * CRIT_1 is controlled by the FW, through the configuration parameters
  13876. * it applies to the queues.
  13877. */
  13878. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  13879. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  13880. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  13881. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  13882. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  13883. /* New MSDU_QTYPE should be added above this line */
  13884. /*
  13885. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  13886. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  13887. * any host/target message definitions. The QTYPE_MAX value can
  13888. * only be used internally within the host or within the target.
  13889. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  13890. * it must regard the unexpected value as a default qtype value,
  13891. * or ignore it.
  13892. */
  13893. HTT_MSDU_QTYPE_MAX,
  13894. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  13895. };
  13896. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  13897. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  13898. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  13899. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  13900. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  13901. };
  13902. /**
  13903. * @brief target -> host mlo timestamp offset indication
  13904. *
  13905. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13906. *
  13907. * @details
  13908. * The following field definitions describe the format of the HTT target
  13909. * to host mlo timestamp offset indication message.
  13910. *
  13911. *
  13912. * |31 16|15 12|11 10|9 8|7 0 |
  13913. * |----------------------------------------------------------------------|
  13914. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  13915. * |----------------------------------------------------------------------|
  13916. * | Sync time stamp lo in us |
  13917. * |----------------------------------------------------------------------|
  13918. * | Sync time stamp hi in us |
  13919. * |----------------------------------------------------------------------|
  13920. * | mlo time stamp offset lo in us |
  13921. * |----------------------------------------------------------------------|
  13922. * | mlo time stamp offset hi in us |
  13923. * |----------------------------------------------------------------------|
  13924. * | mlo time stamp offset clocks in clock ticks |
  13925. * |----------------------------------------------------------------------|
  13926. * |31 26|25 16|15 0 |
  13927. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  13928. * | | compensation in clks | |
  13929. * |----------------------------------------------------------------------|
  13930. * |31 22|21 0 |
  13931. * | rsvd 3 | mlo time stamp comp timer period |
  13932. * |----------------------------------------------------------------------|
  13933. * The message is interpreted as follows:
  13934. *
  13935. * dword0 - b'0:7 - msg_type: This will be set to
  13936. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13937. * value: 0x28
  13938. *
  13939. * dword0 - b'9:8 - pdev_id
  13940. *
  13941. * dword0 - b'11:10 - chip_id
  13942. *
  13943. * dword0 - b'15:12 - rsvd1: Reserved for future use
  13944. *
  13945. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  13946. *
  13947. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  13948. * which last sync interrupt was received
  13949. *
  13950. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  13951. * which last sync interrupt was received
  13952. *
  13953. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  13954. *
  13955. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  13956. *
  13957. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  13958. *
  13959. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  13960. *
  13961. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  13962. * for sub us resolution
  13963. *
  13964. * dword6 - b'31:26 - rsvd2: Reserved for future use
  13965. *
  13966. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  13967. * is applied, in us
  13968. *
  13969. * dword7 - b'31:22 - rsvd3: Reserved for future use
  13970. */
  13971. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  13972. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  13973. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  13974. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  13975. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  13976. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  13977. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  13978. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  13979. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  13980. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  13981. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  13982. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  13983. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  13984. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  13985. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  13986. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  13987. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  13988. do { \
  13989. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  13990. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  13991. } while (0)
  13992. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  13993. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  13994. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  13995. do { \
  13996. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  13997. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  13998. } while (0)
  13999. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14000. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14001. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14002. do { \
  14003. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14004. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14005. } while (0)
  14006. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14007. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14008. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14009. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14010. do { \
  14011. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14012. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14013. } while (0)
  14014. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14015. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14016. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14017. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14018. do { \
  14019. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14020. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14021. } while (0)
  14022. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14023. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14024. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14025. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14026. do { \
  14027. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14028. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14029. } while (0)
  14030. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14031. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14032. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14033. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14034. do { \
  14035. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14036. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14037. } while (0)
  14038. typedef struct {
  14039. A_UINT32 msg_type: 8, /* bits 7:0 */
  14040. pdev_id: 2, /* bits 9:8 */
  14041. chip_id: 2, /* bits 11:10 */
  14042. reserved1: 4, /* bits 15:12 */
  14043. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14044. A_UINT32 sync_timestamp_lo_us;
  14045. A_UINT32 sync_timestamp_hi_us;
  14046. A_UINT32 mlo_timestamp_offset_lo_us;
  14047. A_UINT32 mlo_timestamp_offset_hi_us;
  14048. A_UINT32 mlo_timestamp_offset_clks;
  14049. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14050. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14051. reserved2: 6; /* bits 31:26 */
  14052. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14053. reserved3: 10; /* bits 31:22 */
  14054. } htt_t2h_mlo_offset_ind_t;
  14055. #endif