htt.h 684 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224
  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. */
  211. #define HTT_CURRENT_VERSION_MAJOR 3
  212. #define HTT_CURRENT_VERSION_MINOR 92
  213. #define HTT_NUM_TX_FRAG_DESC 1024
  214. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  215. #define HTT_CHECK_SET_VAL(field, val) \
  216. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  217. /* macros to assist in sign-extending fields from HTT messages */
  218. #define HTT_SIGN_BIT_MASK(field) \
  219. ((field ## _M + (1 << field ## _S)) >> 1)
  220. #define HTT_SIGN_BIT(_val, field) \
  221. (_val & HTT_SIGN_BIT_MASK(field))
  222. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  223. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  224. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  225. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  226. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  227. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  228. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  229. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  230. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  231. /*
  232. * TEMPORARY:
  233. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  234. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  235. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  236. * updated.
  237. */
  238. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  239. /*
  240. * TEMPORARY:
  241. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  242. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  243. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  244. * updated.
  245. */
  246. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  247. /*
  248. * htt_dbg_stats_type -
  249. * bit positions for each stats type within a stats type bitmask
  250. * The bitmask contains 24 bits.
  251. */
  252. enum htt_dbg_stats_type {
  253. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  254. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  255. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  256. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  257. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  258. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  259. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  260. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  261. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  262. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  263. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  264. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  265. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  266. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  267. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  268. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  269. /* bits 16-23 currently reserved */
  270. /* keep this last */
  271. HTT_DBG_NUM_STATS
  272. };
  273. /*=== HTT option selection TLVs ===
  274. * Certain HTT messages have alternatives or options.
  275. * For such cases, the host and target need to agree on which option to use.
  276. * Option specification TLVs can be appended to the VERSION_REQ and
  277. * VERSION_CONF messages to select options other than the default.
  278. * These TLVs are entirely optional - if they are not provided, there is a
  279. * well-defined default for each option. If they are provided, they can be
  280. * provided in any order. Each TLV can be present or absent independent of
  281. * the presence / absence of other TLVs.
  282. *
  283. * The HTT option selection TLVs use the following format:
  284. * |31 16|15 8|7 0|
  285. * |---------------------------------+----------------+----------------|
  286. * | value (payload) | length | tag |
  287. * |-------------------------------------------------------------------|
  288. * The value portion need not be only 2 bytes; it can be extended by any
  289. * integer number of 4-byte units. The total length of the TLV, including
  290. * the tag and length fields, must be a multiple of 4 bytes. The length
  291. * field specifies the total TLV size in 4-byte units. Thus, the typical
  292. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  293. * field, would store 0x1 in its length field, to show that the TLV occupies
  294. * a single 4-byte unit.
  295. */
  296. /*--- TLV header format - applies to all HTT option TLVs ---*/
  297. enum HTT_OPTION_TLV_TAGS {
  298. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  299. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  300. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  301. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  302. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  303. };
  304. PREPACK struct htt_option_tlv_header_t {
  305. A_UINT8 tag;
  306. A_UINT8 length;
  307. } POSTPACK;
  308. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  309. #define HTT_OPTION_TLV_TAG_S 0
  310. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  311. #define HTT_OPTION_TLV_LENGTH_S 8
  312. /*
  313. * value0 - 16 bit value field stored in word0
  314. * The TLV's value field may be longer than 2 bytes, in which case
  315. * the remainder of the value is stored in word1, word2, etc.
  316. */
  317. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  318. #define HTT_OPTION_TLV_VALUE0_S 16
  319. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  320. do { \
  321. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  322. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  323. } while (0)
  324. #define HTT_OPTION_TLV_TAG_GET(word) \
  325. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  326. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  327. do { \
  328. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  329. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  330. } while (0)
  331. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  332. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  333. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  334. do { \
  335. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  336. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  337. } while (0)
  338. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  339. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  340. /*--- format of specific HTT option TLVs ---*/
  341. /*
  342. * HTT option TLV for specifying LL bus address size
  343. * Some chips require bus addresses used by the target to access buffers
  344. * within the host's memory to be 32 bits; others require bus addresses
  345. * used by the target to access buffers within the host's memory to be
  346. * 64 bits.
  347. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  348. * a suffix to the VERSION_CONF message to specify which bus address format
  349. * the target requires.
  350. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  351. * default to providing bus addresses to the target in 32-bit format.
  352. */
  353. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  354. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  355. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  356. };
  357. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  358. struct htt_option_tlv_header_t hdr;
  359. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  360. } POSTPACK;
  361. /*
  362. * HTT option TLV for specifying whether HL systems should indicate
  363. * over-the-air tx completion for individual frames, or should instead
  364. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  365. * requests an OTA tx completion for a particular tx frame.
  366. * This option does not apply to LL systems, where the TX_COMPL_IND
  367. * is mandatory.
  368. * This option is primarily intended for HL systems in which the tx frame
  369. * downloads over the host --> target bus are as slow as or slower than
  370. * the transmissions over the WLAN PHY. For cases where the bus is faster
  371. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  372. * and consquently will send one TX_COMPL_IND message that covers several
  373. * tx frames. For cases where the WLAN PHY is faster than the bus,
  374. * the target will end up transmitting very short A-MPDUs, and consequently
  375. * sending many TX_COMPL_IND messages, which each cover a very small number
  376. * of tx frames.
  377. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  378. * a suffix to the VERSION_REQ message to request whether the host desires to
  379. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  380. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  381. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  382. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  383. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  384. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  385. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  386. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  387. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  388. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  389. * TLV.
  390. */
  391. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  392. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  393. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  394. };
  395. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  396. struct htt_option_tlv_header_t hdr;
  397. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  398. } POSTPACK;
  399. /*
  400. * HTT option TLV for specifying how many tx queue groups the target
  401. * may establish.
  402. * This TLV specifies the maximum value the target may send in the
  403. * txq_group_id field of any TXQ_GROUP information elements sent by
  404. * the target to the host. This allows the host to pre-allocate an
  405. * appropriate number of tx queue group structs.
  406. *
  407. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  408. * a suffix to the VERSION_REQ message to specify whether the host supports
  409. * tx queue groups at all, and if so if there is any limit on the number of
  410. * tx queue groups that the host supports.
  411. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  412. * a suffix to the VERSION_CONF message. If the host has specified in the
  413. * VER_REQ message a limit on the number of tx queue groups the host can
  414. * supprt, the target shall limit its specification of the maximum tx groups
  415. * to be no larger than this host-specified limit.
  416. *
  417. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  418. * shall preallocate 4 tx queue group structs, and the target shall not
  419. * specify a txq_group_id larger than 3.
  420. */
  421. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  422. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  423. /*
  424. * values 1 through N specify the max number of tx queue groups
  425. * the sender supports
  426. */
  427. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  428. };
  429. /* TEMPORARY backwards-compatibility alias for a typo fix -
  430. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  431. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  432. * to support the old name (with the typo) until all references to the
  433. * old name are replaced with the new name.
  434. */
  435. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  436. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  437. struct htt_option_tlv_header_t hdr;
  438. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  439. } POSTPACK;
  440. /*
  441. * HTT option TLV for specifying whether the target supports an extended
  442. * version of the HTT tx descriptor. If the target provides this TLV
  443. * and specifies in the TLV that the target supports an extended version
  444. * of the HTT tx descriptor, the target must check the "extension" bit in
  445. * the HTT tx descriptor, and if the extension bit is set, to expect a
  446. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  447. * descriptor. Furthermore, the target must provide room for the HTT
  448. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  449. * This option is intended for systems where the host needs to explicitly
  450. * control the transmission parameters such as tx power for individual
  451. * tx frames.
  452. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  453. * as a suffix to the VERSION_CONF message to explicitly specify whether
  454. * the target supports the HTT tx MSDU extension descriptor.
  455. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  456. * by the host as lack of target support for the HTT tx MSDU extension
  457. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  458. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  459. * the HTT tx MSDU extension descriptor.
  460. * The host is not required to provide the HTT tx MSDU extension descriptor
  461. * just because the target supports it; the target must check the
  462. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  463. * extension descriptor is present.
  464. */
  465. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  466. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  467. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  468. };
  469. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  470. struct htt_option_tlv_header_t hdr;
  471. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  472. } POSTPACK;
  473. /*=== host -> target messages ===============================================*/
  474. enum htt_h2t_msg_type {
  475. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  476. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  477. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  478. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  479. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  480. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  481. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  482. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  483. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  484. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  485. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  486. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  487. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  488. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  489. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  490. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  491. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  492. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  493. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  494. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  495. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  496. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  497. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  498. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  499. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  500. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  501. /* keep this last */
  502. HTT_H2T_NUM_MSGS
  503. };
  504. /*
  505. * HTT host to target message type -
  506. * stored in bits 7:0 of the first word of the message
  507. */
  508. #define HTT_H2T_MSG_TYPE_M 0xff
  509. #define HTT_H2T_MSG_TYPE_S 0
  510. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  511. do { \
  512. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  513. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  514. } while (0)
  515. #define HTT_H2T_MSG_TYPE_GET(word) \
  516. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  517. /**
  518. * @brief host -> target version number request message definition
  519. *
  520. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  521. *
  522. *
  523. * |31 24|23 16|15 8|7 0|
  524. * |----------------+----------------+----------------+----------------|
  525. * | reserved | msg type |
  526. * |-------------------------------------------------------------------|
  527. * : option request TLV (optional) |
  528. * :...................................................................:
  529. *
  530. * The VER_REQ message may consist of a single 4-byte word, or may be
  531. * extended with TLVs that specify which HTT options the host is requesting
  532. * from the target.
  533. * The following option TLVs may be appended to the VER_REQ message:
  534. * - HL_SUPPRESS_TX_COMPL_IND
  535. * - HL_MAX_TX_QUEUE_GROUPS
  536. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  537. * may be appended to the VER_REQ message (but only one TLV of each type).
  538. *
  539. * Header fields:
  540. * - MSG_TYPE
  541. * Bits 7:0
  542. * Purpose: identifies this as a version number request message
  543. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  544. */
  545. #define HTT_VER_REQ_BYTES 4
  546. /* TBDXXX: figure out a reasonable number */
  547. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  548. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  549. /**
  550. * @brief HTT tx MSDU descriptor
  551. *
  552. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  553. *
  554. * @details
  555. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  556. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  557. * the target firmware needs for the FW's tx processing, particularly
  558. * for creating the HW msdu descriptor.
  559. * The same HTT tx descriptor is used for HL and LL systems, though
  560. * a few fields within the tx descriptor are used only by LL or
  561. * only by HL.
  562. * The HTT tx descriptor is defined in two manners: by a struct with
  563. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  564. * definitions.
  565. * The target should use the struct def, for simplicitly and clarity,
  566. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  567. * neutral. Specifically, the host shall use the get/set macros built
  568. * around the mask + shift defs.
  569. */
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  572. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  573. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  574. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  575. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  576. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  577. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  578. #define HTT_TX_VDEV_ID_WORD 0
  579. #define HTT_TX_VDEV_ID_MASK 0x3f
  580. #define HTT_TX_VDEV_ID_SHIFT 16
  581. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  582. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  583. #define HTT_TX_MSDU_LEN_DWORD 1
  584. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  585. /*
  586. * HTT_VAR_PADDR macros
  587. * Allow physical / bus addresses to be either a single 32-bit value,
  588. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  589. */
  590. #define HTT_VAR_PADDR32(var_name) \
  591. A_UINT32 var_name
  592. #define HTT_VAR_PADDR64_LE(var_name) \
  593. struct { \
  594. /* little-endian: lo precedes hi */ \
  595. A_UINT32 lo; \
  596. A_UINT32 hi; \
  597. } var_name
  598. /*
  599. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  600. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  601. * addresses are stored in a XXX-bit field.
  602. * This macro is used to define both htt_tx_msdu_desc32_t and
  603. * htt_tx_msdu_desc64_t structs.
  604. */
  605. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  606. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  607. { \
  608. /* DWORD 0: flags and meta-data */ \
  609. A_UINT32 \
  610. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  611. \
  612. /* pkt_subtype - \
  613. * Detailed specification of the tx frame contents, extending the \
  614. * general specification provided by pkt_type. \
  615. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  616. * pkt_type | pkt_subtype \
  617. * ============================================================== \
  618. * 802.3 | bit 0:3 - Reserved \
  619. * | bit 4: 0x0 - Copy-Engine Classification Results \
  620. * | not appended to the HTT message \
  621. * | 0x1 - Copy-Engine Classification Results \
  622. * | appended to the HTT message in the \
  623. * | format: \
  624. * | [HTT tx desc, frame header, \
  625. * | CE classification results] \
  626. * | The CE classification results begin \
  627. * | at the next 4-byte boundary after \
  628. * | the frame header. \
  629. * ------------+------------------------------------------------- \
  630. * Eth2 | bit 0:3 - Reserved \
  631. * | bit 4: 0x0 - Copy-Engine Classification Results \
  632. * | not appended to the HTT message \
  633. * | 0x1 - Copy-Engine Classification Results \
  634. * | appended to the HTT message. \
  635. * | See the above specification of the \
  636. * | CE classification results location. \
  637. * ------------+------------------------------------------------- \
  638. * native WiFi | bit 0:3 - Reserved \
  639. * | bit 4: 0x0 - Copy-Engine Classification Results \
  640. * | not appended to the HTT message \
  641. * | 0x1 - Copy-Engine Classification Results \
  642. * | appended to the HTT message. \
  643. * | See the above specification of the \
  644. * | CE classification results location. \
  645. * ------------+------------------------------------------------- \
  646. * mgmt | 0x0 - 802.11 MAC header absent \
  647. * | 0x1 - 802.11 MAC header present \
  648. * ------------+------------------------------------------------- \
  649. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  650. * | 0x1 - 802.11 MAC header present \
  651. * | bit 1: 0x0 - allow aggregation \
  652. * | 0x1 - don't allow aggregation \
  653. * | bit 2: 0x0 - perform encryption \
  654. * | 0x1 - don't perform encryption \
  655. * | bit 3: 0x0 - perform tx classification / queuing \
  656. * | 0x1 - don't perform tx classification; \
  657. * | insert the frame into the "misc" \
  658. * | tx queue \
  659. * | bit 4: 0x0 - Copy-Engine Classification Results \
  660. * | not appended to the HTT message \
  661. * | 0x1 - Copy-Engine Classification Results \
  662. * | appended to the HTT message. \
  663. * | See the above specification of the \
  664. * | CE classification results location. \
  665. */ \
  666. pkt_subtype: 5, \
  667. \
  668. /* pkt_type - \
  669. * General specification of the tx frame contents. \
  670. * The htt_pkt_type enum should be used to specify and check the \
  671. * value of this field. \
  672. */ \
  673. pkt_type: 3, \
  674. \
  675. /* vdev_id - \
  676. * ID for the vdev that is sending this tx frame. \
  677. * For certain non-standard packet types, e.g. pkt_type == raw \
  678. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  679. * This field is used primarily for determining where to queue \
  680. * broadcast and multicast frames. \
  681. */ \
  682. vdev_id: 6, \
  683. /* ext_tid - \
  684. * The extended traffic ID. \
  685. * If the TID is unknown, the extended TID is set to \
  686. * HTT_TX_EXT_TID_INVALID. \
  687. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  688. * value of the QoS TID. \
  689. * If the tx frame is non-QoS data, then the extended TID is set to \
  690. * HTT_TX_EXT_TID_NON_QOS. \
  691. * If the tx frame is multicast or broadcast, then the extended TID \
  692. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  693. */ \
  694. ext_tid: 5, \
  695. \
  696. /* postponed - \
  697. * This flag indicates whether the tx frame has been downloaded to \
  698. * the target before but discarded by the target, and now is being \
  699. * downloaded again; or if this is a new frame that is being \
  700. * downloaded for the first time. \
  701. * This flag allows the target to determine the correct order for \
  702. * transmitting new vs. old frames. \
  703. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  704. * This flag only applies to HL systems, since in LL systems, \
  705. * the tx flow control is handled entirely within the target. \
  706. */ \
  707. postponed: 1, \
  708. \
  709. /* extension - \
  710. * This flag indicates whether a HTT tx MSDU extension descriptor \
  711. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  712. * \
  713. * 0x0 - no extension MSDU descriptor is present \
  714. * 0x1 - an extension MSDU descriptor immediately follows the \
  715. * regular MSDU descriptor \
  716. */ \
  717. extension: 1, \
  718. \
  719. /* cksum_offload - \
  720. * This flag indicates whether checksum offload is enabled or not \
  721. * for this frame. Target FW use this flag to turn on HW checksumming \
  722. * 0x0 - No checksum offload \
  723. * 0x1 - L3 header checksum only \
  724. * 0x2 - L4 checksum only \
  725. * 0x3 - L3 header checksum + L4 checksum \
  726. */ \
  727. cksum_offload: 2, \
  728. \
  729. /* tx_comp_req - \
  730. * This flag indicates whether Tx Completion \
  731. * from fw is required or not. \
  732. * This flag is only relevant if tx completion is not \
  733. * universally enabled. \
  734. * For all LL systems, tx completion is mandatory, \
  735. * so this flag will be irrelevant. \
  736. * For HL systems tx completion is optional, but HL systems in which \
  737. * the bus throughput exceeds the WLAN throughput will \
  738. * probably want to always use tx completion, and thus \
  739. * would not check this flag. \
  740. * This flag is required when tx completions are not used universally, \
  741. * but are still required for certain tx frames for which \
  742. * an OTA delivery acknowledgment is needed by the host. \
  743. * In practice, this would be for HL systems in which the \
  744. * bus throughput is less than the WLAN throughput. \
  745. * \
  746. * 0x0 - Tx Completion Indication from Fw not required \
  747. * 0x1 - Tx Completion Indication from Fw is required \
  748. */ \
  749. tx_compl_req: 1; \
  750. \
  751. \
  752. /* DWORD 1: MSDU length and ID */ \
  753. A_UINT32 \
  754. len: 16, /* MSDU length, in bytes */ \
  755. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  756. * and this id is used to calculate fragmentation \
  757. * descriptor pointer inside the target based on \
  758. * the base address, configured inside the target. \
  759. */ \
  760. \
  761. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  762. /* frags_desc_ptr - \
  763. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  764. * where the tx frame's fragments reside in memory. \
  765. * This field only applies to LL systems, since in HL systems the \
  766. * (degenerate single-fragment) fragmentation descriptor is created \
  767. * within the target. \
  768. */ \
  769. _paddr__frags_desc_ptr_; \
  770. \
  771. /* DWORD 3 (or 4): peerid, chanfreq */ \
  772. /* \
  773. * Peer ID : Target can use this value to know which peer-id packet \
  774. * destined to. \
  775. * It's intended to be specified by host in case of NAWDS. \
  776. */ \
  777. A_UINT16 peerid; \
  778. \
  779. /* \
  780. * Channel frequency: This identifies the desired channel \
  781. * frequency (in mhz) for tx frames. This is used by FW to help \
  782. * determine when it is safe to transmit or drop frames for \
  783. * off-channel operation. \
  784. * The default value of zero indicates to FW that the corresponding \
  785. * VDEV's home channel (if there is one) is the desired channel \
  786. * frequency. \
  787. */ \
  788. A_UINT16 chanfreq; \
  789. \
  790. /* Reason reserved is commented is increasing the htt structure size \
  791. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  792. * A_UINT32 reserved_dword3_bits0_31; \
  793. */ \
  794. } POSTPACK
  795. /* define a htt_tx_msdu_desc32_t type */
  796. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  797. /* define a htt_tx_msdu_desc64_t type */
  798. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  799. /*
  800. * Make htt_tx_msdu_desc_t be an alias for either
  801. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  802. */
  803. #if HTT_PADDR64
  804. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  805. #else
  806. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  807. #endif
  808. /* decriptor information for Management frame*/
  809. /*
  810. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  811. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  812. */
  813. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  814. extern A_UINT32 mgmt_hdr_len;
  815. PREPACK struct htt_mgmt_tx_desc_t {
  816. A_UINT32 msg_type;
  817. #if HTT_PADDR64
  818. A_UINT64 frag_paddr; /* DMAble address of the data */
  819. #else
  820. A_UINT32 frag_paddr; /* DMAble address of the data */
  821. #endif
  822. A_UINT32 desc_id; /* returned to host during completion
  823. * to free the meory*/
  824. A_UINT32 len; /* Fragment length */
  825. A_UINT32 vdev_id; /* virtual device ID*/
  826. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  827. } POSTPACK;
  828. PREPACK struct htt_mgmt_tx_compl_ind {
  829. A_UINT32 desc_id;
  830. A_UINT32 status;
  831. } POSTPACK;
  832. /*
  833. * This SDU header size comes from the summation of the following:
  834. * 1. Max of:
  835. * a. Native WiFi header, for native WiFi frames: 24 bytes
  836. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  837. * b. 802.11 header, for raw frames: 36 bytes
  838. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  839. * QoS header, HT header)
  840. * c. 802.3 header, for ethernet frames: 14 bytes
  841. * (destination address, source address, ethertype / length)
  842. * 2. Max of:
  843. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  844. * b. IPv6 header, up through the Traffic Class: 2 bytes
  845. * 3. 802.1Q VLAN header: 4 bytes
  846. * 4. LLC/SNAP header: 8 bytes
  847. */
  848. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  849. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  850. #define HTT_TX_HDR_SIZE_ETHERNET 14
  851. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  852. A_COMPILE_TIME_ASSERT(
  853. htt_encap_hdr_size_max_check_nwifi,
  854. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  855. A_COMPILE_TIME_ASSERT(
  856. htt_encap_hdr_size_max_check_enet,
  857. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  858. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  859. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  860. #define HTT_TX_HDR_SIZE_802_1Q 4
  861. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  862. #define HTT_COMMON_TX_FRM_HDR_LEN \
  863. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  864. HTT_TX_HDR_SIZE_802_1Q + \
  865. HTT_TX_HDR_SIZE_LLC_SNAP)
  866. #define HTT_HL_TX_FRM_HDR_LEN \
  867. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  868. #define HTT_LL_TX_FRM_HDR_LEN \
  869. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  870. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  871. /* dword 0 */
  872. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  875. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  876. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  879. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  880. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  883. #define HTT_TX_DESC_PKT_TYPE_S 13
  884. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  885. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  887. #define HTT_TX_DESC_VDEV_ID_S 16
  888. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  891. #define HTT_TX_DESC_EXT_TID_S 22
  892. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  893. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  895. #define HTT_TX_DESC_POSTPONED_S 27
  896. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  897. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  898. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  899. #define HTT_TX_DESC_EXTENSION_S 28
  900. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  901. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  902. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  903. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  904. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  905. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  906. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  907. #define HTT_TX_DESC_TX_COMP_S 31
  908. /* dword 1 */
  909. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  910. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  911. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  912. #define HTT_TX_DESC_FRM_LEN_S 0
  913. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  914. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  915. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  916. #define HTT_TX_DESC_FRM_ID_S 16
  917. /* dword 2 */
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  920. /* for systems using 64-bit format for bus addresses */
  921. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  922. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  923. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  925. /* for systems using 32-bit format for bus addresses */
  926. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  927. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  928. /* dword 3 */
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  932. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  933. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  934. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  935. #if HTT_PADDR64
  936. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  938. #else
  939. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  940. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  941. #endif
  942. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  943. #define HTT_TX_DESC_PEER_ID_S 0
  944. /*
  945. * TEMPORARY:
  946. * The original definitions for the PEER_ID fields contained typos
  947. * (with _DESC_PADDR appended to this PEER_ID field name).
  948. * Retain deprecated original names for PEER_ID fields until all code that
  949. * refers to them has been updated.
  950. */
  951. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  952. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  953. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  954. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  955. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  956. HTT_TX_DESC_PEER_ID_M
  957. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  958. HTT_TX_DESC_PEER_ID_S
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  962. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  963. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  964. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  965. #if HTT_PADDR64
  966. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  968. #else
  969. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  970. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  971. #endif
  972. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  973. #define HTT_TX_DESC_CHAN_FREQ_S 16
  974. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  975. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  976. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  977. do { \
  978. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  979. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  980. } while (0)
  981. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  982. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  983. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  984. do { \
  985. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  986. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  987. } while (0)
  988. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  989. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  990. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  991. do { \
  992. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  993. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  994. } while (0)
  995. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  996. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  997. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  998. do { \
  999. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1000. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1001. } while (0)
  1002. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1003. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1004. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1005. do { \
  1006. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1007. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1008. } while (0)
  1009. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1010. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1011. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1012. do { \
  1013. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1014. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1015. } while (0)
  1016. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1017. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1018. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1019. do { \
  1020. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1021. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1022. } while (0)
  1023. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1024. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1025. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1026. do { \
  1027. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1028. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1029. } while (0)
  1030. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1031. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1032. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1033. do { \
  1034. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1035. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1036. } while (0)
  1037. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1038. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1039. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1040. do { \
  1041. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1042. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1043. } while (0)
  1044. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1045. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1046. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1047. do { \
  1048. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1049. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1050. } while (0)
  1051. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1052. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1053. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1054. do { \
  1055. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1056. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1057. } while (0)
  1058. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1059. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1060. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1061. do { \
  1062. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1063. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1064. } while (0)
  1065. /* enums used in the HTT tx MSDU extension descriptor */
  1066. enum {
  1067. htt_tx_guard_interval_regular = 0,
  1068. htt_tx_guard_interval_short = 1,
  1069. };
  1070. enum {
  1071. htt_tx_preamble_type_ofdm = 0,
  1072. htt_tx_preamble_type_cck = 1,
  1073. htt_tx_preamble_type_ht = 2,
  1074. htt_tx_preamble_type_vht = 3,
  1075. };
  1076. enum {
  1077. htt_tx_bandwidth_5MHz = 0,
  1078. htt_tx_bandwidth_10MHz = 1,
  1079. htt_tx_bandwidth_20MHz = 2,
  1080. htt_tx_bandwidth_40MHz = 3,
  1081. htt_tx_bandwidth_80MHz = 4,
  1082. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1083. };
  1084. /**
  1085. * @brief HTT tx MSDU extension descriptor
  1086. * @details
  1087. * If the target supports HTT tx MSDU extension descriptors, the host has
  1088. * the option of appending the following struct following the regular
  1089. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1090. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1091. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1092. * tx specs for each frame.
  1093. */
  1094. PREPACK struct htt_tx_msdu_desc_ext_t {
  1095. /* DWORD 0: flags */
  1096. A_UINT32
  1097. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1098. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1099. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1100. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1101. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1102. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1103. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1104. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1105. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1106. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1107. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1108. /* DWORD 1: tx power, tx rate, tx BW */
  1109. A_UINT32
  1110. /* pwr -
  1111. * Specify what power the tx frame needs to be transmitted at.
  1112. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1113. * The value needs to be appropriately sign-extended when extracting
  1114. * the value from the message and storing it in a variable that is
  1115. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1116. * automatically handles this sign-extension.)
  1117. * If the transmission uses multiple tx chains, this power spec is
  1118. * the total transmit power, assuming incoherent combination of
  1119. * per-chain power to produce the total power.
  1120. */
  1121. pwr: 8,
  1122. /* mcs_mask -
  1123. * Specify the allowable values for MCS index (modulation and coding)
  1124. * to use for transmitting the frame.
  1125. *
  1126. * For HT / VHT preamble types, this mask directly corresponds to
  1127. * the HT or VHT MCS indices that are allowed. For each bit N set
  1128. * within the mask, MCS index N is allowed for transmitting the frame.
  1129. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1130. * rates versus OFDM rates, so the host has the option of specifying
  1131. * that the target must transmit the frame with CCK or OFDM rates
  1132. * (not HT or VHT), but leaving the decision to the target whether
  1133. * to use CCK or OFDM.
  1134. *
  1135. * For CCK and OFDM, the bits within this mask are interpreted as
  1136. * follows:
  1137. * bit 0 -> CCK 1 Mbps rate is allowed
  1138. * bit 1 -> CCK 2 Mbps rate is allowed
  1139. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1140. * bit 3 -> CCK 11 Mbps rate is allowed
  1141. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1142. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1143. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1144. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1145. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1146. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1147. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1148. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1149. *
  1150. * The MCS index specification needs to be compatible with the
  1151. * bandwidth mask specification. For example, a MCS index == 9
  1152. * specification is inconsistent with a preamble type == VHT,
  1153. * Nss == 1, and channel bandwidth == 20 MHz.
  1154. *
  1155. * Furthermore, the host has only a limited ability to specify to
  1156. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1157. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1158. */
  1159. mcs_mask: 12,
  1160. /* nss_mask -
  1161. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1162. * Each bit in this mask corresponds to a Nss value:
  1163. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1164. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1165. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1166. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1167. * The values in the Nss mask must be suitable for the recipient, e.g.
  1168. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1169. * recipient which only supports 2x2 MIMO.
  1170. */
  1171. nss_mask: 4,
  1172. /* guard_interval -
  1173. * Specify a htt_tx_guard_interval enum value to indicate whether
  1174. * the transmission should use a regular guard interval or a
  1175. * short guard interval.
  1176. */
  1177. guard_interval: 1,
  1178. /* preamble_type_mask -
  1179. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1180. * may choose from for transmitting this frame.
  1181. * The bits in this mask correspond to the values in the
  1182. * htt_tx_preamble_type enum. For example, to allow the target
  1183. * to transmit the frame as either CCK or OFDM, this field would
  1184. * be set to
  1185. * (1 << htt_tx_preamble_type_ofdm) |
  1186. * (1 << htt_tx_preamble_type_cck)
  1187. */
  1188. preamble_type_mask: 4,
  1189. reserved1_31_29: 3; /* unused, set to 0x0 */
  1190. /* DWORD 2: tx chain mask, tx retries */
  1191. A_UINT32
  1192. /* chain_mask - specify which chains to transmit from */
  1193. chain_mask: 4,
  1194. /* retry_limit -
  1195. * Specify the maximum number of transmissions, including the
  1196. * initial transmission, to attempt before giving up if no ack
  1197. * is received.
  1198. * If the tx rate is specified, then all retries shall use the
  1199. * same rate as the initial transmission.
  1200. * If no tx rate is specified, the target can choose whether to
  1201. * retain the original rate during the retransmissions, or to
  1202. * fall back to a more robust rate.
  1203. */
  1204. retry_limit: 4,
  1205. /* bandwidth_mask -
  1206. * Specify what channel widths may be used for the transmission.
  1207. * A value of zero indicates "don't care" - the target may choose
  1208. * the transmission bandwidth.
  1209. * The bits within this mask correspond to the htt_tx_bandwidth
  1210. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1211. * The bandwidth_mask must be consistent with the preamble_type_mask
  1212. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1213. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1214. */
  1215. bandwidth_mask: 6,
  1216. reserved2_31_14: 18; /* unused, set to 0x0 */
  1217. /* DWORD 3: tx expiry time (TSF) LSBs */
  1218. A_UINT32 expire_tsf_lo;
  1219. /* DWORD 4: tx expiry time (TSF) MSBs */
  1220. A_UINT32 expire_tsf_hi;
  1221. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1222. } POSTPACK;
  1223. /* DWORD 0 */
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1244. /* DWORD 1 */
  1245. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1246. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1247. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1248. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1249. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1250. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1251. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1252. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1253. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1254. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1255. /* DWORD 2 */
  1256. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1257. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1258. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1259. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1260. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1261. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1262. /* DWORD 0 */
  1263. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1264. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1265. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1266. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1269. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1270. } while (0)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1272. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL( \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1286. ((_var) |= ((_val) \
  1287. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL( \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1296. ((_var) |= ((_val) \
  1297. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1298. } while (0)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1300. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1306. } while (0)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1308. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1309. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1310. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1314. } while (0)
  1315. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1322. } while (0)
  1323. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1330. } while (0)
  1331. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1338. } while (0)
  1339. /* DWORD 1 */
  1340. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1344. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1345. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1346. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1347. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1348. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1349. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1350. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1351. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1352. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1356. } while (0)
  1357. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1364. } while (0)
  1365. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1366. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1367. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1368. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1372. } while (0)
  1373. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1380. } while (0)
  1381. /* DWORD 2 */
  1382. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1383. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1384. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1385. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1386. do { \
  1387. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1388. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1389. } while (0)
  1390. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1391. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1392. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1393. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1394. do { \
  1395. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1396. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1397. } while (0)
  1398. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1399. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1400. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1401. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1402. do { \
  1403. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1404. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1405. } while (0)
  1406. typedef enum {
  1407. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1408. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1409. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1410. } htt_11ax_ltf_subtype_t;
  1411. typedef enum {
  1412. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1413. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1414. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1415. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1416. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1417. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1418. } htt_tx_ext2_preamble_type_t;
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1431. /**
  1432. * @brief HTT tx MSDU extension descriptor v2
  1433. * @details
  1434. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1435. * is received as tcl_exit_base->host_meta_info in firmware.
  1436. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1437. * are already part of tcl_exit_base.
  1438. */
  1439. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1440. /* DWORD 0: flags */
  1441. A_UINT32
  1442. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1443. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1444. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1445. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1446. valid_retries : 1, /* if set, tx retries spec is valid */
  1447. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1448. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1449. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1450. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1451. valid_key_flags : 1, /* if set, key flags is valid */
  1452. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1453. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1454. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1455. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1456. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1457. 1 = ENCRYPT,
  1458. 2 ~ 3 - Reserved */
  1459. /* retry_limit -
  1460. * Specify the maximum number of transmissions, including the
  1461. * initial transmission, to attempt before giving up if no ack
  1462. * is received.
  1463. * If the tx rate is specified, then all retries shall use the
  1464. * same rate as the initial transmission.
  1465. * If no tx rate is specified, the target can choose whether to
  1466. * retain the original rate during the retransmissions, or to
  1467. * fall back to a more robust rate.
  1468. */
  1469. retry_limit : 4,
  1470. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1471. * Valid only for 11ax preamble types HE_SU
  1472. * and HE_EXT_SU
  1473. */
  1474. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1475. * Valid only for 11ax preamble types HE_SU
  1476. * and HE_EXT_SU
  1477. */
  1478. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1479. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1480. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1481. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1482. */
  1483. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1484. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1485. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1486. * Use cases:
  1487. * Any time firmware uses TQM-BYPASS for Data
  1488. * TID, firmware expect host to set this bit.
  1489. */
  1490. /* DWORD 1: tx power, tx rate */
  1491. A_UINT32
  1492. power : 8, /* unit of the power field is 0.5 dbm
  1493. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1494. * signed value ranging from -64dbm to 63.5 dbm
  1495. */
  1496. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1497. * Setting more than one MCS isn't currently
  1498. * supported by the target (but is supported
  1499. * in the interface in case in the future
  1500. * the target supports specifications of
  1501. * a limited set of MCS values.
  1502. */
  1503. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1504. * Setting more than one Nss isn't currently
  1505. * supported by the target (but is supported
  1506. * in the interface in case in the future
  1507. * the target supports specifications of
  1508. * a limited set of Nss values.
  1509. */
  1510. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1511. update_peer_cache : 1; /* When set these custom values will be
  1512. * used for all packets, until the next
  1513. * update via this ext header.
  1514. * This is to make sure not all packets
  1515. * need to include this header.
  1516. */
  1517. /* DWORD 2: tx chain mask, tx retries */
  1518. A_UINT32
  1519. /* chain_mask - specify which chains to transmit from */
  1520. chain_mask : 8,
  1521. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1522. * TODO: Update Enum values for key_flags
  1523. */
  1524. /*
  1525. * Channel frequency: This identifies the desired channel
  1526. * frequency (in MHz) for tx frames. This is used by FW to help
  1527. * determine when it is safe to transmit or drop frames for
  1528. * off-channel operation.
  1529. * The default value of zero indicates to FW that the corresponding
  1530. * VDEV's home channel (if there is one) is the desired channel
  1531. * frequency.
  1532. */
  1533. chanfreq : 16;
  1534. /* DWORD 3: tx expiry time (TSF) LSBs */
  1535. A_UINT32 expire_tsf_lo;
  1536. /* DWORD 4: tx expiry time (TSF) MSBs */
  1537. A_UINT32 expire_tsf_hi;
  1538. /* DWORD 5: flags to control routing / processing of the MSDU */
  1539. A_UINT32
  1540. /* learning_frame
  1541. * When this flag is set, this frame will be dropped by FW
  1542. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1543. */
  1544. learning_frame : 1,
  1545. /* send_as_standalone
  1546. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1547. * i.e. with no A-MSDU or A-MPDU aggregation.
  1548. * The scope is extended to other use-cases.
  1549. */
  1550. send_as_standalone : 1,
  1551. /* is_host_opaque_valid
  1552. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1553. * with valid information.
  1554. */
  1555. is_host_opaque_valid : 1,
  1556. rsvd0 : 29;
  1557. /* DWORD 6 : Host opaque cookie for special frames */
  1558. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1559. rsvd1 : 16;
  1560. /*
  1561. * This structure can be expanded further up to 40 bytes
  1562. * by adding further DWORDs as needed.
  1563. */
  1564. } POSTPACK;
  1565. /* DWORD 0 */
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1592. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1593. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1594. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1595. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1596. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1597. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1598. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1599. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1600. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1601. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1602. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1603. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1606. /* DWORD 1 */
  1607. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1608. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1609. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1610. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1611. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1612. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1613. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1614. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1615. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1616. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1617. /* DWORD 2 */
  1618. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1619. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1620. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1621. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1622. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1623. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1624. /* DWORD 5 */
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1631. /* DWORD 6 */
  1632. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1633. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1634. /* DWORD 0 */
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1645. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL( \
  1665. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1666. ((_var) |= ((_val) \
  1667. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL( \
  1691. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1692. ((_var) |= ((_val) \
  1693. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1750. } while (0)
  1751. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1755. do { \
  1756. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1757. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1758. } while (0)
  1759. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1760. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1761. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1762. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1763. do { \
  1764. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1765. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1766. } while (0)
  1767. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1768. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1769. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1770. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1771. do { \
  1772. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1773. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1774. } while (0)
  1775. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1776. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1777. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1778. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1779. do { \
  1780. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1781. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1782. } while (0)
  1783. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1784. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1785. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1786. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1787. do { \
  1788. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1789. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1790. } while (0)
  1791. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1797. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1798. } while (0)
  1799. /* DWORD 1 */
  1800. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1804. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1805. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1806. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1807. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1808. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1809. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1810. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1811. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1812. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1813. do { \
  1814. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1815. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1816. } while (0)
  1817. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1818. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1819. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1820. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1821. do { \
  1822. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1823. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1824. } while (0)
  1825. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1835. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1836. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1840. } while (0)
  1841. /* DWORD 2 */
  1842. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1843. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1844. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1845. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1846. do { \
  1847. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1848. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1849. } while (0)
  1850. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1851. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1852. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1853. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1854. do { \
  1855. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1856. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1857. } while (0)
  1858. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1865. } while (0)
  1866. /* DWORD 5 */
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1868. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1869. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1873. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1874. } while (0)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1881. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1882. } while (0)
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1890. } while (0)
  1891. /* DWORD 6 */
  1892. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1893. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1894. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1895. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1899. } while (0)
  1900. typedef enum {
  1901. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1902. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1903. } htt_tcl_metadata_type;
  1904. /**
  1905. * @brief HTT TCL command number format
  1906. * @details
  1907. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1908. * available to firmware as tcl_exit_base->tcl_status_number.
  1909. * For regular / multicast packets host will send vdev and mac id and for
  1910. * NAWDS packets, host will send peer id.
  1911. * A_UINT32 is used to avoid endianness conversion problems.
  1912. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1913. */
  1914. typedef struct {
  1915. A_UINT32
  1916. type: 1, /* vdev_id based or peer_id based */
  1917. rsvd: 31;
  1918. } htt_tx_tcl_vdev_or_peer_t;
  1919. typedef struct {
  1920. A_UINT32
  1921. type: 1, /* vdev_id based or peer_id based */
  1922. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1923. vdev_id: 8,
  1924. pdev_id: 2,
  1925. host_inspected:1,
  1926. rsvd: 19;
  1927. } htt_tx_tcl_vdev_metadata;
  1928. typedef struct {
  1929. A_UINT32
  1930. type: 1, /* vdev_id based or peer_id based */
  1931. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1932. peer_id: 14,
  1933. rsvd: 16;
  1934. } htt_tx_tcl_peer_metadata;
  1935. PREPACK struct htt_tx_tcl_metadata {
  1936. union {
  1937. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1938. htt_tx_tcl_vdev_metadata vdev_meta;
  1939. htt_tx_tcl_peer_metadata peer_meta;
  1940. };
  1941. } POSTPACK;
  1942. /* DWORD 0 */
  1943. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1944. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1945. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1946. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1947. /* VDEV metadata */
  1948. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1949. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1950. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1951. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1952. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1953. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1954. /* PEER metadata */
  1955. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1956. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1957. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1958. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1959. HTT_TX_TCL_METADATA_TYPE_S)
  1960. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1964. } while (0)
  1965. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1966. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1967. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1968. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1972. } while (0)
  1973. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1974. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1975. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1976. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1980. } while (0)
  1981. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1982. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1983. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1984. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1988. } while (0)
  1989. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1990. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1991. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1992. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1996. } while (0)
  1997. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1998. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1999. HTT_TX_TCL_METADATA_PEER_ID_S)
  2000. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2004. } while (0)
  2005. typedef enum {
  2006. HTT_TX_FW2WBM_TX_STATUS_OK,
  2007. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2008. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2009. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2010. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2011. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2012. HTT_TX_FW2WBM_TX_STATUS_MAX
  2013. } htt_tx_fw2wbm_tx_status_t;
  2014. typedef enum {
  2015. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2016. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2017. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2018. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2019. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2020. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2021. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2022. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2023. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2024. } htt_tx_fw2wbm_reinject_reason_t;
  2025. /**
  2026. * @brief HTT TX WBM Completion from firmware to host
  2027. * @details
  2028. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2029. * DWORD 3 and 4 for software based completions (Exception frames and
  2030. * TQM bypass frames)
  2031. * For software based completions, wbm_release_ring->release_source_module will
  2032. * be set to release_source_fw
  2033. */
  2034. PREPACK struct htt_tx_wbm_completion {
  2035. A_UINT32
  2036. sch_cmd_id: 24,
  2037. exception_frame: 1, /* If set, this packet was queued via exception path */
  2038. rsvd0_31_25: 7;
  2039. A_UINT32
  2040. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2041. * reception of an ACK or BA, this field indicates
  2042. * the RSSI of the received ACK or BA frame.
  2043. * When the frame is removed as result of a direct
  2044. * remove command from the SW, this field is set
  2045. * to 0x0 (which is never a valid value when real
  2046. * RSSI is available).
  2047. * Units: dB w.r.t noise floor
  2048. */
  2049. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2050. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2051. rsvd1_31_16: 16;
  2052. } POSTPACK;
  2053. /* DWORD 0 */
  2054. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2055. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2056. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2057. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2058. /* DWORD 1 */
  2059. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2060. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2061. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2062. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2063. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2064. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2065. /* DWORD 0 */
  2066. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2067. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2068. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2069. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2070. do { \
  2071. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2072. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2073. } while (0)
  2074. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2075. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2076. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2077. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2081. } while (0)
  2082. /* DWORD 1 */
  2083. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2084. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2085. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2086. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2090. } while (0)
  2091. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2093. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2094. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2098. } while (0)
  2099. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2100. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2101. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2102. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2106. } while (0)
  2107. /**
  2108. * @brief HTT TX WBM Completion from firmware to host
  2109. * @details
  2110. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2111. * (WBM) offload HW.
  2112. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2113. * For software based completions, release_source_module will
  2114. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2115. * struct wbm_release_ring and then switch to this after looking at
  2116. * release_source_module.
  2117. */
  2118. PREPACK struct htt_tx_wbm_completion_v2 {
  2119. A_UINT32
  2120. used_by_hw0; /* Refer to struct wbm_release_ring */
  2121. A_UINT32
  2122. used_by_hw1; /* Refer to struct wbm_release_ring */
  2123. A_UINT32
  2124. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2125. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2126. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2127. exception_frame: 1,
  2128. rsvd0: 12, /* For future use */
  2129. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2130. rsvd1: 1; /* For future use */
  2131. A_UINT32
  2132. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2133. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2134. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2135. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2136. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2137. */
  2138. A_UINT32
  2139. data1: 32;
  2140. A_UINT32
  2141. data2: 32;
  2142. A_UINT32
  2143. used_by_hw3; /* Refer to struct wbm_release_ring */
  2144. } POSTPACK;
  2145. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2146. /* DWORD 3 */
  2147. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2148. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2149. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2150. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2151. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2152. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2153. /* DWORD 3 */
  2154. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2155. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2156. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2157. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2158. do { \
  2159. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2160. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2161. } while (0)
  2162. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2163. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2164. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2165. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2169. } while (0)
  2170. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2171. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2172. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2173. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2177. } while (0)
  2178. /**
  2179. * @brief HTT TX WBM transmit status from firmware to host
  2180. * @details
  2181. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2182. * (WBM) offload HW.
  2183. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2184. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2185. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2186. */
  2187. PREPACK struct htt_tx_wbm_transmit_status {
  2188. A_UINT32
  2189. sch_cmd_id: 24,
  2190. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2191. * reception of an ACK or BA, this field indicates
  2192. * the RSSI of the received ACK or BA frame.
  2193. * When the frame is removed as result of a direct
  2194. * remove command from the SW, this field is set
  2195. * to 0x0 (which is never a valid value when real
  2196. * RSSI is available).
  2197. * Units: dB w.r.t noise floor
  2198. */
  2199. A_UINT32
  2200. sw_peer_id: 16,
  2201. tid_num: 5,
  2202. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2203. * and tid_num fields contain valid data.
  2204. * If this "valid" flag is not set, the
  2205. * sw_peer_id and tid_num fields must be ignored.
  2206. */
  2207. mcast: 1,
  2208. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2209. * contains valid data.
  2210. */
  2211. reserved0: 8;
  2212. A_UINT32
  2213. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2214. * packets in the wbm completion path
  2215. */
  2216. } POSTPACK;
  2217. /* DWORD 4 */
  2218. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2219. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2220. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2221. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2222. /* DWORD 5 */
  2223. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2224. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2225. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2226. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2227. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2228. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2229. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2230. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2231. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2232. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2233. /* DWORD 4 */
  2234. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2235. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2236. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2237. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2238. do { \
  2239. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2240. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2241. } while (0)
  2242. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2244. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2245. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2249. } while (0)
  2250. /* DWORD 5 */
  2251. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2252. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2253. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2254. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2258. } while (0)
  2259. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2260. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2261. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2262. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2266. } while (0)
  2267. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2268. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2269. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2270. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2274. } while (0)
  2275. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2276. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2277. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2278. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2282. } while (0)
  2283. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2284. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2285. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2286. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2290. } while (0)
  2291. /**
  2292. * @brief HTT TX WBM reinject status from firmware to host
  2293. * @details
  2294. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2295. * (WBM) offload HW.
  2296. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2297. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2298. */
  2299. PREPACK struct htt_tx_wbm_reinject_status {
  2300. A_UINT32
  2301. reserved0: 32;
  2302. A_UINT32
  2303. reserved1: 32;
  2304. A_UINT32
  2305. reserved2: 32;
  2306. } POSTPACK;
  2307. /**
  2308. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2309. * @details
  2310. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2311. * (WBM) offload HW.
  2312. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2313. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2314. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2315. * STA side.
  2316. */
  2317. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2318. A_UINT32
  2319. mec_sa_addr_31_0;
  2320. A_UINT32
  2321. mec_sa_addr_47_32: 16,
  2322. sa_ast_index: 16;
  2323. A_UINT32
  2324. vdev_id: 8,
  2325. reserved0: 24;
  2326. } POSTPACK;
  2327. /* DWORD 4 - mec_sa_addr_31_0 */
  2328. /* DWORD 5 */
  2329. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2330. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2331. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2332. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2333. /* DWORD 6 */
  2334. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2335. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2336. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2337. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2338. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2339. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2340. do { \
  2341. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2342. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2343. } while (0)
  2344. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2345. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2346. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2347. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2351. } while (0)
  2352. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2353. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2354. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2355. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2359. } while (0)
  2360. typedef enum {
  2361. TX_FLOW_PRIORITY_BE,
  2362. TX_FLOW_PRIORITY_HIGH,
  2363. TX_FLOW_PRIORITY_LOW,
  2364. } htt_tx_flow_priority_t;
  2365. typedef enum {
  2366. TX_FLOW_LATENCY_SENSITIVE,
  2367. TX_FLOW_LATENCY_INSENSITIVE,
  2368. } htt_tx_flow_latency_t;
  2369. typedef enum {
  2370. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2371. TX_FLOW_INTERACTIVE_TRAFFIC,
  2372. TX_FLOW_PERIODIC_TRAFFIC,
  2373. TX_FLOW_BURSTY_TRAFFIC,
  2374. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2375. } htt_tx_flow_traffic_pattern_t;
  2376. /**
  2377. * @brief HTT TX Flow search metadata format
  2378. * @details
  2379. * Host will set this metadata in flow table's flow search entry along with
  2380. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2381. * firmware and TQM ring if the flow search entry wins.
  2382. * This metadata is available to firmware in that first MSDU's
  2383. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2384. * to one of the available flows for specific tid and returns the tqm flow
  2385. * pointer as part of htt_tx_map_flow_info message.
  2386. */
  2387. PREPACK struct htt_tx_flow_metadata {
  2388. A_UINT32
  2389. rsvd0_1_0: 2,
  2390. tid: 4,
  2391. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2392. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2393. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2394. * Else choose final tid based on latency, priority.
  2395. */
  2396. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2397. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2398. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2399. } POSTPACK;
  2400. /* DWORD 0 */
  2401. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2402. #define HTT_TX_FLOW_METADATA_TID_S 2
  2403. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2404. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2405. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2406. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2407. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2408. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2409. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2410. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2411. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2412. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2413. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2414. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2415. /* DWORD 0 */
  2416. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2417. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2418. HTT_TX_FLOW_METADATA_TID_S)
  2419. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2420. do { \
  2421. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2422. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2423. } while (0)
  2424. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2425. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2426. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2427. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2431. } while (0)
  2432. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2433. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2434. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2435. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2439. } while (0)
  2440. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2441. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2442. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2443. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2447. } while (0)
  2448. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2449. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2450. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2451. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2455. } while (0)
  2456. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2457. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2458. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2459. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2463. } while (0)
  2464. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2465. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2466. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2467. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2471. } while (0)
  2472. /**
  2473. * @brief host -> target ADD WDS Entry
  2474. *
  2475. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2476. *
  2477. * @brief host -> target DELETE WDS Entry
  2478. *
  2479. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2480. *
  2481. * @details
  2482. * HTT wds entry from source port learning
  2483. * Host will learn wds entries from rx and send this message to firmware
  2484. * to enable firmware to configure/delete AST entries for wds clients.
  2485. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2486. * and when SA's entry is deleted, firmware removes this AST entry
  2487. *
  2488. * The message would appear as follows:
  2489. *
  2490. * |31 30|29 |17 16|15 8|7 0|
  2491. * |----------------+----------------+----------------+----------------|
  2492. * | rsvd0 |PDVID| vdev_id | msg_type |
  2493. * |-------------------------------------------------------------------|
  2494. * | sa_addr_31_0 |
  2495. * |-------------------------------------------------------------------|
  2496. * | | ta_peer_id | sa_addr_47_32 |
  2497. * |-------------------------------------------------------------------|
  2498. * Where PDVID = pdev_id
  2499. *
  2500. * The message is interpreted as follows:
  2501. *
  2502. * dword0 - b'0:7 - msg_type: This will be set to
  2503. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2504. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2505. *
  2506. * dword0 - b'8:15 - vdev_id
  2507. *
  2508. * dword0 - b'16:17 - pdev_id
  2509. *
  2510. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2511. *
  2512. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2513. *
  2514. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2515. *
  2516. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2517. */
  2518. PREPACK struct htt_wds_entry {
  2519. A_UINT32
  2520. msg_type: 8,
  2521. vdev_id: 8,
  2522. pdev_id: 2,
  2523. rsvd0: 14;
  2524. A_UINT32 sa_addr_31_0;
  2525. A_UINT32
  2526. sa_addr_47_32: 16,
  2527. ta_peer_id: 14,
  2528. rsvd2: 2;
  2529. } POSTPACK;
  2530. /* DWORD 0 */
  2531. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2532. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2533. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2534. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2535. /* DWORD 2 */
  2536. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2537. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2538. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2539. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2540. /* DWORD 0 */
  2541. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2542. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2543. HTT_WDS_ENTRY_VDEV_ID_S)
  2544. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2547. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2548. } while (0)
  2549. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2550. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2551. HTT_WDS_ENTRY_PDEV_ID_S)
  2552. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2555. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2556. } while (0)
  2557. /* DWORD 2 */
  2558. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2559. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2560. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2561. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2562. do { \
  2563. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2564. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2565. } while (0)
  2566. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2567. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2568. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2569. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2572. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2573. } while (0)
  2574. /**
  2575. * @brief MAC DMA rx ring setup specification
  2576. *
  2577. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2578. *
  2579. * @details
  2580. * To allow for dynamic rx ring reconfiguration and to avoid race
  2581. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2582. * it uses. Instead, it sends this message to the target, indicating how
  2583. * the rx ring used by the host should be set up and maintained.
  2584. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2585. * specifications.
  2586. *
  2587. * |31 16|15 8|7 0|
  2588. * |---------------------------------------------------------------|
  2589. * header: | reserved | num rings | msg type |
  2590. * |---------------------------------------------------------------|
  2591. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2592. #if HTT_PADDR64
  2593. * | FW_IDX shadow register physical address (bits 63:32) |
  2594. #endif
  2595. * |---------------------------------------------------------------|
  2596. * | rx ring base physical address (bits 31:0) |
  2597. #if HTT_PADDR64
  2598. * | rx ring base physical address (bits 63:32) |
  2599. #endif
  2600. * |---------------------------------------------------------------|
  2601. * | rx ring buffer size | rx ring length |
  2602. * |---------------------------------------------------------------|
  2603. * | FW_IDX initial value | enabled flags |
  2604. * |---------------------------------------------------------------|
  2605. * | MSDU payload offset | 802.11 header offset |
  2606. * |---------------------------------------------------------------|
  2607. * | PPDU end offset | PPDU start offset |
  2608. * |---------------------------------------------------------------|
  2609. * | MPDU end offset | MPDU start offset |
  2610. * |---------------------------------------------------------------|
  2611. * | MSDU end offset | MSDU start offset |
  2612. * |---------------------------------------------------------------|
  2613. * | frag info offset | rx attention offset |
  2614. * |---------------------------------------------------------------|
  2615. * payload 2, if present, has the same format as payload 1
  2616. * Header fields:
  2617. * - MSG_TYPE
  2618. * Bits 7:0
  2619. * Purpose: identifies this as an rx ring configuration message
  2620. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2621. * - NUM_RINGS
  2622. * Bits 15:8
  2623. * Purpose: indicates whether the host is setting up one rx ring or two
  2624. * Value: 1 or 2
  2625. * Payload:
  2626. * for systems using 64-bit format for bus addresses:
  2627. * - IDX_SHADOW_REG_PADDR_LO
  2628. * Bits 31:0
  2629. * Value: lower 4 bytes of physical address of the host's
  2630. * FW_IDX shadow register
  2631. * - IDX_SHADOW_REG_PADDR_HI
  2632. * Bits 31:0
  2633. * Value: upper 4 bytes of physical address of the host's
  2634. * FW_IDX shadow register
  2635. * - RING_BASE_PADDR_LO
  2636. * Bits 31:0
  2637. * Value: lower 4 bytes of physical address of the host's rx ring
  2638. * - RING_BASE_PADDR_HI
  2639. * Bits 31:0
  2640. * Value: uppper 4 bytes of physical address of the host's rx ring
  2641. * for systems using 32-bit format for bus addresses:
  2642. * - IDX_SHADOW_REG_PADDR
  2643. * Bits 31:0
  2644. * Value: physical address of the host's FW_IDX shadow register
  2645. * - RING_BASE_PADDR
  2646. * Bits 31:0
  2647. * Value: physical address of the host's rx ring
  2648. * - RING_LEN
  2649. * Bits 15:0
  2650. * Value: number of elements in the rx ring
  2651. * - RING_BUF_SZ
  2652. * Bits 31:16
  2653. * Value: size of the buffers referenced by the rx ring, in byte units
  2654. * - ENABLED_FLAGS
  2655. * Bits 15:0
  2656. * Value: 1-bit flags to show whether different rx fields are enabled
  2657. * bit 0: 802.11 header enabled (1) or disabled (0)
  2658. * bit 1: MSDU payload enabled (1) or disabled (0)
  2659. * bit 2: PPDU start enabled (1) or disabled (0)
  2660. * bit 3: PPDU end enabled (1) or disabled (0)
  2661. * bit 4: MPDU start enabled (1) or disabled (0)
  2662. * bit 5: MPDU end enabled (1) or disabled (0)
  2663. * bit 6: MSDU start enabled (1) or disabled (0)
  2664. * bit 7: MSDU end enabled (1) or disabled (0)
  2665. * bit 8: rx attention enabled (1) or disabled (0)
  2666. * bit 9: frag info enabled (1) or disabled (0)
  2667. * bit 10: unicast rx enabled (1) or disabled (0)
  2668. * bit 11: multicast rx enabled (1) or disabled (0)
  2669. * bit 12: ctrl rx enabled (1) or disabled (0)
  2670. * bit 13: mgmt rx enabled (1) or disabled (0)
  2671. * bit 14: null rx enabled (1) or disabled (0)
  2672. * bit 15: phy data rx enabled (1) or disabled (0)
  2673. * - IDX_INIT_VAL
  2674. * Bits 31:16
  2675. * Purpose: Specify the initial value for the FW_IDX.
  2676. * Value: the number of buffers initially present in the host's rx ring
  2677. * - OFFSET_802_11_HDR
  2678. * Bits 15:0
  2679. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2680. * - OFFSET_MSDU_PAYLOAD
  2681. * Bits 31:16
  2682. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2683. * - OFFSET_PPDU_START
  2684. * Bits 15:0
  2685. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2686. * - OFFSET_PPDU_END
  2687. * Bits 31:16
  2688. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2689. * - OFFSET_MPDU_START
  2690. * Bits 15:0
  2691. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2692. * - OFFSET_MPDU_END
  2693. * Bits 31:16
  2694. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2695. * - OFFSET_MSDU_START
  2696. * Bits 15:0
  2697. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2698. * - OFFSET_MSDU_END
  2699. * Bits 31:16
  2700. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2701. * - OFFSET_RX_ATTN
  2702. * Bits 15:0
  2703. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2704. * - OFFSET_FRAG_INFO
  2705. * Bits 31:16
  2706. * Value: offset in QUAD-bytes of frag info table
  2707. */
  2708. /* header fields */
  2709. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2710. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2711. /* payload fields */
  2712. /* for systems using a 64-bit format for bus addresses */
  2713. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2714. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2715. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2716. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2717. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2718. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2719. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2720. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2721. /* for systems using a 32-bit format for bus addresses */
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2724. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2725. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2726. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2727. #define HTT_RX_RING_CFG_LEN_S 0
  2728. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2729. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2730. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2731. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2732. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2733. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2734. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2735. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2736. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2737. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2738. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2739. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2740. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2741. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2743. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2744. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2745. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2746. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2747. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2748. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2749. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2750. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2751. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2752. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2753. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2754. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2755. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2756. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2757. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2758. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2759. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2760. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2761. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2762. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2763. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2764. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2765. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2766. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2767. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2768. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2769. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2770. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2771. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2772. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2773. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2774. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2775. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2776. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2777. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2778. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2779. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2780. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2781. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2782. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2783. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2784. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2785. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2786. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2787. #if HTT_PADDR64
  2788. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2789. #else
  2790. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2791. #endif
  2792. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2793. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2794. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2795. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2796. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2799. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2800. } while (0)
  2801. /* degenerate case for 32-bit fields */
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2804. ((_var) = (_val))
  2805. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2806. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2807. ((_var) = (_val))
  2808. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2809. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2810. ((_var) = (_val))
  2811. /* degenerate case for 32-bit fields */
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2814. ((_var) = (_val))
  2815. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2816. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2817. ((_var) = (_val))
  2818. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2819. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2820. ((_var) = (_val))
  2821. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2822. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2823. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2824. do { \
  2825. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2826. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2827. } while (0)
  2828. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2829. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2830. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2837. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2838. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2845. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2846. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2853. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2854. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2861. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2862. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2869. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2870. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2877. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2878. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2885. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2886. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2893. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2894. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2898. } while (0)
  2899. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2900. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2901. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2902. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2905. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2906. } while (0)
  2907. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2908. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2909. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2910. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2911. do { \
  2912. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2913. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2914. } while (0)
  2915. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2916. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2917. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2918. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2919. do { \
  2920. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2921. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2922. } while (0)
  2923. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2924. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2925. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2926. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2927. do { \
  2928. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2929. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2930. } while (0)
  2931. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2932. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2933. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2934. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2935. do { \
  2936. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2937. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2938. } while (0)
  2939. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2940. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2941. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2942. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2943. do { \
  2944. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2945. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2946. } while (0)
  2947. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2948. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2949. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2950. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2953. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2954. } while (0)
  2955. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2956. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2957. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2958. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2961. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2962. } while (0)
  2963. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2964. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2965. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2966. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2969. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2970. } while (0)
  2971. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2972. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2973. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2974. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2977. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2978. } while (0)
  2979. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2980. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2981. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2982. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2985. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2986. } while (0)
  2987. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2988. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2989. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2990. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2993. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2994. } while (0)
  2995. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2996. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2997. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2998. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3001. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3002. } while (0)
  3003. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3004. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3005. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3006. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3007. do { \
  3008. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3009. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3010. } while (0)
  3011. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3012. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3013. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3014. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3017. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3018. } while (0)
  3019. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3021. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3022. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3023. do { \
  3024. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3025. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3026. } while (0)
  3027. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3028. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3029. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3030. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3031. do { \
  3032. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3033. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3034. } while (0)
  3035. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3036. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3037. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3038. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3039. do { \
  3040. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3041. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3042. } while (0)
  3043. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3044. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3045. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3046. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3047. do { \
  3048. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3049. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3050. } while (0)
  3051. /**
  3052. * @brief host -> target FW statistics retrieve
  3053. *
  3054. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3055. *
  3056. * @details
  3057. * The following field definitions describe the format of the HTT host
  3058. * to target FW stats retrieve message. The message specifies the type of
  3059. * stats host wants to retrieve.
  3060. *
  3061. * |31 24|23 16|15 8|7 0|
  3062. * |-----------------------------------------------------------|
  3063. * | stats types request bitmask | msg type |
  3064. * |-----------------------------------------------------------|
  3065. * | stats types reset bitmask | reserved |
  3066. * |-----------------------------------------------------------|
  3067. * | stats type | config value |
  3068. * |-----------------------------------------------------------|
  3069. * | cookie LSBs |
  3070. * |-----------------------------------------------------------|
  3071. * | cookie MSBs |
  3072. * |-----------------------------------------------------------|
  3073. * Header fields:
  3074. * - MSG_TYPE
  3075. * Bits 7:0
  3076. * Purpose: identifies this is a stats upload request message
  3077. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3078. * - UPLOAD_TYPES
  3079. * Bits 31:8
  3080. * Purpose: identifies which types of FW statistics to upload
  3081. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3082. * - RESET_TYPES
  3083. * Bits 31:8
  3084. * Purpose: identifies which types of FW statistics to reset
  3085. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3086. * - CFG_VAL
  3087. * Bits 23:0
  3088. * Purpose: give an opaque configuration value to the specified stats type
  3089. * Value: stats-type specific configuration value
  3090. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3091. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3092. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3093. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3094. * - CFG_STAT_TYPE
  3095. * Bits 31:24
  3096. * Purpose: specify which stats type (if any) the config value applies to
  3097. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3098. * a valid configuration specification
  3099. * - COOKIE_LSBS
  3100. * Bits 31:0
  3101. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3102. * message with its preceding host->target stats request message.
  3103. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3104. * - COOKIE_MSBS
  3105. * Bits 31:0
  3106. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3107. * message with its preceding host->target stats request message.
  3108. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3109. */
  3110. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3111. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3112. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3113. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3114. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3115. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3116. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3117. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3118. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3119. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3120. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3121. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3122. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3123. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3126. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3127. } while (0)
  3128. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3129. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3130. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3131. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3134. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3135. } while (0)
  3136. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3137. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3138. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3139. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3142. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3143. } while (0)
  3144. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3145. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3146. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3147. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3148. do { \
  3149. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3150. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3151. } while (0)
  3152. /**
  3153. * @brief host -> target HTT out-of-band sync request
  3154. *
  3155. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3156. *
  3157. * @details
  3158. * The HTT SYNC tells the target to suspend processing of subsequent
  3159. * HTT host-to-target messages until some other target agent locally
  3160. * informs the target HTT FW that the current sync counter is equal to
  3161. * or greater than (in a modulo sense) the sync counter specified in
  3162. * the SYNC message.
  3163. * This allows other host-target components to synchronize their operation
  3164. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3165. * security key has been downloaded to and activated by the target.
  3166. * In the absence of any explicit synchronization counter value
  3167. * specification, the target HTT FW will use zero as the default current
  3168. * sync value.
  3169. *
  3170. * |31 24|23 16|15 8|7 0|
  3171. * |-----------------------------------------------------------|
  3172. * | reserved | sync count | msg type |
  3173. * |-----------------------------------------------------------|
  3174. * Header fields:
  3175. * - MSG_TYPE
  3176. * Bits 7:0
  3177. * Purpose: identifies this as a sync message
  3178. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3179. * - SYNC_COUNT
  3180. * Bits 15:8
  3181. * Purpose: specifies what sync value the HTT FW will wait for from
  3182. * an out-of-band specification to resume its operation
  3183. * Value: in-band sync counter value to compare against the out-of-band
  3184. * counter spec.
  3185. * The HTT target FW will suspend its host->target message processing
  3186. * as long as
  3187. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3188. */
  3189. #define HTT_H2T_SYNC_MSG_SZ 4
  3190. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3191. #define HTT_H2T_SYNC_COUNT_S 8
  3192. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3193. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3194. HTT_H2T_SYNC_COUNT_S)
  3195. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3196. do { \
  3197. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3198. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3199. } while (0)
  3200. /**
  3201. * @brief host -> target HTT aggregation configuration
  3202. *
  3203. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3204. */
  3205. #define HTT_AGGR_CFG_MSG_SZ 4
  3206. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3207. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3208. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3211. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3212. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3213. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3214. do { \
  3215. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3216. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3217. } while (0)
  3218. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3219. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3220. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3221. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3222. do { \
  3223. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3224. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3225. } while (0)
  3226. /**
  3227. * @brief host -> target HTT configure max amsdu info per vdev
  3228. *
  3229. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3230. *
  3231. * @details
  3232. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3233. *
  3234. * |31 21|20 16|15 8|7 0|
  3235. * |-----------------------------------------------------------|
  3236. * | reserved | vdev id | max amsdu | msg type |
  3237. * |-----------------------------------------------------------|
  3238. * Header fields:
  3239. * - MSG_TYPE
  3240. * Bits 7:0
  3241. * Purpose: identifies this as a aggr cfg ex message
  3242. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3243. * - MAX_NUM_AMSDU_SUBFRM
  3244. * Bits 15:8
  3245. * Purpose: max MSDUs per A-MSDU
  3246. * - VDEV_ID
  3247. * Bits 20:16
  3248. * Purpose: ID of the vdev to which this limit is applied
  3249. */
  3250. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3251. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3252. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3253. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3254. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3255. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3256. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3257. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3258. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3259. do { \
  3260. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3261. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3262. } while (0)
  3263. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3264. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3265. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3266. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3267. do { \
  3268. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3269. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3270. } while (0)
  3271. /**
  3272. * @brief HTT WDI_IPA Config Message
  3273. *
  3274. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3275. *
  3276. * @details
  3277. * The HTT WDI_IPA config message is created/sent by host at driver
  3278. * init time. It contains information about data structures used on
  3279. * WDI_IPA TX and RX path.
  3280. * TX CE ring is used for pushing packet metadata from IPA uC
  3281. * to WLAN FW
  3282. * TX Completion ring is used for generating TX completions from
  3283. * WLAN FW to IPA uC
  3284. * RX Indication ring is used for indicating RX packets from FW
  3285. * to IPA uC
  3286. * RX Ring2 is used as either completion ring or as second
  3287. * indication ring. when Ring2 is used as completion ring, IPA uC
  3288. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3289. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3290. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3291. * indicated in RX Indication ring. Please see WDI_IPA specification
  3292. * for more details.
  3293. * |31 24|23 16|15 8|7 0|
  3294. * |----------------+----------------+----------------+----------------|
  3295. * | tx pkt pool size | Rsvd | msg_type |
  3296. * |-------------------------------------------------------------------|
  3297. * | tx comp ring base (bits 31:0) |
  3298. #if HTT_PADDR64
  3299. * | tx comp ring base (bits 63:32) |
  3300. #endif
  3301. * |-------------------------------------------------------------------|
  3302. * | tx comp ring size |
  3303. * |-------------------------------------------------------------------|
  3304. * | tx comp WR_IDX physical address (bits 31:0) |
  3305. #if HTT_PADDR64
  3306. * | tx comp WR_IDX physical address (bits 63:32) |
  3307. #endif
  3308. * |-------------------------------------------------------------------|
  3309. * | tx CE WR_IDX physical address (bits 31:0) |
  3310. #if HTT_PADDR64
  3311. * | tx CE WR_IDX physical address (bits 63:32) |
  3312. #endif
  3313. * |-------------------------------------------------------------------|
  3314. * | rx indication ring base (bits 31:0) |
  3315. #if HTT_PADDR64
  3316. * | rx indication ring base (bits 63:32) |
  3317. #endif
  3318. * |-------------------------------------------------------------------|
  3319. * | rx indication ring size |
  3320. * |-------------------------------------------------------------------|
  3321. * | rx ind RD_IDX physical address (bits 31:0) |
  3322. #if HTT_PADDR64
  3323. * | rx ind RD_IDX physical address (bits 63:32) |
  3324. #endif
  3325. * |-------------------------------------------------------------------|
  3326. * | rx ind WR_IDX physical address (bits 31:0) |
  3327. #if HTT_PADDR64
  3328. * | rx ind WR_IDX physical address (bits 63:32) |
  3329. #endif
  3330. * |-------------------------------------------------------------------|
  3331. * |-------------------------------------------------------------------|
  3332. * | rx ring2 base (bits 31:0) |
  3333. #if HTT_PADDR64
  3334. * | rx ring2 base (bits 63:32) |
  3335. #endif
  3336. * |-------------------------------------------------------------------|
  3337. * | rx ring2 size |
  3338. * |-------------------------------------------------------------------|
  3339. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3340. #if HTT_PADDR64
  3341. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3342. #endif
  3343. * |-------------------------------------------------------------------|
  3344. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3345. #if HTT_PADDR64
  3346. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3347. #endif
  3348. * |-------------------------------------------------------------------|
  3349. *
  3350. * Header fields:
  3351. * Header fields:
  3352. * - MSG_TYPE
  3353. * Bits 7:0
  3354. * Purpose: Identifies this as WDI_IPA config message
  3355. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3356. * - TX_PKT_POOL_SIZE
  3357. * Bits 15:0
  3358. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3359. * WDI_IPA TX path
  3360. * For systems using 32-bit format for bus addresses:
  3361. * - TX_COMP_RING_BASE_ADDR
  3362. * Bits 31:0
  3363. * Purpose: TX Completion Ring base address in DDR
  3364. * - TX_COMP_RING_SIZE
  3365. * Bits 31:0
  3366. * Purpose: TX Completion Ring size (must be power of 2)
  3367. * - TX_COMP_WR_IDX_ADDR
  3368. * Bits 31:0
  3369. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3370. * updates the Write Index for WDI_IPA TX completion ring
  3371. * - TX_CE_WR_IDX_ADDR
  3372. * Bits 31:0
  3373. * Purpose: DDR address where IPA uC
  3374. * updates the WR Index for TX CE ring
  3375. * (needed for fusion platforms)
  3376. * - RX_IND_RING_BASE_ADDR
  3377. * Bits 31:0
  3378. * Purpose: RX Indication Ring base address in DDR
  3379. * - RX_IND_RING_SIZE
  3380. * Bits 31:0
  3381. * Purpose: RX Indication Ring size
  3382. * - RX_IND_RD_IDX_ADDR
  3383. * Bits 31:0
  3384. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3385. * RX indication ring
  3386. * - RX_IND_WR_IDX_ADDR
  3387. * Bits 31:0
  3388. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3389. * updates the Write Index for WDI_IPA RX indication ring
  3390. * - RX_RING2_BASE_ADDR
  3391. * Bits 31:0
  3392. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3393. * - RX_RING2_SIZE
  3394. * Bits 31:0
  3395. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3396. * - RX_RING2_RD_IDX_ADDR
  3397. * Bits 31:0
  3398. * Purpose: If Second RX ring is Indication ring, DDR address where
  3399. * IPA uC updates the Read Index for Ring2.
  3400. * If Second RX ring is completion ring, this is NOT used
  3401. * - RX_RING2_WR_IDX_ADDR
  3402. * Bits 31:0
  3403. * Purpose: If Second RX ring is Indication ring, DDR address where
  3404. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3405. * If second RX ring is completion ring, DDR address where
  3406. * IPA uC updates the Write Index for Ring 2.
  3407. * For systems using 64-bit format for bus addresses:
  3408. * - TX_COMP_RING_BASE_ADDR_LO
  3409. * Bits 31:0
  3410. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3411. * - TX_COMP_RING_BASE_ADDR_HI
  3412. * Bits 31:0
  3413. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3414. * - TX_COMP_RING_SIZE
  3415. * Bits 31:0
  3416. * Purpose: TX Completion Ring size (must be power of 2)
  3417. * - TX_COMP_WR_IDX_ADDR_LO
  3418. * Bits 31:0
  3419. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3420. * Lower 4 bytes of DDR address where WIFI FW
  3421. * updates the Write Index for WDI_IPA TX completion ring
  3422. * - TX_COMP_WR_IDX_ADDR_HI
  3423. * Bits 31:0
  3424. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3425. * Higher 4 bytes of DDR address where WIFI FW
  3426. * updates the Write Index for WDI_IPA TX completion ring
  3427. * - TX_CE_WR_IDX_ADDR_LO
  3428. * Bits 31:0
  3429. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3430. * updates the WR Index for TX CE ring
  3431. * (needed for fusion platforms)
  3432. * - TX_CE_WR_IDX_ADDR_HI
  3433. * Bits 31:0
  3434. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3435. * updates the WR Index for TX CE ring
  3436. * (needed for fusion platforms)
  3437. * - RX_IND_RING_BASE_ADDR_LO
  3438. * Bits 31:0
  3439. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3440. * - RX_IND_RING_BASE_ADDR_HI
  3441. * Bits 31:0
  3442. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3443. * - RX_IND_RING_SIZE
  3444. * Bits 31:0
  3445. * Purpose: RX Indication Ring size
  3446. * - RX_IND_RD_IDX_ADDR_LO
  3447. * Bits 31:0
  3448. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3449. * for WDI_IPA RX indication ring
  3450. * - RX_IND_RD_IDX_ADDR_HI
  3451. * Bits 31:0
  3452. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3453. * for WDI_IPA RX indication ring
  3454. * - RX_IND_WR_IDX_ADDR_LO
  3455. * Bits 31:0
  3456. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3457. * Lower 4 bytes of DDR address where WIFI FW
  3458. * updates the Write Index for WDI_IPA RX indication ring
  3459. * - RX_IND_WR_IDX_ADDR_HI
  3460. * Bits 31:0
  3461. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3462. * Higher 4 bytes of DDR address where WIFI FW
  3463. * updates the Write Index for WDI_IPA RX indication ring
  3464. * - RX_RING2_BASE_ADDR_LO
  3465. * Bits 31:0
  3466. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3467. * - RX_RING2_BASE_ADDR_HI
  3468. * Bits 31:0
  3469. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3470. * - RX_RING2_SIZE
  3471. * Bits 31:0
  3472. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3473. * - RX_RING2_RD_IDX_ADDR_LO
  3474. * Bits 31:0
  3475. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3476. * DDR address where IPA uC updates the Read Index for Ring2.
  3477. * If Second RX ring is completion ring, this is NOT used
  3478. * - RX_RING2_RD_IDX_ADDR_HI
  3479. * Bits 31:0
  3480. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3481. * DDR address where IPA uC updates the Read Index for Ring2.
  3482. * If Second RX ring is completion ring, this is NOT used
  3483. * - RX_RING2_WR_IDX_ADDR_LO
  3484. * Bits 31:0
  3485. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3486. * DDR address where WIFI FW updates the Write Index
  3487. * for WDI_IPA RX ring2
  3488. * If second RX ring is completion ring, lower 4 bytes of
  3489. * DDR address where IPA uC updates the Write Index for Ring 2.
  3490. * - RX_RING2_WR_IDX_ADDR_HI
  3491. * Bits 31:0
  3492. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3493. * DDR address where WIFI FW updates the Write Index
  3494. * for WDI_IPA RX ring2
  3495. * If second RX ring is completion ring, higher 4 bytes of
  3496. * DDR address where IPA uC updates the Write Index for Ring 2.
  3497. */
  3498. #if HTT_PADDR64
  3499. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3500. #else
  3501. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3502. #endif
  3503. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3504. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3523. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3537. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3538. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3542. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3543. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3544. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3562. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3563. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3564. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3565. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3567. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3571. } while (0)
  3572. /* for systems using 32-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3575. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3579. } while (0)
  3580. /* for systems using 64-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3587. } while (0)
  3588. /* for systems using 64-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3595. } while (0)
  3596. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3598. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3602. } while (0)
  3603. /* for systems using 32-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3606. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3614. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3618. } while (0)
  3619. /* for systems using 64-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3622. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3626. } while (0)
  3627. /* for systems using 32-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3630. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3634. } while (0)
  3635. /* for systems using 64-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3638. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3642. } while (0)
  3643. /* for systems using 64-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3646. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3650. } while (0)
  3651. /* for systems using 32-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3654. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3658. } while (0)
  3659. /* for systems using 64-bit format for bus addr */
  3660. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3666. } while (0)
  3667. /* for systems using 64-bit format for bus addr */
  3668. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3674. } while (0)
  3675. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3677. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3681. } while (0)
  3682. /* for systems using 32-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3685. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3689. } while (0)
  3690. /* for systems using 64-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3693. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3697. } while (0)
  3698. /* for systems using 64-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3701. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3705. } while (0)
  3706. /* for systems using 32-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3709. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3713. } while (0)
  3714. /* for systems using 64-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3717. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3721. } while (0)
  3722. /* for systems using 64-bit format for bus addr */
  3723. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3724. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3725. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3728. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3729. } while (0)
  3730. /* for systems using 32-bit format for bus addr */
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3732. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3736. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3737. } while (0)
  3738. /* for systems using 64-bit format for bus addr */
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3740. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3742. do { \
  3743. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3744. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3745. } while (0)
  3746. /* for systems using 64-bit format for bus addr */
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3748. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3752. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3753. } while (0)
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3755. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3759. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3760. } while (0)
  3761. /* for systems using 32-bit format for bus addr */
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3764. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3768. } while (0)
  3769. /* for systems using 64-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3772. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3776. } while (0)
  3777. /* for systems using 64-bit format for bus addr */
  3778. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3779. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3780. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3783. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3784. } while (0)
  3785. /* for systems using 32-bit format for bus addr */
  3786. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3787. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3788. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3789. do { \
  3790. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3791. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3792. } while (0)
  3793. /* for systems using 64-bit format for bus addr */
  3794. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3795. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3796. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3797. do { \
  3798. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3799. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3800. } while (0)
  3801. /* for systems using 64-bit format for bus addr */
  3802. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3803. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3804. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3805. do { \
  3806. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3807. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3808. } while (0)
  3809. /*
  3810. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3811. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3812. * addresses are stored in a XXX-bit field.
  3813. * This macro is used to define both htt_wdi_ipa_config32_t and
  3814. * htt_wdi_ipa_config64_t structs.
  3815. */
  3816. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3817. _paddr__tx_comp_ring_base_addr_, \
  3818. _paddr__tx_comp_wr_idx_addr_, \
  3819. _paddr__tx_ce_wr_idx_addr_, \
  3820. _paddr__rx_ind_ring_base_addr_, \
  3821. _paddr__rx_ind_rd_idx_addr_, \
  3822. _paddr__rx_ind_wr_idx_addr_, \
  3823. _paddr__rx_ring2_base_addr_,\
  3824. _paddr__rx_ring2_rd_idx_addr_,\
  3825. _paddr__rx_ring2_wr_idx_addr_) \
  3826. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3827. { \
  3828. /* DWORD 0: flags and meta-data */ \
  3829. A_UINT32 \
  3830. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3831. reserved: 8, \
  3832. tx_pkt_pool_size: 16;\
  3833. /* DWORD 1 */\
  3834. _paddr__tx_comp_ring_base_addr_;\
  3835. /* DWORD 2 (or 3)*/\
  3836. A_UINT32 tx_comp_ring_size;\
  3837. /* DWORD 3 (or 4)*/\
  3838. _paddr__tx_comp_wr_idx_addr_;\
  3839. /* DWORD 4 (or 6)*/\
  3840. _paddr__tx_ce_wr_idx_addr_;\
  3841. /* DWORD 5 (or 8)*/\
  3842. _paddr__rx_ind_ring_base_addr_;\
  3843. /* DWORD 6 (or 10)*/\
  3844. A_UINT32 rx_ind_ring_size;\
  3845. /* DWORD 7 (or 11)*/\
  3846. _paddr__rx_ind_rd_idx_addr_;\
  3847. /* DWORD 8 (or 13)*/\
  3848. _paddr__rx_ind_wr_idx_addr_;\
  3849. /* DWORD 9 (or 15)*/\
  3850. _paddr__rx_ring2_base_addr_;\
  3851. /* DWORD 10 (or 17) */\
  3852. A_UINT32 rx_ring2_size;\
  3853. /* DWORD 11 (or 18) */\
  3854. _paddr__rx_ring2_rd_idx_addr_;\
  3855. /* DWORD 12 (or 20) */\
  3856. _paddr__rx_ring2_wr_idx_addr_;\
  3857. } POSTPACK
  3858. /* define a htt_wdi_ipa_config32_t type */
  3859. 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));
  3860. /* define a htt_wdi_ipa_config64_t type */
  3861. 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));
  3862. #if HTT_PADDR64
  3863. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3864. #else
  3865. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3866. #endif
  3867. enum htt_wdi_ipa_op_code {
  3868. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3869. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3870. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3871. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3872. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3873. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3874. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3875. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3876. /* keep this last */
  3877. HTT_WDI_IPA_OPCODE_MAX
  3878. };
  3879. /**
  3880. * @brief HTT WDI_IPA Operation Request Message
  3881. *
  3882. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  3883. *
  3884. * @details
  3885. * HTT WDI_IPA Operation Request message is sent by host
  3886. * to either suspend or resume WDI_IPA TX or RX path.
  3887. * |31 24|23 16|15 8|7 0|
  3888. * |----------------+----------------+----------------+----------------|
  3889. * | op_code | Rsvd | msg_type |
  3890. * |-------------------------------------------------------------------|
  3891. *
  3892. * Header fields:
  3893. * - MSG_TYPE
  3894. * Bits 7:0
  3895. * Purpose: Identifies this as WDI_IPA Operation Request message
  3896. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  3897. * - OP_CODE
  3898. * Bits 31:16
  3899. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3900. * value: = enum htt_wdi_ipa_op_code
  3901. */
  3902. PREPACK struct htt_wdi_ipa_op_request_t
  3903. {
  3904. /* DWORD 0: flags and meta-data */
  3905. A_UINT32
  3906. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3907. reserved: 8,
  3908. op_code: 16;
  3909. } POSTPACK;
  3910. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3911. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3912. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3913. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3914. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3915. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3916. do { \
  3917. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3918. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3919. } while (0)
  3920. /*
  3921. * @brief host -> target HTT_SRING_SETUP message
  3922. *
  3923. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  3924. *
  3925. * @details
  3926. * After target is booted up, Host can send SRING setup message for
  3927. * each host facing LMAC SRING. Target setups up HW registers based
  3928. * on setup message and confirms back to Host if response_required is set.
  3929. * Host should wait for confirmation message before sending new SRING
  3930. * setup message
  3931. *
  3932. * The message would appear as follows:
  3933. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3934. * |--------------- +-----------------+-----------------+-----------------|
  3935. * | ring_type | ring_id | pdev_id | msg_type |
  3936. * |----------------------------------------------------------------------|
  3937. * | ring_base_addr_lo |
  3938. * |----------------------------------------------------------------------|
  3939. * | ring_base_addr_hi |
  3940. * |----------------------------------------------------------------------|
  3941. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3942. * |----------------------------------------------------------------------|
  3943. * | ring_head_offset32_remote_addr_lo |
  3944. * |----------------------------------------------------------------------|
  3945. * | ring_head_offset32_remote_addr_hi |
  3946. * |----------------------------------------------------------------------|
  3947. * | ring_tail_offset32_remote_addr_lo |
  3948. * |----------------------------------------------------------------------|
  3949. * | ring_tail_offset32_remote_addr_hi |
  3950. * |----------------------------------------------------------------------|
  3951. * | ring_msi_addr_lo |
  3952. * |----------------------------------------------------------------------|
  3953. * | ring_msi_addr_hi |
  3954. * |----------------------------------------------------------------------|
  3955. * | ring_msi_data |
  3956. * |----------------------------------------------------------------------|
  3957. * | intr_timer_th |IM| intr_batch_counter_th |
  3958. * |----------------------------------------------------------------------|
  3959. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3960. * |----------------------------------------------------------------------|
  3961. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3962. * |----------------------------------------------------------------------|
  3963. * Where
  3964. * IM = sw_intr_mode
  3965. * RR = response_required
  3966. * PTCF = prefetch_timer_cfg
  3967. * IP = IPA drop flag
  3968. *
  3969. * The message is interpreted as follows:
  3970. * dword0 - b'0:7 - msg_type: This will be set to
  3971. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  3972. * b'8:15 - pdev_id:
  3973. * 0 (for rings at SOC/UMAC level),
  3974. * 1/2/3 mac id (for rings at LMAC level)
  3975. * b'16:23 - ring_id: identify which ring is to setup,
  3976. * more details can be got from enum htt_srng_ring_id
  3977. * b'24:31 - ring_type: identify type of host rings,
  3978. * more details can be got from enum htt_srng_ring_type
  3979. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3980. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3981. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3982. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3983. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3984. * SW_TO_HW_RING.
  3985. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3986. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3987. * Lower 32 bits of memory address of the remote variable
  3988. * storing the 4-byte word offset that identifies the head
  3989. * element within the ring.
  3990. * (The head offset variable has type A_UINT32.)
  3991. * Valid for HW_TO_SW and SW_TO_SW rings.
  3992. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3993. * Upper 32 bits of memory address of the remote variable
  3994. * storing the 4-byte word offset that identifies the head
  3995. * element within the ring.
  3996. * (The head offset variable has type A_UINT32.)
  3997. * Valid for HW_TO_SW and SW_TO_SW rings.
  3998. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3999. * Lower 32 bits of memory address of the remote variable
  4000. * storing the 4-byte word offset that identifies the tail
  4001. * element within the ring.
  4002. * (The tail offset variable has type A_UINT32.)
  4003. * Valid for HW_TO_SW and SW_TO_SW rings.
  4004. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4005. * Upper 32 bits of memory address of the remote variable
  4006. * storing the 4-byte word offset that identifies the tail
  4007. * element within the ring.
  4008. * (The tail offset variable has type A_UINT32.)
  4009. * Valid for HW_TO_SW and SW_TO_SW rings.
  4010. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4011. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4012. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4013. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4014. * dword10 - b'0:31 - ring_msi_data: MSI data
  4015. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4016. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4017. * dword11 - b'0:14 - intr_batch_counter_th:
  4018. * batch counter threshold is in units of 4-byte words.
  4019. * HW internally maintains and increments batch count.
  4020. * (see SRING spec for detail description).
  4021. * When batch count reaches threshold value, an interrupt
  4022. * is generated by HW.
  4023. * b'15 - sw_intr_mode:
  4024. * This configuration shall be static.
  4025. * Only programmed at power up.
  4026. * 0: generate pulse style sw interrupts
  4027. * 1: generate level style sw interrupts
  4028. * b'16:31 - intr_timer_th:
  4029. * The timer init value when timer is idle or is
  4030. * initialized to start downcounting.
  4031. * In 8us units (to cover a range of 0 to 524 ms)
  4032. * dword12 - b'0:15 - intr_low_threshold:
  4033. * Used only by Consumer ring to generate ring_sw_int_p.
  4034. * Ring entries low threshold water mark, that is used
  4035. * in combination with the interrupt timer as well as
  4036. * the the clearing of the level interrupt.
  4037. * b'16:18 - prefetch_timer_cfg:
  4038. * Used only by Consumer ring to set timer mode to
  4039. * support Application prefetch handling.
  4040. * The external tail offset/pointer will be updated
  4041. * at following intervals:
  4042. * 3'b000: (Prefetch feature disabled; used only for debug)
  4043. * 3'b001: 1 usec
  4044. * 3'b010: 4 usec
  4045. * 3'b011: 8 usec (default)
  4046. * 3'b100: 16 usec
  4047. * Others: Reserverd
  4048. * b'19 - response_required:
  4049. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4050. * b'20 - ipa_drop_flag:
  4051. Indicates that host will config ipa drop threshold percentage
  4052. * b'21:31 - reserved: reserved for future use
  4053. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4054. * b'8:15 - ipa drop high threshold percentage:
  4055. * b'16:31 - Reserved
  4056. */
  4057. PREPACK struct htt_sring_setup_t {
  4058. A_UINT32 msg_type: 8,
  4059. pdev_id: 8,
  4060. ring_id: 8,
  4061. ring_type: 8;
  4062. A_UINT32 ring_base_addr_lo;
  4063. A_UINT32 ring_base_addr_hi;
  4064. A_UINT32 ring_size: 16,
  4065. ring_entry_size: 8,
  4066. ring_misc_cfg_flag: 8;
  4067. A_UINT32 ring_head_offset32_remote_addr_lo;
  4068. A_UINT32 ring_head_offset32_remote_addr_hi;
  4069. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4070. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4071. A_UINT32 ring_msi_addr_lo;
  4072. A_UINT32 ring_msi_addr_hi;
  4073. A_UINT32 ring_msi_data;
  4074. A_UINT32 intr_batch_counter_th: 15,
  4075. sw_intr_mode: 1,
  4076. intr_timer_th: 16;
  4077. A_UINT32 intr_low_threshold: 16,
  4078. prefetch_timer_cfg: 3,
  4079. response_required: 1,
  4080. ipa_drop_flag: 1,
  4081. reserved1: 11;
  4082. A_UINT32 ipa_drop_low_threshold: 8,
  4083. ipa_drop_high_threshold: 8,
  4084. reserved: 16;
  4085. } POSTPACK;
  4086. enum htt_srng_ring_type {
  4087. HTT_HW_TO_SW_RING = 0,
  4088. HTT_SW_TO_HW_RING,
  4089. HTT_SW_TO_SW_RING,
  4090. /* Insert new ring types above this line */
  4091. };
  4092. enum htt_srng_ring_id {
  4093. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4094. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4095. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4096. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4097. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4098. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4099. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4100. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4101. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4102. /* Add Other SRING which can't be directly configured by host software above this line */
  4103. };
  4104. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4105. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4106. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4107. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4109. HTT_SRING_SETUP_PDEV_ID_S)
  4110. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4113. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4114. } while (0)
  4115. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4116. #define HTT_SRING_SETUP_RING_ID_S 16
  4117. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4119. HTT_SRING_SETUP_RING_ID_S)
  4120. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4124. } while (0)
  4125. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4126. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4127. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4129. HTT_SRING_SETUP_RING_TYPE_S)
  4130. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4134. } while (0)
  4135. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4136. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4137. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4138. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4139. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4140. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4143. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4144. } while (0)
  4145. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4146. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4147. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4149. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4150. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4156. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4157. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4159. HTT_SRING_SETUP_RING_SIZE_S)
  4160. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4164. } while (0)
  4165. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4166. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4167. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4169. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4170. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4174. } while (0)
  4175. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4176. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4177. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4179. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4180. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4184. } while (0)
  4185. /* This control bit is applicable to only Producer, which updates Ring ID field
  4186. * of each descriptor before pushing into the ring.
  4187. * 0: updates ring_id(default)
  4188. * 1: ring_id updating disabled */
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4190. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4192. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4193. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4194. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4197. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4198. } while (0)
  4199. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4200. * of each descriptor before pushing into the ring.
  4201. * 0: updates Loopcnt(default)
  4202. * 1: Loopcnt updating disabled */
  4203. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4206. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4207. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4211. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4212. } while (0)
  4213. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4214. * into security_id port of GXI/AXI. */
  4215. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4216. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4217. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4218. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4219. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4223. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4224. } while (0)
  4225. /* During MSI write operation, SRNG drives value of this register bit into
  4226. * swap bit of GXI/AXI. */
  4227. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4228. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4230. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4231. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4232. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4235. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4236. } while (0)
  4237. /* During Pointer write operation, SRNG drives value of this register bit into
  4238. * swap bit of GXI/AXI. */
  4239. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4240. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4241. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4242. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4243. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4244. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4247. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4248. } while (0)
  4249. /* During any data or TLV write operation, SRNG drives value of this register
  4250. * bit into swap bit of GXI/AXI. */
  4251. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4252. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4253. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4254. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4255. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4256. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4259. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4260. } while (0)
  4261. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4262. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4263. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4264. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4265. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4266. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4267. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4268. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4271. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4272. } while (0)
  4273. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4274. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4275. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4276. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4277. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4278. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4281. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4282. } while (0)
  4283. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4284. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4285. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4286. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4287. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4288. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4291. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4292. } while (0)
  4293. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4294. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4295. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4296. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4297. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4298. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4301. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4302. } while (0)
  4303. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4304. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4305. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4306. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4307. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4308. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4311. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4312. } while (0)
  4313. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4314. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4315. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4316. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4317. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4318. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4321. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4322. } while (0)
  4323. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4324. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4325. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4326. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4327. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4328. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4331. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4332. } while (0)
  4333. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4334. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4335. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4336. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4337. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4338. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4341. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4342. } while (0)
  4343. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4344. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4345. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4346. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4347. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4348. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4351. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4352. } while (0)
  4353. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4354. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4355. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4356. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4357. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4358. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4359. do { \
  4360. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4361. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4362. } while (0)
  4363. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4364. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4365. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4366. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4367. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4368. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4369. do { \
  4370. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4371. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4372. } while (0)
  4373. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4374. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4375. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4376. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4377. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4378. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4379. do { \
  4380. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4381. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4382. } while (0)
  4383. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4384. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4385. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4386. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4387. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4388. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4389. do { \
  4390. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4391. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4392. } while (0)
  4393. /**
  4394. * @brief host -> target RX ring selection config message
  4395. *
  4396. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4397. *
  4398. * @details
  4399. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4400. * configure RXDMA rings.
  4401. * The configuration is per ring based and includes both packet subtypes
  4402. * and PPDU/MPDU TLVs.
  4403. *
  4404. * The message would appear as follows:
  4405. *
  4406. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4407. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4408. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4409. * |-------------------------------------------------------------------|
  4410. * | rsvd2 | ring_buffer_size |
  4411. * |-------------------------------------------------------------------|
  4412. * | packet_type_enable_flags_0 |
  4413. * |-------------------------------------------------------------------|
  4414. * | packet_type_enable_flags_1 |
  4415. * |-------------------------------------------------------------------|
  4416. * | packet_type_enable_flags_2 |
  4417. * |-------------------------------------------------------------------|
  4418. * | packet_type_enable_flags_3 |
  4419. * |-------------------------------------------------------------------|
  4420. * | tlv_filter_in_flags |
  4421. * |-------------------------------------------------------------------|
  4422. * | rx_header_offset | rx_packet_offset |
  4423. * |-------------------------------------------------------------------|
  4424. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4425. * |-------------------------------------------------------------------|
  4426. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4427. * |-------------------------------------------------------------------|
  4428. * | rsvd3 | rx_attention_offset |
  4429. * |-------------------------------------------------------------------|
  4430. * | rsvd4 | mo| fp| rx_drop_threshold |
  4431. * | |ndp|ndp| |
  4432. * |-------------------------------------------------------------------|
  4433. * Where:
  4434. * PS = pkt_swap
  4435. * SS = status_swap
  4436. * OV = rx_offsets_valid
  4437. * DT = drop_thresh_valid
  4438. * The message is interpreted as follows:
  4439. * dword0 - b'0:7 - msg_type: This will be set to
  4440. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4441. * b'8:15 - pdev_id:
  4442. * 0 (for rings at SOC/UMAC level),
  4443. * 1/2/3 mac id (for rings at LMAC level)
  4444. * b'16:23 - ring_id : Identify the ring to configure.
  4445. * More details can be got from enum htt_srng_ring_id
  4446. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4447. * BUF_RING_CFG_0 defs within HW .h files,
  4448. * e.g. wmac_top_reg_seq_hwioreg.h
  4449. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4450. * BUF_RING_CFG_0 defs within HW .h files,
  4451. * e.g. wmac_top_reg_seq_hwioreg.h
  4452. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4453. * configuration fields are valid
  4454. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4455. * rx_drop_threshold field is valid
  4456. * b'28:31 - rsvd1: reserved for future use
  4457. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4458. * in byte units.
  4459. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4460. * - b'16:31 - rsvd2: Reserved for future use
  4461. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4462. * Enable MGMT packet from 0b0000 to 0b1001
  4463. * bits from low to high: FP, MD, MO - 3 bits
  4464. * FP: Filter_Pass
  4465. * MD: Monitor_Direct
  4466. * MO: Monitor_Other
  4467. * 10 mgmt subtypes * 3 bits -> 30 bits
  4468. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4469. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4470. * Enable MGMT packet from 0b1010 to 0b1111
  4471. * bits from low to high: FP, MD, MO - 3 bits
  4472. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4473. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4474. * Enable CTRL packet from 0b0000 to 0b1001
  4475. * bits from low to high: FP, MD, MO - 3 bits
  4476. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4477. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4478. * Enable CTRL packet from 0b1010 to 0b1111,
  4479. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4480. * bits from low to high: FP, MD, MO - 3 bits
  4481. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4482. * dword6 - b'0:31 - tlv_filter_in_flags:
  4483. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4484. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4485. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4486. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4487. * A value of 0 will be considered as ignore this config.
  4488. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4489. * e.g. wmac_top_reg_seq_hwioreg.h
  4490. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4491. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4492. * A value of 0 will be considered as ignore this config.
  4493. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4494. * e.g. wmac_top_reg_seq_hwioreg.h
  4495. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4496. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4497. * A value of 0 will be considered as ignore this config.
  4498. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4499. * e.g. wmac_top_reg_seq_hwioreg.h
  4500. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4501. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4502. * A value of 0 will be considered as ignore this config.
  4503. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4504. * e.g. wmac_top_reg_seq_hwioreg.h
  4505. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4506. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4507. * A value of 0 will be considered as ignore this config.
  4508. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4509. * e.g. wmac_top_reg_seq_hwioreg.h
  4510. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4511. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4512. * A value of 0 will be considered as ignore this config.
  4513. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4514. * e.g. wmac_top_reg_seq_hwioreg.h
  4515. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4516. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4517. * A value of 0 will be considered as ignore this config.
  4518. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4519. * e.g. wmac_top_reg_seq_hwioreg.h
  4520. * - b'16:31 - rsvd3 for future use
  4521. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4522. * to source rings. Consumer drops packets if the available
  4523. * words in the ring falls below the configured threshold
  4524. * value.
  4525. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4526. * by host. 1 -> subscribed
  4527. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4528. * by host. 1 -> subscribed
  4529. */
  4530. PREPACK struct htt_rx_ring_selection_cfg_t {
  4531. A_UINT32 msg_type: 8,
  4532. pdev_id: 8,
  4533. ring_id: 8,
  4534. status_swap: 1,
  4535. pkt_swap: 1,
  4536. rx_offsets_valid: 1,
  4537. drop_thresh_valid: 1,
  4538. rsvd1: 4;
  4539. A_UINT32 ring_buffer_size: 16,
  4540. rsvd2: 16;
  4541. A_UINT32 packet_type_enable_flags_0;
  4542. A_UINT32 packet_type_enable_flags_1;
  4543. A_UINT32 packet_type_enable_flags_2;
  4544. A_UINT32 packet_type_enable_flags_3;
  4545. A_UINT32 tlv_filter_in_flags;
  4546. A_UINT32 rx_packet_offset: 16,
  4547. rx_header_offset: 16;
  4548. A_UINT32 rx_mpdu_end_offset: 16,
  4549. rx_mpdu_start_offset: 16;
  4550. A_UINT32 rx_msdu_end_offset: 16,
  4551. rx_msdu_start_offset: 16;
  4552. A_UINT32 rx_attn_offset: 16,
  4553. rsvd3: 16;
  4554. A_UINT32 rx_drop_threshold: 10,
  4555. fp_ndp: 1,
  4556. mo_ndp: 1,
  4557. rsvd4: 20;
  4558. } POSTPACK;
  4559. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4560. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4561. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4562. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4563. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4564. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4565. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4566. do { \
  4567. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4568. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4569. } while (0)
  4570. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4571. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4572. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4573. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4574. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4575. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4576. do { \
  4577. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4578. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4579. } while (0)
  4580. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4581. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4582. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4583. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4584. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4585. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4586. do { \
  4587. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4588. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4589. } while (0)
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4593. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4594. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4596. do { \
  4597. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4598. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4599. } while (0)
  4600. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4602. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4603. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4604. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4605. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4606. do { \
  4607. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4608. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4609. } while (0)
  4610. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4611. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4612. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4613. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4614. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4615. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4616. do { \
  4617. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4618. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4619. } while (0)
  4620. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4621. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4622. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4623. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4624. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4625. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4626. do { \
  4627. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4628. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4629. } while (0)
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4633. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4634. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4636. do { \
  4637. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4638. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4639. } while (0)
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4643. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4644. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4646. do { \
  4647. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4648. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4649. } while (0)
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4653. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4654. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4656. do { \
  4657. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4658. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4659. } while (0)
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4663. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4664. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4666. do { \
  4667. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4668. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4669. } while (0)
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4673. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4674. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4675. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4676. do { \
  4677. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4678. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4679. } while (0)
  4680. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4683. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4684. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4686. do { \
  4687. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4688. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4689. } while (0)
  4690. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4693. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4694. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4696. do { \
  4697. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4698. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4699. } while (0)
  4700. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4703. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4704. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4706. do { \
  4707. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4708. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4709. } while (0)
  4710. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4713. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4714. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4716. do { \
  4717. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4718. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4719. } while (0)
  4720. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4723. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4724. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4725. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4726. do { \
  4727. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4728. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4729. } while (0)
  4730. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4733. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4734. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4735. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4736. do { \
  4737. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4738. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4739. } while (0)
  4740. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4741. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4742. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4743. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4744. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4745. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4746. do { \
  4747. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4748. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4749. } while (0)
  4750. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4751. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4752. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4753. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4754. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4755. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4756. do { \
  4757. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4758. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4759. } while (0)
  4760. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4761. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4762. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4763. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4764. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4765. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4768. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4769. } while (0)
  4770. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4771. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4772. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4773. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4774. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4775. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4776. do { \
  4777. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4778. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4779. } while (0)
  4780. /*
  4781. * Subtype based MGMT frames enable bits.
  4782. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4783. */
  4784. /* association request */
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4791. /* association response */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4798. /* Reassociation request */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4805. /* Reassociation response */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4812. /* Probe request */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4819. /* Probe response */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4826. /* Timing Advertisement */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4833. /* Reserved */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4840. /* Beacon */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4847. /* ATIM */
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4854. /* Disassociation */
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4861. /* Authentication */
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4868. /* Deauthentication */
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4875. /* Action */
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4882. /* Action No Ack */
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4889. /* Reserved */
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4896. /*
  4897. * Subtype based CTRL frames enable bits.
  4898. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4899. */
  4900. /* Reserved */
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4907. /* Reserved */
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4914. /* Reserved */
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4921. /* Reserved */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4928. /* Reserved */
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4935. /* Reserved */
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4942. /* Reserved */
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4949. /* Control Wrapper */
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4956. /* Block Ack Request */
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4963. /* Block Ack*/
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4970. /* PS-POLL */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4977. /* RTS */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4984. /* CTS */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4991. /* ACK */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4998. /* CF-END */
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5005. /* CF-END + CF-ACK */
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5012. /* Multicast data */
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5019. /* Unicast data */
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5026. /* NULL data */
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5034. do { \
  5035. HTT_CHECK_SET_VAL(httsym, value); \
  5036. (word) |= (value) << httsym##_S; \
  5037. } while (0)
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5039. (((word) & httsym##_M) >> httsym##_S)
  5040. #define htt_rx_ring_pkt_enable_subtype_set( \
  5041. word, flag, mode, type, subtype, val) \
  5042. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5043. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5044. #define htt_rx_ring_pkt_enable_subtype_get( \
  5045. word, flag, mode, type, subtype) \
  5046. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5047. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5048. /* Definition to filter in TLVs */
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5070. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5071. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5072. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5073. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5074. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5075. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5076. do { \
  5077. HTT_CHECK_SET_VAL(httsym, enable); \
  5078. (word) |= (enable) << httsym##_S; \
  5079. } while (0)
  5080. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5081. (((word) & httsym##_M) >> httsym##_S)
  5082. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5083. HTT_RX_RING_TLV_ENABLE_SET( \
  5084. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5085. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5086. HTT_RX_RING_TLV_ENABLE_GET( \
  5087. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5088. /**
  5089. * @brief host --> target Receive Flow Steering configuration message definition
  5090. *
  5091. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5092. *
  5093. * host --> target Receive Flow Steering configuration message definition.
  5094. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5095. * The reason for this is we want RFS to be configured and ready before MAC
  5096. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5097. *
  5098. * |31 24|23 16|15 9|8|7 0|
  5099. * |----------------+----------------+----------------+----------------|
  5100. * | reserved |E| msg type |
  5101. * |-------------------------------------------------------------------|
  5102. * Where E = RFS enable flag
  5103. *
  5104. * The RFS_CONFIG message consists of a single 4-byte word.
  5105. *
  5106. * Header fields:
  5107. * - MSG_TYPE
  5108. * Bits 7:0
  5109. * Purpose: identifies this as a RFS config msg
  5110. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5111. * - RFS_CONFIG
  5112. * Bit 8
  5113. * Purpose: Tells target whether to enable (1) or disable (0)
  5114. * flow steering feature when sending rx indication messages to host
  5115. */
  5116. #define HTT_H2T_RFS_CONFIG_M 0x100
  5117. #define HTT_H2T_RFS_CONFIG_S 8
  5118. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5119. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5120. HTT_H2T_RFS_CONFIG_S)
  5121. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5122. do { \
  5123. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5124. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5125. } while (0)
  5126. #define HTT_RFS_CFG_REQ_BYTES 4
  5127. /**
  5128. * @brief host -> target FW extended statistics retrieve
  5129. *
  5130. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5131. *
  5132. * @details
  5133. * The following field definitions describe the format of the HTT host
  5134. * to target FW extended stats retrieve message.
  5135. * The message specifies the type of stats the host wants to retrieve.
  5136. *
  5137. * |31 24|23 16|15 8|7 0|
  5138. * |-----------------------------------------------------------|
  5139. * | reserved | stats type | pdev_mask | msg type |
  5140. * |-----------------------------------------------------------|
  5141. * | config param [0] |
  5142. * |-----------------------------------------------------------|
  5143. * | config param [1] |
  5144. * |-----------------------------------------------------------|
  5145. * | config param [2] |
  5146. * |-----------------------------------------------------------|
  5147. * | config param [3] |
  5148. * |-----------------------------------------------------------|
  5149. * | reserved |
  5150. * |-----------------------------------------------------------|
  5151. * | cookie LSBs |
  5152. * |-----------------------------------------------------------|
  5153. * | cookie MSBs |
  5154. * |-----------------------------------------------------------|
  5155. * Header fields:
  5156. * - MSG_TYPE
  5157. * Bits 7:0
  5158. * Purpose: identifies this is a extended stats upload request message
  5159. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5160. * - PDEV_MASK
  5161. * Bits 8:15
  5162. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5163. * Value: This is a overloaded field, refer to usage and interpretation of
  5164. * PDEV in interface document.
  5165. * Bit 8 : Reserved for SOC stats
  5166. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5167. * Indicates MACID_MASK in DBS
  5168. * - STATS_TYPE
  5169. * Bits 23:16
  5170. * Purpose: identifies which FW statistics to upload
  5171. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5172. * - Reserved
  5173. * Bits 31:24
  5174. * - CONFIG_PARAM [0]
  5175. * Bits 31:0
  5176. * Purpose: give an opaque configuration value to the specified stats type
  5177. * Value: stats-type specific configuration value
  5178. * Refer to htt_stats.h for interpretation for each stats sub_type
  5179. * - CONFIG_PARAM [1]
  5180. * Bits 31:0
  5181. * Purpose: give an opaque configuration value to the specified stats type
  5182. * Value: stats-type specific configuration value
  5183. * Refer to htt_stats.h for interpretation for each stats sub_type
  5184. * - CONFIG_PARAM [2]
  5185. * Bits 31:0
  5186. * Purpose: give an opaque configuration value to the specified stats type
  5187. * Value: stats-type specific configuration value
  5188. * Refer to htt_stats.h for interpretation for each stats sub_type
  5189. * - CONFIG_PARAM [3]
  5190. * Bits 31:0
  5191. * Purpose: give an opaque configuration value to the specified stats type
  5192. * Value: stats-type specific configuration value
  5193. * Refer to htt_stats.h for interpretation for each stats sub_type
  5194. * - Reserved [31:0] for future use.
  5195. * - COOKIE_LSBS
  5196. * Bits 31:0
  5197. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5198. * message with its preceding host->target stats request message.
  5199. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5200. * - COOKIE_MSBS
  5201. * Bits 31:0
  5202. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5203. * message with its preceding host->target stats request message.
  5204. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5205. */
  5206. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5207. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5208. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5209. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5210. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5211. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5212. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5213. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5214. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5215. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5216. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5217. do { \
  5218. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5219. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5220. } while (0)
  5221. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5222. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5223. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5224. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5225. do { \
  5226. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5227. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5228. } while (0)
  5229. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5230. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5231. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5232. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5235. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5236. } while (0)
  5237. /**
  5238. * @brief host -> target FW PPDU_STATS request message
  5239. *
  5240. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5241. *
  5242. * @details
  5243. * The following field definitions describe the format of the HTT host
  5244. * to target FW for PPDU_STATS_CFG msg.
  5245. * The message allows the host to configure the PPDU_STATS_IND messages
  5246. * produced by the target.
  5247. *
  5248. * |31 24|23 16|15 8|7 0|
  5249. * |-----------------------------------------------------------|
  5250. * | REQ bit mask | pdev_mask | msg type |
  5251. * |-----------------------------------------------------------|
  5252. * Header fields:
  5253. * - MSG_TYPE
  5254. * Bits 7:0
  5255. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5256. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5257. * - PDEV_MASK
  5258. * Bits 8:15
  5259. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5260. * Value: This is a overloaded field, refer to usage and interpretation of
  5261. * PDEV in interface document.
  5262. * Bit 8 : Reserved for SOC stats
  5263. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5264. * Indicates MACID_MASK in DBS
  5265. * - REQ_TLV_BIT_MASK
  5266. * Bits 16:31
  5267. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5268. * needs to be included in the target's PPDU_STATS_IND messages.
  5269. * Value: refer htt_ppdu_stats_tlv_tag_t
  5270. *
  5271. */
  5272. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5273. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5274. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5275. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5276. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5277. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5278. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5279. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5280. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5281. do { \
  5282. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5283. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5284. } while (0)
  5285. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5286. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5287. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5288. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5291. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5292. } while (0)
  5293. /**
  5294. * @brief Host-->target HTT RX FSE setup message
  5295. *
  5296. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5297. *
  5298. * @details
  5299. * Through this message, the host will provide details of the flow tables
  5300. * in host DDR along with hash keys.
  5301. * This message can be sent per SOC or per PDEV, which is differentiated
  5302. * by pdev id values.
  5303. * The host will allocate flow search table and sends table size,
  5304. * physical DMA address of flow table, and hash keys to firmware to
  5305. * program into the RXOLE FSE HW block.
  5306. *
  5307. * The following field definitions describe the format of the RX FSE setup
  5308. * message sent from the host to target
  5309. *
  5310. * Header fields:
  5311. * dword0 - b'7:0 - msg_type: This will be set to
  5312. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5313. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5314. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5315. * pdev's LMAC ring.
  5316. * b'31:16 - reserved : Reserved for future use
  5317. * dword1 - b'19:0 - number of records: This field indicates the number of
  5318. * entries in the flow table. For example: 8k number of
  5319. * records is equivalent to
  5320. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5321. * b'27:20 - max search: This field specifies the skid length to FSE
  5322. * parser HW module whenever match is not found at the
  5323. * exact index pointed by hash.
  5324. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5325. * Refer htt_ip_da_sa_prefix below for more details.
  5326. * b'31:30 - reserved: Reserved for future use
  5327. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5328. * table allocated by host in DDR
  5329. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5330. * table allocated by host in DDR
  5331. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5332. * entry hashing
  5333. *
  5334. *
  5335. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5336. * |---------------------------------------------------------------|
  5337. * | reserved | pdev_id | MSG_TYPE |
  5338. * |---------------------------------------------------------------|
  5339. * |resvd|IPDSA| max_search | Number of records |
  5340. * |---------------------------------------------------------------|
  5341. * | base address lo |
  5342. * |---------------------------------------------------------------|
  5343. * | base address high |
  5344. * |---------------------------------------------------------------|
  5345. * | toeplitz key 31_0 |
  5346. * |---------------------------------------------------------------|
  5347. * | toeplitz key 63_32 |
  5348. * |---------------------------------------------------------------|
  5349. * | toeplitz key 95_64 |
  5350. * |---------------------------------------------------------------|
  5351. * | toeplitz key 127_96 |
  5352. * |---------------------------------------------------------------|
  5353. * | toeplitz key 159_128 |
  5354. * |---------------------------------------------------------------|
  5355. * | toeplitz key 191_160 |
  5356. * |---------------------------------------------------------------|
  5357. * | toeplitz key 223_192 |
  5358. * |---------------------------------------------------------------|
  5359. * | toeplitz key 255_224 |
  5360. * |---------------------------------------------------------------|
  5361. * | toeplitz key 287_256 |
  5362. * |---------------------------------------------------------------|
  5363. * | reserved | toeplitz key 314_288(26:0 bits) |
  5364. * |---------------------------------------------------------------|
  5365. * where:
  5366. * IPDSA = ip_da_sa
  5367. */
  5368. /**
  5369. * @brief: htt_ip_da_sa_prefix
  5370. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5371. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5372. * documentation per RFC3849
  5373. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5374. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5375. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5376. */
  5377. enum htt_ip_da_sa_prefix {
  5378. HTT_RX_IPV6_20010db8,
  5379. HTT_RX_IPV4_MAPPED_IPV6,
  5380. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5381. HTT_RX_IPV6_64FF9B,
  5382. };
  5383. /**
  5384. * @brief Host-->target HTT RX FISA configure and enable
  5385. *
  5386. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5387. *
  5388. * @details
  5389. * The host will send this command down to configure and enable the FISA
  5390. * operational params.
  5391. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5392. * register.
  5393. * Should configure both the MACs.
  5394. *
  5395. * dword0 - b'7:0 - msg_type:
  5396. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5397. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5398. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5399. * pdev's LMAC ring.
  5400. * b'31:16 - reserved : Reserved for future use
  5401. *
  5402. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5403. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5404. * packets. 1 flow search will be skipped
  5405. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5406. * tcp,udp packets
  5407. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5408. * calculation
  5409. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5410. * calculation
  5411. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5412. * calculation
  5413. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5414. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5415. * length
  5416. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5417. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5418. * length
  5419. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5420. * num jump
  5421. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5422. * num jump
  5423. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5424. * data type switch has happend for MPDU Sequence num jump
  5425. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5426. * for MPDU Sequence num jump
  5427. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5428. * for decrypt errors
  5429. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5430. * while aggregating a msdu
  5431. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5432. * The aggregation is done until (number of MSDUs aggregated
  5433. * < LIMIT + 1)
  5434. * b'31:18 - Reserved
  5435. *
  5436. * fisa_control_value - 32bit value FW can write to register
  5437. *
  5438. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5439. * Threshold value for FISA timeout (units are microseconds).
  5440. * When the global timestamp exceeds this threshold, FISA
  5441. * aggregation will be restarted.
  5442. * A value of 0 means timeout is disabled.
  5443. * Compare the threshold register with timestamp field in
  5444. * flow entry to generate timeout for the flow.
  5445. *
  5446. * |31 18 |17 16|15 8|7 0|
  5447. * |-------------------------------------------------------------|
  5448. * | reserved | pdev_mask | msg type |
  5449. * |-------------------------------------------------------------|
  5450. * | reserved | FISA_CTRL |
  5451. * |-------------------------------------------------------------|
  5452. * | FISA_TIMEOUT_THRESH |
  5453. * |-------------------------------------------------------------|
  5454. */
  5455. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5456. A_UINT32 msg_type:8,
  5457. pdev_id:8,
  5458. reserved0:16;
  5459. /**
  5460. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5461. * [17:0]
  5462. */
  5463. union {
  5464. /*
  5465. * fisa_control_bits structure is deprecated.
  5466. * Please use fisa_control_bits_v2 going forward.
  5467. */
  5468. struct {
  5469. A_UINT32 fisa_enable: 1,
  5470. ipsec_skip_search: 1,
  5471. nontcp_skip_search: 1,
  5472. add_ipv4_fixed_hdr_len: 1,
  5473. add_ipv6_fixed_hdr_len: 1,
  5474. add_tcp_fixed_hdr_len: 1,
  5475. add_udp_hdr_len: 1,
  5476. chksum_cum_ip_len_en: 1,
  5477. disable_tid_check: 1,
  5478. disable_ta_check: 1,
  5479. disable_qos_check: 1,
  5480. disable_raw_check: 1,
  5481. disable_decrypt_err_check: 1,
  5482. disable_msdu_drop_check: 1,
  5483. fisa_aggr_limit: 4,
  5484. reserved: 14;
  5485. } fisa_control_bits;
  5486. struct {
  5487. A_UINT32 fisa_enable: 1,
  5488. fisa_aggr_limit: 4,
  5489. reserved: 27;
  5490. } fisa_control_bits_v2;
  5491. A_UINT32 fisa_control_value;
  5492. } u_fisa_control;
  5493. /**
  5494. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5495. * timeout threshold for aggregation. Unit in usec.
  5496. * [31:0]
  5497. */
  5498. A_UINT32 fisa_timeout_threshold;
  5499. } POSTPACK;
  5500. /* DWord 0: pdev-ID */
  5501. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5502. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5503. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5504. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5505. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5506. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5509. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5510. } while (0)
  5511. /* Dword 1: fisa_control_value fisa config */
  5512. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5513. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5514. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5515. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5516. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5517. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5518. do { \
  5519. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5520. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5521. } while (0)
  5522. /* Dword 1: fisa_control_value ipsec_skip_search */
  5523. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5524. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5525. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5526. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5527. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5528. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5531. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5532. } while (0)
  5533. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5534. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5535. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5536. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5537. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5538. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5539. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5542. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5543. } while (0)
  5544. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5545. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5546. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5547. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5548. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5549. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5550. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5551. do { \
  5552. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5553. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5554. } while (0)
  5555. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5556. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5557. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5558. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5559. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5560. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5561. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5565. } while (0)
  5566. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5567. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5568. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5569. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5570. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5571. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5572. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5573. do { \
  5574. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5575. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5576. } while (0)
  5577. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5578. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5579. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5580. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5581. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5582. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5583. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5586. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5587. } while (0)
  5588. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5589. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5590. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5591. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5592. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5593. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5594. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5597. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5598. } while (0)
  5599. /* Dword 1: fisa_control_value disable_tid_check */
  5600. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5601. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5603. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5604. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5605. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5606. do { \
  5607. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5608. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5609. } while (0)
  5610. /* Dword 1: fisa_control_value disable_ta_check */
  5611. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5612. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5614. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5615. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5616. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5617. do { \
  5618. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5619. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5620. } while (0)
  5621. /* Dword 1: fisa_control_value disable_qos_check */
  5622. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5623. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5624. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5625. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5626. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5627. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5628. do { \
  5629. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5630. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5631. } while (0)
  5632. /* Dword 1: fisa_control_value disable_raw_check */
  5633. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5634. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5635. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5636. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5637. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5638. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5641. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5642. } while (0)
  5643. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5644. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5645. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5646. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5647. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5648. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5649. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5652. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5653. } while (0)
  5654. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5655. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5656. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5657. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5658. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5659. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5660. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5661. do { \
  5662. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5663. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5664. } while (0)
  5665. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5666. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5667. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5668. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5669. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5670. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5671. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5675. } while (0)
  5676. /* Dword 1: fisa_control_value fisa config */
  5677. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5678. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5679. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5680. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5681. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5682. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5686. } while (0)
  5687. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5688. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5689. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5690. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5691. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5692. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5693. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5697. } while (0)
  5698. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5699. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5700. pdev_id:8,
  5701. reserved0:16;
  5702. A_UINT32 num_records:20,
  5703. max_search:8,
  5704. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5705. reserved1:2;
  5706. A_UINT32 base_addr_lo;
  5707. A_UINT32 base_addr_hi;
  5708. A_UINT32 toeplitz31_0;
  5709. A_UINT32 toeplitz63_32;
  5710. A_UINT32 toeplitz95_64;
  5711. A_UINT32 toeplitz127_96;
  5712. A_UINT32 toeplitz159_128;
  5713. A_UINT32 toeplitz191_160;
  5714. A_UINT32 toeplitz223_192;
  5715. A_UINT32 toeplitz255_224;
  5716. A_UINT32 toeplitz287_256;
  5717. A_UINT32 toeplitz314_288:27,
  5718. reserved2:5;
  5719. } POSTPACK;
  5720. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5721. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5722. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5723. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5724. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5725. /* DWORD 0: Pdev ID */
  5726. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5727. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5728. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5729. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5730. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5731. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5732. do { \
  5733. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5734. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5735. } while (0)
  5736. /* DWORD 1:num of records */
  5737. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5738. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5739. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5740. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5741. HTT_RX_FSE_SETUP_NUM_REC_S)
  5742. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5743. do { \
  5744. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5745. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5746. } while (0)
  5747. /* DWORD 1:max_search */
  5748. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5749. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5750. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5751. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5752. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5753. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5754. do { \
  5755. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5756. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5757. } while (0)
  5758. /* DWORD 1:ip_da_sa prefix */
  5759. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5760. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5761. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5762. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5763. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5764. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5765. do { \
  5766. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5767. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5768. } while (0)
  5769. /* DWORD 2: Base Address LO */
  5770. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5771. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5772. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5773. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5774. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5775. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5776. do { \
  5777. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5778. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5779. } while (0)
  5780. /* DWORD 3: Base Address High */
  5781. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5782. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5783. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5784. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5785. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5786. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5787. do { \
  5788. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5789. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5790. } while (0)
  5791. /* DWORD 4-12: Hash Value */
  5792. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5793. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5794. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5795. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5796. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5797. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5798. do { \
  5799. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5800. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5801. } while (0)
  5802. /* DWORD 13: Hash Value 314:288 bits */
  5803. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5804. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5805. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5806. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5809. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5810. } while (0)
  5811. /**
  5812. * @brief Host-->target HTT RX FSE operation message
  5813. *
  5814. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5815. *
  5816. * @details
  5817. * The host will send this Flow Search Engine (FSE) operation message for
  5818. * every flow add/delete operation.
  5819. * The FSE operation includes FSE full cache invalidation or individual entry
  5820. * invalidation.
  5821. * This message can be sent per SOC or per PDEV which is differentiated
  5822. * by pdev id values.
  5823. *
  5824. * |31 16|15 8|7 1|0|
  5825. * |-------------------------------------------------------------|
  5826. * | reserved | pdev_id | MSG_TYPE |
  5827. * |-------------------------------------------------------------|
  5828. * | reserved | operation |I|
  5829. * |-------------------------------------------------------------|
  5830. * | ip_src_addr_31_0 |
  5831. * |-------------------------------------------------------------|
  5832. * | ip_src_addr_63_32 |
  5833. * |-------------------------------------------------------------|
  5834. * | ip_src_addr_95_64 |
  5835. * |-------------------------------------------------------------|
  5836. * | ip_src_addr_127_96 |
  5837. * |-------------------------------------------------------------|
  5838. * | ip_dst_addr_31_0 |
  5839. * |-------------------------------------------------------------|
  5840. * | ip_dst_addr_63_32 |
  5841. * |-------------------------------------------------------------|
  5842. * | ip_dst_addr_95_64 |
  5843. * |-------------------------------------------------------------|
  5844. * | ip_dst_addr_127_96 |
  5845. * |-------------------------------------------------------------|
  5846. * | l4_dst_port | l4_src_port |
  5847. * | (32-bit SPI incase of IPsec) |
  5848. * |-------------------------------------------------------------|
  5849. * | reserved | l4_proto |
  5850. * |-------------------------------------------------------------|
  5851. *
  5852. * where I is 1-bit ipsec_valid.
  5853. *
  5854. * The following field definitions describe the format of the RX FSE operation
  5855. * message sent from the host to target for every add/delete flow entry to flow
  5856. * table.
  5857. *
  5858. * Header fields:
  5859. * dword0 - b'7:0 - msg_type: This will be set to
  5860. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  5861. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5862. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5863. * specified pdev's LMAC ring.
  5864. * b'31:16 - reserved : Reserved for future use
  5865. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5866. * (Internet Protocol Security).
  5867. * IPsec describes the framework for providing security at
  5868. * IP layer. IPsec is defined for both versions of IP:
  5869. * IPV4 and IPV6.
  5870. * Please refer to htt_rx_flow_proto enumeration below for
  5871. * more info.
  5872. * ipsec_valid = 1 for IPSEC packets
  5873. * ipsec_valid = 0 for IP Packets
  5874. * b'7:1 - operation: This indicates types of FSE operation.
  5875. * Refer to htt_rx_fse_operation enumeration:
  5876. * 0 - No Cache Invalidation required
  5877. * 1 - Cache invalidate only one entry given by IP
  5878. * src/dest address at DWORD[2:9]
  5879. * 2 - Complete FSE Cache Invalidation
  5880. * 3 - FSE Disable
  5881. * 4 - FSE Enable
  5882. * b'31:8 - reserved: Reserved for future use
  5883. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5884. * for per flow addition/deletion
  5885. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5886. * and the subsequent 3 A_UINT32 will be padding bytes.
  5887. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5888. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5889. * from 0 to 65535 but only 0 to 1023 are designated as
  5890. * well-known ports. Refer to [RFC1700] for more details.
  5891. * This field is valid only if
  5892. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5893. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5894. * range from 0 to 65535 but only 0 to 1023 are designated
  5895. * as well-known ports. Refer to [RFC1700] for more details.
  5896. * This field is valid only if
  5897. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5898. * - SPI (31:0): Security Parameters Index is an
  5899. * identification tag added to the header while using IPsec
  5900. * for tunneling the IP traffici.
  5901. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5902. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5903. * Assigned Internet Protocol Numbers.
  5904. * l4_proto numbers for standard protocol like UDP/TCP
  5905. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5906. * l4_proto = 17 for UDP etc.
  5907. * b'31:8 - reserved: Reserved for future use.
  5908. *
  5909. */
  5910. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5911. A_UINT32 msg_type:8,
  5912. pdev_id:8,
  5913. reserved0:16;
  5914. A_UINT32 ipsec_valid:1,
  5915. operation:7,
  5916. reserved1:24;
  5917. A_UINT32 ip_src_addr_31_0;
  5918. A_UINT32 ip_src_addr_63_32;
  5919. A_UINT32 ip_src_addr_95_64;
  5920. A_UINT32 ip_src_addr_127_96;
  5921. A_UINT32 ip_dest_addr_31_0;
  5922. A_UINT32 ip_dest_addr_63_32;
  5923. A_UINT32 ip_dest_addr_95_64;
  5924. A_UINT32 ip_dest_addr_127_96;
  5925. union {
  5926. A_UINT32 spi;
  5927. struct {
  5928. A_UINT32 l4_src_port:16,
  5929. l4_dest_port:16;
  5930. } ip;
  5931. } u;
  5932. A_UINT32 l4_proto:8,
  5933. reserved:24;
  5934. } POSTPACK;
  5935. /**
  5936. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5937. *
  5938. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  5939. *
  5940. * @details
  5941. * The host will send this Full monitor mode register configuration message.
  5942. * This message can be sent per SOC or per PDEV which is differentiated
  5943. * by pdev id values.
  5944. *
  5945. * |31 16|15 11|10 8|7 3|2|1|0|
  5946. * |-------------------------------------------------------------|
  5947. * | reserved | pdev_id | MSG_TYPE |
  5948. * |-------------------------------------------------------------|
  5949. * | reserved |Release Ring |N|Z|E|
  5950. * |-------------------------------------------------------------|
  5951. *
  5952. * where E is 1-bit full monitor mode enable/disable.
  5953. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5954. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5955. *
  5956. * The following field definitions describe the format of the full monitor
  5957. * mode configuration message sent from the host to target for each pdev.
  5958. *
  5959. * Header fields:
  5960. * dword0 - b'7:0 - msg_type: This will be set to
  5961. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  5962. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5963. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5964. * specified pdev's LMAC ring.
  5965. * b'31:16 - reserved : Reserved for future use.
  5966. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5967. * monitor mode rxdma register is to be enabled or disabled.
  5968. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5969. * additional descriptors at ppdu end for zero mpdus
  5970. * enabled or disabled.
  5971. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5972. * additional descriptors at ppdu end for non zero mpdus
  5973. * enabled or disabled.
  5974. * b'10:3 - release_ring: This indicates the destination ring
  5975. * selection for the descriptor at the end of PPDU
  5976. * 0 - REO ring select
  5977. * 1 - FW ring select
  5978. * 2 - SW ring select
  5979. * 3 - Release ring select
  5980. * Refer to htt_rx_full_mon_release_ring.
  5981. * b'31:11 - reserved for future use
  5982. */
  5983. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5984. A_UINT32 msg_type:8,
  5985. pdev_id:8,
  5986. reserved0:16;
  5987. A_UINT32 full_monitor_mode_enable:1,
  5988. addnl_descs_zero_mpdus_end:1,
  5989. addnl_descs_non_zero_mpdus_end:1,
  5990. release_ring:8,
  5991. reserved1:21;
  5992. } POSTPACK;
  5993. /**
  5994. * Enumeration for full monitor mode destination ring select
  5995. * 0 - REO destination ring select
  5996. * 1 - FW destination ring select
  5997. * 2 - SW destination ring select
  5998. * 3 - Release destination ring select
  5999. */
  6000. enum htt_rx_full_mon_release_ring {
  6001. HTT_RX_MON_RING_REO,
  6002. HTT_RX_MON_RING_FW,
  6003. HTT_RX_MON_RING_SW,
  6004. HTT_RX_MON_RING_RELEASE,
  6005. };
  6006. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6007. /* DWORD 0: Pdev ID */
  6008. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6009. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6010. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6011. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6012. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6013. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6014. do { \
  6015. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6016. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6017. } while (0)
  6018. /* DWORD 1:ENABLE */
  6019. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6020. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6021. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6022. do { \
  6023. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6024. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6025. } while (0)
  6026. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6027. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6028. /* DWORD 1:ZERO_MPDU */
  6029. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6030. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6031. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6032. do { \
  6033. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6034. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6035. } while (0)
  6036. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6037. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6038. /* DWORD 1:NON_ZERO_MPDU */
  6039. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6040. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6041. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6042. do { \
  6043. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6044. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6045. } while (0)
  6046. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6047. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6048. /* DWORD 1:RELEASE_RINGS */
  6049. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6050. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6051. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6052. do { \
  6053. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6054. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6055. } while (0)
  6056. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6057. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6058. /**
  6059. * Enumeration for IP Protocol or IPSEC Protocol
  6060. * IPsec describes the framework for providing security at IP layer.
  6061. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6062. */
  6063. enum htt_rx_flow_proto {
  6064. HTT_RX_FLOW_IP_PROTO,
  6065. HTT_RX_FLOW_IPSEC_PROTO,
  6066. };
  6067. /**
  6068. * Enumeration for FSE Cache Invalidation
  6069. * 0 - No Cache Invalidation required
  6070. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6071. * 2 - Complete FSE Cache Invalidation
  6072. * 3 - FSE Disable
  6073. * 4 - FSE Enable
  6074. */
  6075. enum htt_rx_fse_operation {
  6076. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6077. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6078. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6079. HTT_RX_FSE_DISABLE,
  6080. HTT_RX_FSE_ENABLE,
  6081. };
  6082. /* DWORD 0: Pdev ID */
  6083. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6084. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6085. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6086. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6087. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6088. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6089. do { \
  6090. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6091. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6092. } while (0)
  6093. /* DWORD 1:IP PROTO or IPSEC */
  6094. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6095. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6096. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6097. do { \
  6098. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6099. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6100. } while (0)
  6101. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6102. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6103. /* DWORD 1:FSE Operation */
  6104. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6105. #define HTT_RX_FSE_OPERATION_S 1
  6106. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6107. do { \
  6108. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6109. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6110. } while (0)
  6111. #define HTT_RX_FSE_OPERATION_GET(word) \
  6112. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6113. /* DWORD 2-9:IP Address */
  6114. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6115. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6116. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6117. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6118. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6119. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6120. do { \
  6121. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6122. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6123. } while (0)
  6124. /* DWORD 10:Source Port Number */
  6125. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6126. #define HTT_RX_FSE_SOURCEPORT_S 0
  6127. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6128. do { \
  6129. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6130. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6131. } while (0)
  6132. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6133. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6134. /* DWORD 11:Destination Port Number */
  6135. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6136. #define HTT_RX_FSE_DESTPORT_S 16
  6137. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6138. do { \
  6139. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6140. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6141. } while (0)
  6142. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6143. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6144. /* DWORD 10-11:SPI (In case of IPSEC) */
  6145. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6146. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6147. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6148. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6149. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6150. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6151. do { \
  6152. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6153. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6154. } while (0)
  6155. /* DWORD 12:L4 PROTO */
  6156. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6157. #define HTT_RX_FSE_L4_PROTO_S 0
  6158. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6159. do { \
  6160. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6161. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6162. } while (0)
  6163. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6164. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6165. /**
  6166. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6167. *
  6168. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6169. *
  6170. * |31 24|23 |15 8|7 2|1|0|
  6171. * |----------------+----------------+----------------+----------------|
  6172. * | reserved | pdev_id | msg_type |
  6173. * |---------------------------------+----------------+----------------|
  6174. * | reserved |E|F|
  6175. * |---------------------------------+----------------+----------------|
  6176. * Where E = Configure the target to provide the 3-tuple hash value in
  6177. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6178. * F = Configure the target to provide the 3-tuple hash value in
  6179. * flow_id_toeplitz field of rx_msdu_start tlv
  6180. *
  6181. * The following field definitions describe the format of the 3 tuple hash value
  6182. * message sent from the host to target as part of initialization sequence.
  6183. *
  6184. * Header fields:
  6185. * dword0 - b'7:0 - msg_type: This will be set to
  6186. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6187. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6188. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6189. * specified pdev's LMAC ring.
  6190. * b'31:16 - reserved : Reserved for future use
  6191. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6192. * b'1 - toeplitz_hash_2_or_4_field_enable
  6193. * b'31:2 - reserved : Reserved for future use
  6194. * ---------+------+----------------------------------------------------------
  6195. * bit1 | bit0 | Functionality
  6196. * ---------+------+----------------------------------------------------------
  6197. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6198. * | | in flow_id_toeplitz field
  6199. * ---------+------+----------------------------------------------------------
  6200. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6201. * | | in toeplitz_hash_2_or_4 field
  6202. * ---------+------+----------------------------------------------------------
  6203. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6204. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6205. * ---------+------+----------------------------------------------------------
  6206. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6207. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6208. * | | toeplitz_hash_2_or_4 field
  6209. *----------------------------------------------------------------------------
  6210. */
  6211. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6212. A_UINT32 msg_type :8,
  6213. pdev_id :8,
  6214. reserved0 :16;
  6215. A_UINT32 flow_id_toeplitz_field_enable :1,
  6216. toeplitz_hash_2_or_4_field_enable :1,
  6217. reserved1 :30;
  6218. } POSTPACK;
  6219. /* DWORD0 : pdev_id configuration Macros */
  6220. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6221. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6222. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6223. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6224. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6225. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6226. do { \
  6227. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6228. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6229. } while (0)
  6230. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6231. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6232. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6233. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6234. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6235. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6236. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6237. do { \
  6238. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6239. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6240. } while (0)
  6241. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6242. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6243. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6244. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6245. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6246. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6247. do { \
  6248. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6249. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6250. } while (0)
  6251. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6252. /**
  6253. * @brief host --> target Host PA Address Size
  6254. *
  6255. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6256. *
  6257. * @details
  6258. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6259. * provide the physical start address and size of each of the memory
  6260. * areas within host DDR that the target FW may need to access.
  6261. *
  6262. * For example, the host can use this message to allow the target FW
  6263. * to set up access to the host's pools of TQM link descriptors.
  6264. * The message would appear as follows:
  6265. *
  6266. * |31 24|23 16|15 8|7 0|
  6267. * |----------------+----------------+----------------+----------------|
  6268. * | reserved | num_entries | msg_type |
  6269. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6270. * | mem area 0 size |
  6271. * |----------------+----------------+----------------+----------------|
  6272. * | mem area 0 physical_address_lo |
  6273. * |----------------+----------------+----------------+----------------|
  6274. * | mem area 0 physical_address_hi |
  6275. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6276. * | mem area 1 size |
  6277. * |----------------+----------------+----------------+----------------|
  6278. * | mem area 1 physical_address_lo |
  6279. * |----------------+----------------+----------------+----------------|
  6280. * | mem area 1 physical_address_hi |
  6281. * |----------------+----------------+----------------+----------------|
  6282. * ...
  6283. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6284. * | mem area N size |
  6285. * |----------------+----------------+----------------+----------------|
  6286. * | mem area N physical_address_lo |
  6287. * |----------------+----------------+----------------+----------------|
  6288. * | mem area N physical_address_hi |
  6289. * |----------------+----------------+----------------+----------------|
  6290. *
  6291. * The message is interpreted as follows:
  6292. * dword0 - b'0:7 - msg_type: This will be set to
  6293. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6294. * b'8:15 - number_entries: Indicated the number of host memory
  6295. * areas specified within the remainder of the message
  6296. * b'16:31 - reserved.
  6297. * dword1 - b'0:31 - memory area 0 size in bytes
  6298. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6299. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6300. * and similar for memory area 1 through memory area N.
  6301. */
  6302. PREPACK struct htt_h2t_host_paddr_size {
  6303. A_UINT32 msg_type: 8,
  6304. num_entries: 8,
  6305. reserved: 16;
  6306. } POSTPACK;
  6307. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6308. A_UINT32 size;
  6309. A_UINT32 physical_address_lo;
  6310. A_UINT32 physical_address_hi;
  6311. } POSTPACK;
  6312. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6313. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6314. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6315. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6316. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6317. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6318. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6321. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6322. } while (0)
  6323. /**
  6324. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  6325. *
  6326. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  6327. *
  6328. * @details
  6329. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  6330. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  6331. *
  6332. * The message would appear as follows:
  6333. *
  6334. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  6335. * |---------------------------------+---+---+----------+-+-----------|
  6336. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  6337. * |---------------------+---+---+---+---+---+----------+-+-----------|
  6338. *
  6339. *
  6340. * The message is interpreted as follows:
  6341. * dword0 - b'0:7 - msg_type: This will be set to
  6342. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  6343. * b'8 - override bit to drive MSDUs to PPE ring
  6344. * b'9:13 - REO destination ring indication
  6345. * b'14 - Multi buffer msdu override enable bit
  6346. * b'15 - Intra BSS override
  6347. * b'16 - Decap raw override
  6348. * b'17 - Decap Native wifi override
  6349. * b'18 - IP frag override
  6350. * b'19:31 - reserved
  6351. */
  6352. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  6353. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  6354. override: 1,
  6355. reo_destination_indication: 5,
  6356. multi_buffer_msdu_override_en: 1,
  6357. intra_bss_override: 1,
  6358. decap_raw_override: 1,
  6359. decap_nwifi_override: 1,
  6360. ip_frag_override: 1,
  6361. reserved: 13;
  6362. } POSTPACK;
  6363. /* DWORD 0: Override */
  6364. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  6365. #define HTT_PPE_CFG_OVERRIDE_S 8
  6366. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  6367. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  6368. HTT_PPE_CFG_OVERRIDE_S)
  6369. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  6370. do { \
  6371. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  6372. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  6373. } while (0)
  6374. /* DWORD 0: REO Destination Indication*/
  6375. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  6376. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  6377. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  6378. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  6379. HTT_PPE_CFG_REO_DEST_IND_S)
  6380. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  6383. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  6384. } while (0)
  6385. /* DWORD 0: Multi buffer MSDU override */
  6386. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  6387. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  6388. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  6389. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  6390. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  6391. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  6394. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  6395. } while (0)
  6396. /* DWORD 0: Intra BSS override */
  6397. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  6398. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  6399. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  6400. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  6401. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  6402. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  6403. do { \
  6404. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  6405. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  6406. } while (0)
  6407. /* DWORD 0: Decap RAW override */
  6408. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  6409. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  6410. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  6411. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  6412. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  6413. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  6416. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  6417. } while (0)
  6418. /* DWORD 0: Decap NWIFI override */
  6419. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  6420. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  6421. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  6422. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  6423. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  6424. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  6427. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  6428. } while (0)
  6429. /* DWORD 0: IP frag override */
  6430. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  6431. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  6432. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  6433. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  6434. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  6435. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  6436. do { \
  6437. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  6438. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  6439. } while (0)
  6440. /*=== target -> host messages ===============================================*/
  6441. enum htt_t2h_msg_type {
  6442. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6443. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6444. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6445. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6446. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6447. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6448. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6449. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6450. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6451. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6452. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6453. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6454. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6455. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6456. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6457. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6458. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6459. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6460. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6461. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6462. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6463. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6464. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6465. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6466. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6467. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6468. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6469. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6470. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6471. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6472. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6473. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6474. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6475. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6476. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6477. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6478. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6479. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6480. /* TX_OFFLOAD_DELIVER_IND:
  6481. * Forward the target's locally-generated packets to the host,
  6482. * to provide to the monitor mode interface.
  6483. */
  6484. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6485. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6486. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6487. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  6488. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  6489. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  6490. HTT_T2H_MSG_TYPE_TEST,
  6491. /* keep this last */
  6492. HTT_T2H_NUM_MSGS
  6493. };
  6494. /*
  6495. * HTT target to host message type -
  6496. * stored in bits 7:0 of the first word of the message
  6497. */
  6498. #define HTT_T2H_MSG_TYPE_M 0xff
  6499. #define HTT_T2H_MSG_TYPE_S 0
  6500. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6503. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6504. } while (0)
  6505. #define HTT_T2H_MSG_TYPE_GET(word) \
  6506. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6507. /**
  6508. * @brief target -> host version number confirmation message definition
  6509. *
  6510. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6511. *
  6512. * |31 24|23 16|15 8|7 0|
  6513. * |----------------+----------------+----------------+----------------|
  6514. * | reserved | major number | minor number | msg type |
  6515. * |-------------------------------------------------------------------|
  6516. * : option request TLV (optional) |
  6517. * :...................................................................:
  6518. *
  6519. * The VER_CONF message may consist of a single 4-byte word, or may be
  6520. * extended with TLVs that specify HTT options selected by the target.
  6521. * The following option TLVs may be appended to the VER_CONF message:
  6522. * - LL_BUS_ADDR_SIZE
  6523. * - HL_SUPPRESS_TX_COMPL_IND
  6524. * - MAX_TX_QUEUE_GROUPS
  6525. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6526. * may be appended to the VER_CONF message (but only one TLV of each type).
  6527. *
  6528. * Header fields:
  6529. * - MSG_TYPE
  6530. * Bits 7:0
  6531. * Purpose: identifies this as a version number confirmation message
  6532. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6533. * - VER_MINOR
  6534. * Bits 15:8
  6535. * Purpose: Specify the minor number of the HTT message library version
  6536. * in use by the target firmware.
  6537. * The minor number specifies the specific revision within a range
  6538. * of fundamentally compatible HTT message definition revisions.
  6539. * Compatible revisions involve adding new messages or perhaps
  6540. * adding new fields to existing messages, in a backwards-compatible
  6541. * manner.
  6542. * Incompatible revisions involve changing the message type values,
  6543. * or redefining existing messages.
  6544. * Value: minor number
  6545. * - VER_MAJOR
  6546. * Bits 15:8
  6547. * Purpose: Specify the major number of the HTT message library version
  6548. * in use by the target firmware.
  6549. * The major number specifies the family of minor revisions that are
  6550. * fundamentally compatible with each other, but not with prior or
  6551. * later families.
  6552. * Value: major number
  6553. */
  6554. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6555. #define HTT_VER_CONF_MINOR_S 8
  6556. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6557. #define HTT_VER_CONF_MAJOR_S 16
  6558. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6561. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6562. } while (0)
  6563. #define HTT_VER_CONF_MINOR_GET(word) \
  6564. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6565. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6566. do { \
  6567. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6568. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6569. } while (0)
  6570. #define HTT_VER_CONF_MAJOR_GET(word) \
  6571. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6572. #define HTT_VER_CONF_BYTES 4
  6573. /**
  6574. * @brief - target -> host HTT Rx In order indication message
  6575. *
  6576. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6577. *
  6578. * @details
  6579. *
  6580. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6581. * |----------------+-------------------+---------------------+---------------|
  6582. * | peer ID | P| F| O| ext TID | msg type |
  6583. * |--------------------------------------------------------------------------|
  6584. * | MSDU count | Reserved | vdev id |
  6585. * |--------------------------------------------------------------------------|
  6586. * | MSDU 0 bus address (bits 31:0) |
  6587. #if HTT_PADDR64
  6588. * | MSDU 0 bus address (bits 63:32) |
  6589. #endif
  6590. * |--------------------------------------------------------------------------|
  6591. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6592. * |--------------------------------------------------------------------------|
  6593. * | MSDU 1 bus address (bits 31:0) |
  6594. #if HTT_PADDR64
  6595. * | MSDU 1 bus address (bits 63:32) |
  6596. #endif
  6597. * |--------------------------------------------------------------------------|
  6598. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6599. * |--------------------------------------------------------------------------|
  6600. */
  6601. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6602. *
  6603. * @details
  6604. * bits
  6605. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6606. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6607. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6608. * | | frag | | | | fail |chksum fail|
  6609. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6610. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6611. */
  6612. struct htt_rx_in_ord_paddr_ind_hdr_t
  6613. {
  6614. A_UINT32 /* word 0 */
  6615. msg_type: 8,
  6616. ext_tid: 5,
  6617. offload: 1,
  6618. frag: 1,
  6619. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6620. peer_id: 16;
  6621. A_UINT32 /* word 1 */
  6622. vap_id: 8,
  6623. /* NOTE:
  6624. * This reserved_1 field is not truly reserved - certain targets use
  6625. * this field internally to store debug information, and do not zero
  6626. * out the contents of the field before uploading the message to the
  6627. * host. Thus, any host-target communication supported by this field
  6628. * is limited to using values that are never used by the debug
  6629. * information stored by certain targets in the reserved_1 field.
  6630. * In particular, the targets in question don't use the value 0x3
  6631. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6632. * so this previously-unused value within these bits is available to
  6633. * use as the host / target PKT_CAPTURE_MODE flag.
  6634. */
  6635. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6636. /* if pkt_capture_mode == 0x3, host should
  6637. * send rx frames to monitor mode interface
  6638. */
  6639. msdu_cnt: 16;
  6640. };
  6641. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6642. {
  6643. A_UINT32 dma_addr;
  6644. A_UINT32
  6645. length: 16,
  6646. fw_desc: 8,
  6647. msdu_info:8;
  6648. };
  6649. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6650. {
  6651. A_UINT32 dma_addr_lo;
  6652. A_UINT32 dma_addr_hi;
  6653. A_UINT32
  6654. length: 16,
  6655. fw_desc: 8,
  6656. msdu_info:8;
  6657. };
  6658. #if HTT_PADDR64
  6659. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6660. #else
  6661. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6662. #endif
  6663. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6664. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6665. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6666. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6667. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6668. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6669. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6670. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6671. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6672. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6673. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6674. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6675. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6676. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6677. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6678. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6679. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6680. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6681. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6682. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6683. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6684. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6685. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6686. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6687. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6688. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6689. /* for systems using 64-bit format for bus addresses */
  6690. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6691. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6692. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6693. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6694. /* for systems using 32-bit format for bus addresses */
  6695. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6696. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6697. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6698. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6699. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6700. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6703. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6704. do { \
  6705. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6706. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6707. } while (0)
  6708. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6709. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6710. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6713. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6714. } while (0)
  6715. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6716. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6717. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6718. do { \
  6719. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6720. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6721. } while (0)
  6722. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6723. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6724. /*
  6725. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6726. * deliver the rx frames to the monitor mode interface.
  6727. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6728. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6729. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6730. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6731. */
  6732. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6733. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6736. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6737. } while (0)
  6738. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6739. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6740. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6741. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6742. do { \
  6743. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6744. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6745. } while (0)
  6746. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6747. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6748. /* for systems using 64-bit format for bus addresses */
  6749. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6750. do { \
  6751. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6752. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6753. } while (0)
  6754. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6755. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6756. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6759. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6760. } while (0)
  6761. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6762. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6763. /* for systems using 32-bit format for bus addresses */
  6764. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6765. do { \
  6766. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6767. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6768. } while (0)
  6769. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6770. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6771. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6772. do { \
  6773. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6774. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6775. } while (0)
  6776. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6777. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6778. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6779. do { \
  6780. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6781. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6782. } while (0)
  6783. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6784. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6785. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6786. do { \
  6787. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6788. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6789. } while (0)
  6790. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6791. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6792. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6793. do { \
  6794. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6795. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6796. } while (0)
  6797. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6798. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6799. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6800. do { \
  6801. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6802. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6803. } while (0)
  6804. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6805. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6806. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6809. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6810. } while (0)
  6811. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6812. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6813. /* definitions used within target -> host rx indication message */
  6814. PREPACK struct htt_rx_ind_hdr_prefix_t
  6815. {
  6816. A_UINT32 /* word 0 */
  6817. msg_type: 8,
  6818. ext_tid: 5,
  6819. release_valid: 1,
  6820. flush_valid: 1,
  6821. reserved0: 1,
  6822. peer_id: 16;
  6823. A_UINT32 /* word 1 */
  6824. flush_start_seq_num: 6,
  6825. flush_end_seq_num: 6,
  6826. release_start_seq_num: 6,
  6827. release_end_seq_num: 6,
  6828. num_mpdu_ranges: 8;
  6829. } POSTPACK;
  6830. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6831. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6832. #define HTT_TGT_RSSI_INVALID 0x80
  6833. PREPACK struct htt_rx_ppdu_desc_t
  6834. {
  6835. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6836. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6837. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6838. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6839. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6840. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6841. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6842. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6843. A_UINT32 /* word 0 */
  6844. rssi_cmb: 8,
  6845. timestamp_submicrosec: 8,
  6846. phy_err_code: 8,
  6847. phy_err: 1,
  6848. legacy_rate: 4,
  6849. legacy_rate_sel: 1,
  6850. end_valid: 1,
  6851. start_valid: 1;
  6852. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6853. union {
  6854. A_UINT32 /* word 1 */
  6855. rssi0_pri20: 8,
  6856. rssi0_ext20: 8,
  6857. rssi0_ext40: 8,
  6858. rssi0_ext80: 8;
  6859. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6860. } u0;
  6861. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6862. union {
  6863. A_UINT32 /* word 2 */
  6864. rssi1_pri20: 8,
  6865. rssi1_ext20: 8,
  6866. rssi1_ext40: 8,
  6867. rssi1_ext80: 8;
  6868. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6869. } u1;
  6870. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6871. union {
  6872. A_UINT32 /* word 3 */
  6873. rssi2_pri20: 8,
  6874. rssi2_ext20: 8,
  6875. rssi2_ext40: 8,
  6876. rssi2_ext80: 8;
  6877. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6878. } u2;
  6879. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6880. union {
  6881. A_UINT32 /* word 4 */
  6882. rssi3_pri20: 8,
  6883. rssi3_ext20: 8,
  6884. rssi3_ext40: 8,
  6885. rssi3_ext80: 8;
  6886. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6887. } u3;
  6888. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6889. A_UINT32 tsf32; /* word 5 */
  6890. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6891. A_UINT32 timestamp_microsec; /* word 6 */
  6892. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6893. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6894. A_UINT32 /* word 7 */
  6895. vht_sig_a1: 24,
  6896. preamble_type: 8;
  6897. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6898. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6899. A_UINT32 /* word 8 */
  6900. vht_sig_a2: 24,
  6901. /* sa_ant_matrix
  6902. * For cases where a single rx chain has options to be connected to
  6903. * different rx antennas, show which rx antennas were in use during
  6904. * receipt of a given PPDU.
  6905. * This sa_ant_matrix provides a bitmask of the antennas used while
  6906. * receiving this frame.
  6907. */
  6908. sa_ant_matrix: 8;
  6909. } POSTPACK;
  6910. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6911. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6912. PREPACK struct htt_rx_ind_hdr_suffix_t
  6913. {
  6914. A_UINT32 /* word 0 */
  6915. fw_rx_desc_bytes: 16,
  6916. reserved0: 16;
  6917. } POSTPACK;
  6918. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6919. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6920. PREPACK struct htt_rx_ind_hdr_t
  6921. {
  6922. struct htt_rx_ind_hdr_prefix_t prefix;
  6923. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6924. struct htt_rx_ind_hdr_suffix_t suffix;
  6925. } POSTPACK;
  6926. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6927. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6928. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6929. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6930. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6931. /*
  6932. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6933. * the offset into the HTT rx indication message at which the
  6934. * FW rx PPDU descriptor resides
  6935. */
  6936. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6937. /*
  6938. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6939. * the offset into the HTT rx indication message at which the
  6940. * header suffix (FW rx MSDU byte count) resides
  6941. */
  6942. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6943. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6944. /*
  6945. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6946. * the offset into the HTT rx indication message at which the per-MSDU
  6947. * information starts
  6948. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6949. * per-MSDU information portion of the message. The per-MSDU info itself
  6950. * starts at byte 12.
  6951. */
  6952. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6953. /**
  6954. * @brief target -> host rx indication message definition
  6955. *
  6956. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  6957. *
  6958. * @details
  6959. * The following field definitions describe the format of the rx indication
  6960. * message sent from the target to the host.
  6961. * The message consists of three major sections:
  6962. * 1. a fixed-length header
  6963. * 2. a variable-length list of firmware rx MSDU descriptors
  6964. * 3. one or more 4-octet MPDU range information elements
  6965. * The fixed length header itself has two sub-sections
  6966. * 1. the message meta-information, including identification of the
  6967. * sender and type of the received data, and a 4-octet flush/release IE
  6968. * 2. the firmware rx PPDU descriptor
  6969. *
  6970. * The format of the message is depicted below.
  6971. * in this depiction, the following abbreviations are used for information
  6972. * elements within the message:
  6973. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6974. * elements associated with the PPDU start are valid.
  6975. * Specifically, the following fields are valid only if SV is set:
  6976. * RSSI (all variants), L, legacy rate, preamble type, service,
  6977. * VHT-SIG-A
  6978. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6979. * elements associated with the PPDU end are valid.
  6980. * Specifically, the following fields are valid only if EV is set:
  6981. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6982. * - L - Legacy rate selector - if legacy rates are used, this flag
  6983. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6984. * (L == 0) PHY.
  6985. * - P - PHY error flag - boolean indication of whether the rx frame had
  6986. * a PHY error
  6987. *
  6988. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6989. * |----------------+-------------------+---------------------+---------------|
  6990. * | peer ID | |RV|FV| ext TID | msg type |
  6991. * |--------------------------------------------------------------------------|
  6992. * | num | release | release | flush | flush |
  6993. * | MPDU | end | start | end | start |
  6994. * | ranges | seq num | seq num | seq num | seq num |
  6995. * |==========================================================================|
  6996. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6997. * |V|V| | rate | | | timestamp | RSSI |
  6998. * |--------------------------------------------------------------------------|
  6999. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7000. * |--------------------------------------------------------------------------|
  7001. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7002. * |--------------------------------------------------------------------------|
  7003. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7004. * |--------------------------------------------------------------------------|
  7005. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7006. * |--------------------------------------------------------------------------|
  7007. * | TSF LSBs |
  7008. * |--------------------------------------------------------------------------|
  7009. * | microsec timestamp |
  7010. * |--------------------------------------------------------------------------|
  7011. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7012. * |--------------------------------------------------------------------------|
  7013. * | service | HT-SIG / VHT-SIG-A2 |
  7014. * |==========================================================================|
  7015. * | reserved | FW rx desc bytes |
  7016. * |--------------------------------------------------------------------------|
  7017. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7018. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7019. * |--------------------------------------------------------------------------|
  7020. * : : :
  7021. * |--------------------------------------------------------------------------|
  7022. * | alignment | MSDU Rx |
  7023. * | padding | desc Bn |
  7024. * |--------------------------------------------------------------------------|
  7025. * | reserved | MPDU range status | MPDU count |
  7026. * |--------------------------------------------------------------------------|
  7027. * : reserved : MPDU range status : MPDU count :
  7028. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7029. *
  7030. * Header fields:
  7031. * - MSG_TYPE
  7032. * Bits 7:0
  7033. * Purpose: identifies this as an rx indication message
  7034. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7035. * - EXT_TID
  7036. * Bits 12:8
  7037. * Purpose: identify the traffic ID of the rx data, including
  7038. * special "extended" TID values for multicast, broadcast, and
  7039. * non-QoS data frames
  7040. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7041. * - FLUSH_VALID (FV)
  7042. * Bit 13
  7043. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7044. * is valid
  7045. * Value:
  7046. * 1 -> flush IE is valid and needs to be processed
  7047. * 0 -> flush IE is not valid and should be ignored
  7048. * - REL_VALID (RV)
  7049. * Bit 13
  7050. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7051. * is valid
  7052. * Value:
  7053. * 1 -> release IE is valid and needs to be processed
  7054. * 0 -> release IE is not valid and should be ignored
  7055. * - PEER_ID
  7056. * Bits 31:16
  7057. * Purpose: Identify, by ID, which peer sent the rx data
  7058. * Value: ID of the peer who sent the rx data
  7059. * - FLUSH_SEQ_NUM_START
  7060. * Bits 5:0
  7061. * Purpose: Indicate the start of a series of MPDUs to flush
  7062. * Not all MPDUs within this series are necessarily valid - the host
  7063. * must check each sequence number within this range to see if the
  7064. * corresponding MPDU is actually present.
  7065. * This field is only valid if the FV bit is set.
  7066. * Value:
  7067. * The sequence number for the first MPDUs to check to flush.
  7068. * The sequence number is masked by 0x3f.
  7069. * - FLUSH_SEQ_NUM_END
  7070. * Bits 11:6
  7071. * Purpose: Indicate the end of a series of MPDUs to flush
  7072. * Value:
  7073. * The sequence number one larger than the sequence number of the
  7074. * last MPDU to check to flush.
  7075. * The sequence number is masked by 0x3f.
  7076. * Not all MPDUs within this series are necessarily valid - the host
  7077. * must check each sequence number within this range to see if the
  7078. * corresponding MPDU is actually present.
  7079. * This field is only valid if the FV bit is set.
  7080. * - REL_SEQ_NUM_START
  7081. * Bits 17:12
  7082. * Purpose: Indicate the start of a series of MPDUs to release.
  7083. * All MPDUs within this series are present and valid - the host
  7084. * need not check each sequence number within this range to see if
  7085. * the corresponding MPDU is actually present.
  7086. * This field is only valid if the RV bit is set.
  7087. * Value:
  7088. * The sequence number for the first MPDUs to check to release.
  7089. * The sequence number is masked by 0x3f.
  7090. * - REL_SEQ_NUM_END
  7091. * Bits 23:18
  7092. * Purpose: Indicate the end of a series of MPDUs to release.
  7093. * Value:
  7094. * The sequence number one larger than the sequence number of the
  7095. * last MPDU to check to release.
  7096. * The sequence number is masked by 0x3f.
  7097. * All MPDUs within this series are present and valid - the host
  7098. * need not check each sequence number within this range to see if
  7099. * the corresponding MPDU is actually present.
  7100. * This field is only valid if the RV bit is set.
  7101. * - NUM_MPDU_RANGES
  7102. * Bits 31:24
  7103. * Purpose: Indicate how many ranges of MPDUs are present.
  7104. * Each MPDU range consists of a series of contiguous MPDUs within the
  7105. * rx frame sequence which all have the same MPDU status.
  7106. * Value: 1-63 (typically a small number, like 1-3)
  7107. *
  7108. * Rx PPDU descriptor fields:
  7109. * - RSSI_CMB
  7110. * Bits 7:0
  7111. * Purpose: Combined RSSI from all active rx chains, across the active
  7112. * bandwidth.
  7113. * Value: RSSI dB units w.r.t. noise floor
  7114. * - TIMESTAMP_SUBMICROSEC
  7115. * Bits 15:8
  7116. * Purpose: high-resolution timestamp
  7117. * Value:
  7118. * Sub-microsecond time of PPDU reception.
  7119. * This timestamp ranges from [0,MAC clock MHz).
  7120. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  7121. * to form a high-resolution, large range rx timestamp.
  7122. * - PHY_ERR_CODE
  7123. * Bits 23:16
  7124. * Purpose:
  7125. * If the rx frame processing resulted in a PHY error, indicate what
  7126. * type of rx PHY error occurred.
  7127. * Value:
  7128. * This field is valid if the "P" (PHY_ERR) flag is set.
  7129. * TBD: document/specify the values for this field
  7130. * - PHY_ERR
  7131. * Bit 24
  7132. * Purpose: indicate whether the rx PPDU had a PHY error
  7133. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7134. * - LEGACY_RATE
  7135. * Bits 28:25
  7136. * Purpose:
  7137. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7138. * specify which rate was used.
  7139. * Value:
  7140. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7141. * flag.
  7142. * If LEGACY_RATE_SEL is 0:
  7143. * 0x8: OFDM 48 Mbps
  7144. * 0x9: OFDM 24 Mbps
  7145. * 0xA: OFDM 12 Mbps
  7146. * 0xB: OFDM 6 Mbps
  7147. * 0xC: OFDM 54 Mbps
  7148. * 0xD: OFDM 36 Mbps
  7149. * 0xE: OFDM 18 Mbps
  7150. * 0xF: OFDM 9 Mbps
  7151. * If LEGACY_RATE_SEL is 1:
  7152. * 0x8: CCK 11 Mbps long preamble
  7153. * 0x9: CCK 5.5 Mbps long preamble
  7154. * 0xA: CCK 2 Mbps long preamble
  7155. * 0xB: CCK 1 Mbps long preamble
  7156. * 0xC: CCK 11 Mbps short preamble
  7157. * 0xD: CCK 5.5 Mbps short preamble
  7158. * 0xE: CCK 2 Mbps short preamble
  7159. * - LEGACY_RATE_SEL
  7160. * Bit 29
  7161. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7162. * Value:
  7163. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7164. * used a legacy rate.
  7165. * 0 -> OFDM, 1 -> CCK
  7166. * - END_VALID
  7167. * Bit 30
  7168. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7169. * the start of the PPDU are valid. Specifically, the following
  7170. * fields are only valid if END_VALID is set:
  7171. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7172. * TIMESTAMP_SUBMICROSEC
  7173. * Value:
  7174. * 0 -> rx PPDU desc end fields are not valid
  7175. * 1 -> rx PPDU desc end fields are valid
  7176. * - START_VALID
  7177. * Bit 31
  7178. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7179. * the end of the PPDU are valid. Specifically, the following
  7180. * fields are only valid if START_VALID is set:
  7181. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7182. * VHT-SIG-A
  7183. * Value:
  7184. * 0 -> rx PPDU desc start fields are not valid
  7185. * 1 -> rx PPDU desc start fields are valid
  7186. * - RSSI0_PRI20
  7187. * Bits 7:0
  7188. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7189. * Value: RSSI dB units w.r.t. noise floor
  7190. *
  7191. * - RSSI0_EXT20
  7192. * Bits 7:0
  7193. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7194. * (if the rx bandwidth was >= 40 MHz)
  7195. * Value: RSSI dB units w.r.t. noise floor
  7196. * - RSSI0_EXT40
  7197. * Bits 7:0
  7198. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7199. * (if the rx bandwidth was >= 80 MHz)
  7200. * Value: RSSI dB units w.r.t. noise floor
  7201. * - RSSI0_EXT80
  7202. * Bits 7:0
  7203. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7204. * (if the rx bandwidth was >= 160 MHz)
  7205. * Value: RSSI dB units w.r.t. noise floor
  7206. *
  7207. * - RSSI1_PRI20
  7208. * Bits 7:0
  7209. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7210. * Value: RSSI dB units w.r.t. noise floor
  7211. * - RSSI1_EXT20
  7212. * Bits 7:0
  7213. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7214. * (if the rx bandwidth was >= 40 MHz)
  7215. * Value: RSSI dB units w.r.t. noise floor
  7216. * - RSSI1_EXT40
  7217. * Bits 7:0
  7218. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7219. * (if the rx bandwidth was >= 80 MHz)
  7220. * Value: RSSI dB units w.r.t. noise floor
  7221. * - RSSI1_EXT80
  7222. * Bits 7:0
  7223. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7224. * (if the rx bandwidth was >= 160 MHz)
  7225. * Value: RSSI dB units w.r.t. noise floor
  7226. *
  7227. * - RSSI2_PRI20
  7228. * Bits 7:0
  7229. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7230. * Value: RSSI dB units w.r.t. noise floor
  7231. * - RSSI2_EXT20
  7232. * Bits 7:0
  7233. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7234. * (if the rx bandwidth was >= 40 MHz)
  7235. * Value: RSSI dB units w.r.t. noise floor
  7236. * - RSSI2_EXT40
  7237. * Bits 7:0
  7238. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7239. * (if the rx bandwidth was >= 80 MHz)
  7240. * Value: RSSI dB units w.r.t. noise floor
  7241. * - RSSI2_EXT80
  7242. * Bits 7:0
  7243. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7244. * (if the rx bandwidth was >= 160 MHz)
  7245. * Value: RSSI dB units w.r.t. noise floor
  7246. *
  7247. * - RSSI3_PRI20
  7248. * Bits 7:0
  7249. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7250. * Value: RSSI dB units w.r.t. noise floor
  7251. * - RSSI3_EXT20
  7252. * Bits 7:0
  7253. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7254. * (if the rx bandwidth was >= 40 MHz)
  7255. * Value: RSSI dB units w.r.t. noise floor
  7256. * - RSSI3_EXT40
  7257. * Bits 7:0
  7258. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7259. * (if the rx bandwidth was >= 80 MHz)
  7260. * Value: RSSI dB units w.r.t. noise floor
  7261. * - RSSI3_EXT80
  7262. * Bits 7:0
  7263. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7264. * (if the rx bandwidth was >= 160 MHz)
  7265. * Value: RSSI dB units w.r.t. noise floor
  7266. *
  7267. * - TSF32
  7268. * Bits 31:0
  7269. * Purpose: specify the time the rx PPDU was received, in TSF units
  7270. * Value: 32 LSBs of the TSF
  7271. * - TIMESTAMP_MICROSEC
  7272. * Bits 31:0
  7273. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7274. * Value: PPDU rx time, in microseconds
  7275. * - VHT_SIG_A1
  7276. * Bits 23:0
  7277. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7278. * from the rx PPDU
  7279. * Value:
  7280. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7281. * VHT-SIG-A1 data.
  7282. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7283. * first 24 bits of the HT-SIG data.
  7284. * Otherwise, this field is invalid.
  7285. * Refer to the the 802.11 protocol for the definition of the
  7286. * HT-SIG and VHT-SIG-A1 fields
  7287. * - VHT_SIG_A2
  7288. * Bits 23:0
  7289. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7290. * from the rx PPDU
  7291. * Value:
  7292. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7293. * VHT-SIG-A2 data.
  7294. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7295. * last 24 bits of the HT-SIG data.
  7296. * Otherwise, this field is invalid.
  7297. * Refer to the the 802.11 protocol for the definition of the
  7298. * HT-SIG and VHT-SIG-A2 fields
  7299. * - PREAMBLE_TYPE
  7300. * Bits 31:24
  7301. * Purpose: indicate the PHY format of the received burst
  7302. * Value:
  7303. * 0x4: Legacy (OFDM/CCK)
  7304. * 0x8: HT
  7305. * 0x9: HT with TxBF
  7306. * 0xC: VHT
  7307. * 0xD: VHT with TxBF
  7308. * - SERVICE
  7309. * Bits 31:24
  7310. * Purpose: TBD
  7311. * Value: TBD
  7312. *
  7313. * Rx MSDU descriptor fields:
  7314. * - FW_RX_DESC_BYTES
  7315. * Bits 15:0
  7316. * Purpose: Indicate how many bytes in the Rx indication are used for
  7317. * FW Rx descriptors
  7318. *
  7319. * Payload fields:
  7320. * - MPDU_COUNT
  7321. * Bits 7:0
  7322. * Purpose: Indicate how many sequential MPDUs share the same status.
  7323. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7324. * - MPDU_STATUS
  7325. * Bits 15:8
  7326. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7327. * received successfully.
  7328. * Value:
  7329. * 0x1: success
  7330. * 0x2: FCS error
  7331. * 0x3: duplicate error
  7332. * 0x4: replay error
  7333. * 0x5: invalid peer
  7334. */
  7335. /* header fields */
  7336. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7337. #define HTT_RX_IND_EXT_TID_S 8
  7338. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7339. #define HTT_RX_IND_FLUSH_VALID_S 13
  7340. #define HTT_RX_IND_REL_VALID_M 0x4000
  7341. #define HTT_RX_IND_REL_VALID_S 14
  7342. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7343. #define HTT_RX_IND_PEER_ID_S 16
  7344. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7345. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7346. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7347. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7348. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7349. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7350. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7351. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7352. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7353. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7354. /* rx PPDU descriptor fields */
  7355. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7356. #define HTT_RX_IND_RSSI_CMB_S 0
  7357. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7358. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7359. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7360. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7361. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7362. #define HTT_RX_IND_PHY_ERR_S 24
  7363. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7364. #define HTT_RX_IND_LEGACY_RATE_S 25
  7365. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7366. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7367. #define HTT_RX_IND_END_VALID_M 0x40000000
  7368. #define HTT_RX_IND_END_VALID_S 30
  7369. #define HTT_RX_IND_START_VALID_M 0x80000000
  7370. #define HTT_RX_IND_START_VALID_S 31
  7371. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7372. #define HTT_RX_IND_RSSI_PRI20_S 0
  7373. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7374. #define HTT_RX_IND_RSSI_EXT20_S 8
  7375. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7376. #define HTT_RX_IND_RSSI_EXT40_S 16
  7377. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7378. #define HTT_RX_IND_RSSI_EXT80_S 24
  7379. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7380. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7381. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7382. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7383. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7384. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7385. #define HTT_RX_IND_SERVICE_M 0xff000000
  7386. #define HTT_RX_IND_SERVICE_S 24
  7387. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7388. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7389. /* rx MSDU descriptor fields */
  7390. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7391. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7392. /* payload fields */
  7393. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7394. #define HTT_RX_IND_MPDU_COUNT_S 0
  7395. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7396. #define HTT_RX_IND_MPDU_STATUS_S 8
  7397. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7398. do { \
  7399. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7400. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7401. } while (0)
  7402. #define HTT_RX_IND_EXT_TID_GET(word) \
  7403. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7404. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7405. do { \
  7406. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7407. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7408. } while (0)
  7409. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7410. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7411. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7412. do { \
  7413. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7414. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7415. } while (0)
  7416. #define HTT_RX_IND_REL_VALID_GET(word) \
  7417. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7418. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7421. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7422. } while (0)
  7423. #define HTT_RX_IND_PEER_ID_GET(word) \
  7424. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7425. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7426. do { \
  7427. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7428. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7429. } while (0)
  7430. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7431. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7432. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7435. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7436. } while (0)
  7437. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7438. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7439. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7440. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7441. do { \
  7442. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7443. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7444. } while (0)
  7445. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7446. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7447. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7448. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7449. do { \
  7450. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7451. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7452. } while (0)
  7453. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7454. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7455. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7456. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7457. do { \
  7458. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7459. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7460. } while (0)
  7461. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7462. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7463. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7464. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7465. do { \
  7466. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7467. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7468. } while (0)
  7469. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7470. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7471. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7472. /* FW rx PPDU descriptor fields */
  7473. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7474. do { \
  7475. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7476. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7477. } while (0)
  7478. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7479. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7480. HTT_RX_IND_RSSI_CMB_S)
  7481. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7482. do { \
  7483. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7484. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7485. } while (0)
  7486. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7487. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7488. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7489. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7490. do { \
  7491. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7492. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7493. } while (0)
  7494. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7495. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7496. HTT_RX_IND_PHY_ERR_CODE_S)
  7497. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7498. do { \
  7499. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7500. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7501. } while (0)
  7502. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7503. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7504. HTT_RX_IND_PHY_ERR_S)
  7505. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7508. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7509. } while (0)
  7510. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7511. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7512. HTT_RX_IND_LEGACY_RATE_S)
  7513. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7514. do { \
  7515. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7516. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7517. } while (0)
  7518. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7519. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7520. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7521. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7522. do { \
  7523. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7524. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7525. } while (0)
  7526. #define HTT_RX_IND_END_VALID_GET(word) \
  7527. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7528. HTT_RX_IND_END_VALID_S)
  7529. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7530. do { \
  7531. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7532. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7533. } while (0)
  7534. #define HTT_RX_IND_START_VALID_GET(word) \
  7535. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7536. HTT_RX_IND_START_VALID_S)
  7537. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7538. do { \
  7539. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7540. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7541. } while (0)
  7542. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7543. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7544. HTT_RX_IND_RSSI_PRI20_S)
  7545. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7546. do { \
  7547. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7548. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7549. } while (0)
  7550. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7551. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7552. HTT_RX_IND_RSSI_EXT20_S)
  7553. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7554. do { \
  7555. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7556. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7557. } while (0)
  7558. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7559. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7560. HTT_RX_IND_RSSI_EXT40_S)
  7561. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7562. do { \
  7563. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7564. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7565. } while (0)
  7566. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7567. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7568. HTT_RX_IND_RSSI_EXT80_S)
  7569. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7570. do { \
  7571. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7572. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7573. } while (0)
  7574. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7575. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7576. HTT_RX_IND_VHT_SIG_A1_S)
  7577. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7580. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7581. } while (0)
  7582. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7583. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7584. HTT_RX_IND_VHT_SIG_A2_S)
  7585. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7586. do { \
  7587. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7588. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7589. } while (0)
  7590. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7591. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7592. HTT_RX_IND_PREAMBLE_TYPE_S)
  7593. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7594. do { \
  7595. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7596. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7597. } while (0)
  7598. #define HTT_RX_IND_SERVICE_GET(word) \
  7599. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7600. HTT_RX_IND_SERVICE_S)
  7601. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7602. do { \
  7603. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7604. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7605. } while (0)
  7606. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7607. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7608. HTT_RX_IND_SA_ANT_MATRIX_S)
  7609. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7610. do { \
  7611. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7612. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7613. } while (0)
  7614. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7615. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7616. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7617. do { \
  7618. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7619. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7620. } while (0)
  7621. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7622. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7623. #define HTT_RX_IND_HL_BYTES \
  7624. (HTT_RX_IND_HDR_BYTES + \
  7625. 4 /* single FW rx MSDU descriptor */ + \
  7626. 4 /* single MPDU range information element */)
  7627. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7628. /* Could we use one macro entry? */
  7629. #define HTT_WORD_SET(word, field, value) \
  7630. do { \
  7631. HTT_CHECK_SET_VAL(field, value); \
  7632. (word) |= ((value) << field ## _S); \
  7633. } while (0)
  7634. #define HTT_WORD_GET(word, field) \
  7635. (((word) & field ## _M) >> field ## _S)
  7636. PREPACK struct hl_htt_rx_ind_base {
  7637. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7638. } POSTPACK;
  7639. /*
  7640. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7641. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7642. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7643. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7644. * htt_rx_ind_hl_rx_desc_t.
  7645. */
  7646. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7647. struct htt_rx_ind_hl_rx_desc_t {
  7648. A_UINT8 ver;
  7649. A_UINT8 len;
  7650. struct {
  7651. A_UINT8
  7652. first_msdu: 1,
  7653. last_msdu: 1,
  7654. c3_failed: 1,
  7655. c4_failed: 1,
  7656. ipv6: 1,
  7657. tcp: 1,
  7658. udp: 1,
  7659. reserved: 1;
  7660. } flags;
  7661. /* NOTE: no reserved space - don't append any new fields here */
  7662. };
  7663. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7664. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7665. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7666. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7667. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7668. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7669. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7670. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7671. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7672. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7673. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7674. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7675. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7676. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7677. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7678. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7679. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7680. /* This structure is used in HL, the basic descriptor information
  7681. * used by host. the structure is translated by FW from HW desc
  7682. * or generated by FW. But in HL monitor mode, the host would use
  7683. * the same structure with LL.
  7684. */
  7685. PREPACK struct hl_htt_rx_desc_base {
  7686. A_UINT32
  7687. seq_num:12,
  7688. encrypted:1,
  7689. chan_info_present:1,
  7690. resv0:2,
  7691. mcast_bcast:1,
  7692. fragment:1,
  7693. key_id_oct:8,
  7694. resv1:6;
  7695. A_UINT32
  7696. pn_31_0;
  7697. union {
  7698. struct {
  7699. A_UINT16 pn_47_32;
  7700. A_UINT16 pn_63_48;
  7701. } pn16;
  7702. A_UINT32 pn_63_32;
  7703. } u0;
  7704. A_UINT32
  7705. pn_95_64;
  7706. A_UINT32
  7707. pn_127_96;
  7708. } POSTPACK;
  7709. /*
  7710. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7711. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7712. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7713. * Please see htt_chan_change_t for description of the fields.
  7714. */
  7715. PREPACK struct htt_chan_info_t
  7716. {
  7717. A_UINT32 primary_chan_center_freq_mhz: 16,
  7718. contig_chan1_center_freq_mhz: 16;
  7719. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7720. phy_mode: 8,
  7721. reserved: 8;
  7722. } POSTPACK;
  7723. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7724. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7725. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7726. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7727. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7728. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7729. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7730. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7731. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7732. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7733. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7734. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7735. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7736. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7737. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7738. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7739. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7740. /* Channel information */
  7741. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7742. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7743. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7744. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7745. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7746. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7747. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7748. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7749. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7750. do { \
  7751. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7752. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7753. } while (0)
  7754. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7755. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7756. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7757. do { \
  7758. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7759. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7760. } while (0)
  7761. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7762. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7763. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7764. do { \
  7765. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7766. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7767. } while (0)
  7768. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7769. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7770. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7771. do { \
  7772. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7773. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7774. } while (0)
  7775. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7776. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7777. /*
  7778. * @brief target -> host message definition for FW offloaded pkts
  7779. *
  7780. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7781. *
  7782. * @details
  7783. * The following field definitions describe the format of the firmware
  7784. * offload deliver message sent from the target to the host.
  7785. *
  7786. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7787. *
  7788. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7789. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7790. * | reserved_1 | msg type |
  7791. * |--------------------------------------------------------------------------|
  7792. * | phy_timestamp_l32 |
  7793. * |--------------------------------------------------------------------------|
  7794. * | WORD2 (see below) |
  7795. * |--------------------------------------------------------------------------|
  7796. * | seqno | framectrl |
  7797. * |--------------------------------------------------------------------------|
  7798. * | reserved_3 | vdev_id | tid_num|
  7799. * |--------------------------------------------------------------------------|
  7800. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7801. * |--------------------------------------------------------------------------|
  7802. *
  7803. * where:
  7804. * STAT = status
  7805. * F = format (802.3 vs. 802.11)
  7806. *
  7807. * definition for word 2
  7808. *
  7809. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7810. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7811. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7812. * |--------------------------------------------------------------------------|
  7813. *
  7814. * where:
  7815. * PR = preamble
  7816. * BF = beamformed
  7817. */
  7818. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7819. {
  7820. A_UINT32 /* word 0 */
  7821. msg_type:8, /* [ 7: 0] */
  7822. reserved_1:24; /* [31: 8] */
  7823. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7824. A_UINT32 /* word 2 */
  7825. /* preamble:
  7826. * 0-OFDM,
  7827. * 1-CCk,
  7828. * 2-HT,
  7829. * 3-VHT
  7830. */
  7831. preamble: 2, /* [1:0] */
  7832. /* mcs:
  7833. * In case of HT preamble interpret
  7834. * MCS along with NSS.
  7835. * Valid values for HT are 0 to 7.
  7836. * HT mcs 0 with NSS 2 is mcs 8.
  7837. * Valid values for VHT are 0 to 9.
  7838. */
  7839. mcs: 4, /* [5:2] */
  7840. /* rate:
  7841. * This is applicable only for
  7842. * CCK and OFDM preamble type
  7843. * rate 0: OFDM 48 Mbps,
  7844. * 1: OFDM 24 Mbps,
  7845. * 2: OFDM 12 Mbps
  7846. * 3: OFDM 6 Mbps
  7847. * 4: OFDM 54 Mbps
  7848. * 5: OFDM 36 Mbps
  7849. * 6: OFDM 18 Mbps
  7850. * 7: OFDM 9 Mbps
  7851. * rate 0: CCK 11 Mbps Long
  7852. * 1: CCK 5.5 Mbps Long
  7853. * 2: CCK 2 Mbps Long
  7854. * 3: CCK 1 Mbps Long
  7855. * 4: CCK 11 Mbps Short
  7856. * 5: CCK 5.5 Mbps Short
  7857. * 6: CCK 2 Mbps Short
  7858. */
  7859. rate : 3, /* [ 8: 6] */
  7860. rssi : 8, /* [16: 9] units=dBm */
  7861. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7862. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7863. stbc : 1, /* [22] */
  7864. sgi : 1, /* [23] */
  7865. ldpc : 1, /* [24] */
  7866. beamformed: 1, /* [25] */
  7867. reserved_2: 6; /* [31:26] */
  7868. A_UINT32 /* word 3 */
  7869. framectrl:16, /* [15: 0] */
  7870. seqno:16; /* [31:16] */
  7871. A_UINT32 /* word 4 */
  7872. tid_num:5, /* [ 4: 0] actual TID number */
  7873. vdev_id:8, /* [12: 5] */
  7874. reserved_3:19; /* [31:13] */
  7875. A_UINT32 /* word 5 */
  7876. /* status:
  7877. * 0: tx_ok
  7878. * 1: retry
  7879. * 2: drop
  7880. * 3: filtered
  7881. * 4: abort
  7882. * 5: tid delete
  7883. * 6: sw abort
  7884. * 7: dropped by peer migration
  7885. */
  7886. status:3, /* [2:0] */
  7887. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7888. tx_mpdu_bytes:16, /* [19:4] */
  7889. /* Indicates retry count of offloaded/local generated Data tx frames */
  7890. tx_retry_cnt:6, /* [25:20] */
  7891. reserved_4:6; /* [31:26] */
  7892. } POSTPACK;
  7893. /* FW offload deliver ind message header fields */
  7894. /* DWORD one */
  7895. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7896. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7897. /* DWORD two */
  7898. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7899. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7900. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7901. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7902. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7903. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7904. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7905. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7906. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7907. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7908. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7909. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7910. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7911. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7912. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7913. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7914. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7915. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7916. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7917. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7918. /* DWORD three*/
  7919. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7920. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7921. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7922. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7923. /* DWORD four */
  7924. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7925. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7926. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7927. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7928. /* DWORD five */
  7929. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7930. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7931. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7932. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7933. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7934. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7935. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7936. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7937. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7938. do { \
  7939. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7940. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7941. } while (0)
  7942. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7943. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7944. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7945. do { \
  7946. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7947. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7948. } while (0)
  7949. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7950. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7951. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7952. do { \
  7953. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7954. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7955. } while (0)
  7956. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7957. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7958. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7959. do { \
  7960. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7961. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7962. } while (0)
  7963. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7964. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7965. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7966. do { \
  7967. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7968. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7969. } while (0)
  7970. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7971. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7972. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7973. do { \
  7974. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7975. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7976. } while (0)
  7977. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7978. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7979. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7980. do { \
  7981. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7982. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7983. } while (0)
  7984. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7985. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7986. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7987. do { \
  7988. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7989. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7990. } while (0)
  7991. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7992. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7993. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7994. do { \
  7995. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7996. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7997. } while (0)
  7998. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7999. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8000. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8003. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8004. } while (0)
  8005. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8006. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8007. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8008. do { \
  8009. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8010. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8011. } while (0)
  8012. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8013. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8014. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8015. do { \
  8016. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8017. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8018. } while (0)
  8019. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8020. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8021. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8024. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8025. } while (0)
  8026. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8027. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8028. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8031. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8032. } while (0)
  8033. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8034. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8035. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8036. do { \
  8037. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8038. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8039. } while (0)
  8040. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8041. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8042. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8043. do { \
  8044. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8045. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8046. } while (0)
  8047. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8048. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8049. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8050. do { \
  8051. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8052. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8053. } while (0)
  8054. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8055. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8056. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8057. do { \
  8058. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8059. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8060. } while (0)
  8061. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8062. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8063. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8064. do { \
  8065. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8066. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8067. } while (0)
  8068. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  8069. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  8070. /*
  8071. * @brief target -> host rx reorder flush message definition
  8072. *
  8073. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  8074. *
  8075. * @details
  8076. * The following field definitions describe the format of the rx flush
  8077. * message sent from the target to the host.
  8078. * The message consists of a 4-octet header, followed by one or more
  8079. * 4-octet payload information elements.
  8080. *
  8081. * |31 24|23 8|7 0|
  8082. * |--------------------------------------------------------------|
  8083. * | TID | peer ID | msg type |
  8084. * |--------------------------------------------------------------|
  8085. * | seq num end | seq num start | MPDU status | reserved |
  8086. * |--------------------------------------------------------------|
  8087. * First DWORD:
  8088. * - MSG_TYPE
  8089. * Bits 7:0
  8090. * Purpose: identifies this as an rx flush message
  8091. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  8092. * - PEER_ID
  8093. * Bits 23:8 (only bits 18:8 actually used)
  8094. * Purpose: identify which peer's rx data is being flushed
  8095. * Value: (rx) peer ID
  8096. * - TID
  8097. * Bits 31:24 (only bits 27:24 actually used)
  8098. * Purpose: Specifies which traffic identifier's rx data is being flushed
  8099. * Value: traffic identifier
  8100. * Second DWORD:
  8101. * - MPDU_STATUS
  8102. * Bits 15:8
  8103. * Purpose:
  8104. * Indicate whether the flushed MPDUs should be discarded or processed.
  8105. * Value:
  8106. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  8107. * stages of rx processing
  8108. * other: discard the MPDUs
  8109. * It is anticipated that flush messages will always have
  8110. * MPDU status == 1, but the status flag is included for
  8111. * flexibility.
  8112. * - SEQ_NUM_START
  8113. * Bits 23:16
  8114. * Purpose:
  8115. * Indicate the start of a series of consecutive MPDUs being flushed.
  8116. * Not all MPDUs within this range are necessarily valid - the host
  8117. * must check each sequence number within this range to see if the
  8118. * corresponding MPDU is actually present.
  8119. * Value:
  8120. * The sequence number for the first MPDU in the sequence.
  8121. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8122. * - SEQ_NUM_END
  8123. * Bits 30:24
  8124. * Purpose:
  8125. * Indicate the end of a series of consecutive MPDUs being flushed.
  8126. * Value:
  8127. * The sequence number one larger than the sequence number of the
  8128. * last MPDU being flushed.
  8129. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8130. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8131. * are to be released for further rx processing.
  8132. * Not all MPDUs within this range are necessarily valid - the host
  8133. * must check each sequence number within this range to see if the
  8134. * corresponding MPDU is actually present.
  8135. */
  8136. /* first DWORD */
  8137. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8138. #define HTT_RX_FLUSH_PEER_ID_S 8
  8139. #define HTT_RX_FLUSH_TID_M 0xff000000
  8140. #define HTT_RX_FLUSH_TID_S 24
  8141. /* second DWORD */
  8142. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8143. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8144. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8145. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8146. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8147. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8148. #define HTT_RX_FLUSH_BYTES 8
  8149. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8150. do { \
  8151. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8152. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8153. } while (0)
  8154. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8155. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8156. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8157. do { \
  8158. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8159. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8160. } while (0)
  8161. #define HTT_RX_FLUSH_TID_GET(word) \
  8162. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8163. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8166. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8167. } while (0)
  8168. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8169. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8170. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8171. do { \
  8172. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8173. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8174. } while (0)
  8175. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8176. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8177. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8178. do { \
  8179. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8180. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8181. } while (0)
  8182. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8183. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8184. /*
  8185. * @brief target -> host rx pn check indication message
  8186. *
  8187. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8188. *
  8189. * @details
  8190. * The following field definitions describe the format of the Rx PN check
  8191. * indication message sent from the target to the host.
  8192. * The message consists of a 4-octet header, followed by the start and
  8193. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8194. * IE is one octet containing the sequence number that failed the PN
  8195. * check.
  8196. *
  8197. * |31 24|23 8|7 0|
  8198. * |--------------------------------------------------------------|
  8199. * | TID | peer ID | msg type |
  8200. * |--------------------------------------------------------------|
  8201. * | Reserved | PN IE count | seq num end | seq num start|
  8202. * |--------------------------------------------------------------|
  8203. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8204. * |--------------------------------------------------------------|
  8205. * First DWORD:
  8206. * - MSG_TYPE
  8207. * Bits 7:0
  8208. * Purpose: Identifies this as an rx pn check indication message
  8209. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8210. * - PEER_ID
  8211. * Bits 23:8 (only bits 18:8 actually used)
  8212. * Purpose: identify which peer
  8213. * Value: (rx) peer ID
  8214. * - TID
  8215. * Bits 31:24 (only bits 27:24 actually used)
  8216. * Purpose: identify traffic identifier
  8217. * Value: traffic identifier
  8218. * Second DWORD:
  8219. * - SEQ_NUM_START
  8220. * Bits 7:0
  8221. * Purpose:
  8222. * Indicates the starting sequence number of the MPDU in this
  8223. * series of MPDUs that went though PN check.
  8224. * Value:
  8225. * The sequence number for the first MPDU in the sequence.
  8226. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8227. * - SEQ_NUM_END
  8228. * Bits 15:8
  8229. * Purpose:
  8230. * Indicates the ending sequence number of the MPDU in this
  8231. * series of MPDUs that went though PN check.
  8232. * Value:
  8233. * The sequence number one larger then the sequence number of the last
  8234. * MPDU being flushed.
  8235. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8236. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8237. * for invalid PN numbers and are ready to be released for further processing.
  8238. * Not all MPDUs within this range are necessarily valid - the host
  8239. * must check each sequence number within this range to see if the
  8240. * corresponding MPDU is actually present.
  8241. * - PN_IE_COUNT
  8242. * Bits 23:16
  8243. * Purpose:
  8244. * Used to determine the variable number of PN information elements in this
  8245. * message
  8246. *
  8247. * PN information elements:
  8248. * - PN_IE_x-
  8249. * Purpose:
  8250. * Each PN information element contains the sequence number of the MPDU that
  8251. * has failed the target PN check.
  8252. * Value:
  8253. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8254. * that failed the PN check.
  8255. */
  8256. /* first DWORD */
  8257. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8258. #define HTT_RX_PN_IND_PEER_ID_S 8
  8259. #define HTT_RX_PN_IND_TID_M 0xff000000
  8260. #define HTT_RX_PN_IND_TID_S 24
  8261. /* second DWORD */
  8262. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8263. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8264. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8265. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8266. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8267. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8268. #define HTT_RX_PN_IND_BYTES 8
  8269. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8272. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8273. } while (0)
  8274. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8275. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8276. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8279. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8280. } while (0)
  8281. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8282. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8283. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8286. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8287. } while (0)
  8288. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8289. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8290. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8293. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8294. } while (0)
  8295. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8296. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8297. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8298. do { \
  8299. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8300. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8301. } while (0)
  8302. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8303. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8304. /*
  8305. * @brief target -> host rx offload deliver message for LL system
  8306. *
  8307. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8308. *
  8309. * @details
  8310. * In a low latency system this message is sent whenever the offload
  8311. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8312. * The DMA of the actual packets into host memory is done before sending out
  8313. * this message. This message indicates only how many MSDUs to reap. The
  8314. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8315. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8316. * DMA'd by the MAC directly into host memory these packets do not contain
  8317. * the MAC descriptors in the header portion of the packet. Instead they contain
  8318. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8319. * message, the packets are delivered directly to the NW stack without going
  8320. * through the regular reorder buffering and PN checking path since it has
  8321. * already been done in target.
  8322. *
  8323. * |31 24|23 16|15 8|7 0|
  8324. * |-----------------------------------------------------------------------|
  8325. * | Total MSDU count | reserved | msg type |
  8326. * |-----------------------------------------------------------------------|
  8327. *
  8328. * @brief target -> host rx offload deliver message for HL system
  8329. *
  8330. * @details
  8331. * In a high latency system this message is sent whenever the offload manager
  8332. * flushes out the packets it has coalesced in its coalescing buffer. The
  8333. * actual packets are also carried along with this message. When the host
  8334. * receives this message, it is expected to deliver these packets to the NW
  8335. * stack directly instead of routing them through the reorder buffering and
  8336. * PN checking path since it has already been done in target.
  8337. *
  8338. * |31 24|23 16|15 8|7 0|
  8339. * |-----------------------------------------------------------------------|
  8340. * | Total MSDU count | reserved | msg type |
  8341. * |-----------------------------------------------------------------------|
  8342. * | peer ID | MSDU length |
  8343. * |-----------------------------------------------------------------------|
  8344. * | MSDU payload | FW Desc | tid | vdev ID |
  8345. * |-----------------------------------------------------------------------|
  8346. * | MSDU payload contd. |
  8347. * |-----------------------------------------------------------------------|
  8348. * | peer ID | MSDU length |
  8349. * |-----------------------------------------------------------------------|
  8350. * | MSDU payload | FW Desc | tid | vdev ID |
  8351. * |-----------------------------------------------------------------------|
  8352. * | MSDU payload contd. |
  8353. * |-----------------------------------------------------------------------|
  8354. *
  8355. */
  8356. /* first DWORD */
  8357. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8358. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8359. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8360. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8361. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8362. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8363. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8364. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8365. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8366. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8367. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8368. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8369. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8370. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8371. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8372. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8373. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8374. do { \
  8375. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8376. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8377. } while (0)
  8378. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8379. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8380. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8383. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8384. } while (0)
  8385. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8386. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8387. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8390. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8391. } while (0)
  8392. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8393. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8395. do { \
  8396. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8397. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8398. } while (0)
  8399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8400. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8402. do { \
  8403. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8404. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8405. } while (0)
  8406. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8407. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8408. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8409. do { \
  8410. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8411. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8412. } while (0)
  8413. /**
  8414. * @brief target -> host rx peer map/unmap message definition
  8415. *
  8416. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8417. *
  8418. * @details
  8419. * The following diagram shows the format of the rx peer map message sent
  8420. * from the target to the host. This layout assumes the target operates
  8421. * as little-endian.
  8422. *
  8423. * This message always contains a SW peer ID. The main purpose of the
  8424. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8425. * with, so that the host can use that peer ID to determine which peer
  8426. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8427. * other purposes, such as identifying during tx completions which peer
  8428. * the tx frames in question were transmitted to.
  8429. *
  8430. * In certain generations of chips, the peer map message also contains
  8431. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8432. * to identify which peer the frame needs to be forwarded to (i.e. the
  8433. * peer assocated with the Destination MAC Address within the packet),
  8434. * and particularly which vdev needs to transmit the frame (for cases
  8435. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8436. * meaning as AST_INDEX_0.
  8437. * This DA-based peer ID that is provided for certain rx frames
  8438. * (the rx frames that need to be re-transmitted as tx frames)
  8439. * is the ID that the HW uses for referring to the peer in question,
  8440. * rather than the peer ID that the SW+FW use to refer to the peer.
  8441. *
  8442. *
  8443. * |31 24|23 16|15 8|7 0|
  8444. * |-----------------------------------------------------------------------|
  8445. * | SW peer ID | VDEV ID | msg type |
  8446. * |-----------------------------------------------------------------------|
  8447. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8448. * |-----------------------------------------------------------------------|
  8449. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8450. * |-----------------------------------------------------------------------|
  8451. *
  8452. *
  8453. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8454. *
  8455. * The following diagram shows the format of the rx peer unmap message sent
  8456. * from the target to the host.
  8457. *
  8458. * |31 24|23 16|15 8|7 0|
  8459. * |-----------------------------------------------------------------------|
  8460. * | SW peer ID | VDEV ID | msg type |
  8461. * |-----------------------------------------------------------------------|
  8462. *
  8463. * The following field definitions describe the format of the rx peer map
  8464. * and peer unmap messages sent from the target to the host.
  8465. * - MSG_TYPE
  8466. * Bits 7:0
  8467. * Purpose: identifies this as an rx peer map or peer unmap message
  8468. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8469. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8470. * - VDEV_ID
  8471. * Bits 15:8
  8472. * Purpose: Indicates which virtual device the peer is associated
  8473. * with.
  8474. * Value: vdev ID (used in the host to look up the vdev object)
  8475. * - PEER_ID (a.k.a. SW_PEER_ID)
  8476. * Bits 31:16
  8477. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8478. * freeing (unmap)
  8479. * Value: (rx) peer ID
  8480. * - MAC_ADDR_L32 (peer map only)
  8481. * Bits 31:0
  8482. * Purpose: Identifies which peer node the peer ID is for.
  8483. * Value: lower 4 bytes of peer node's MAC address
  8484. * - MAC_ADDR_U16 (peer map only)
  8485. * Bits 15:0
  8486. * Purpose: Identifies which peer node the peer ID is for.
  8487. * Value: upper 2 bytes of peer node's MAC address
  8488. * - HW_PEER_ID
  8489. * Bits 31:16
  8490. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8491. * address, so for rx frames marked for rx --> tx forwarding, the
  8492. * host can determine from the HW peer ID provided as meta-data with
  8493. * the rx frame which peer the frame is supposed to be forwarded to.
  8494. * Value: ID used by the MAC HW to identify the peer
  8495. */
  8496. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8497. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8498. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8499. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8500. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8501. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8502. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8503. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8504. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8505. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8506. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8507. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8508. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8509. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8510. do { \
  8511. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8512. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8513. } while (0)
  8514. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8515. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8516. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8517. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8518. do { \
  8519. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8520. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8521. } while (0)
  8522. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8523. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8524. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8525. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8526. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8527. do { \
  8528. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8529. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8530. } while (0)
  8531. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8532. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8533. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8534. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8535. #define HTT_RX_PEER_MAP_BYTES 12
  8536. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8537. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8538. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8539. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8540. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8541. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8542. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8543. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8544. #define HTT_RX_PEER_UNMAP_BYTES 4
  8545. /**
  8546. * @brief target -> host rx peer map V2 message definition
  8547. *
  8548. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8549. *
  8550. * @details
  8551. * The following diagram shows the format of the rx peer map v2 message sent
  8552. * from the target to the host. This layout assumes the target operates
  8553. * as little-endian.
  8554. *
  8555. * This message always contains a SW peer ID. The main purpose of the
  8556. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8557. * with, so that the host can use that peer ID to determine which peer
  8558. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8559. * other purposes, such as identifying during tx completions which peer
  8560. * the tx frames in question were transmitted to.
  8561. *
  8562. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8563. * is used during rx --> tx frame forwarding to identify which peer the
  8564. * frame needs to be forwarded to (i.e. the peer assocated with the
  8565. * Destination MAC Address within the packet), and particularly which vdev
  8566. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8567. * This DA-based peer ID that is provided for certain rx frames
  8568. * (the rx frames that need to be re-transmitted as tx frames)
  8569. * is the ID that the HW uses for referring to the peer in question,
  8570. * rather than the peer ID that the SW+FW use to refer to the peer.
  8571. *
  8572. * The HW peer id here is the same meaning as AST_INDEX_0.
  8573. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8574. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8575. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8576. * AST is valid.
  8577. *
  8578. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8579. * |-------------------------------------------------------------------------|
  8580. * | SW peer ID | VDEV ID | msg type |
  8581. * |-------------------------------------------------------------------------|
  8582. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8583. * |-------------------------------------------------------------------------|
  8584. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8585. * |-------------------------------------------------------------------------|
  8586. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8587. * |-------------------------------------------------------------------------|
  8588. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8589. * |-------------------------------------------------------------------------|
  8590. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8591. * |-------------------------------------------------------------------------|
  8592. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8593. * |-------------------------------------------------------------------------|
  8594. * | Reserved_2 |
  8595. * |-------------------------------------------------------------------------|
  8596. * Where:
  8597. * NH = Next Hop
  8598. * ASTVM = AST valid mask
  8599. * OA = on-chip AST valid bit
  8600. * ASTFM = AST flow mask
  8601. *
  8602. * The following field definitions describe the format of the rx peer map v2
  8603. * messages sent from the target to the host.
  8604. * - MSG_TYPE
  8605. * Bits 7:0
  8606. * Purpose: identifies this as an rx peer map v2 message
  8607. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8608. * - VDEV_ID
  8609. * Bits 15:8
  8610. * Purpose: Indicates which virtual device the peer is associated with.
  8611. * Value: vdev ID (used in the host to look up the vdev object)
  8612. * - SW_PEER_ID
  8613. * Bits 31:16
  8614. * Purpose: The peer ID (index) that WAL is allocating
  8615. * Value: (rx) peer ID
  8616. * - MAC_ADDR_L32
  8617. * Bits 31:0
  8618. * Purpose: Identifies which peer node the peer ID is for.
  8619. * Value: lower 4 bytes of peer node's MAC address
  8620. * - MAC_ADDR_U16
  8621. * Bits 15:0
  8622. * Purpose: Identifies which peer node the peer ID is for.
  8623. * Value: upper 2 bytes of peer node's MAC address
  8624. * - HW_PEER_ID / AST_INDEX_0
  8625. * Bits 31:16
  8626. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8627. * address, so for rx frames marked for rx --> tx forwarding, the
  8628. * host can determine from the HW peer ID provided as meta-data with
  8629. * the rx frame which peer the frame is supposed to be forwarded to.
  8630. * Value: ID used by the MAC HW to identify the peer
  8631. * - AST_HASH_VALUE
  8632. * Bits 15:0
  8633. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8634. * override feature.
  8635. * - NEXT_HOP
  8636. * Bit 16
  8637. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8638. * (Wireless Distribution System).
  8639. * - AST_VALID_MASK
  8640. * Bits 19:17
  8641. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8642. * - ONCHIP_AST_VALID_FLAG
  8643. * Bit 20
  8644. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8645. * is valid.
  8646. * - AST_INDEX_1
  8647. * Bits 15:0
  8648. * Purpose: indicate the second AST index for this peer
  8649. * - AST_0_FLOW_MASK
  8650. * Bits 19:16
  8651. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8652. * - AST_1_FLOW_MASK
  8653. * Bits 23:20
  8654. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8655. * - AST_2_FLOW_MASK
  8656. * Bits 27:24
  8657. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8658. * - AST_3_FLOW_MASK
  8659. * Bits 31:28
  8660. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8661. * - AST_INDEX_2
  8662. * Bits 15:0
  8663. * Purpose: indicate the third AST index for this peer
  8664. * - TID_VALID_HI_PRI
  8665. * Bits 23:16
  8666. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8667. * - TID_VALID_LOW_PRI
  8668. * Bits 31:24
  8669. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8670. * - AST_INDEX_3
  8671. * Bits 15:0
  8672. * Purpose: indicate the fourth AST index for this peer
  8673. * - ONCHIP_AST_IDX / RESERVED
  8674. * Bits 31:16
  8675. * Purpose: This field is valid only when split AST feature is enabled.
  8676. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8677. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8678. * address, this ast_idx is used for LMAC modules for RXPCU.
  8679. * Value: ID used by the LMAC HW to identify the peer
  8680. */
  8681. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8682. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8683. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8684. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8685. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8686. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8687. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8688. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8689. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8690. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8691. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8692. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8693. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8694. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8695. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8696. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8697. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8698. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8699. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8700. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8701. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8702. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8703. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8704. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8705. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8706. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8707. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8708. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8709. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8710. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8711. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8712. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8713. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8714. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8715. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8716. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8717. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8718. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8719. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8720. do { \
  8721. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8722. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8723. } while (0)
  8724. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8725. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8726. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8727. do { \
  8728. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8729. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8730. } while (0)
  8731. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8732. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8733. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8736. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8737. } while (0)
  8738. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8739. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8740. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8741. do { \
  8742. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8743. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8744. } while (0)
  8745. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8746. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8747. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8748. do { \
  8749. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8750. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8751. } while (0)
  8752. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8753. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8754. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8755. do { \
  8756. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8757. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8758. } while (0)
  8759. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8760. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8761. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8762. do { \
  8763. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8764. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8765. } while (0)
  8766. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8767. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8768. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8769. do { \
  8770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8771. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8772. } while (0)
  8773. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8774. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8775. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8776. do { \
  8777. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8778. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8779. } while (0)
  8780. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8781. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8782. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8783. do { \
  8784. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8785. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8786. } while (0)
  8787. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8788. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8789. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8790. do { \
  8791. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8792. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8793. } while (0)
  8794. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8795. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8796. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8797. do { \
  8798. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8799. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8800. } while (0)
  8801. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8802. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8803. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8804. do { \
  8805. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8806. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8807. } while (0)
  8808. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8809. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8810. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8811. do { \
  8812. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8813. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8814. } while (0)
  8815. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8816. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8817. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8820. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8821. } while (0)
  8822. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8823. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8824. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8825. do { \
  8826. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8827. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8828. } while (0)
  8829. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8830. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8831. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8832. do { \
  8833. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8834. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8835. } while (0)
  8836. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8837. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8838. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8839. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8840. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8841. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8842. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8843. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8844. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8845. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8846. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8847. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8848. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8849. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8850. /**
  8851. * @brief target -> host rx peer unmap V2 message definition
  8852. *
  8853. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  8854. *
  8855. * The following diagram shows the format of the rx peer unmap message sent
  8856. * from the target to the host.
  8857. *
  8858. * |31 24|23 16|15 8|7 0|
  8859. * |-----------------------------------------------------------------------|
  8860. * | SW peer ID | VDEV ID | msg type |
  8861. * |-----------------------------------------------------------------------|
  8862. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8863. * |-----------------------------------------------------------------------|
  8864. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8865. * |-----------------------------------------------------------------------|
  8866. * | Peer Delete Duration |
  8867. * |-----------------------------------------------------------------------|
  8868. * | Reserved_0 | WDS Free Count |
  8869. * |-----------------------------------------------------------------------|
  8870. * | Reserved_1 |
  8871. * |-----------------------------------------------------------------------|
  8872. * | Reserved_2 |
  8873. * |-----------------------------------------------------------------------|
  8874. *
  8875. *
  8876. * The following field definitions describe the format of the rx peer unmap
  8877. * messages sent from the target to the host.
  8878. * - MSG_TYPE
  8879. * Bits 7:0
  8880. * Purpose: identifies this as an rx peer unmap v2 message
  8881. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  8882. * - VDEV_ID
  8883. * Bits 15:8
  8884. * Purpose: Indicates which virtual device the peer is associated
  8885. * with.
  8886. * Value: vdev ID (used in the host to look up the vdev object)
  8887. * - SW_PEER_ID
  8888. * Bits 31:16
  8889. * Purpose: The peer ID (index) that WAL is freeing
  8890. * Value: (rx) peer ID
  8891. * - MAC_ADDR_L32
  8892. * Bits 31:0
  8893. * Purpose: Identifies which peer node the peer ID is for.
  8894. * Value: lower 4 bytes of peer node's MAC address
  8895. * - MAC_ADDR_U16
  8896. * Bits 15:0
  8897. * Purpose: Identifies which peer node the peer ID is for.
  8898. * Value: upper 2 bytes of peer node's MAC address
  8899. * - NEXT_HOP
  8900. * Bits 16
  8901. * Purpose: Bit indicates next_hop AST entry used for WDS
  8902. * (Wireless Distribution System).
  8903. * - PEER_DELETE_DURATION
  8904. * Bits 31:0
  8905. * Purpose: Time taken to delete peer, in msec,
  8906. * Used for monitoring / debugging PEER delete response delay
  8907. * - PEER_WDS_FREE_COUNT
  8908. * Bits 15:0
  8909. * Purpose: Count of WDS entries deleted associated to peer deleted
  8910. */
  8911. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8912. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8913. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8914. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8915. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8916. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8917. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8918. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8919. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8920. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8921. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8922. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8923. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8924. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8925. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8926. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8927. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8928. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8929. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8930. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8931. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8934. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8935. } while (0)
  8936. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8937. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8938. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8941. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8942. } while (0)
  8943. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8944. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8945. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8946. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8947. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8948. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8949. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8950. /**
  8951. * @brief target -> host rx peer mlo map message definition
  8952. *
  8953. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  8954. *
  8955. * @details
  8956. * The following diagram shows the format of the rx mlo peer map message sent
  8957. * from the target to the host. This layout assumes the target operates
  8958. * as little-endian.
  8959. *
  8960. * MCC:
  8961. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  8962. *
  8963. * WIN:
  8964. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  8965. * It will be sent on the Assoc Link.
  8966. *
  8967. * This message always contains a MLO peer ID. The main purpose of the
  8968. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  8969. * with, so that the host can use that MLO peer ID to determine which peer
  8970. * transmitted the rx frame.
  8971. *
  8972. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  8973. * |-------------------------------------------------------------------------|
  8974. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  8975. * |-------------------------------------------------------------------------|
  8976. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8977. * |-------------------------------------------------------------------------|
  8978. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  8979. * |-------------------------------------------------------------------------|
  8980. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  8981. * |-------------------------------------------------------------------------|
  8982. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  8983. * |-------------------------------------------------------------------------|
  8984. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  8985. * |-------------------------------------------------------------------------|
  8986. * |RSVD |
  8987. * |-------------------------------------------------------------------------|
  8988. * |RSVD |
  8989. * |-------------------------------------------------------------------------|
  8990. * | htt_tlv_hdr_t |
  8991. * |-------------------------------------------------------------------------|
  8992. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  8993. * |-------------------------------------------------------------------------|
  8994. * | htt_tlv_hdr_t |
  8995. * |-------------------------------------------------------------------------|
  8996. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  8997. * |-------------------------------------------------------------------------|
  8998. * | htt_tlv_hdr_t |
  8999. * |-------------------------------------------------------------------------|
  9000. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  9001. * |-------------------------------------------------------------------------|
  9002. *
  9003. * Where:
  9004. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  9005. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  9006. * V (valid) - 1 Bit Bit17
  9007. * CHIPID - 3 Bits
  9008. * TIDMASK - 8 Bits
  9009. * CACHE_SET_NUM - 8 Bits
  9010. *
  9011. * The following field definitions describe the format of the rx MLO peer map
  9012. * messages sent from the target to the host.
  9013. * - MSG_TYPE
  9014. * Bits 7:0
  9015. * Purpose: identifies this as an rx mlo peer map message
  9016. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  9017. *
  9018. * - MLO_PEER_ID
  9019. * Bits 23:8
  9020. * Purpose: The MLO peer ID (index).
  9021. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  9022. * Value: MLO peer ID
  9023. *
  9024. * - NUMLINK
  9025. * Bits: 26:24 (3Bits)
  9026. * Purpose: Indicate the max number of logical links supported per client.
  9027. * Value: number of logical links
  9028. *
  9029. * - PRC
  9030. * Bits: 29:27 (3Bits)
  9031. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  9032. * if there is migration of the primary chip.
  9033. * Value: Primary REO CHIPID
  9034. *
  9035. * - MAC_ADDR_L32
  9036. * Bits 31:0
  9037. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  9038. * Value: lower 4 bytes of peer node's MAC address
  9039. *
  9040. * - MAC_ADDR_U16
  9041. * Bits 15:0
  9042. * Purpose: Identifies which peer node the peer ID is for.
  9043. * Value: upper 2 bytes of peer node's MAC address
  9044. *
  9045. * - PRIMARY_TCL_AST_IDX
  9046. * Bits 15:0
  9047. * Purpose: Primary TCL AST index for this peer.
  9048. *
  9049. * - V
  9050. * 1 Bit Position 16
  9051. * Purpose: If the ast idx is valid.
  9052. *
  9053. * - CHIPID
  9054. * Bits 19:17
  9055. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  9056. *
  9057. * - TIDMASK
  9058. * Bits 27:20
  9059. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  9060. *
  9061. * - CACHE_SET_NUM
  9062. * Bits 31:28
  9063. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  9064. * Cache set number that should be used to cache the index based
  9065. * search results, for address and flow search.
  9066. * This value should be equal to LSB four bits of the hash value
  9067. * of match data, in case of search index points to an entry which
  9068. * may be used in content based search also. The value can be
  9069. * anything when the entry pointed by search index will not be
  9070. * used for content based search.
  9071. *
  9072. * - htt_tlv_hdr_t
  9073. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  9074. *
  9075. * Bits 11:0
  9076. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  9077. *
  9078. * Bits 23:12
  9079. * Purpose: Length, Length of the value that follows the header
  9080. *
  9081. * Bits 31:28
  9082. * Purpose: Reserved.
  9083. *
  9084. *
  9085. * - SW_PEER_ID
  9086. * Bits 15:0
  9087. * Purpose: The peer ID (index) that WAL is allocating
  9088. * Value: (rx) peer ID
  9089. *
  9090. * - VDEV_ID
  9091. * Bits 23:16
  9092. * Purpose: Indicates which virtual device the peer is associated with.
  9093. * Value: vdev ID (used in the host to look up the vdev object)
  9094. *
  9095. * - CHIPID
  9096. * Bits 26:24
  9097. * Purpose: Indicates which Chip id the peer is associated with.
  9098. * Value: chip ID (Provided by Host as part of QMI exchange)
  9099. */
  9100. typedef enum {
  9101. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  9102. } MLO_PEER_MAP_TLV_TAG_ID;
  9103. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  9104. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  9105. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  9106. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  9107. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  9108. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  9109. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9110. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  9111. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  9112. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  9113. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  9114. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  9115. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  9116. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  9117. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  9118. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  9119. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  9120. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  9121. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  9122. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  9123. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  9124. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  9125. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  9126. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  9127. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  9128. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  9129. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  9130. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  9131. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  9132. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  9133. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  9136. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  9137. } while (0)
  9138. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  9139. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  9140. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  9143. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  9144. } while (0)
  9145. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  9146. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  9147. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  9150. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  9151. } while (0)
  9152. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  9153. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  9154. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  9157. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  9158. } while (0)
  9159. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  9160. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  9161. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  9162. do { \
  9163. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  9164. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  9165. } while (0)
  9166. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  9167. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  9168. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  9169. do { \
  9170. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  9171. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  9172. } while (0)
  9173. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  9174. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  9175. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  9176. do { \
  9177. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  9178. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  9179. } while (0)
  9180. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  9181. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  9182. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  9185. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  9186. } while (0)
  9187. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  9188. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  9189. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  9190. do { \
  9191. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  9192. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  9193. } while (0)
  9194. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  9195. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  9196. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  9197. do { \
  9198. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  9199. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  9200. } while (0)
  9201. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  9202. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  9203. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  9204. do { \
  9205. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  9206. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  9207. } while (0)
  9208. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  9209. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  9210. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  9213. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  9214. } while (0)
  9215. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  9216. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  9217. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  9218. do { \
  9219. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  9220. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  9221. } while (0)
  9222. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  9223. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  9224. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9225. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  9226. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  9227. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  9228. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  9229. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  9230. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  9231. *
  9232. * The following diagram shows the format of the rx mlo peer unmap message sent
  9233. * from the target to the host.
  9234. *
  9235. * |31 24|23 16|15 8|7 0|
  9236. * |-----------------------------------------------------------------------|
  9237. * | RSVD_24_31 | MLO peer ID | msg type |
  9238. * |-----------------------------------------------------------------------|
  9239. */
  9240. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  9241. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  9242. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  9243. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  9244. /**
  9245. * @brief target -> host message specifying security parameters
  9246. *
  9247. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  9248. *
  9249. * @details
  9250. * The following diagram shows the format of the security specification
  9251. * message sent from the target to the host.
  9252. * This security specification message tells the host whether a PN check is
  9253. * necessary on rx data frames, and if so, how large the PN counter is.
  9254. * This message also tells the host about the security processing to apply
  9255. * to defragmented rx frames - specifically, whether a Message Integrity
  9256. * Check is required, and the Michael key to use.
  9257. *
  9258. * |31 24|23 16|15|14 8|7 0|
  9259. * |-----------------------------------------------------------------------|
  9260. * | peer ID | U| security type | msg type |
  9261. * |-----------------------------------------------------------------------|
  9262. * | Michael Key K0 |
  9263. * |-----------------------------------------------------------------------|
  9264. * | Michael Key K1 |
  9265. * |-----------------------------------------------------------------------|
  9266. * | WAPI RSC Low0 |
  9267. * |-----------------------------------------------------------------------|
  9268. * | WAPI RSC Low1 |
  9269. * |-----------------------------------------------------------------------|
  9270. * | WAPI RSC Hi0 |
  9271. * |-----------------------------------------------------------------------|
  9272. * | WAPI RSC Hi1 |
  9273. * |-----------------------------------------------------------------------|
  9274. *
  9275. * The following field definitions describe the format of the security
  9276. * indication message sent from the target to the host.
  9277. * - MSG_TYPE
  9278. * Bits 7:0
  9279. * Purpose: identifies this as a security specification message
  9280. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  9281. * - SEC_TYPE
  9282. * Bits 14:8
  9283. * Purpose: specifies which type of security applies to the peer
  9284. * Value: htt_sec_type enum value
  9285. * - UNICAST
  9286. * Bit 15
  9287. * Purpose: whether this security is applied to unicast or multicast data
  9288. * Value: 1 -> unicast, 0 -> multicast
  9289. * - PEER_ID
  9290. * Bits 31:16
  9291. * Purpose: The ID number for the peer the security specification is for
  9292. * Value: peer ID
  9293. * - MICHAEL_KEY_K0
  9294. * Bits 31:0
  9295. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  9296. * Value: Michael Key K0 (if security type is TKIP)
  9297. * - MICHAEL_KEY_K1
  9298. * Bits 31:0
  9299. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  9300. * Value: Michael Key K1 (if security type is TKIP)
  9301. * - WAPI_RSC_LOW0
  9302. * Bits 31:0
  9303. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  9304. * Value: WAPI RSC Low0 (if security type is WAPI)
  9305. * - WAPI_RSC_LOW1
  9306. * Bits 31:0
  9307. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  9308. * Value: WAPI RSC Low1 (if security type is WAPI)
  9309. * - WAPI_RSC_HI0
  9310. * Bits 31:0
  9311. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  9312. * Value: WAPI RSC Hi0 (if security type is WAPI)
  9313. * - WAPI_RSC_HI1
  9314. * Bits 31:0
  9315. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  9316. * Value: WAPI RSC Hi1 (if security type is WAPI)
  9317. */
  9318. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  9319. #define HTT_SEC_IND_SEC_TYPE_S 8
  9320. #define HTT_SEC_IND_UNICAST_M 0x00008000
  9321. #define HTT_SEC_IND_UNICAST_S 15
  9322. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  9323. #define HTT_SEC_IND_PEER_ID_S 16
  9324. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  9325. do { \
  9326. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  9327. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  9328. } while (0)
  9329. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  9330. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  9331. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  9332. do { \
  9333. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  9334. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  9335. } while (0)
  9336. #define HTT_SEC_IND_UNICAST_GET(word) \
  9337. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  9338. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  9339. do { \
  9340. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  9341. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  9342. } while (0)
  9343. #define HTT_SEC_IND_PEER_ID_GET(word) \
  9344. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  9345. #define HTT_SEC_IND_BYTES 28
  9346. /**
  9347. * @brief target -> host rx ADDBA / DELBA message definitions
  9348. *
  9349. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  9350. *
  9351. * @details
  9352. * The following diagram shows the format of the rx ADDBA message sent
  9353. * from the target to the host:
  9354. *
  9355. * |31 20|19 16|15 8|7 0|
  9356. * |---------------------------------------------------------------------|
  9357. * | peer ID | TID | window size | msg type |
  9358. * |---------------------------------------------------------------------|
  9359. *
  9360. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  9361. *
  9362. * The following diagram shows the format of the rx DELBA message sent
  9363. * from the target to the host:
  9364. *
  9365. * |31 20|19 16|15 10|9 8|7 0|
  9366. * |---------------------------------------------------------------------|
  9367. * | peer ID | TID | window size | IR| msg type |
  9368. * |---------------------------------------------------------------------|
  9369. *
  9370. * The following field definitions describe the format of the rx ADDBA
  9371. * and DELBA messages sent from the target to the host.
  9372. * - MSG_TYPE
  9373. * Bits 7:0
  9374. * Purpose: identifies this as an rx ADDBA or DELBA message
  9375. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  9376. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  9377. * - IR (initiator / recipient)
  9378. * Bits 9:8 (DELBA only)
  9379. * Purpose: specify whether the DELBA handshake was initiated by the
  9380. * local STA/AP, or by the peer STA/AP
  9381. * Value:
  9382. * 0 - unspecified
  9383. * 1 - initiator (a.k.a. originator)
  9384. * 2 - recipient (a.k.a. responder)
  9385. * 3 - unused / reserved
  9386. * - WIN_SIZE
  9387. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  9388. * Purpose: Specifies the length of the block ack window (max = 64).
  9389. * Value:
  9390. * block ack window length specified by the received ADDBA/DELBA
  9391. * management message.
  9392. * - TID
  9393. * Bits 19:16
  9394. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  9395. * Value:
  9396. * TID specified by the received ADDBA or DELBA management message.
  9397. * - PEER_ID
  9398. * Bits 31:20
  9399. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  9400. * Value:
  9401. * ID (hash value) used by the host for fast, direct lookup of
  9402. * host SW peer info, including rx reorder states.
  9403. */
  9404. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  9405. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  9406. #define HTT_RX_ADDBA_TID_M 0xf0000
  9407. #define HTT_RX_ADDBA_TID_S 16
  9408. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  9409. #define HTT_RX_ADDBA_PEER_ID_S 20
  9410. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  9411. do { \
  9412. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  9413. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  9414. } while (0)
  9415. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  9416. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  9417. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9418. do { \
  9419. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9420. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9421. } while (0)
  9422. #define HTT_RX_ADDBA_TID_GET(word) \
  9423. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9424. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9425. do { \
  9426. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9427. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9428. } while (0)
  9429. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9430. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9431. #define HTT_RX_ADDBA_BYTES 4
  9432. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9433. #define HTT_RX_DELBA_INITIATOR_S 8
  9434. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9435. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9436. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9437. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9438. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9439. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9440. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9441. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9442. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9443. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9444. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9445. do { \
  9446. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9447. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9448. } while (0)
  9449. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9450. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9451. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9452. do { \
  9453. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9454. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9455. } while (0)
  9456. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9457. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9458. #define HTT_RX_DELBA_BYTES 4
  9459. /**
  9460. * @brief tx queue group information element definition
  9461. *
  9462. * @details
  9463. * The following diagram shows the format of the tx queue group
  9464. * information element, which can be included in target --> host
  9465. * messages to specify the number of tx "credits" (tx descriptors
  9466. * for LL, or tx buffers for HL) available to a particular group
  9467. * of host-side tx queues, and which host-side tx queues belong to
  9468. * the group.
  9469. *
  9470. * |31|30 24|23 16|15|14|13 0|
  9471. * |------------------------------------------------------------------------|
  9472. * | X| reserved | tx queue grp ID | A| S| credit count |
  9473. * |------------------------------------------------------------------------|
  9474. * | vdev ID mask | AC mask |
  9475. * |------------------------------------------------------------------------|
  9476. *
  9477. * The following definitions describe the fields within the tx queue group
  9478. * information element:
  9479. * - credit_count
  9480. * Bits 13:1
  9481. * Purpose: specify how many tx credits are available to the tx queue group
  9482. * Value: An absolute or relative, positive or negative credit value
  9483. * The 'A' bit specifies whether the value is absolute or relative.
  9484. * The 'S' bit specifies whether the value is positive or negative.
  9485. * A negative value can only be relative, not absolute.
  9486. * An absolute value replaces any prior credit value the host has for
  9487. * the tx queue group in question.
  9488. * A relative value is added to the prior credit value the host has for
  9489. * the tx queue group in question.
  9490. * - sign
  9491. * Bit 14
  9492. * Purpose: specify whether the credit count is positive or negative
  9493. * Value: 0 -> positive, 1 -> negative
  9494. * - absolute
  9495. * Bit 15
  9496. * Purpose: specify whether the credit count is absolute or relative
  9497. * Value: 0 -> relative, 1 -> absolute
  9498. * - txq_group_id
  9499. * Bits 23:16
  9500. * Purpose: indicate which tx queue group's credit and/or membership are
  9501. * being specified
  9502. * Value: 0 to max_tx_queue_groups-1
  9503. * - reserved
  9504. * Bits 30:16
  9505. * Value: 0x0
  9506. * - eXtension
  9507. * Bit 31
  9508. * Purpose: specify whether another tx queue group info element follows
  9509. * Value: 0 -> no more tx queue group information elements
  9510. * 1 -> another tx queue group information element immediately follows
  9511. * - ac_mask
  9512. * Bits 15:0
  9513. * Purpose: specify which Access Categories belong to the tx queue group
  9514. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9515. * the tx queue group.
  9516. * The AC bit-mask values are obtained by left-shifting by the
  9517. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9518. * - vdev_id_mask
  9519. * Bits 31:16
  9520. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9521. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9522. * belong to the tx queue group.
  9523. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9524. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9525. */
  9526. PREPACK struct htt_txq_group {
  9527. A_UINT32
  9528. credit_count: 14,
  9529. sign: 1,
  9530. absolute: 1,
  9531. tx_queue_group_id: 8,
  9532. reserved0: 7,
  9533. extension: 1;
  9534. A_UINT32
  9535. ac_mask: 16,
  9536. vdev_id_mask: 16;
  9537. } POSTPACK;
  9538. /* first word */
  9539. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9540. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9541. #define HTT_TXQ_GROUP_SIGN_S 14
  9542. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9543. #define HTT_TXQ_GROUP_ABS_S 15
  9544. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9545. #define HTT_TXQ_GROUP_ID_S 16
  9546. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9547. #define HTT_TXQ_GROUP_EXT_S 31
  9548. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9549. /* second word */
  9550. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9551. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9552. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9553. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9554. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9555. do { \
  9556. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9557. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9558. } while (0)
  9559. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9560. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9561. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9562. do { \
  9563. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9564. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9565. } while (0)
  9566. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9567. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9568. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9569. do { \
  9570. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9571. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9572. } while (0)
  9573. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9574. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9575. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9576. do { \
  9577. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9578. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9579. } while (0)
  9580. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9581. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9582. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9583. do { \
  9584. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9585. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9586. } while (0)
  9587. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9588. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9589. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9590. do { \
  9591. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9592. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9593. } while (0)
  9594. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9595. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9596. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9599. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9600. } while (0)
  9601. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9602. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9603. /**
  9604. * @brief target -> host TX completion indication message definition
  9605. *
  9606. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  9607. *
  9608. * @details
  9609. * The following diagram shows the format of the TX completion indication sent
  9610. * from the target to the host
  9611. *
  9612. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9613. * |-------------------------------------------------------------------|
  9614. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9615. * |-------------------------------------------------------------------|
  9616. * payload:| MSDU1 ID | MSDU0 ID |
  9617. * |-------------------------------------------------------------------|
  9618. * : MSDU3 ID | MSDU2 ID :
  9619. * |-------------------------------------------------------------------|
  9620. * | struct htt_tx_compl_ind_append_retries |
  9621. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9622. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9623. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9624. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9625. * |-------------------------------------------------------------------|
  9626. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9627. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9628. * | MSDU0 tx_tsf64_low |
  9629. * |-------------------------------------------------------------------|
  9630. * | MSDU0 tx_tsf64_high |
  9631. * |-------------------------------------------------------------------|
  9632. * | MSDU1 tx_tsf64_low |
  9633. * |-------------------------------------------------------------------|
  9634. * | MSDU1 tx_tsf64_high |
  9635. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9636. * | phy_timestamp |
  9637. * |-------------------------------------------------------------------|
  9638. * | rate specs (see below) |
  9639. * |-------------------------------------------------------------------|
  9640. * | seqctrl | framectrl |
  9641. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9642. * Where:
  9643. * A0 = append (a.k.a. append0)
  9644. * A1 = append1
  9645. * TP = MSDU tx power presence
  9646. * A2 = append2
  9647. * A3 = append3
  9648. * A4 = append4
  9649. *
  9650. * The following field definitions describe the format of the TX completion
  9651. * indication sent from the target to the host
  9652. * Header fields:
  9653. * - msg_type
  9654. * Bits 7:0
  9655. * Purpose: identifies this as HTT TX completion indication
  9656. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  9657. * - status
  9658. * Bits 10:8
  9659. * Purpose: the TX completion status of payload fragmentations descriptors
  9660. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9661. * - tid
  9662. * Bits 14:11
  9663. * Purpose: the tid associated with those fragmentation descriptors. It is
  9664. * valid or not, depending on the tid_invalid bit.
  9665. * Value: 0 to 15
  9666. * - tid_invalid
  9667. * Bits 15:15
  9668. * Purpose: this bit indicates whether the tid field is valid or not
  9669. * Value: 0 indicates valid; 1 indicates invalid
  9670. * - num
  9671. * Bits 23:16
  9672. * Purpose: the number of payload in this indication
  9673. * Value: 1 to 255
  9674. * - append (a.k.a. append0)
  9675. * Bits 24:24
  9676. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9677. * the number of tx retries for one MSDU at the end of this message
  9678. * Value: 0 indicates no appending; 1 indicates appending
  9679. * - append1
  9680. * Bits 25:25
  9681. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9682. * contains the timestamp info for each TX msdu id in payload.
  9683. * The order of the timestamps matches the order of the MSDU IDs.
  9684. * Note that a big-endian host needs to account for the reordering
  9685. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9686. * conversion) when determining which tx timestamp corresponds to
  9687. * which MSDU ID.
  9688. * Value: 0 indicates no appending; 1 indicates appending
  9689. * - msdu_tx_power_presence
  9690. * Bits 26:26
  9691. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9692. * for each MSDU referenced by the TX_COMPL_IND message.
  9693. * The tx power is reported in 0.5 dBm units.
  9694. * The order of the per-MSDU tx power reports matches the order
  9695. * of the MSDU IDs.
  9696. * Note that a big-endian host needs to account for the reordering
  9697. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9698. * conversion) when determining which Tx Power corresponds to
  9699. * which MSDU ID.
  9700. * Value: 0 indicates MSDU tx power reports are not appended,
  9701. * 1 indicates MSDU tx power reports are appended
  9702. * - append2
  9703. * Bits 27:27
  9704. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9705. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9706. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9707. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9708. * for each MSDU, for convenience.
  9709. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9710. * this append2 bit is set).
  9711. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9712. * dB above the noise floor.
  9713. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9714. * 1 indicates MSDU ACK RSSI values are appended.
  9715. * - append3
  9716. * Bits 28:28
  9717. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9718. * contains the tx tsf info based on wlan global TSF for
  9719. * each TX msdu id in payload.
  9720. * The order of the tx tsf matches the order of the MSDU IDs.
  9721. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9722. * values to indicate the the lower 32 bits and higher 32 bits of
  9723. * the tx tsf.
  9724. * The tx_tsf64 here represents the time MSDU was acked and the
  9725. * tx_tsf64 has microseconds units.
  9726. * Value: 0 indicates no appending; 1 indicates appending
  9727. * - append4
  9728. * Bits 29:29
  9729. * Purpose: Indicate whether data frame control fields and fields required
  9730. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9731. * message. The order of the this message matches the order of
  9732. * the MSDU IDs.
  9733. * Value: 0 indicates frame control fields and fields required for
  9734. * radio tap header values are not appended,
  9735. * 1 indicates frame control fields and fields required for
  9736. * radio tap header values are appended.
  9737. * Payload fields:
  9738. * - hmsdu_id
  9739. * Bits 15:0
  9740. * Purpose: this ID is used to track the Tx buffer in host
  9741. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9742. */
  9743. PREPACK struct htt_tx_data_hdr_information {
  9744. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9745. A_UINT32 /* word 1 */
  9746. /* preamble:
  9747. * 0-OFDM,
  9748. * 1-CCk,
  9749. * 2-HT,
  9750. * 3-VHT
  9751. */
  9752. preamble: 2, /* [1:0] */
  9753. /* mcs:
  9754. * In case of HT preamble interpret
  9755. * MCS along with NSS.
  9756. * Valid values for HT are 0 to 7.
  9757. * HT mcs 0 with NSS 2 is mcs 8.
  9758. * Valid values for VHT are 0 to 9.
  9759. */
  9760. mcs: 4, /* [5:2] */
  9761. /* rate:
  9762. * This is applicable only for
  9763. * CCK and OFDM preamble type
  9764. * rate 0: OFDM 48 Mbps,
  9765. * 1: OFDM 24 Mbps,
  9766. * 2: OFDM 12 Mbps
  9767. * 3: OFDM 6 Mbps
  9768. * 4: OFDM 54 Mbps
  9769. * 5: OFDM 36 Mbps
  9770. * 6: OFDM 18 Mbps
  9771. * 7: OFDM 9 Mbps
  9772. * rate 0: CCK 11 Mbps Long
  9773. * 1: CCK 5.5 Mbps Long
  9774. * 2: CCK 2 Mbps Long
  9775. * 3: CCK 1 Mbps Long
  9776. * 4: CCK 11 Mbps Short
  9777. * 5: CCK 5.5 Mbps Short
  9778. * 6: CCK 2 Mbps Short
  9779. */
  9780. rate : 3, /* [ 8: 6] */
  9781. rssi : 8, /* [16: 9] units=dBm */
  9782. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9783. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9784. stbc : 1, /* [22] */
  9785. sgi : 1, /* [23] */
  9786. ldpc : 1, /* [24] */
  9787. beamformed: 1, /* [25] */
  9788. /* tx_retry_cnt:
  9789. * Indicates retry count of data tx frames provided by the host.
  9790. */
  9791. tx_retry_cnt: 6; /* [31:26] */
  9792. A_UINT32 /* word 2 */
  9793. framectrl:16, /* [15: 0] */
  9794. seqno:16; /* [31:16] */
  9795. } POSTPACK;
  9796. #define HTT_TX_COMPL_IND_STATUS_S 8
  9797. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9798. #define HTT_TX_COMPL_IND_TID_S 11
  9799. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9800. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9801. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9802. #define HTT_TX_COMPL_IND_NUM_S 16
  9803. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9804. #define HTT_TX_COMPL_IND_APPEND_S 24
  9805. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9806. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9807. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9808. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9809. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9810. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9811. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9812. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9813. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9814. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9815. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9816. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9817. do { \
  9818. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9819. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9820. } while (0)
  9821. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9822. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9823. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9826. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9827. } while (0)
  9828. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9829. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9830. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9833. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9834. } while (0)
  9835. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9836. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9837. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9840. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9841. } while (0)
  9842. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9843. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9844. HTT_TX_COMPL_IND_TID_INV_S)
  9845. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9846. do { \
  9847. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9848. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9849. } while (0)
  9850. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9851. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9852. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9853. do { \
  9854. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9855. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9856. } while (0)
  9857. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9858. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9859. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9860. do { \
  9861. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9862. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9863. } while (0)
  9864. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9865. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9866. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9867. do { \
  9868. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9869. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9870. } while (0)
  9871. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9872. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9873. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9874. do { \
  9875. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9876. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9877. } while (0)
  9878. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9879. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9880. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9881. do { \
  9882. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9883. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9884. } while (0)
  9885. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9886. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9887. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9888. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9889. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9890. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9891. #define HTT_TX_COMPL_IND_STAT_OK 0
  9892. /* DISCARD:
  9893. * current meaning:
  9894. * MSDUs were queued for transmission but filtered by HW or SW
  9895. * without any over the air attempts
  9896. * legacy meaning (HL Rome):
  9897. * MSDUs were discarded by the target FW without any over the air
  9898. * attempts due to lack of space
  9899. */
  9900. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9901. /* NO_ACK:
  9902. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9903. */
  9904. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9905. /* POSTPONE:
  9906. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9907. * be downloaded again later (in the appropriate order), when they are
  9908. * deliverable.
  9909. */
  9910. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9911. /*
  9912. * The PEER_DEL tx completion status is used for HL cases
  9913. * where the peer the frame is for has been deleted.
  9914. * The host has already discarded its copy of the frame, but
  9915. * it still needs the tx completion to restore its credit.
  9916. */
  9917. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9918. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9919. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9920. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9921. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9922. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9923. PREPACK struct htt_tx_compl_ind_base {
  9924. A_UINT32 hdr;
  9925. A_UINT16 payload[1/*or more*/];
  9926. } POSTPACK;
  9927. PREPACK struct htt_tx_compl_ind_append_retries {
  9928. A_UINT16 msdu_id;
  9929. A_UINT8 tx_retries;
  9930. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9931. 0: this is the last append_retries struct */
  9932. } POSTPACK;
  9933. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9934. A_UINT32 timestamp[1/*or more*/];
  9935. } POSTPACK;
  9936. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9937. A_UINT32 tx_tsf64_low;
  9938. A_UINT32 tx_tsf64_high;
  9939. } POSTPACK;
  9940. /* htt_tx_data_hdr_information payload extension fields: */
  9941. /* DWORD zero */
  9942. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9943. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9944. /* DWORD one */
  9945. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9946. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9947. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9948. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9949. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9950. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9951. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9952. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9953. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9954. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9955. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9956. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9957. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9958. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9959. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9960. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9961. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9962. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9963. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9964. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9965. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9966. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9967. /* DWORD two */
  9968. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9969. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9970. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9971. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9972. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9973. do { \
  9974. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9975. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9976. } while (0)
  9977. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9978. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9979. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9980. do { \
  9981. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9982. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9983. } while (0)
  9984. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9985. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9986. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9989. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9990. } while (0)
  9991. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9992. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9993. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9994. do { \
  9995. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9996. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9997. } while (0)
  9998. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9999. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  10000. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  10003. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  10004. } while (0)
  10005. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  10006. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  10007. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  10008. do { \
  10009. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  10010. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  10011. } while (0)
  10012. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  10013. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  10014. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  10017. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  10018. } while (0)
  10019. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  10020. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  10021. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  10022. do { \
  10023. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  10024. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  10025. } while (0)
  10026. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  10027. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  10028. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  10031. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  10032. } while (0)
  10033. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  10034. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  10035. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  10036. do { \
  10037. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  10038. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  10039. } while (0)
  10040. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  10041. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  10042. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  10045. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  10046. } while (0)
  10047. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  10048. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  10049. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  10052. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  10053. } while (0)
  10054. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  10055. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  10056. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  10059. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  10060. } while (0)
  10061. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  10062. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  10063. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  10064. do { \
  10065. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  10066. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  10067. } while (0)
  10068. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  10069. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  10070. /**
  10071. * @brief target -> host rate-control update indication message
  10072. *
  10073. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  10074. *
  10075. * @details
  10076. * The following diagram shows the format of the RC Update message
  10077. * sent from the target to the host, while processing the tx-completion
  10078. * of a transmitted PPDU.
  10079. *
  10080. * |31 24|23 16|15 8|7 0|
  10081. * |-------------------------------------------------------------|
  10082. * | peer ID | vdev ID | msg_type |
  10083. * |-------------------------------------------------------------|
  10084. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10085. * |-------------------------------------------------------------|
  10086. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  10087. * |-------------------------------------------------------------|
  10088. * | : |
  10089. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10090. * | : |
  10091. * |-------------------------------------------------------------|
  10092. * | : |
  10093. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  10094. * | : |
  10095. * |-------------------------------------------------------------|
  10096. * : :
  10097. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10098. *
  10099. */
  10100. typedef struct {
  10101. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  10102. A_UINT32 rate_code_flags;
  10103. A_UINT32 flags; /* Encodes information such as excessive
  10104. retransmission, aggregate, some info
  10105. from .11 frame control,
  10106. STBC, LDPC, (SGI and Tx Chain Mask
  10107. are encoded in ptx_rc->flags field),
  10108. AMPDU truncation (BT/time based etc.),
  10109. RTS/CTS attempt */
  10110. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  10111. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  10112. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  10113. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  10114. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  10115. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  10116. } HTT_RC_TX_DONE_PARAMS;
  10117. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  10118. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  10119. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  10120. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  10121. #define HTT_RC_UPDATE_VDEVID_S 8
  10122. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  10123. #define HTT_RC_UPDATE_PEERID_S 16
  10124. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  10125. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  10126. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  10127. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  10128. do { \
  10129. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  10130. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  10131. } while (0)
  10132. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  10133. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  10134. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  10135. do { \
  10136. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  10137. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  10138. } while (0)
  10139. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  10140. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  10141. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  10142. do { \
  10143. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  10144. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  10145. } while (0)
  10146. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  10147. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  10148. /**
  10149. * @brief target -> host rx fragment indication message definition
  10150. *
  10151. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  10152. *
  10153. * @details
  10154. * The following field definitions describe the format of the rx fragment
  10155. * indication message sent from the target to the host.
  10156. * The rx fragment indication message shares the format of the
  10157. * rx indication message, but not all fields from the rx indication message
  10158. * are relevant to the rx fragment indication message.
  10159. *
  10160. *
  10161. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10162. * |-----------+-------------------+---------------------+-------------|
  10163. * | peer ID | |FV| ext TID | msg type |
  10164. * |-------------------------------------------------------------------|
  10165. * | | flush | flush |
  10166. * | | end | start |
  10167. * | | seq num | seq num |
  10168. * |-------------------------------------------------------------------|
  10169. * | reserved | FW rx desc bytes |
  10170. * |-------------------------------------------------------------------|
  10171. * | | FW MSDU Rx |
  10172. * | | desc B0 |
  10173. * |-------------------------------------------------------------------|
  10174. * Header fields:
  10175. * - MSG_TYPE
  10176. * Bits 7:0
  10177. * Purpose: identifies this as an rx fragment indication message
  10178. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  10179. * - EXT_TID
  10180. * Bits 12:8
  10181. * Purpose: identify the traffic ID of the rx data, including
  10182. * special "extended" TID values for multicast, broadcast, and
  10183. * non-QoS data frames
  10184. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10185. * - FLUSH_VALID (FV)
  10186. * Bit 13
  10187. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10188. * is valid
  10189. * Value:
  10190. * 1 -> flush IE is valid and needs to be processed
  10191. * 0 -> flush IE is not valid and should be ignored
  10192. * - PEER_ID
  10193. * Bits 31:16
  10194. * Purpose: Identify, by ID, which peer sent the rx data
  10195. * Value: ID of the peer who sent the rx data
  10196. * - FLUSH_SEQ_NUM_START
  10197. * Bits 5:0
  10198. * Purpose: Indicate the start of a series of MPDUs to flush
  10199. * Not all MPDUs within this series are necessarily valid - the host
  10200. * must check each sequence number within this range to see if the
  10201. * corresponding MPDU is actually present.
  10202. * This field is only valid if the FV bit is set.
  10203. * Value:
  10204. * The sequence number for the first MPDUs to check to flush.
  10205. * The sequence number is masked by 0x3f.
  10206. * - FLUSH_SEQ_NUM_END
  10207. * Bits 11:6
  10208. * Purpose: Indicate the end of a series of MPDUs to flush
  10209. * Value:
  10210. * The sequence number one larger than the sequence number of the
  10211. * last MPDU to check to flush.
  10212. * The sequence number is masked by 0x3f.
  10213. * Not all MPDUs within this series are necessarily valid - the host
  10214. * must check each sequence number within this range to see if the
  10215. * corresponding MPDU is actually present.
  10216. * This field is only valid if the FV bit is set.
  10217. * Rx descriptor fields:
  10218. * - FW_RX_DESC_BYTES
  10219. * Bits 15:0
  10220. * Purpose: Indicate how many bytes in the Rx indication are used for
  10221. * FW Rx descriptors
  10222. * Value: 1
  10223. */
  10224. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  10225. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  10226. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  10227. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  10228. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  10229. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  10230. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  10231. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  10232. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  10233. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  10234. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  10235. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  10236. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  10237. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  10238. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  10239. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  10240. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  10241. #define HTT_RX_FRAG_IND_BYTES \
  10242. (4 /* msg hdr */ + \
  10243. 4 /* flush spec */ + \
  10244. 4 /* (unused) FW rx desc bytes spec */ + \
  10245. 4 /* FW rx desc */)
  10246. /**
  10247. * @brief target -> host test message definition
  10248. *
  10249. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  10250. *
  10251. * @details
  10252. * The following field definitions describe the format of the test
  10253. * message sent from the target to the host.
  10254. * The message consists of a 4-octet header, followed by a variable
  10255. * number of 32-bit integer values, followed by a variable number
  10256. * of 8-bit character values.
  10257. *
  10258. * |31 16|15 8|7 0|
  10259. * |-----------------------------------------------------------|
  10260. * | num chars | num ints | msg type |
  10261. * |-----------------------------------------------------------|
  10262. * | int 0 |
  10263. * |-----------------------------------------------------------|
  10264. * | int 1 |
  10265. * |-----------------------------------------------------------|
  10266. * | ... |
  10267. * |-----------------------------------------------------------|
  10268. * | char 3 | char 2 | char 1 | char 0 |
  10269. * |-----------------------------------------------------------|
  10270. * | | | ... | char 4 |
  10271. * |-----------------------------------------------------------|
  10272. * - MSG_TYPE
  10273. * Bits 7:0
  10274. * Purpose: identifies this as a test message
  10275. * Value: HTT_MSG_TYPE_TEST
  10276. * - NUM_INTS
  10277. * Bits 15:8
  10278. * Purpose: indicate how many 32-bit integers follow the message header
  10279. * - NUM_CHARS
  10280. * Bits 31:16
  10281. * Purpose: indicate how many 8-bit charaters follow the series of integers
  10282. */
  10283. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  10284. #define HTT_RX_TEST_NUM_INTS_S 8
  10285. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  10286. #define HTT_RX_TEST_NUM_CHARS_S 16
  10287. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  10288. do { \
  10289. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  10290. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  10291. } while (0)
  10292. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  10293. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  10294. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  10295. do { \
  10296. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  10297. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  10298. } while (0)
  10299. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  10300. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  10301. /**
  10302. * @brief target -> host packet log message
  10303. *
  10304. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  10305. *
  10306. * @details
  10307. * The following field definitions describe the format of the packet log
  10308. * message sent from the target to the host.
  10309. * The message consists of a 4-octet header,followed by a variable number
  10310. * of 32-bit character values.
  10311. *
  10312. * |31 16|15 12|11 10|9 8|7 0|
  10313. * |------------------------------------------------------------------|
  10314. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  10315. * |------------------------------------------------------------------|
  10316. * | payload |
  10317. * |------------------------------------------------------------------|
  10318. * - MSG_TYPE
  10319. * Bits 7:0
  10320. * Purpose: identifies this as a pktlog message
  10321. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  10322. * - mac_id
  10323. * Bits 9:8
  10324. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  10325. * Value: 0-3
  10326. * - pdev_id
  10327. * Bits 11:10
  10328. * Purpose: pdev_id
  10329. * Value: 0-3
  10330. * 0 (for rings at SOC level),
  10331. * 1/2/3 PDEV -> 0/1/2
  10332. * - payload_size
  10333. * Bits 31:16
  10334. * Purpose: explicitly specify the payload size
  10335. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  10336. */
  10337. PREPACK struct htt_pktlog_msg {
  10338. A_UINT32 header;
  10339. A_UINT32 payload[1/* or more */];
  10340. } POSTPACK;
  10341. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  10342. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  10343. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  10344. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  10345. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  10346. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  10347. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  10348. do { \
  10349. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  10350. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  10351. } while (0)
  10352. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  10353. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  10354. HTT_T2H_PKTLOG_MAC_ID_S)
  10355. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  10358. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  10359. } while (0)
  10360. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  10361. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  10362. HTT_T2H_PKTLOG_PDEV_ID_S)
  10363. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  10366. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  10367. } while (0)
  10368. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  10369. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  10370. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  10371. /*
  10372. * Rx reorder statistics
  10373. * NB: all the fields must be defined in 4 octets size.
  10374. */
  10375. struct rx_reorder_stats {
  10376. /* Non QoS MPDUs received */
  10377. A_UINT32 deliver_non_qos;
  10378. /* MPDUs received in-order */
  10379. A_UINT32 deliver_in_order;
  10380. /* Flush due to reorder timer expired */
  10381. A_UINT32 deliver_flush_timeout;
  10382. /* Flush due to move out of window */
  10383. A_UINT32 deliver_flush_oow;
  10384. /* Flush due to DELBA */
  10385. A_UINT32 deliver_flush_delba;
  10386. /* MPDUs dropped due to FCS error */
  10387. A_UINT32 fcs_error;
  10388. /* MPDUs dropped due to monitor mode non-data packet */
  10389. A_UINT32 mgmt_ctrl;
  10390. /* Unicast-data MPDUs dropped due to invalid peer */
  10391. A_UINT32 invalid_peer;
  10392. /* MPDUs dropped due to duplication (non aggregation) */
  10393. A_UINT32 dup_non_aggr;
  10394. /* MPDUs dropped due to processed before */
  10395. A_UINT32 dup_past;
  10396. /* MPDUs dropped due to duplicate in reorder queue */
  10397. A_UINT32 dup_in_reorder;
  10398. /* Reorder timeout happened */
  10399. A_UINT32 reorder_timeout;
  10400. /* invalid bar ssn */
  10401. A_UINT32 invalid_bar_ssn;
  10402. /* reorder reset due to bar ssn */
  10403. A_UINT32 ssn_reset;
  10404. /* Flush due to delete peer */
  10405. A_UINT32 deliver_flush_delpeer;
  10406. /* Flush due to offload*/
  10407. A_UINT32 deliver_flush_offload;
  10408. /* Flush due to out of buffer*/
  10409. A_UINT32 deliver_flush_oob;
  10410. /* MPDUs dropped due to PN check fail */
  10411. A_UINT32 pn_fail;
  10412. /* MPDUs dropped due to unable to allocate memory */
  10413. A_UINT32 store_fail;
  10414. /* Number of times the tid pool alloc succeeded */
  10415. A_UINT32 tid_pool_alloc_succ;
  10416. /* Number of times the MPDU pool alloc succeeded */
  10417. A_UINT32 mpdu_pool_alloc_succ;
  10418. /* Number of times the MSDU pool alloc succeeded */
  10419. A_UINT32 msdu_pool_alloc_succ;
  10420. /* Number of times the tid pool alloc failed */
  10421. A_UINT32 tid_pool_alloc_fail;
  10422. /* Number of times the MPDU pool alloc failed */
  10423. A_UINT32 mpdu_pool_alloc_fail;
  10424. /* Number of times the MSDU pool alloc failed */
  10425. A_UINT32 msdu_pool_alloc_fail;
  10426. /* Number of times the tid pool freed */
  10427. A_UINT32 tid_pool_free;
  10428. /* Number of times the MPDU pool freed */
  10429. A_UINT32 mpdu_pool_free;
  10430. /* Number of times the MSDU pool freed */
  10431. A_UINT32 msdu_pool_free;
  10432. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10433. A_UINT32 msdu_queued;
  10434. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10435. A_UINT32 msdu_recycled;
  10436. /* Number of MPDUs with invalid peer but A2 found in AST */
  10437. A_UINT32 invalid_peer_a2_in_ast;
  10438. /* Number of MPDUs with invalid peer but A3 found in AST */
  10439. A_UINT32 invalid_peer_a3_in_ast;
  10440. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10441. A_UINT32 invalid_peer_bmc_mpdus;
  10442. /* Number of MSDUs with err attention word */
  10443. A_UINT32 rxdesc_err_att;
  10444. /* Number of MSDUs with flag of peer_idx_invalid */
  10445. A_UINT32 rxdesc_err_peer_idx_inv;
  10446. /* Number of MSDUs with flag of peer_idx_timeout */
  10447. A_UINT32 rxdesc_err_peer_idx_to;
  10448. /* Number of MSDUs with flag of overflow */
  10449. A_UINT32 rxdesc_err_ov;
  10450. /* Number of MSDUs with flag of msdu_length_err */
  10451. A_UINT32 rxdesc_err_msdu_len;
  10452. /* Number of MSDUs with flag of mpdu_length_err */
  10453. A_UINT32 rxdesc_err_mpdu_len;
  10454. /* Number of MSDUs with flag of tkip_mic_err */
  10455. A_UINT32 rxdesc_err_tkip_mic;
  10456. /* Number of MSDUs with flag of decrypt_err */
  10457. A_UINT32 rxdesc_err_decrypt;
  10458. /* Number of MSDUs with flag of fcs_err */
  10459. A_UINT32 rxdesc_err_fcs;
  10460. /* Number of Unicast (bc_mc bit is not set in attention word)
  10461. * frames with invalid peer handler
  10462. */
  10463. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10464. /* Number of unicast frame directly (direct bit is set in attention word)
  10465. * to DUT with invalid peer handler
  10466. */
  10467. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10468. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10469. * frames with invalid peer handler
  10470. */
  10471. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10472. /* Number of MSDUs dropped due to no first MSDU flag */
  10473. A_UINT32 rxdesc_no_1st_msdu;
  10474. /* Number of MSDUs droped due to ring overflow */
  10475. A_UINT32 msdu_drop_ring_ov;
  10476. /* Number of MSDUs dropped due to FC mismatch */
  10477. A_UINT32 msdu_drop_fc_mismatch;
  10478. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10479. A_UINT32 msdu_drop_mgmt_remote_ring;
  10480. /* Number of MSDUs dropped due to errors not reported in attention word */
  10481. A_UINT32 msdu_drop_misc;
  10482. /* Number of MSDUs go to offload before reorder */
  10483. A_UINT32 offload_msdu_wal;
  10484. /* Number of data frame dropped by offload after reorder */
  10485. A_UINT32 offload_msdu_reorder;
  10486. /* Number of MPDUs with sequence number in the past and within the BA window */
  10487. A_UINT32 dup_past_within_window;
  10488. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10489. A_UINT32 dup_past_outside_window;
  10490. /* Number of MSDUs with decrypt/MIC error */
  10491. A_UINT32 rxdesc_err_decrypt_mic;
  10492. /* Number of data MSDUs received on both local and remote rings */
  10493. A_UINT32 data_msdus_on_both_rings;
  10494. /* MPDUs never filled */
  10495. A_UINT32 holes_not_filled;
  10496. };
  10497. /*
  10498. * Rx Remote buffer statistics
  10499. * NB: all the fields must be defined in 4 octets size.
  10500. */
  10501. struct rx_remote_buffer_mgmt_stats {
  10502. /* Total number of MSDUs reaped for Rx processing */
  10503. A_UINT32 remote_reaped;
  10504. /* MSDUs recycled within firmware */
  10505. A_UINT32 remote_recycled;
  10506. /* MSDUs stored by Data Rx */
  10507. A_UINT32 data_rx_msdus_stored;
  10508. /* Number of HTT indications from WAL Rx MSDU */
  10509. A_UINT32 wal_rx_ind;
  10510. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10511. A_UINT32 wal_rx_ind_unconsumed;
  10512. /* Number of HTT indications from Data Rx MSDU */
  10513. A_UINT32 data_rx_ind;
  10514. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10515. A_UINT32 data_rx_ind_unconsumed;
  10516. /* Number of HTT indications from ATHBUF */
  10517. A_UINT32 athbuf_rx_ind;
  10518. /* Number of remote buffers requested for refill */
  10519. A_UINT32 refill_buf_req;
  10520. /* Number of remote buffers filled by the host */
  10521. A_UINT32 refill_buf_rsp;
  10522. /* Number of times MAC hw_index = f/w write_index */
  10523. A_INT32 mac_no_bufs;
  10524. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10525. A_INT32 fw_indices_equal;
  10526. /* Number of times f/w finds no buffers to post */
  10527. A_INT32 host_no_bufs;
  10528. };
  10529. /*
  10530. * TXBF MU/SU packets and NDPA statistics
  10531. * NB: all the fields must be defined in 4 octets size.
  10532. */
  10533. struct rx_txbf_musu_ndpa_pkts_stats {
  10534. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10535. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10536. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10537. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10538. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10539. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10540. };
  10541. /*
  10542. * htt_dbg_stats_status -
  10543. * present - The requested stats have been delivered in full.
  10544. * This indicates that either the stats information was contained
  10545. * in its entirety within this message, or else this message
  10546. * completes the delivery of the requested stats info that was
  10547. * partially delivered through earlier STATS_CONF messages.
  10548. * partial - The requested stats have been delivered in part.
  10549. * One or more subsequent STATS_CONF messages with the same
  10550. * cookie value will be sent to deliver the remainder of the
  10551. * information.
  10552. * error - The requested stats could not be delivered, for example due
  10553. * to a shortage of memory to construct a message holding the
  10554. * requested stats.
  10555. * invalid - The requested stat type is either not recognized, or the
  10556. * target is configured to not gather the stats type in question.
  10557. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10558. * series_done - This special value indicates that no further stats info
  10559. * elements are present within a series of stats info elems
  10560. * (within a stats upload confirmation message).
  10561. */
  10562. enum htt_dbg_stats_status {
  10563. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10564. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10565. HTT_DBG_STATS_STATUS_ERROR = 2,
  10566. HTT_DBG_STATS_STATUS_INVALID = 3,
  10567. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10568. };
  10569. /**
  10570. * @brief target -> host statistics upload
  10571. *
  10572. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  10573. *
  10574. * @details
  10575. * The following field definitions describe the format of the HTT target
  10576. * to host stats upload confirmation message.
  10577. * The message contains a cookie echoed from the HTT host->target stats
  10578. * upload request, which identifies which request the confirmation is
  10579. * for, and a series of tag-length-value stats information elements.
  10580. * The tag-length header for each stats info element also includes a
  10581. * status field, to indicate whether the request for the stat type in
  10582. * question was fully met, partially met, unable to be met, or invalid
  10583. * (if the stat type in question is disabled in the target).
  10584. * A special value of all 1's in this status field is used to indicate
  10585. * the end of the series of stats info elements.
  10586. *
  10587. *
  10588. * |31 16|15 8|7 5|4 0|
  10589. * |------------------------------------------------------------|
  10590. * | reserved | msg type |
  10591. * |------------------------------------------------------------|
  10592. * | cookie LSBs |
  10593. * |------------------------------------------------------------|
  10594. * | cookie MSBs |
  10595. * |------------------------------------------------------------|
  10596. * | stats entry length | reserved | S |stat type|
  10597. * |------------------------------------------------------------|
  10598. * | |
  10599. * | type-specific stats info |
  10600. * | |
  10601. * |------------------------------------------------------------|
  10602. * | stats entry length | reserved | S |stat type|
  10603. * |------------------------------------------------------------|
  10604. * | |
  10605. * | type-specific stats info |
  10606. * | |
  10607. * |------------------------------------------------------------|
  10608. * | n/a | reserved | 111 | n/a |
  10609. * |------------------------------------------------------------|
  10610. * Header fields:
  10611. * - MSG_TYPE
  10612. * Bits 7:0
  10613. * Purpose: identifies this is a statistics upload confirmation message
  10614. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  10615. * - COOKIE_LSBS
  10616. * Bits 31:0
  10617. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10618. * message with its preceding host->target stats request message.
  10619. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10620. * - COOKIE_MSBS
  10621. * Bits 31:0
  10622. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10623. * message with its preceding host->target stats request message.
  10624. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10625. *
  10626. * Stats Information Element tag-length header fields:
  10627. * - STAT_TYPE
  10628. * Bits 4:0
  10629. * Purpose: identifies the type of statistics info held in the
  10630. * following information element
  10631. * Value: htt_dbg_stats_type
  10632. * - STATUS
  10633. * Bits 7:5
  10634. * Purpose: indicate whether the requested stats are present
  10635. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10636. * the completion of the stats entry series
  10637. * - LENGTH
  10638. * Bits 31:16
  10639. * Purpose: indicate the stats information size
  10640. * Value: This field specifies the number of bytes of stats information
  10641. * that follows the element tag-length header.
  10642. * It is expected but not required that this length is a multiple of
  10643. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10644. * subsequent stats entry header will begin on a 4-byte aligned
  10645. * boundary.
  10646. */
  10647. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10648. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10649. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10650. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10651. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10652. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10653. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10654. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10655. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10656. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10657. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10658. do { \
  10659. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10660. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10661. } while (0)
  10662. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10663. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10664. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10665. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10666. do { \
  10667. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10668. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10669. } while (0)
  10670. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10671. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10672. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10673. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10674. do { \
  10675. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10676. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10677. } while (0)
  10678. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10679. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10680. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10681. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10682. #define HTT_MAX_AGGR 64
  10683. #define HTT_HL_MAX_AGGR 18
  10684. /**
  10685. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10686. *
  10687. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  10688. *
  10689. * @details
  10690. * The following field definitions describe the format of the HTT host
  10691. * to target frag_desc/msdu_ext bank configuration message.
  10692. * The message contains the based address and the min and max id of the
  10693. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10694. * MSDU_EXT/FRAG_DESC.
  10695. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10696. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10697. * the hardware does the mapping/translation.
  10698. *
  10699. * Total banks that can be configured is configured to 16.
  10700. *
  10701. * This should be called before any TX has be initiated by the HTT
  10702. *
  10703. * |31 16|15 8|7 5|4 0|
  10704. * |------------------------------------------------------------|
  10705. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10706. * |------------------------------------------------------------|
  10707. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10708. #if HTT_PADDR64
  10709. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10710. #endif
  10711. * |------------------------------------------------------------|
  10712. * | ... |
  10713. * |------------------------------------------------------------|
  10714. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10715. #if HTT_PADDR64
  10716. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10717. #endif
  10718. * |------------------------------------------------------------|
  10719. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10720. * |------------------------------------------------------------|
  10721. * | ... |
  10722. * |------------------------------------------------------------|
  10723. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10724. * |------------------------------------------------------------|
  10725. * Header fields:
  10726. * - MSG_TYPE
  10727. * Bits 7:0
  10728. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  10729. * for systems with 64-bit format for bus addresses:
  10730. * - BANKx_BASE_ADDRESS_LO
  10731. * Bits 31:0
  10732. * Purpose: Provide a mechanism to specify the base address of the
  10733. * MSDU_EXT bank physical/bus address.
  10734. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10735. * - BANKx_BASE_ADDRESS_HI
  10736. * Bits 31:0
  10737. * Purpose: Provide a mechanism to specify the base address of the
  10738. * MSDU_EXT bank physical/bus address.
  10739. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10740. * for systems with 32-bit format for bus addresses:
  10741. * - BANKx_BASE_ADDRESS
  10742. * Bits 31:0
  10743. * Purpose: Provide a mechanism to specify the base address of the
  10744. * MSDU_EXT bank physical/bus address.
  10745. * Value: MSDU_EXT bank physical / bus address
  10746. * - BANKx_MIN_ID
  10747. * Bits 15:0
  10748. * Purpose: Provide a mechanism to specify the min index that needs to
  10749. * mapped.
  10750. * - BANKx_MAX_ID
  10751. * Bits 31:16
  10752. * Purpose: Provide a mechanism to specify the max index that needs to
  10753. * mapped.
  10754. *
  10755. */
  10756. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10757. * safe value.
  10758. * @note MAX supported banks is 16.
  10759. */
  10760. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10761. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10762. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10763. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10764. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10765. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10766. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10767. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10768. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10769. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10770. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10771. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10772. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10773. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10774. do { \
  10775. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10776. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10777. } while (0)
  10778. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10779. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10780. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10781. do { \
  10782. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10783. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10784. } while (0)
  10785. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10786. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10787. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10788. do { \
  10789. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10790. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10791. } while (0)
  10792. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10793. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10794. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10795. do { \
  10796. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10797. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10798. } while (0)
  10799. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10800. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10801. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10802. do { \
  10803. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10804. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10805. } while (0)
  10806. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10807. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10808. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10809. do { \
  10810. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10811. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10812. } while (0)
  10813. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10814. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10815. /*
  10816. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10817. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10818. * addresses are stored in a XXX-bit field.
  10819. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10820. * htt_tx_frag_desc64_bank_cfg_t structs.
  10821. */
  10822. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10823. _paddr_bits_, \
  10824. _paddr__bank_base_address_) \
  10825. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10826. /** word 0 \
  10827. * msg_type: 8, \
  10828. * pdev_id: 2, \
  10829. * swap: 1, \
  10830. * reserved0: 5, \
  10831. * num_banks: 8, \
  10832. * desc_size: 8; \
  10833. */ \
  10834. A_UINT32 word0; \
  10835. /* \
  10836. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10837. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10838. * the second A_UINT32). \
  10839. */ \
  10840. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10841. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10842. } POSTPACK
  10843. /* define htt_tx_frag_desc32_bank_cfg_t */
  10844. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10845. /* define htt_tx_frag_desc64_bank_cfg_t */
  10846. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10847. /*
  10848. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10849. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10850. */
  10851. #if HTT_PADDR64
  10852. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10853. #else
  10854. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10855. #endif
  10856. /**
  10857. * @brief target -> host HTT TX Credit total count update message definition
  10858. *
  10859. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  10860. *
  10861. *|31 16|15|14 9| 8 |7 0 |
  10862. *|---------------------+--+----------+-------+----------|
  10863. *|cur htt credit delta | Q| reserved | sign | msg type |
  10864. *|------------------------------------------------------|
  10865. *
  10866. * Header fields:
  10867. * - MSG_TYPE
  10868. * Bits 7:0
  10869. * Purpose: identifies this as a htt tx credit delta update message
  10870. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  10871. * - SIGN
  10872. * Bits 8
  10873. * identifies whether credit delta is positive or negative
  10874. * Value:
  10875. * - 0x0: credit delta is positive, rebalance in some buffers
  10876. * - 0x1: credit delta is negative, rebalance out some buffers
  10877. * - reserved
  10878. * Bits 14:9
  10879. * Value: 0x0
  10880. * - TXQ_GRP
  10881. * Bit 15
  10882. * Purpose: indicates whether any tx queue group information elements
  10883. * are appended to the tx credit update message
  10884. * Value: 0 -> no tx queue group information element is present
  10885. * 1 -> a tx queue group information element immediately follows
  10886. * - DELTA_COUNT
  10887. * Bits 31:16
  10888. * Purpose: Specify current htt credit delta absolute count
  10889. */
  10890. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10891. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10892. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10893. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10894. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10895. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10896. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10897. do { \
  10898. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10899. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10900. } while (0)
  10901. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10902. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10903. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10904. do { \
  10905. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10906. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10907. } while (0)
  10908. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10909. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10910. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10911. do { \
  10912. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10913. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10914. } while (0)
  10915. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10916. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10917. #define HTT_TX_CREDIT_MSG_BYTES 4
  10918. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10919. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10920. /**
  10921. * @brief HTT WDI_IPA Operation Response Message
  10922. *
  10923. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  10924. *
  10925. * @details
  10926. * HTT WDI_IPA Operation Response message is sent by target
  10927. * to host confirming suspend or resume operation.
  10928. * |31 24|23 16|15 8|7 0|
  10929. * |----------------+----------------+----------------+----------------|
  10930. * | op_code | Rsvd | msg_type |
  10931. * |-------------------------------------------------------------------|
  10932. * | Rsvd | Response len |
  10933. * |-------------------------------------------------------------------|
  10934. * | |
  10935. * | Response-type specific info |
  10936. * | |
  10937. * | |
  10938. * |-------------------------------------------------------------------|
  10939. * Header fields:
  10940. * - MSG_TYPE
  10941. * Bits 7:0
  10942. * Purpose: Identifies this as WDI_IPA Operation Response message
  10943. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  10944. * - OP_CODE
  10945. * Bits 31:16
  10946. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10947. * value: = enum htt_wdi_ipa_op_code
  10948. * - RSP_LEN
  10949. * Bits 16:0
  10950. * Purpose: length for the response-type specific info
  10951. * value: = length in bytes for response-type specific info
  10952. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10953. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10954. */
  10955. PREPACK struct htt_wdi_ipa_op_response_t
  10956. {
  10957. /* DWORD 0: flags and meta-data */
  10958. A_UINT32
  10959. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10960. reserved1: 8,
  10961. op_code: 16;
  10962. A_UINT32
  10963. rsp_len: 16,
  10964. reserved2: 16;
  10965. } POSTPACK;
  10966. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10967. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10968. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10969. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10970. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10971. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10972. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10973. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10974. do { \
  10975. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10976. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10977. } while (0)
  10978. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10979. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10980. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10981. do { \
  10982. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10983. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10984. } while (0)
  10985. enum htt_phy_mode {
  10986. htt_phy_mode_11a = 0,
  10987. htt_phy_mode_11g = 1,
  10988. htt_phy_mode_11b = 2,
  10989. htt_phy_mode_11g_only = 3,
  10990. htt_phy_mode_11na_ht20 = 4,
  10991. htt_phy_mode_11ng_ht20 = 5,
  10992. htt_phy_mode_11na_ht40 = 6,
  10993. htt_phy_mode_11ng_ht40 = 7,
  10994. htt_phy_mode_11ac_vht20 = 8,
  10995. htt_phy_mode_11ac_vht40 = 9,
  10996. htt_phy_mode_11ac_vht80 = 10,
  10997. htt_phy_mode_11ac_vht20_2g = 11,
  10998. htt_phy_mode_11ac_vht40_2g = 12,
  10999. htt_phy_mode_11ac_vht80_2g = 13,
  11000. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  11001. htt_phy_mode_11ac_vht160 = 15,
  11002. htt_phy_mode_max,
  11003. };
  11004. /**
  11005. * @brief target -> host HTT channel change indication
  11006. *
  11007. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  11008. *
  11009. * @details
  11010. * Specify when a channel change occurs.
  11011. * This allows the host to precisely determine which rx frames arrived
  11012. * on the old channel and which rx frames arrived on the new channel.
  11013. *
  11014. *|31 |7 0 |
  11015. *|-------------------------------------------+----------|
  11016. *| reserved | msg type |
  11017. *|------------------------------------------------------|
  11018. *| primary_chan_center_freq_mhz |
  11019. *|------------------------------------------------------|
  11020. *| contiguous_chan1_center_freq_mhz |
  11021. *|------------------------------------------------------|
  11022. *| contiguous_chan2_center_freq_mhz |
  11023. *|------------------------------------------------------|
  11024. *| phy_mode |
  11025. *|------------------------------------------------------|
  11026. *
  11027. * Header fields:
  11028. * - MSG_TYPE
  11029. * Bits 7:0
  11030. * Purpose: identifies this as a htt channel change indication message
  11031. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  11032. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  11033. * Bits 31:0
  11034. * Purpose: identify the (center of the) new 20 MHz primary channel
  11035. * Value: center frequency of the 20 MHz primary channel, in MHz units
  11036. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  11037. * Bits 31:0
  11038. * Purpose: identify the (center of the) contiguous frequency range
  11039. * comprising the new channel.
  11040. * For example, if the new channel is a 80 MHz channel extending
  11041. * 60 MHz beyond the primary channel, this field would be 30 larger
  11042. * than the primary channel center frequency field.
  11043. * Value: center frequency of the contiguous frequency range comprising
  11044. * the full channel in MHz units
  11045. * (80+80 channels also use the CONTIG_CHAN2 field)
  11046. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  11047. * Bits 31:0
  11048. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  11049. * within a VHT 80+80 channel.
  11050. * This field is only relevant for VHT 80+80 channels.
  11051. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  11052. * channel (arbitrary value for cases besides VHT 80+80)
  11053. * - PHY_MODE
  11054. * Bits 31:0
  11055. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  11056. * and band
  11057. * Value: htt_phy_mode enum value
  11058. */
  11059. PREPACK struct htt_chan_change_t
  11060. {
  11061. /* DWORD 0: flags and meta-data */
  11062. A_UINT32
  11063. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  11064. reserved1: 24;
  11065. A_UINT32 primary_chan_center_freq_mhz;
  11066. A_UINT32 contig_chan1_center_freq_mhz;
  11067. A_UINT32 contig_chan2_center_freq_mhz;
  11068. A_UINT32 phy_mode;
  11069. } POSTPACK;
  11070. /*
  11071. * Due to historical / backwards-compatibility reasons, maintain the
  11072. * below htt_chan_change_msg struct definition, which needs to be
  11073. * consistent with the above htt_chan_change_t struct definition
  11074. * (aside from the htt_chan_change_t definition including the msg_type
  11075. * dword within the message, and the htt_chan_change_msg only containing
  11076. * the payload of the message that follows the msg_type dword).
  11077. */
  11078. PREPACK struct htt_chan_change_msg {
  11079. A_UINT32 chan_mhz; /* frequency in mhz */
  11080. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  11081. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11082. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11083. } POSTPACK;
  11084. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  11085. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  11086. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  11087. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  11088. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  11089. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  11090. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  11091. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  11092. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  11093. do { \
  11094. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  11095. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  11096. } while (0)
  11097. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  11098. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  11099. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  11100. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  11101. do { \
  11102. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  11103. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  11104. } while (0)
  11105. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  11106. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  11107. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  11108. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  11109. do { \
  11110. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  11111. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  11112. } while (0)
  11113. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  11114. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  11115. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  11116. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  11117. do { \
  11118. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  11119. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  11120. } while (0)
  11121. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  11122. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  11123. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  11124. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  11125. /**
  11126. * @brief rx offload packet error message
  11127. *
  11128. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  11129. *
  11130. * @details
  11131. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  11132. * of target payload like mic err.
  11133. *
  11134. * |31 24|23 16|15 8|7 0|
  11135. * |----------------+----------------+----------------+----------------|
  11136. * | tid | vdev_id | msg_sub_type | msg_type |
  11137. * |-------------------------------------------------------------------|
  11138. * : (sub-type dependent content) :
  11139. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11140. * Header fields:
  11141. * - msg_type
  11142. * Bits 7:0
  11143. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  11144. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  11145. * - msg_sub_type
  11146. * Bits 15:8
  11147. * Purpose: Identifies which type of rx error is reported by this message
  11148. * value: htt_rx_ofld_pkt_err_type
  11149. * - vdev_id
  11150. * Bits 23:16
  11151. * Purpose: Identifies which vdev received the erroneous rx frame
  11152. * value:
  11153. * - tid
  11154. * Bits 31:24
  11155. * Purpose: Identifies the traffic type of the rx frame
  11156. * value:
  11157. *
  11158. * - The payload fields used if the sub-type == MIC error are shown below.
  11159. * Note - MIC err is per MSDU, while PN is per MPDU.
  11160. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  11161. * with MIC err in A-MSDU case, so FW will send only one HTT message
  11162. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  11163. * instead of sending separate HTT messages for each wrong MSDU within
  11164. * the MPDU.
  11165. *
  11166. * |31 24|23 16|15 8|7 0|
  11167. * |----------------+----------------+----------------+----------------|
  11168. * | Rsvd | key_id | peer_id |
  11169. * |-------------------------------------------------------------------|
  11170. * | receiver MAC addr 31:0 |
  11171. * |-------------------------------------------------------------------|
  11172. * | Rsvd | receiver MAC addr 47:32 |
  11173. * |-------------------------------------------------------------------|
  11174. * | transmitter MAC addr 31:0 |
  11175. * |-------------------------------------------------------------------|
  11176. * | Rsvd | transmitter MAC addr 47:32 |
  11177. * |-------------------------------------------------------------------|
  11178. * | PN 31:0 |
  11179. * |-------------------------------------------------------------------|
  11180. * | Rsvd | PN 47:32 |
  11181. * |-------------------------------------------------------------------|
  11182. * - peer_id
  11183. * Bits 15:0
  11184. * Purpose: identifies which peer is frame is from
  11185. * value:
  11186. * - key_id
  11187. * Bits 23:16
  11188. * Purpose: identifies key_id of rx frame
  11189. * value:
  11190. * - RA_31_0 (receiver MAC addr 31:0)
  11191. * Bits 31:0
  11192. * Purpose: identifies by MAC address which vdev received the frame
  11193. * value: MAC address lower 4 bytes
  11194. * - RA_47_32 (receiver MAC addr 47:32)
  11195. * Bits 15:0
  11196. * Purpose: identifies by MAC address which vdev received the frame
  11197. * value: MAC address upper 2 bytes
  11198. * - TA_31_0 (transmitter MAC addr 31:0)
  11199. * Bits 31:0
  11200. * Purpose: identifies by MAC address which peer transmitted the frame
  11201. * value: MAC address lower 4 bytes
  11202. * - TA_47_32 (transmitter MAC addr 47:32)
  11203. * Bits 15:0
  11204. * Purpose: identifies by MAC address which peer transmitted the frame
  11205. * value: MAC address upper 2 bytes
  11206. * - PN_31_0
  11207. * Bits 31:0
  11208. * Purpose: Identifies pn of rx frame
  11209. * value: PN lower 4 bytes
  11210. * - PN_47_32
  11211. * Bits 15:0
  11212. * Purpose: Identifies pn of rx frame
  11213. * value:
  11214. * TKIP or CCMP: PN upper 2 bytes
  11215. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  11216. */
  11217. enum htt_rx_ofld_pkt_err_type {
  11218. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  11219. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  11220. };
  11221. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  11222. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  11223. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  11224. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  11225. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  11226. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  11227. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  11228. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  11229. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  11230. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  11231. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  11232. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  11233. do { \
  11234. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  11235. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  11236. } while (0)
  11237. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  11238. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  11239. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  11240. do { \
  11241. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  11242. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  11243. } while (0)
  11244. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  11245. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  11246. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  11247. do { \
  11248. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  11249. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  11250. } while (0)
  11251. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  11252. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  11253. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  11254. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  11255. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  11256. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  11257. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  11258. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  11259. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  11260. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  11261. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  11262. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  11263. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  11264. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  11265. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  11266. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  11267. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  11268. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  11269. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  11270. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  11271. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  11272. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  11273. do { \
  11274. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  11275. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  11276. } while (0)
  11277. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  11278. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  11279. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  11280. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  11281. do { \
  11282. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  11283. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  11284. } while (0)
  11285. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  11286. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  11287. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  11288. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  11289. do { \
  11290. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  11291. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  11292. } while (0)
  11293. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  11294. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  11295. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  11296. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  11297. do { \
  11298. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  11299. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  11300. } while (0)
  11301. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  11302. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  11303. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  11304. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  11305. do { \
  11306. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  11307. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  11308. } while (0)
  11309. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  11310. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  11311. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  11312. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  11315. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  11316. } while (0)
  11317. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  11318. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  11319. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  11320. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  11321. do { \
  11322. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  11323. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  11324. } while (0)
  11325. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  11326. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  11327. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  11328. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  11329. do { \
  11330. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  11331. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  11332. } while (0)
  11333. /**
  11334. * @brief target -> host peer rate report message
  11335. *
  11336. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  11337. *
  11338. * @details
  11339. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  11340. * justified rate of all the peers.
  11341. *
  11342. * |31 24|23 16|15 8|7 0|
  11343. * |----------------+----------------+----------------+----------------|
  11344. * | peer_count | | msg_type |
  11345. * |-------------------------------------------------------------------|
  11346. * : Payload (variant number of peer rate report) :
  11347. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  11348. * Header fields:
  11349. * - msg_type
  11350. * Bits 7:0
  11351. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  11352. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  11353. * - reserved
  11354. * Bits 15:8
  11355. * Purpose:
  11356. * value:
  11357. * - peer_count
  11358. * Bits 31:16
  11359. * Purpose: Specify how many peer rate report elements are present in the payload.
  11360. * value:
  11361. *
  11362. * Payload:
  11363. * There are variant number of peer rate report follow the first 32 bits.
  11364. * The peer rate report is defined as follows.
  11365. *
  11366. * |31 20|19 16|15 0|
  11367. * |-----------------------+---------+---------------------------------|-
  11368. * | reserved | phy | peer_id | \
  11369. * |-------------------------------------------------------------------| -> report #0
  11370. * | rate | /
  11371. * |-----------------------+---------+---------------------------------|-
  11372. * | reserved | phy | peer_id | \
  11373. * |-------------------------------------------------------------------| -> report #1
  11374. * | rate | /
  11375. * |-----------------------+---------+---------------------------------|-
  11376. * | reserved | phy | peer_id | \
  11377. * |-------------------------------------------------------------------| -> report #2
  11378. * | rate | /
  11379. * |-------------------------------------------------------------------|-
  11380. * : :
  11381. * : :
  11382. * : :
  11383. * :-------------------------------------------------------------------:
  11384. *
  11385. * - peer_id
  11386. * Bits 15:0
  11387. * Purpose: identify the peer
  11388. * value:
  11389. * - phy
  11390. * Bits 19:16
  11391. * Purpose: identify which phy is in use
  11392. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  11393. * Please see enum htt_peer_report_phy_type for detail.
  11394. * - reserved
  11395. * Bits 31:20
  11396. * Purpose:
  11397. * value:
  11398. * - rate
  11399. * Bits 31:0
  11400. * Purpose: represent the justified rate of the peer specified by peer_id
  11401. * value:
  11402. */
  11403. enum htt_peer_rate_report_phy_type {
  11404. HTT_PEER_RATE_REPORT_11B = 0,
  11405. HTT_PEER_RATE_REPORT_11A_G,
  11406. HTT_PEER_RATE_REPORT_11N,
  11407. HTT_PEER_RATE_REPORT_11AC,
  11408. };
  11409. #define HTT_PEER_RATE_REPORT_SIZE 8
  11410. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  11411. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  11412. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  11413. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  11414. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  11415. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  11416. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  11417. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11418. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11419. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11420. do { \
  11421. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11422. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11423. } while (0)
  11424. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11425. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11426. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11427. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11428. do { \
  11429. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11430. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11431. } while (0)
  11432. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11433. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11434. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11435. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11438. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11439. } while (0)
  11440. /**
  11441. * @brief target -> host flow pool map message
  11442. *
  11443. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11444. *
  11445. * @details
  11446. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11447. * a flow of descriptors.
  11448. *
  11449. * This message is in TLV format and indicates the parameters to be setup a
  11450. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11451. * receive descriptors from a specified pool.
  11452. *
  11453. * The message would appear as follows:
  11454. *
  11455. * |31 24|23 16|15 8|7 0|
  11456. * |----------------+----------------+----------------+----------------|
  11457. * header | reserved | num_flows | msg_type |
  11458. * |-------------------------------------------------------------------|
  11459. * | |
  11460. * : payload :
  11461. * | |
  11462. * |-------------------------------------------------------------------|
  11463. *
  11464. * The header field is one DWORD long and is interpreted as follows:
  11465. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11466. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11467. * this message
  11468. * b'16-31 - reserved: These bits are reserved for future use
  11469. *
  11470. * Payload:
  11471. * The payload would contain multiple objects of the following structure. Each
  11472. * object represents a flow.
  11473. *
  11474. * |31 24|23 16|15 8|7 0|
  11475. * |----------------+----------------+----------------+----------------|
  11476. * header | reserved | num_flows | msg_type |
  11477. * |-------------------------------------------------------------------|
  11478. * payload0| flow_type |
  11479. * |-------------------------------------------------------------------|
  11480. * | flow_id |
  11481. * |-------------------------------------------------------------------|
  11482. * | reserved0 | flow_pool_id |
  11483. * |-------------------------------------------------------------------|
  11484. * | reserved1 | flow_pool_size |
  11485. * |-------------------------------------------------------------------|
  11486. * | reserved2 |
  11487. * |-------------------------------------------------------------------|
  11488. * payload1| flow_type |
  11489. * |-------------------------------------------------------------------|
  11490. * | flow_id |
  11491. * |-------------------------------------------------------------------|
  11492. * | reserved0 | flow_pool_id |
  11493. * |-------------------------------------------------------------------|
  11494. * | reserved1 | flow_pool_size |
  11495. * |-------------------------------------------------------------------|
  11496. * | reserved2 |
  11497. * |-------------------------------------------------------------------|
  11498. * | . |
  11499. * | . |
  11500. * | . |
  11501. * |-------------------------------------------------------------------|
  11502. *
  11503. * Each payload is 5 DWORDS long and is interpreted as follows:
  11504. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  11505. * this flow is associated. It can be VDEV, peer,
  11506. * or tid (AC). Based on enum htt_flow_type.
  11507. *
  11508. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11509. * object. For flow_type vdev it is set to the
  11510. * vdevid, for peer it is peerid and for tid, it is
  11511. * tid_num.
  11512. *
  11513. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  11514. * in the host for this flow
  11515. * b'16:31 - reserved0: This field in reserved for the future. In case
  11516. * we have a hierarchical implementation (HCM) of
  11517. * pools, it can be used to indicate the ID of the
  11518. * parent-pool.
  11519. *
  11520. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  11521. * Descriptors for this flow will be
  11522. * allocated from this pool in the host.
  11523. * b'16:31 - reserved1: This field in reserved for the future. In case
  11524. * we have a hierarchical implementation of pools,
  11525. * it can be used to indicate the max number of
  11526. * descriptors in the pool. The b'0:15 can be used
  11527. * to indicate min number of descriptors in the
  11528. * HCM scheme.
  11529. *
  11530. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  11531. * we have a hierarchical implementation of pools,
  11532. * b'0:15 can be used to indicate the
  11533. * priority-based borrowing (PBB) threshold of
  11534. * the flow's pool. The b'16:31 are still left
  11535. * reserved.
  11536. */
  11537. enum htt_flow_type {
  11538. FLOW_TYPE_VDEV = 0,
  11539. /* Insert new flow types above this line */
  11540. };
  11541. PREPACK struct htt_flow_pool_map_payload_t {
  11542. A_UINT32 flow_type;
  11543. A_UINT32 flow_id;
  11544. A_UINT32 flow_pool_id:16,
  11545. reserved0:16;
  11546. A_UINT32 flow_pool_size:16,
  11547. reserved1:16;
  11548. A_UINT32 reserved2;
  11549. } POSTPACK;
  11550. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11551. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11552. (sizeof(struct htt_flow_pool_map_payload_t))
  11553. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11554. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11555. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11556. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11557. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11558. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11559. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11560. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11561. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11562. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11563. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11564. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11565. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11566. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11567. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11568. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11569. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11570. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11571. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11572. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11573. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11574. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11575. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11576. do { \
  11577. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11578. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11579. } while (0)
  11580. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11581. do { \
  11582. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11583. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11584. } while (0)
  11585. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11586. do { \
  11587. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11588. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11589. } while (0)
  11590. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11591. do { \
  11592. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11593. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11594. } while (0)
  11595. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11596. do { \
  11597. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11598. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11599. } while (0)
  11600. /**
  11601. * @brief target -> host flow pool unmap message
  11602. *
  11603. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11604. *
  11605. * @details
  11606. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11607. * down a flow of descriptors.
  11608. * This message indicates that for the flow (whose ID is provided) is wanting
  11609. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11610. * pool of descriptors from where descriptors are being allocated for this
  11611. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11612. * be unmapped by the host.
  11613. *
  11614. * The message would appear as follows:
  11615. *
  11616. * |31 24|23 16|15 8|7 0|
  11617. * |----------------+----------------+----------------+----------------|
  11618. * | reserved0 | msg_type |
  11619. * |-------------------------------------------------------------------|
  11620. * | flow_type |
  11621. * |-------------------------------------------------------------------|
  11622. * | flow_id |
  11623. * |-------------------------------------------------------------------|
  11624. * | reserved1 | flow_pool_id |
  11625. * |-------------------------------------------------------------------|
  11626. *
  11627. * The message is interpreted as follows:
  11628. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  11629. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  11630. * b'8:31 - reserved0: Reserved for future use
  11631. *
  11632. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11633. * this flow is associated. It can be VDEV, peer,
  11634. * or tid (AC). Based on enum htt_flow_type.
  11635. *
  11636. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11637. * object. For flow_type vdev it is set to the
  11638. * vdevid, for peer it is peerid and for tid, it is
  11639. * tid_num.
  11640. *
  11641. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11642. * used in the host for this flow
  11643. * b'16:31 - reserved0: This field in reserved for the future.
  11644. *
  11645. */
  11646. PREPACK struct htt_flow_pool_unmap_t {
  11647. A_UINT32 msg_type:8,
  11648. reserved0:24;
  11649. A_UINT32 flow_type;
  11650. A_UINT32 flow_id;
  11651. A_UINT32 flow_pool_id:16,
  11652. reserved1:16;
  11653. } POSTPACK;
  11654. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11655. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11656. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11657. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11658. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11659. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11660. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11661. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11662. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11663. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11664. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11665. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11666. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11667. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11668. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11669. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11670. do { \
  11671. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11672. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11673. } while (0)
  11674. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11675. do { \
  11676. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11677. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11678. } while (0)
  11679. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11680. do { \
  11681. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11682. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11683. } while (0)
  11684. /**
  11685. * @brief target -> host SRING setup done message
  11686. *
  11687. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11688. *
  11689. * @details
  11690. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11691. * SRNG ring setup is done
  11692. *
  11693. * This message indicates whether the last setup operation is successful.
  11694. * It will be sent to host when host set respose_required bit in
  11695. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11696. * The message would appear as follows:
  11697. *
  11698. * |31 24|23 16|15 8|7 0|
  11699. * |--------------- +----------------+----------------+----------------|
  11700. * | setup_status | ring_id | pdev_id | msg_type |
  11701. * |-------------------------------------------------------------------|
  11702. *
  11703. * The message is interpreted as follows:
  11704. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  11705. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  11706. * b'8:15 - pdev_id:
  11707. * 0 (for rings at SOC/UMAC level),
  11708. * 1/2/3 mac id (for rings at LMAC level)
  11709. * b'16:23 - ring_id: Identify the ring which is set up
  11710. * More details can be got from enum htt_srng_ring_id
  11711. * b'24:31 - setup_status: Indicate status of setup operation
  11712. * Refer to htt_ring_setup_status
  11713. */
  11714. PREPACK struct htt_sring_setup_done_t {
  11715. A_UINT32 msg_type: 8,
  11716. pdev_id: 8,
  11717. ring_id: 8,
  11718. setup_status: 8;
  11719. } POSTPACK;
  11720. enum htt_ring_setup_status {
  11721. htt_ring_setup_status_ok = 0,
  11722. htt_ring_setup_status_error,
  11723. };
  11724. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11725. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11726. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11727. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11728. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11729. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11730. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11731. do { \
  11732. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11733. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11734. } while (0)
  11735. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11736. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11737. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11738. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11739. HTT_SRING_SETUP_DONE_RING_ID_S)
  11740. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11741. do { \
  11742. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11743. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11744. } while (0)
  11745. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11746. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11747. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11748. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11749. HTT_SRING_SETUP_DONE_STATUS_S)
  11750. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11751. do { \
  11752. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11753. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11754. } while (0)
  11755. /**
  11756. * @brief target -> flow map flow info
  11757. *
  11758. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11759. *
  11760. * @details
  11761. * HTT TX map flow entry with tqm flow pointer
  11762. * Sent from firmware to host to add tqm flow pointer in corresponding
  11763. * flow search entry. Flow metadata is replayed back to host as part of this
  11764. * struct to enable host to find the specific flow search entry
  11765. *
  11766. * The message would appear as follows:
  11767. *
  11768. * |31 28|27 18|17 14|13 8|7 0|
  11769. * |-------+------------------------------------------+----------------|
  11770. * | rsvd0 | fse_hsh_idx | msg_type |
  11771. * |-------------------------------------------------------------------|
  11772. * | rsvd1 | tid | peer_id |
  11773. * |-------------------------------------------------------------------|
  11774. * | tqm_flow_pntr_lo |
  11775. * |-------------------------------------------------------------------|
  11776. * | tqm_flow_pntr_hi |
  11777. * |-------------------------------------------------------------------|
  11778. * | fse_meta_data |
  11779. * |-------------------------------------------------------------------|
  11780. *
  11781. * The message is interpreted as follows:
  11782. *
  11783. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  11784. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  11785. *
  11786. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11787. * for this flow entry
  11788. *
  11789. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11790. *
  11791. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11792. *
  11793. * dword1 - b'14:17 - tid
  11794. *
  11795. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11796. *
  11797. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11798. *
  11799. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11800. *
  11801. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11802. * given by host
  11803. */
  11804. PREPACK struct htt_tx_map_flow_info {
  11805. A_UINT32
  11806. msg_type: 8,
  11807. fse_hsh_idx: 20,
  11808. rsvd0: 4;
  11809. A_UINT32
  11810. peer_id: 14,
  11811. tid: 4,
  11812. rsvd1: 14;
  11813. A_UINT32 tqm_flow_pntr_lo;
  11814. A_UINT32 tqm_flow_pntr_hi;
  11815. struct htt_tx_flow_metadata fse_meta_data;
  11816. } POSTPACK;
  11817. /* DWORD 0 */
  11818. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11819. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11820. /* DWORD 1 */
  11821. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11822. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11823. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11824. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11825. /* DWORD 0 */
  11826. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11827. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11828. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11829. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11830. do { \
  11831. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11832. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11833. } while (0)
  11834. /* DWORD 1 */
  11835. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11836. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11837. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11838. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11841. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11842. } while (0)
  11843. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11844. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11845. HTT_TX_MAP_FLOW_INFO_TID_S)
  11846. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11847. do { \
  11848. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11849. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11850. } while (0)
  11851. /*
  11852. * htt_dbg_ext_stats_status -
  11853. * present - The requested stats have been delivered in full.
  11854. * This indicates that either the stats information was contained
  11855. * in its entirety within this message, or else this message
  11856. * completes the delivery of the requested stats info that was
  11857. * partially delivered through earlier STATS_CONF messages.
  11858. * partial - The requested stats have been delivered in part.
  11859. * One or more subsequent STATS_CONF messages with the same
  11860. * cookie value will be sent to deliver the remainder of the
  11861. * information.
  11862. * error - The requested stats could not be delivered, for example due
  11863. * to a shortage of memory to construct a message holding the
  11864. * requested stats.
  11865. * invalid - The requested stat type is either not recognized, or the
  11866. * target is configured to not gather the stats type in question.
  11867. */
  11868. enum htt_dbg_ext_stats_status {
  11869. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11870. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11871. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11872. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11873. };
  11874. /**
  11875. * @brief target -> host ppdu stats upload
  11876. *
  11877. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  11878. *
  11879. * @details
  11880. * The following field definitions describe the format of the HTT target
  11881. * to host ppdu stats indication message.
  11882. *
  11883. *
  11884. * |31 16|15 12|11 10|9 8|7 0 |
  11885. * |----------------------------------------------------------------------|
  11886. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11887. * |----------------------------------------------------------------------|
  11888. * | ppdu_id |
  11889. * |----------------------------------------------------------------------|
  11890. * | Timestamp in us |
  11891. * |----------------------------------------------------------------------|
  11892. * | reserved |
  11893. * |----------------------------------------------------------------------|
  11894. * | type-specific stats info |
  11895. * | (see htt_ppdu_stats.h) |
  11896. * |----------------------------------------------------------------------|
  11897. * Header fields:
  11898. * - MSG_TYPE
  11899. * Bits 7:0
  11900. * Purpose: Identifies this is a PPDU STATS indication
  11901. * message.
  11902. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  11903. * - mac_id
  11904. * Bits 9:8
  11905. * Purpose: mac_id of this ppdu_id
  11906. * Value: 0-3
  11907. * - pdev_id
  11908. * Bits 11:10
  11909. * Purpose: pdev_id of this ppdu_id
  11910. * Value: 0-3
  11911. * 0 (for rings at SOC level),
  11912. * 1/2/3 PDEV -> 0/1/2
  11913. * - payload_size
  11914. * Bits 31:16
  11915. * Purpose: total tlv size
  11916. * Value: payload_size in bytes
  11917. */
  11918. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11919. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11920. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11921. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11922. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11923. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11924. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11925. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11926. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11927. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11928. do { \
  11929. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11930. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11931. } while (0)
  11932. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11933. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11934. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11935. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11936. do { \
  11937. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11938. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11939. } while (0)
  11940. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11941. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11942. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11943. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11944. do { \
  11945. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11946. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11947. } while (0)
  11948. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11949. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11950. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11951. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11954. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11955. } while (0)
  11956. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11957. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11958. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11959. /* htt_t2h_ppdu_stats_ind_hdr_t
  11960. * This struct contains the fields within the header of the
  11961. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11962. * stats info.
  11963. * This struct assumes little-endian layout, and thus is only
  11964. * suitable for use within processors known to be little-endian
  11965. * (such as the target).
  11966. * In contrast, the above macros provide endian-portable methods
  11967. * to get and set the bitfields within this PPDU_STATS_IND header.
  11968. */
  11969. typedef struct {
  11970. A_UINT32 msg_type: 8, /* bits 7:0 */
  11971. mac_id: 2, /* bits 9:8 */
  11972. pdev_id: 2, /* bits 11:10 */
  11973. reserved1: 4, /* bits 15:12 */
  11974. payload_size: 16; /* bits 31:16 */
  11975. A_UINT32 ppdu_id;
  11976. A_UINT32 timestamp_us;
  11977. A_UINT32 reserved2;
  11978. } htt_t2h_ppdu_stats_ind_hdr_t;
  11979. /**
  11980. * @brief target -> host extended statistics upload
  11981. *
  11982. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  11983. *
  11984. * @details
  11985. * The following field definitions describe the format of the HTT target
  11986. * to host stats upload confirmation message.
  11987. * The message contains a cookie echoed from the HTT host->target stats
  11988. * upload request, which identifies which request the confirmation is
  11989. * for, and a single stats can span over multiple HTT stats indication
  11990. * due to the HTT message size limitation so every HTT ext stats indication
  11991. * will have tag-length-value stats information elements.
  11992. * The tag-length header for each HTT stats IND message also includes a
  11993. * status field, to indicate whether the request for the stat type in
  11994. * question was fully met, partially met, unable to be met, or invalid
  11995. * (if the stat type in question is disabled in the target).
  11996. * A Done bit 1's indicate the end of the of stats info elements.
  11997. *
  11998. *
  11999. * |31 16|15 12|11|10 8|7 5|4 0|
  12000. * |--------------------------------------------------------------|
  12001. * | reserved | msg type |
  12002. * |--------------------------------------------------------------|
  12003. * | cookie LSBs |
  12004. * |--------------------------------------------------------------|
  12005. * | cookie MSBs |
  12006. * |--------------------------------------------------------------|
  12007. * | stats entry length | rsvd | D| S | stat type |
  12008. * |--------------------------------------------------------------|
  12009. * | type-specific stats info |
  12010. * | (see htt_stats.h) |
  12011. * |--------------------------------------------------------------|
  12012. * Header fields:
  12013. * - MSG_TYPE
  12014. * Bits 7:0
  12015. * Purpose: Identifies this is a extended statistics upload confirmation
  12016. * message.
  12017. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  12018. * - COOKIE_LSBS
  12019. * Bits 31:0
  12020. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12021. * message with its preceding host->target stats request message.
  12022. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12023. * - COOKIE_MSBS
  12024. * Bits 31:0
  12025. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12026. * message with its preceding host->target stats request message.
  12027. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12028. *
  12029. * Stats Information Element tag-length header fields:
  12030. * - STAT_TYPE
  12031. * Bits 7:0
  12032. * Purpose: identifies the type of statistics info held in the
  12033. * following information element
  12034. * Value: htt_dbg_ext_stats_type
  12035. * - STATUS
  12036. * Bits 10:8
  12037. * Purpose: indicate whether the requested stats are present
  12038. * Value: htt_dbg_ext_stats_status
  12039. * - DONE
  12040. * Bits 11
  12041. * Purpose:
  12042. * Indicates the completion of the stats entry, this will be the last
  12043. * stats conf HTT segment for the requested stats type.
  12044. * Value:
  12045. * 0 -> the stats retrieval is ongoing
  12046. * 1 -> the stats retrieval is complete
  12047. * - LENGTH
  12048. * Bits 31:16
  12049. * Purpose: indicate the stats information size
  12050. * Value: This field specifies the number of bytes of stats information
  12051. * that follows the element tag-length header.
  12052. * It is expected but not required that this length is a multiple of
  12053. * 4 bytes.
  12054. */
  12055. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  12056. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  12057. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  12058. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  12059. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  12060. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  12061. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  12062. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  12063. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  12064. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12065. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  12066. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  12067. do { \
  12068. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  12069. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  12070. } while (0)
  12071. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  12072. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  12073. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  12074. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  12075. do { \
  12076. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  12077. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  12078. } while (0)
  12079. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  12080. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  12081. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  12082. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  12083. do { \
  12084. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  12085. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  12086. } while (0)
  12087. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  12088. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  12089. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  12090. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  12093. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  12094. } while (0)
  12095. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  12096. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  12097. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  12098. typedef enum {
  12099. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  12100. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  12101. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  12102. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  12103. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  12104. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  12105. /* Reserved from 128 - 255 for target internal use.*/
  12106. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  12107. } HTT_PEER_TYPE;
  12108. /** macro to convert MAC address from char array to HTT word format */
  12109. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  12110. (phtt_mac_addr)->mac_addr31to0 = \
  12111. (((c_macaddr)[0] << 0) | \
  12112. ((c_macaddr)[1] << 8) | \
  12113. ((c_macaddr)[2] << 16) | \
  12114. ((c_macaddr)[3] << 24)); \
  12115. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  12116. } while (0)
  12117. /**
  12118. * @brief target -> host monitor mac header indication message
  12119. *
  12120. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  12121. *
  12122. * @details
  12123. * The following diagram shows the format of the monitor mac header message
  12124. * sent from the target to the host.
  12125. * This message is primarily sent when promiscuous rx mode is enabled.
  12126. * One message is sent per rx PPDU.
  12127. *
  12128. * |31 24|23 16|15 8|7 0|
  12129. * |-------------------------------------------------------------|
  12130. * | peer_id | reserved0 | msg_type |
  12131. * |-------------------------------------------------------------|
  12132. * | reserved1 | num_mpdu |
  12133. * |-------------------------------------------------------------|
  12134. * | struct hw_rx_desc |
  12135. * | (see wal_rx_desc.h) |
  12136. * |-------------------------------------------------------------|
  12137. * | struct ieee80211_frame_addr4 |
  12138. * | (see ieee80211_defs.h) |
  12139. * |-------------------------------------------------------------|
  12140. * | struct ieee80211_frame_addr4 |
  12141. * | (see ieee80211_defs.h) |
  12142. * |-------------------------------------------------------------|
  12143. * | ...... |
  12144. * |-------------------------------------------------------------|
  12145. *
  12146. * Header fields:
  12147. * - msg_type
  12148. * Bits 7:0
  12149. * Purpose: Identifies this is a monitor mac header indication message.
  12150. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  12151. * - peer_id
  12152. * Bits 31:16
  12153. * Purpose: Software peer id given by host during association,
  12154. * During promiscuous mode, the peer ID will be invalid (0xFF)
  12155. * for rx PPDUs received from unassociated peers.
  12156. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  12157. * - num_mpdu
  12158. * Bits 15:0
  12159. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  12160. * delivered within the message.
  12161. * Value: 1 to 32
  12162. * num_mpdu is limited to a maximum value of 32, due to buffer
  12163. * size limits. For PPDUs with more than 32 MPDUs, only the
  12164. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  12165. * the PPDU will be provided.
  12166. */
  12167. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  12168. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  12169. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  12170. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  12171. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  12172. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  12173. do { \
  12174. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  12175. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  12176. } while (0)
  12177. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  12178. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  12179. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  12180. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  12181. do { \
  12182. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  12183. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  12184. } while (0)
  12185. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  12186. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  12187. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  12188. /**
  12189. * @brief target -> host flow pool resize Message
  12190. *
  12191. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  12192. *
  12193. * @details
  12194. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  12195. * the flow pool associated with the specified ID is resized
  12196. *
  12197. * The message would appear as follows:
  12198. *
  12199. * |31 16|15 8|7 0|
  12200. * |---------------------------------+----------------+----------------|
  12201. * | reserved0 | Msg type |
  12202. * |-------------------------------------------------------------------|
  12203. * | flow pool new size | flow pool ID |
  12204. * |-------------------------------------------------------------------|
  12205. *
  12206. * The message is interpreted as follows:
  12207. * b'0:7 - msg_type: This will be set to 0x21
  12208. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  12209. *
  12210. * b'0:15 - flow pool ID: Existing flow pool ID
  12211. *
  12212. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  12213. *
  12214. */
  12215. PREPACK struct htt_flow_pool_resize_t {
  12216. A_UINT32 msg_type:8,
  12217. reserved0:24;
  12218. A_UINT32 flow_pool_id:16,
  12219. flow_pool_new_size:16;
  12220. } POSTPACK;
  12221. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  12222. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  12223. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  12224. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  12225. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  12226. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  12227. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  12228. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  12229. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  12230. do { \
  12231. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  12232. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  12233. } while (0)
  12234. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  12235. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  12236. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  12237. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  12238. do { \
  12239. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  12240. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  12241. } while (0)
  12242. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  12243. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  12244. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  12245. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  12246. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  12247. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  12248. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  12249. /*
  12250. * The read and write indices point to the data within the host buffer.
  12251. * Because the first 4 bytes of the host buffer is used for the read index and
  12252. * the next 4 bytes for the write index, the data itself starts at offset 8.
  12253. * The read index and write index are the byte offsets from the base of the
  12254. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  12255. * Refer the ASCII text picture below.
  12256. */
  12257. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  12258. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  12259. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  12260. /*
  12261. ***************************************************************************
  12262. *
  12263. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12264. *
  12265. ***************************************************************************
  12266. *
  12267. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  12268. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  12269. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  12270. * written into the Host memory region mentioned below.
  12271. *
  12272. * Read index is updated by the Host. At any point of time, the read index will
  12273. * indicate the index that will next be read by the Host. The read index is
  12274. * in units of bytes offset from the base of the meta-data buffer.
  12275. *
  12276. * Write index is updated by the FW. At any point of time, the write index will
  12277. * indicate from where the FW can start writing any new data. The write index is
  12278. * in units of bytes offset from the base of the meta-data buffer.
  12279. *
  12280. * If the Host is not fast enough in reading the CFR data, any new capture data
  12281. * would be dropped if there is no space left to write the new captures.
  12282. *
  12283. * The last 4 bytes of the memory region will have the magic pattern
  12284. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  12285. * not overrun the host buffer.
  12286. *
  12287. * ,--------------------. read and write indices store the
  12288. * | | byte offset from the base of the
  12289. * | ,--------+--------. meta-data buffer to the next
  12290. * | | | | location within the data buffer
  12291. * | | v v that will be read / written
  12292. * ************************************************************************
  12293. * * Read * Write * * Magic *
  12294. * * index * index * CFR data1 ...... CFR data N * pattern *
  12295. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  12296. * ************************************************************************
  12297. * |<---------- data buffer ---------->|
  12298. *
  12299. * |<----------------- meta-data buffer allocated in Host ----------------|
  12300. *
  12301. * Note:
  12302. * - Considering the 4 bytes needed to store the Read index (R) and the
  12303. * Write index (W), the initial value is as follows:
  12304. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  12305. * - Buffer empty condition:
  12306. * R = W
  12307. *
  12308. * Regarding CFR data format:
  12309. * --------------------------
  12310. *
  12311. * Each CFR tone is stored in HW as 16-bits with the following format:
  12312. * {bits[15:12], bits[11:6], bits[5:0]} =
  12313. * {unsigned exponent (4 bits),
  12314. * signed mantissa_real (6 bits),
  12315. * signed mantissa_imag (6 bits)}
  12316. *
  12317. * CFR_real = mantissa_real * 2^(exponent-5)
  12318. * CFR_imag = mantissa_imag * 2^(exponent-5)
  12319. *
  12320. *
  12321. * The CFR data is written to the 16-bit unsigned output array (buff) in
  12322. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  12323. *
  12324. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  12325. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  12326. * .
  12327. * .
  12328. * .
  12329. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  12330. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  12331. */
  12332. /* Bandwidth of peer CFR captures */
  12333. typedef enum {
  12334. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  12335. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  12336. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  12337. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  12338. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  12339. HTT_PEER_CFR_CAPTURE_BW_MAX,
  12340. } HTT_PEER_CFR_CAPTURE_BW;
  12341. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  12342. * was captured
  12343. */
  12344. typedef enum {
  12345. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  12346. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  12347. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  12348. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  12349. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  12350. } HTT_PEER_CFR_CAPTURE_MODE;
  12351. typedef enum {
  12352. /* This message type is currently used for the below purpose:
  12353. *
  12354. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  12355. * wmi_peer_cfr_capture_cmd.
  12356. * If payload_present bit is set to 0 then the associated memory region
  12357. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  12358. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  12359. * message; the CFR dump will be present at the end of the message,
  12360. * after the chan_phy_mode.
  12361. */
  12362. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  12363. /* Always keep this last */
  12364. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  12365. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  12366. /**
  12367. * @brief target -> host CFR dump completion indication message definition
  12368. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  12369. *
  12370. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  12371. *
  12372. * @details
  12373. * The following diagram shows the format of the Channel Frequency Response
  12374. * (CFR) dump completion indication. This inidcation is sent to the Host when
  12375. * the channel capture of a peer is copied by Firmware into the Host memory
  12376. *
  12377. * **************************************************************************
  12378. *
  12379. * Message format when the CFR capture message type is
  12380. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  12381. *
  12382. * **************************************************************************
  12383. *
  12384. * |31 16|15 |8|7 0|
  12385. * |----------------------------------------------------------------|
  12386. * header: | reserved |P| msg_type |
  12387. * word 0 | | | |
  12388. * |----------------------------------------------------------------|
  12389. * payload: | cfr_capture_msg_type |
  12390. * word 1 | |
  12391. * |----------------------------------------------------------------|
  12392. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  12393. * word 2 | | | | | | | | |
  12394. * |----------------------------------------------------------------|
  12395. * | mac_addr31to0 |
  12396. * word 3 | |
  12397. * |----------------------------------------------------------------|
  12398. * | unused / reserved | mac_addr47to32 |
  12399. * word 4 | | |
  12400. * |----------------------------------------------------------------|
  12401. * | index |
  12402. * word 5 | |
  12403. * |----------------------------------------------------------------|
  12404. * | length |
  12405. * word 6 | |
  12406. * |----------------------------------------------------------------|
  12407. * | timestamp |
  12408. * word 7 | |
  12409. * |----------------------------------------------------------------|
  12410. * | counter |
  12411. * word 8 | |
  12412. * |----------------------------------------------------------------|
  12413. * | chan_mhz |
  12414. * word 9 | |
  12415. * |----------------------------------------------------------------|
  12416. * | band_center_freq1 |
  12417. * word 10 | |
  12418. * |----------------------------------------------------------------|
  12419. * | band_center_freq2 |
  12420. * word 11 | |
  12421. * |----------------------------------------------------------------|
  12422. * | chan_phy_mode |
  12423. * word 12 | |
  12424. * |----------------------------------------------------------------|
  12425. * where,
  12426. * P - payload present bit (payload_present explained below)
  12427. * req_id - memory request id (mem_req_id explained below)
  12428. * S - status field (status explained below)
  12429. * capbw - capture bandwidth (capture_bw explained below)
  12430. * mode - mode of capture (mode explained below)
  12431. * sts - space time streams (sts_count explained below)
  12432. * chbw - channel bandwidth (channel_bw explained below)
  12433. * captype - capture type (cap_type explained below)
  12434. *
  12435. * The following field definitions describe the format of the CFR dump
  12436. * completion indication sent from the target to the host
  12437. *
  12438. * Header fields:
  12439. *
  12440. * Word 0
  12441. * - msg_type
  12442. * Bits 7:0
  12443. * Purpose: Identifies this as CFR TX completion indication
  12444. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12445. * - payload_present
  12446. * Bit 8
  12447. * Purpose: Identifies how CFR data is sent to host
  12448. * Value: 0 - If CFR Payload is written to host memory
  12449. * 1 - If CFR Payload is sent as part of HTT message
  12450. * (This is the requirement for SDIO/USB where it is
  12451. * not possible to write CFR data to host memory)
  12452. * - reserved
  12453. * Bits 31:9
  12454. * Purpose: Reserved
  12455. * Value: 0
  12456. *
  12457. * Payload fields:
  12458. *
  12459. * Word 1
  12460. * - cfr_capture_msg_type
  12461. * Bits 31:0
  12462. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12463. * to specify the format used for the remainder of the message
  12464. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12465. * (currently only MSG_TYPE_1 is defined)
  12466. *
  12467. * Word 2
  12468. * - mem_req_id
  12469. * Bits 6:0
  12470. * Purpose: Contain the mem request id of the region where the CFR capture
  12471. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12472. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12473. this value is invalid)
  12474. * - status
  12475. * Bit 7
  12476. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12477. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12478. * - capture_bw
  12479. * Bits 10:8
  12480. * Purpose: Carry the bandwidth of the CFR capture
  12481. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12482. * - mode
  12483. * Bits 13:11
  12484. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12485. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12486. * - sts_count
  12487. * Bits 16:14
  12488. * Purpose: Carry the number of space time streams
  12489. * Value: Number of space time streams
  12490. * - channel_bw
  12491. * Bits 19:17
  12492. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12493. * measurement
  12494. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12495. * - cap_type
  12496. * Bits 23:20
  12497. * Purpose: Carry the type of the capture
  12498. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12499. * - vdev_id
  12500. * Bits 31:24
  12501. * Purpose: Carry the virtual device id
  12502. * Value: vdev ID
  12503. *
  12504. * Word 3
  12505. * - mac_addr31to0
  12506. * Bits 31:0
  12507. * Purpose: Contain the bits 31:0 of the peer MAC address
  12508. * Value: Bits 31:0 of the peer MAC address
  12509. *
  12510. * Word 4
  12511. * - mac_addr47to32
  12512. * Bits 15:0
  12513. * Purpose: Contain the bits 47:32 of the peer MAC address
  12514. * Value: Bits 47:32 of the peer MAC address
  12515. *
  12516. * Word 5
  12517. * - index
  12518. * Bits 31:0
  12519. * Purpose: Contain the index at which this CFR dump was written in the Host
  12520. * allocated memory. This index is the number of bytes from the base address.
  12521. * Value: Index position
  12522. *
  12523. * Word 6
  12524. * - length
  12525. * Bits 31:0
  12526. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12527. * Value: Length of the CFR capture of the peer
  12528. *
  12529. * Word 7
  12530. * - timestamp
  12531. * Bits 31:0
  12532. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12533. * clock used for this timestamp is private to the target and not visible to
  12534. * the host i.e., Host can interpret only the relative timestamp deltas from
  12535. * one message to the next, but can't interpret the absolute timestamp from a
  12536. * single message.
  12537. * Value: Timestamp in microseconds
  12538. *
  12539. * Word 8
  12540. * - counter
  12541. * Bits 31:0
  12542. * Purpose: Carry the count of the current CFR capture from FW. This is
  12543. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12544. * in host memory)
  12545. * Value: Count of the current CFR capture
  12546. *
  12547. * Word 9
  12548. * - chan_mhz
  12549. * Bits 31:0
  12550. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12551. * Value: Primary 20 channel frequency
  12552. *
  12553. * Word 10
  12554. * - band_center_freq1
  12555. * Bits 31:0
  12556. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12557. * Value: Center frequency 1 in MHz
  12558. *
  12559. * Word 11
  12560. * - band_center_freq2
  12561. * Bits 31:0
  12562. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12563. * the VDEV
  12564. * 80plus80 mode
  12565. * Value: Center frequency 2 in MHz
  12566. *
  12567. * Word 12
  12568. * - chan_phy_mode
  12569. * Bits 31:0
  12570. * Purpose: Carry the phy mode of the channel, of the VDEV
  12571. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12572. */
  12573. PREPACK struct htt_cfr_dump_ind_type_1 {
  12574. A_UINT32 mem_req_id:7,
  12575. status:1,
  12576. capture_bw:3,
  12577. mode:3,
  12578. sts_count:3,
  12579. channel_bw:3,
  12580. cap_type:4,
  12581. vdev_id:8;
  12582. htt_mac_addr addr;
  12583. A_UINT32 index;
  12584. A_UINT32 length;
  12585. A_UINT32 timestamp;
  12586. A_UINT32 counter;
  12587. struct htt_chan_change_msg chan;
  12588. } POSTPACK;
  12589. PREPACK struct htt_cfr_dump_compl_ind {
  12590. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12591. union {
  12592. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12593. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12594. /* If there is a need to change the memory layout and its associated
  12595. * HTT indication format, a new CFR capture message type can be
  12596. * introduced and added into this union.
  12597. */
  12598. };
  12599. } POSTPACK;
  12600. /*
  12601. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12602. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12603. */
  12604. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12605. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12606. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12607. do { \
  12608. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12609. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12610. } while(0)
  12611. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12612. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12613. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12614. /*
  12615. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12616. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12617. */
  12618. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12619. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12620. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12621. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12622. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12623. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12624. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12625. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12626. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12627. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12628. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12629. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12630. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12631. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12632. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12633. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12634. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12635. do { \
  12636. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12637. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12638. } while (0)
  12639. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12640. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12641. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12642. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12643. do { \
  12644. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12645. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12646. } while (0)
  12647. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12648. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12649. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12650. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12651. do { \
  12652. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12653. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12654. } while (0)
  12655. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12656. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12657. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12658. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12659. do { \
  12660. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12661. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12662. } while (0)
  12663. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12664. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12665. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12666. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12667. do { \
  12668. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12669. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12670. } while (0)
  12671. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12672. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12673. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12674. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12675. do { \
  12676. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12677. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12678. } while (0)
  12679. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12680. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12681. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12682. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12683. do { \
  12684. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12685. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12686. } while (0)
  12687. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12688. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12689. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12690. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12693. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12694. } while (0)
  12695. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12696. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12697. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12698. /**
  12699. * @brief target -> host peer (PPDU) stats message
  12700. *
  12701. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12702. *
  12703. * @details
  12704. * This message is generated by FW when FW is sending stats to host
  12705. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12706. * This message is sent autonomously by the target rather than upon request
  12707. * by the host.
  12708. * The following field definitions describe the format of the HTT target
  12709. * to host peer stats indication message.
  12710. *
  12711. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12712. * or more PPDU stats records.
  12713. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12714. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12715. * then the message would start with the
  12716. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12717. * below.
  12718. *
  12719. * |31 16|15|14|13 11|10 9|8|7 0|
  12720. * |-------------------------------------------------------------|
  12721. * | reserved |MSG_TYPE |
  12722. * |-------------------------------------------------------------|
  12723. * rec 0 | TLV header |
  12724. * rec 0 |-------------------------------------------------------------|
  12725. * rec 0 | ppdu successful bytes |
  12726. * rec 0 |-------------------------------------------------------------|
  12727. * rec 0 | ppdu retry bytes |
  12728. * rec 0 |-------------------------------------------------------------|
  12729. * rec 0 | ppdu failed bytes |
  12730. * rec 0 |-------------------------------------------------------------|
  12731. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12732. * rec 0 |-------------------------------------------------------------|
  12733. * rec 0 | retried MSDUs | successful MSDUs |
  12734. * rec 0 |-------------------------------------------------------------|
  12735. * rec 0 | TX duration | failed MSDUs |
  12736. * rec 0 |-------------------------------------------------------------|
  12737. * ...
  12738. * |-------------------------------------------------------------|
  12739. * rec N | TLV header |
  12740. * rec N |-------------------------------------------------------------|
  12741. * rec N | ppdu successful bytes |
  12742. * rec N |-------------------------------------------------------------|
  12743. * rec N | ppdu retry bytes |
  12744. * rec N |-------------------------------------------------------------|
  12745. * rec N | ppdu failed bytes |
  12746. * rec N |-------------------------------------------------------------|
  12747. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12748. * rec N |-------------------------------------------------------------|
  12749. * rec N | retried MSDUs | successful MSDUs |
  12750. * rec N |-------------------------------------------------------------|
  12751. * rec N | TX duration | failed MSDUs |
  12752. * rec N |-------------------------------------------------------------|
  12753. *
  12754. * where:
  12755. * A = is A-MPDU flag
  12756. * BA = block-ack failure flags
  12757. * BW = bandwidth spec
  12758. * SG = SGI enabled spec
  12759. * S = skipped rate ctrl
  12760. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12761. *
  12762. * Header
  12763. * ------
  12764. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  12765. * dword0 - b'8:31 - reserved : Reserved for future use
  12766. *
  12767. * payload include below peer_stats information
  12768. * --------------------------------------------
  12769. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12770. * @tx_success_bytes : total successful bytes in the PPDU.
  12771. * @tx_retry_bytes : total retried bytes in the PPDU.
  12772. * @tx_failed_bytes : total failed bytes in the PPDU.
  12773. * @tx_ratecode : rate code used for the PPDU.
  12774. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12775. * @ba_ack_failed : BA/ACK failed for this PPDU
  12776. * b00 -> BA received
  12777. * b01 -> BA failed once
  12778. * b10 -> BA failed twice, when HW retry is enabled.
  12779. * @bw : BW
  12780. * b00 -> 20 MHz
  12781. * b01 -> 40 MHz
  12782. * b10 -> 80 MHz
  12783. * b11 -> 160 MHz (or 80+80)
  12784. * @sg : SGI enabled
  12785. * @s : skipped ratectrl
  12786. * @peer_id : peer id
  12787. * @tx_success_msdus : successful MSDUs
  12788. * @tx_retry_msdus : retried MSDUs
  12789. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12790. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12791. */
  12792. /**
  12793. * @brief target -> host backpressure event
  12794. *
  12795. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12796. *
  12797. * @details
  12798. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12799. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12800. * This message will only be sent if the backpressure condition has existed
  12801. * continuously for an initial period (100 ms).
  12802. * Repeat messages with updated information will be sent after each
  12803. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12804. * This message indicates the ring id along with current head and tail index
  12805. * locations (i.e. write and read indices).
  12806. * The backpressure time indicates the time in ms for which continous
  12807. * backpressure has been observed in the ring.
  12808. *
  12809. * The message format is as follows:
  12810. *
  12811. * |31 24|23 16|15 8|7 0|
  12812. * |----------------+----------------+----------------+----------------|
  12813. * | ring_id | ring_type | pdev_id | msg_type |
  12814. * |-------------------------------------------------------------------|
  12815. * | tail_idx | head_idx |
  12816. * |-------------------------------------------------------------------|
  12817. * | backpressure_time_ms |
  12818. * |-------------------------------------------------------------------|
  12819. *
  12820. * The message is interpreted as follows:
  12821. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  12822. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  12823. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12824. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12825. the msg is for LMAC ring.
  12826. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12827. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12828. * htt_backpressure_lmac_ring_id. This represents
  12829. * the ring id for which continous backpressure is seen
  12830. *
  12831. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12832. * the ring indicated by the ring_id
  12833. *
  12834. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12835. * the ring indicated by the ring id
  12836. *
  12837. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12838. * backpressure has been seen in the ring
  12839. * indicated by the ring_id.
  12840. * Units = milliseconds
  12841. */
  12842. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12843. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12844. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12845. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12846. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12847. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12848. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12849. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12850. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12851. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12852. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12853. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12854. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12857. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12858. } while (0)
  12859. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12860. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12861. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12862. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12863. do { \
  12864. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12865. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12866. } while (0)
  12867. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12868. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12869. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12870. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12871. do { \
  12872. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12873. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12874. } while (0)
  12875. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12876. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12877. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12878. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12879. do { \
  12880. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12881. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12882. } while (0)
  12883. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12884. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12885. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12886. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12887. do { \
  12888. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12889. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12890. } while (0)
  12891. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12892. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12893. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12894. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12895. do { \
  12896. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12897. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12898. } while (0)
  12899. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12900. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12901. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12902. enum htt_backpressure_ring_type {
  12903. HTT_SW_RING_TYPE_UMAC,
  12904. HTT_SW_RING_TYPE_LMAC,
  12905. HTT_SW_RING_TYPE_MAX,
  12906. };
  12907. /* Ring id for which the message is sent to host */
  12908. enum htt_backpressure_umac_ringid {
  12909. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12910. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12911. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12912. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12913. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12914. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12915. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12916. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12917. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12918. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12919. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12920. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12921. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12922. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12923. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12924. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12925. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12926. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12927. HTT_SW_UMAC_RING_IDX_MAX,
  12928. };
  12929. enum htt_backpressure_lmac_ringid {
  12930. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12931. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12932. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12933. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12934. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12935. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12936. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12937. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12938. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12939. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12940. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12941. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12942. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12943. HTT_SW_LMAC_RING_IDX_MAX,
  12944. };
  12945. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12946. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12947. pdev_id: 8,
  12948. ring_type: 8, /* htt_backpressure_ring_type */
  12949. /*
  12950. * ring_id holds an enum value from either
  12951. * htt_backpressure_umac_ringid or
  12952. * htt_backpressure_lmac_ringid, based on
  12953. * the ring_type setting.
  12954. */
  12955. ring_id: 8;
  12956. A_UINT16 head_idx;
  12957. A_UINT16 tail_idx;
  12958. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12959. } POSTPACK;
  12960. /*
  12961. * Defines two 32 bit words that can be used by the target to indicate a per
  12962. * user RU allocation and rate information.
  12963. *
  12964. * This information is currently provided in the "sw_response_reference_ptr"
  12965. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12966. * "rx_ppdu_end_user_stats" TLV.
  12967. *
  12968. * VALID:
  12969. * The consumer of these words must explicitly check the valid bit,
  12970. * and only attempt interpretation of any of the remaining fields if
  12971. * the valid bit is set to 1.
  12972. *
  12973. * VERSION:
  12974. * The consumer of these words must also explicitly check the version bit,
  12975. * and only use the V0 definition if the VERSION field is set to 0.
  12976. *
  12977. * Version 1 is currently undefined, with the exception of the VALID and
  12978. * VERSION fields.
  12979. *
  12980. * Version 0:
  12981. *
  12982. * The fields below are duplicated per BW.
  12983. *
  12984. * The consumer must determine which BW field to use, based on the UL OFDMA
  12985. * PPDU BW indicated by HW.
  12986. *
  12987. * RU_START: RU26 start index for the user.
  12988. * Note that this is always using the RU26 index, regardless
  12989. * of the actual RU assigned to the user
  12990. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12991. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12992. *
  12993. * For example, 20MHz (the value in the top row is RU_START)
  12994. *
  12995. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12996. * RU Size 1 (52): | | | | | |
  12997. * RU Size 2 (106): | | | |
  12998. * RU Size 3 (242): | |
  12999. *
  13000. * RU_SIZE: Indicates the RU size, as defined by enum
  13001. * htt_ul_ofdma_user_info_ru_size.
  13002. *
  13003. * LDPC: LDPC enabled (if 0, BCC is used)
  13004. *
  13005. * DCM: DCM enabled
  13006. *
  13007. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  13008. * |---------------------------------+--------------------------------|
  13009. * |Ver|Valid| FW internal |
  13010. * |---------------------------------+--------------------------------|
  13011. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  13012. * |---------------------------------+--------------------------------|
  13013. */
  13014. enum htt_ul_ofdma_user_info_ru_size {
  13015. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  13016. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  13017. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  13018. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  13019. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  13020. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  13021. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  13022. };
  13023. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  13024. struct htt_ul_ofdma_user_info_v0 {
  13025. A_UINT32 word0;
  13026. A_UINT32 word1;
  13027. };
  13028. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  13029. A_UINT32 w0_fw_rsvd:30; \
  13030. A_UINT32 w0_valid:1; \
  13031. A_UINT32 w0_version:1;
  13032. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  13033. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13034. };
  13035. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  13036. A_UINT32 w1_nss:3; \
  13037. A_UINT32 w1_mcs:4; \
  13038. A_UINT32 w1_ldpc:1; \
  13039. A_UINT32 w1_dcm:1; \
  13040. A_UINT32 w1_ru_start:7; \
  13041. A_UINT32 w1_ru_size:3; \
  13042. A_UINT32 w1_trig_type:4; \
  13043. A_UINT32 w1_unused:9;
  13044. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  13045. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13046. };
  13047. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  13048. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  13049. union {
  13050. A_UINT32 word0;
  13051. struct {
  13052. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  13053. };
  13054. };
  13055. union {
  13056. A_UINT32 word1;
  13057. struct {
  13058. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  13059. };
  13060. };
  13061. } POSTPACK;
  13062. enum HTT_UL_OFDMA_TRIG_TYPE {
  13063. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  13064. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  13065. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  13066. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  13067. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  13068. };
  13069. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  13070. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  13071. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  13072. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  13073. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  13074. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  13075. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  13076. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  13077. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  13078. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  13079. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  13080. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  13081. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  13082. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  13083. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  13084. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  13085. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  13086. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  13087. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  13088. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  13089. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  13090. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  13091. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  13092. /*--- word 0 ---*/
  13093. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  13094. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  13095. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  13096. do { \
  13097. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  13098. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  13099. } while (0)
  13100. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  13101. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  13102. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  13103. do { \
  13104. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  13105. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  13106. } while (0)
  13107. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  13108. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  13109. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  13112. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  13113. } while (0)
  13114. /*--- word 1 ---*/
  13115. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  13116. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  13117. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  13118. do { \
  13119. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  13120. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  13121. } while (0)
  13122. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  13123. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  13124. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  13125. do { \
  13126. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  13127. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  13128. } while (0)
  13129. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  13130. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  13131. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  13132. do { \
  13133. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  13134. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  13135. } while (0)
  13136. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  13137. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  13138. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  13139. do { \
  13140. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  13141. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  13142. } while (0)
  13143. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  13144. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  13145. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  13146. do { \
  13147. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  13148. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  13149. } while (0)
  13150. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  13151. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  13152. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  13153. do { \
  13154. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  13155. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  13156. } while (0)
  13157. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  13158. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  13159. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  13160. do { \
  13161. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  13162. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  13163. } while (0)
  13164. /**
  13165. * @brief target -> host channel calibration data message
  13166. *
  13167. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  13168. *
  13169. * @brief host -> target channel calibration data message
  13170. *
  13171. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  13172. *
  13173. * @details
  13174. * The following field definitions describe the format of the channel
  13175. * calibration data message sent from the target to the host when
  13176. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  13177. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  13178. * The message is defined as htt_chan_caldata_msg followed by a variable
  13179. * number of 32-bit character values.
  13180. *
  13181. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  13182. * |------------------------------------------------------------------|
  13183. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  13184. * |------------------------------------------------------------------|
  13185. * | payload size | mhz |
  13186. * |------------------------------------------------------------------|
  13187. * | center frequency 2 | center frequency 1 |
  13188. * |------------------------------------------------------------------|
  13189. * | check sum |
  13190. * |------------------------------------------------------------------|
  13191. * | payload |
  13192. * |------------------------------------------------------------------|
  13193. * message info field:
  13194. * - MSG_TYPE
  13195. * Bits 7:0
  13196. * Purpose: identifies this as a channel calibration data message
  13197. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  13198. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  13199. * - SUB_TYPE
  13200. * Bits 11:8
  13201. * Purpose: T2H: indicates whether target is providing chan cal data
  13202. * to the host to store, or requesting that the host
  13203. * download previously-stored data.
  13204. * H2T: indicates whether the host is providing the requested
  13205. * channel cal data, or if it is rejecting the data
  13206. * request because it does not have the requested data.
  13207. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  13208. * - CHKSUM_VALID
  13209. * Bit 12
  13210. * Purpose: indicates if the checksum field is valid
  13211. * value:
  13212. * - FRAG
  13213. * Bit 19:16
  13214. * Purpose: indicates the fragment index for message
  13215. * value: 0 for first fragment, 1 for second fragment, ...
  13216. * - APPEND
  13217. * Bit 20
  13218. * Purpose: indicates if this is the last fragment
  13219. * value: 0 = final fragment, 1 = more fragments will be appended
  13220. *
  13221. * channel and payload size field
  13222. * - MHZ
  13223. * Bits 15:0
  13224. * Purpose: indicates the channel primary frequency
  13225. * Value:
  13226. * - PAYLOAD_SIZE
  13227. * Bits 31:16
  13228. * Purpose: indicates the bytes of calibration data in payload
  13229. * Value:
  13230. *
  13231. * center frequency field
  13232. * - CENTER FREQUENCY 1
  13233. * Bits 15:0
  13234. * Purpose: indicates the channel center frequency
  13235. * Value: channel center frequency, in MHz units
  13236. * - CENTER FREQUENCY 2
  13237. * Bits 31:16
  13238. * Purpose: indicates the secondary channel center frequency,
  13239. * only for 11acvht 80plus80 mode
  13240. * Value: secondary channel center frequeny, in MHz units, if applicable
  13241. *
  13242. * checksum field
  13243. * - CHECK_SUM
  13244. * Bits 31:0
  13245. * Purpose: check the payload data, it is just for this fragment.
  13246. * This is intended for the target to check that the channel
  13247. * calibration data returned by the host is the unmodified data
  13248. * that was previously provided to the host by the target.
  13249. * value: checksum of fragment payload
  13250. */
  13251. PREPACK struct htt_chan_caldata_msg {
  13252. /* DWORD 0: message info */
  13253. A_UINT32
  13254. msg_type: 8,
  13255. sub_type: 4 ,
  13256. chksum_valid: 1, /** 1:valid, 0:invalid */
  13257. reserved1: 3,
  13258. frag_idx: 4, /** fragment index for calibration data */
  13259. appending: 1, /** 0: no fragment appending,
  13260. * 1: extra fragment appending */
  13261. reserved2: 11;
  13262. /* DWORD 1: channel and payload size */
  13263. A_UINT32
  13264. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  13265. payload_size: 16; /** unit: bytes */
  13266. /* DWORD 2: center frequency */
  13267. A_UINT32
  13268. band_center_freq1: 16, /** Center frequency 1 in MHz */
  13269. band_center_freq2: 16; /** Center frequency 2 in MHz,
  13270. * valid only for 11acvht 80plus80 mode */
  13271. /* DWORD 3: check sum */
  13272. A_UINT32 chksum;
  13273. /* variable length for calibration data */
  13274. A_UINT32 payload[1/* or more */];
  13275. } POSTPACK;
  13276. /* T2H SUBTYPE */
  13277. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  13278. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  13279. /* H2T SUBTYPE */
  13280. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  13281. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  13282. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  13283. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  13284. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  13285. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  13286. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  13287. do { \
  13288. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  13289. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  13290. } while (0)
  13291. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  13292. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  13293. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  13294. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  13295. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  13296. do { \
  13297. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  13298. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  13299. } while (0)
  13300. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  13301. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  13302. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  13303. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  13304. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  13305. do { \
  13306. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  13307. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  13308. } while (0)
  13309. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  13310. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  13311. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  13312. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  13313. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  13314. do { \
  13315. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  13316. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  13317. } while (0)
  13318. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  13319. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  13320. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  13321. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  13322. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  13323. do { \
  13324. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  13325. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  13326. } while (0)
  13327. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  13328. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  13329. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  13330. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  13331. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  13332. do { \
  13333. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  13334. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  13335. } while (0)
  13336. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  13337. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  13338. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  13339. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  13340. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  13341. do { \
  13342. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  13343. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  13344. } while (0)
  13345. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  13346. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  13347. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  13348. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  13349. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  13350. do { \
  13351. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  13352. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  13353. } while (0)
  13354. /**
  13355. * @brief target -> host FSE CMEM based send
  13356. *
  13357. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  13358. *
  13359. * @details
  13360. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  13361. * FSE placement in CMEM is enabled.
  13362. *
  13363. * This message sends the non-secure CMEM base address.
  13364. * It will be sent to host in response to message
  13365. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  13366. * The message would appear as follows:
  13367. *
  13368. * |31 24|23 16|15 8|7 0|
  13369. * |----------------+----------------+----------------+----------------|
  13370. * | reserved | num_entries | msg_type |
  13371. * |----------------+----------------+----------------+----------------|
  13372. * | base_address_lo |
  13373. * |----------------+----------------+----------------+----------------|
  13374. * | base_address_hi |
  13375. * |-------------------------------------------------------------------|
  13376. *
  13377. * The message is interpreted as follows:
  13378. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  13379. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  13380. * b'8:15 - number_entries: Indicated the number of entries
  13381. * programmed.
  13382. * b'16:31 - reserved.
  13383. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  13384. * CMEM base address
  13385. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  13386. * CMEM base address
  13387. */
  13388. PREPACK struct htt_cmem_base_send_t {
  13389. A_UINT32 msg_type: 8,
  13390. num_entries: 8,
  13391. reserved: 16;
  13392. A_UINT32 base_address_lo;
  13393. A_UINT32 base_address_hi;
  13394. } POSTPACK;
  13395. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  13396. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  13397. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  13398. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  13399. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  13400. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  13401. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  13402. do { \
  13403. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  13404. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13405. } while (0)
  13406. /**
  13407. * @brief - HTT PPDU ID format
  13408. *
  13409. * @details
  13410. * The following field definitions describe the format of the PPDU ID.
  13411. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  13412. *
  13413. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  13414. * +--------------------------------------------------------------------------
  13415. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  13416. * +--------------------------------------------------------------------------
  13417. *
  13418. * sch id :Schedule command id
  13419. * Bits [11 : 0] : monotonically increasing counter to track the
  13420. * PPDU posted to a specific transmit queue.
  13421. *
  13422. * hwq_id: Hardware Queue ID.
  13423. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13424. *
  13425. * mac_id: MAC ID
  13426. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13427. *
  13428. * seq_idx: Sequence index.
  13429. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13430. * a particular TXOP.
  13431. *
  13432. * tqm_cmd: HWSCH/TQM flag.
  13433. * Bit [23] : Always set to 0.
  13434. *
  13435. * seq_cmd_type: Sequence command type.
  13436. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13437. * Refer to enum HTT_STATS_FTYPE for values.
  13438. */
  13439. PREPACK struct htt_ppdu_id {
  13440. A_UINT32
  13441. sch_id: 12,
  13442. hwq_id: 5,
  13443. mac_id: 2,
  13444. seq_idx: 2,
  13445. reserved1: 2,
  13446. tqm_cmd: 1,
  13447. seq_cmd_type: 6,
  13448. reserved2: 2;
  13449. } POSTPACK;
  13450. #define HTT_PPDU_ID_SCH_ID_S 0
  13451. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13452. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13453. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13454. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13455. do { \
  13456. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13457. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13458. } while (0)
  13459. #define HTT_PPDU_ID_HWQ_ID_S 12
  13460. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13461. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13462. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13463. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13464. do { \
  13465. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13466. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13467. } while (0)
  13468. #define HTT_PPDU_ID_MAC_ID_S 17
  13469. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13470. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13471. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13472. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13473. do { \
  13474. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13475. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13476. } while (0)
  13477. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13478. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13479. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13480. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13481. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13482. do { \
  13483. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13484. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13485. } while (0)
  13486. #define HTT_PPDU_ID_TQM_CMD_S 23
  13487. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13488. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13489. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13490. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13491. do { \
  13492. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13493. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13494. } while (0)
  13495. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13496. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13497. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13498. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13499. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13500. do { \
  13501. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13502. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13503. } while (0)
  13504. /**
  13505. * @brief target -> RX PEER METADATA V0 format
  13506. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13507. * message from target, and will confirm to the target which peer metadata
  13508. * version to use in the wmi_init message.
  13509. *
  13510. * The following diagram shows the format of the RX PEER METADATA.
  13511. *
  13512. * |31 24|23 16|15 8|7 0|
  13513. * |-----------------------------------------------------------------------|
  13514. * | Reserved | VDEV ID | PEER ID |
  13515. * |-----------------------------------------------------------------------|
  13516. */
  13517. PREPACK struct htt_rx_peer_metadata_v0 {
  13518. A_UINT32
  13519. peer_id: 16,
  13520. vdev_id: 8,
  13521. reserved1: 8;
  13522. } POSTPACK;
  13523. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13524. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13525. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13526. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13527. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13528. do { \
  13529. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13530. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13531. } while (0)
  13532. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13533. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13534. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13535. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13536. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13537. do { \
  13538. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13539. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13540. } while (0)
  13541. /**
  13542. * @brief target -> RX PEER METADATA V1 format
  13543. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13544. * message from target, and will confirm to the target which peer metadata
  13545. * version to use in the wmi_init message.
  13546. *
  13547. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13548. *
  13549. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13550. * |-----------------------------------------------------------------------|
  13551. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13552. * |-----------------------------------------------------------------------|
  13553. */
  13554. PREPACK struct htt_rx_peer_metadata_v1 {
  13555. A_UINT32
  13556. peer_id: 13,
  13557. ml_peer_valid: 1,
  13558. reserved1: 2,
  13559. vdev_id: 8,
  13560. lmac_id: 2,
  13561. chip_id: 3,
  13562. reserved2: 3;
  13563. } POSTPACK;
  13564. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13565. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13566. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13567. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13568. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13569. do { \
  13570. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13571. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13572. } while (0)
  13573. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13574. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13575. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13576. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13577. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13578. do { \
  13579. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13580. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13581. } while (0)
  13582. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13583. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13584. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13585. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13586. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13587. do { \
  13588. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13589. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13590. } while (0)
  13591. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13592. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13593. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13594. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13595. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13596. do { \
  13597. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13598. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13599. } while (0)
  13600. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13601. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13602. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13603. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13604. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13605. do { \
  13606. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13607. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13608. } while (0)
  13609. /*
  13610. * In some systems, the host SW wants to specify priorities between
  13611. * different MSDU / flow queues within the same peer-TID.
  13612. * The below enums are used for the host to identify to the target
  13613. * which MSDU queue's priority it wants to adjust.
  13614. */
  13615. /*
  13616. * The MSDUQ index describe index of TCL HW, where each index is
  13617. * used for queuing particular types of MSDUs.
  13618. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  13619. */
  13620. enum HTT_MSDUQ_INDEX {
  13621. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  13622. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  13623. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  13624. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  13625. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  13626. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  13627. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  13628. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  13629. HTT_MSDUQ_MAX_INDEX,
  13630. };
  13631. /* MSDU qtype definition */
  13632. enum HTT_MSDU_QTYPE {
  13633. /*
  13634. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  13635. * relative priority. Instead, the relative priority of CRIT_0 versus
  13636. * CRIT_1 is controlled by the FW, through the configuration parameters
  13637. * it applies to the queues.
  13638. */
  13639. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  13640. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  13641. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  13642. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  13643. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  13644. /* New MSDU_QTYPE should be added above this line */
  13645. /*
  13646. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  13647. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  13648. * any host/target message definitions. The QTYPE_MAX value can
  13649. * only be used internally within the host or within the target.
  13650. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  13651. * it must regard the unexpected value as a default qtype value,
  13652. * or ignore it.
  13653. */
  13654. HTT_MSDU_QTYPE_MAX,
  13655. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  13656. };
  13657. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  13658. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  13659. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  13660. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  13661. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  13662. };
  13663. /**
  13664. * @brief target -> host mlo timestamp offset indication
  13665. *
  13666. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13667. *
  13668. * @details
  13669. * The following field definitions describe the format of the HTT target
  13670. * to host mlo timestamp offset indication message.
  13671. *
  13672. *
  13673. * |31 16|15 12|11 10|9 8|7 0 |
  13674. * |----------------------------------------------------------------------|
  13675. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  13676. * |----------------------------------------------------------------------|
  13677. * | Sync time stamp lo in us |
  13678. * |----------------------------------------------------------------------|
  13679. * | Sync time stamp hi in us |
  13680. * |----------------------------------------------------------------------|
  13681. * | mlo time stamp offset lo in us |
  13682. * |----------------------------------------------------------------------|
  13683. * | mlo time stamp offset hi in us |
  13684. * |----------------------------------------------------------------------|
  13685. * | mlo time stamp offset clocks in clock ticks |
  13686. * |----------------------------------------------------------------------|
  13687. * |31 26|25 16|15 0 |
  13688. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  13689. * | | compensation in clks | |
  13690. * |----------------------------------------------------------------------|
  13691. * |31 22|21 0 |
  13692. * | rsvd 3 | mlo time stamp comp timer period |
  13693. * |----------------------------------------------------------------------|
  13694. * The message is interpreted as follows:
  13695. *
  13696. * dword0 - b'0:7 - msg_type: This will be set to
  13697. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  13698. * value: 0x28
  13699. *
  13700. * dword0 - b'9:8 - pdev_id
  13701. *
  13702. * dword0 - b'11:10 - chip_id
  13703. *
  13704. * dword0 - b'15:12 - rsvd1: Reserved for future use
  13705. *
  13706. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  13707. *
  13708. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  13709. * which last sync interrupt was received
  13710. *
  13711. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  13712. * which last sync interrupt was received
  13713. *
  13714. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  13715. *
  13716. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  13717. *
  13718. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  13719. *
  13720. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  13721. *
  13722. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  13723. * for sub us resolution
  13724. *
  13725. * dword6 - b'31:26 - rsvd2: Reserved for future use
  13726. *
  13727. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  13728. * is applied, in us
  13729. *
  13730. * dword7 - b'31:22 - rsvd3: Reserved for future use
  13731. */
  13732. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  13733. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  13734. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  13735. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  13736. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  13737. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  13738. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  13739. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  13740. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  13741. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  13742. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  13743. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  13744. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  13745. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  13746. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  13747. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  13748. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  13749. do { \
  13750. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  13751. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  13752. } while (0)
  13753. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  13754. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  13755. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  13756. do { \
  13757. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  13758. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  13759. } while (0)
  13760. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  13761. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  13762. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  13763. do { \
  13764. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  13765. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  13766. } while (0)
  13767. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  13768. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  13769. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  13770. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  13771. do { \
  13772. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  13773. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  13774. } while (0)
  13775. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  13776. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  13777. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  13778. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  13779. do { \
  13780. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  13781. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  13782. } while (0)
  13783. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  13784. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  13785. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  13786. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  13787. do { \
  13788. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  13789. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  13790. } while (0)
  13791. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  13792. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  13793. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  13794. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  13795. do { \
  13796. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  13797. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  13798. } while (0)
  13799. typedef struct {
  13800. A_UINT32 msg_type: 8, /* bits 7:0 */
  13801. pdev_id: 2, /* bits 9:8 */
  13802. chip_id: 2, /* bits 11:10 */
  13803. reserved1: 4, /* bits 15:12 */
  13804. mac_clk_freq_mhz: 16; /* bits 31:16 */
  13805. A_UINT32 sync_timestamp_lo_us;
  13806. A_UINT32 sync_timestamp_hi_us;
  13807. A_UINT32 mlo_timestamp_offset_lo_us;
  13808. A_UINT32 mlo_timestamp_offset_hi_us;
  13809. A_UINT32 mlo_timestamp_offset_clks;
  13810. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  13811. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  13812. reserved2: 6; /* bits 31:26 */
  13813. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  13814. reserved3: 10; /* bits 31:22 */
  13815. } htt_t2h_mlo_offset_ind_t;
  13816. #endif