htt.h 654 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601
  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. */
  208. #define HTT_CURRENT_VERSION_MAJOR 3
  209. #define HTT_CURRENT_VERSION_MINOR 89
  210. #define HTT_NUM_TX_FRAG_DESC 1024
  211. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  212. #define HTT_CHECK_SET_VAL(field, val) \
  213. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  214. /* macros to assist in sign-extending fields from HTT messages */
  215. #define HTT_SIGN_BIT_MASK(field) \
  216. ((field ## _M + (1 << field ## _S)) >> 1)
  217. #define HTT_SIGN_BIT(_val, field) \
  218. (_val & HTT_SIGN_BIT_MASK(field))
  219. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  220. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  221. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  222. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  223. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  224. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  225. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  226. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  227. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  228. /*
  229. * TEMPORARY:
  230. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  231. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  232. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  233. * updated.
  234. */
  235. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  236. /*
  237. * TEMPORARY:
  238. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  239. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  240. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  241. * updated.
  242. */
  243. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  244. /*
  245. * htt_dbg_stats_type -
  246. * bit positions for each stats type within a stats type bitmask
  247. * The bitmask contains 24 bits.
  248. */
  249. enum htt_dbg_stats_type {
  250. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  251. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  252. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  253. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  254. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  255. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  256. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  257. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  258. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  259. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  260. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  261. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  262. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  263. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  264. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  265. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  266. /* bits 16-23 currently reserved */
  267. /* keep this last */
  268. HTT_DBG_NUM_STATS
  269. };
  270. /*=== HTT option selection TLVs ===
  271. * Certain HTT messages have alternatives or options.
  272. * For such cases, the host and target need to agree on which option to use.
  273. * Option specification TLVs can be appended to the VERSION_REQ and
  274. * VERSION_CONF messages to select options other than the default.
  275. * These TLVs are entirely optional - if they are not provided, there is a
  276. * well-defined default for each option. If they are provided, they can be
  277. * provided in any order. Each TLV can be present or absent independent of
  278. * the presence / absence of other TLVs.
  279. *
  280. * The HTT option selection TLVs use the following format:
  281. * |31 16|15 8|7 0|
  282. * |---------------------------------+----------------+----------------|
  283. * | value (payload) | length | tag |
  284. * |-------------------------------------------------------------------|
  285. * The value portion need not be only 2 bytes; it can be extended by any
  286. * integer number of 4-byte units. The total length of the TLV, including
  287. * the tag and length fields, must be a multiple of 4 bytes. The length
  288. * field specifies the total TLV size in 4-byte units. Thus, the typical
  289. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  290. * field, would store 0x1 in its length field, to show that the TLV occupies
  291. * a single 4-byte unit.
  292. */
  293. /*--- TLV header format - applies to all HTT option TLVs ---*/
  294. enum HTT_OPTION_TLV_TAGS {
  295. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  296. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  297. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  298. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  299. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  300. };
  301. PREPACK struct htt_option_tlv_header_t {
  302. A_UINT8 tag;
  303. A_UINT8 length;
  304. } POSTPACK;
  305. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  306. #define HTT_OPTION_TLV_TAG_S 0
  307. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  308. #define HTT_OPTION_TLV_LENGTH_S 8
  309. /*
  310. * value0 - 16 bit value field stored in word0
  311. * The TLV's value field may be longer than 2 bytes, in which case
  312. * the remainder of the value is stored in word1, word2, etc.
  313. */
  314. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  315. #define HTT_OPTION_TLV_VALUE0_S 16
  316. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  317. do { \
  318. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  319. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  320. } while (0)
  321. #define HTT_OPTION_TLV_TAG_GET(word) \
  322. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  323. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  329. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  330. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  336. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  337. /*--- format of specific HTT option TLVs ---*/
  338. /*
  339. * HTT option TLV for specifying LL bus address size
  340. * Some chips require bus addresses used by the target to access buffers
  341. * within the host's memory to be 32 bits; others require bus addresses
  342. * used by the target to access buffers within the host's memory to be
  343. * 64 bits.
  344. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  345. * a suffix to the VERSION_CONF message to specify which bus address format
  346. * the target requires.
  347. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  348. * default to providing bus addresses to the target in 32-bit format.
  349. */
  350. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  351. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  352. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  353. };
  354. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  355. struct htt_option_tlv_header_t hdr;
  356. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  357. } POSTPACK;
  358. /*
  359. * HTT option TLV for specifying whether HL systems should indicate
  360. * over-the-air tx completion for individual frames, or should instead
  361. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  362. * requests an OTA tx completion for a particular tx frame.
  363. * This option does not apply to LL systems, where the TX_COMPL_IND
  364. * is mandatory.
  365. * This option is primarily intended for HL systems in which the tx frame
  366. * downloads over the host --> target bus are as slow as or slower than
  367. * the transmissions over the WLAN PHY. For cases where the bus is faster
  368. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  369. * and consquently will send one TX_COMPL_IND message that covers several
  370. * tx frames. For cases where the WLAN PHY is faster than the bus,
  371. * the target will end up transmitting very short A-MPDUs, and consequently
  372. * sending many TX_COMPL_IND messages, which each cover a very small number
  373. * of tx frames.
  374. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  375. * a suffix to the VERSION_REQ message to request whether the host desires to
  376. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  377. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  378. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  379. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  380. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  381. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  382. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  383. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  384. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  385. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  386. * TLV.
  387. */
  388. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  389. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  390. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  391. };
  392. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  393. struct htt_option_tlv_header_t hdr;
  394. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  395. } POSTPACK;
  396. /*
  397. * HTT option TLV for specifying how many tx queue groups the target
  398. * may establish.
  399. * This TLV specifies the maximum value the target may send in the
  400. * txq_group_id field of any TXQ_GROUP information elements sent by
  401. * the target to the host. This allows the host to pre-allocate an
  402. * appropriate number of tx queue group structs.
  403. *
  404. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  405. * a suffix to the VERSION_REQ message to specify whether the host supports
  406. * tx queue groups at all, and if so if there is any limit on the number of
  407. * tx queue groups that the host supports.
  408. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  409. * a suffix to the VERSION_CONF message. If the host has specified in the
  410. * VER_REQ message a limit on the number of tx queue groups the host can
  411. * supprt, the target shall limit its specification of the maximum tx groups
  412. * to be no larger than this host-specified limit.
  413. *
  414. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  415. * shall preallocate 4 tx queue group structs, and the target shall not
  416. * specify a txq_group_id larger than 3.
  417. */
  418. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  419. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  420. /*
  421. * values 1 through N specify the max number of tx queue groups
  422. * the sender supports
  423. */
  424. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  425. };
  426. /* TEMPORARY backwards-compatibility alias for a typo fix -
  427. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  428. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  429. * to support the old name (with the typo) until all references to the
  430. * old name are replaced with the new name.
  431. */
  432. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  433. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  434. struct htt_option_tlv_header_t hdr;
  435. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  436. } POSTPACK;
  437. /*
  438. * HTT option TLV for specifying whether the target supports an extended
  439. * version of the HTT tx descriptor. If the target provides this TLV
  440. * and specifies in the TLV that the target supports an extended version
  441. * of the HTT tx descriptor, the target must check the "extension" bit in
  442. * the HTT tx descriptor, and if the extension bit is set, to expect a
  443. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  444. * descriptor. Furthermore, the target must provide room for the HTT
  445. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  446. * This option is intended for systems where the host needs to explicitly
  447. * control the transmission parameters such as tx power for individual
  448. * tx frames.
  449. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  450. * as a suffix to the VERSION_CONF message to explicitly specify whether
  451. * the target supports the HTT tx MSDU extension descriptor.
  452. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  453. * by the host as lack of target support for the HTT tx MSDU extension
  454. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  455. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  456. * the HTT tx MSDU extension descriptor.
  457. * The host is not required to provide the HTT tx MSDU extension descriptor
  458. * just because the target supports it; the target must check the
  459. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  460. * extension descriptor is present.
  461. */
  462. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  463. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  464. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  465. };
  466. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  467. struct htt_option_tlv_header_t hdr;
  468. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  469. } POSTPACK;
  470. /*=== host -> target messages ===============================================*/
  471. enum htt_h2t_msg_type {
  472. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  473. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  474. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  475. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  476. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  477. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  478. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  479. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  480. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  481. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  482. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  483. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  484. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  485. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  486. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  487. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  488. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  489. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  490. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  491. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  492. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  493. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  494. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  495. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  496. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  497. /* keep this last */
  498. HTT_H2T_NUM_MSGS
  499. };
  500. /*
  501. * HTT host to target message type -
  502. * stored in bits 7:0 of the first word of the message
  503. */
  504. #define HTT_H2T_MSG_TYPE_M 0xff
  505. #define HTT_H2T_MSG_TYPE_S 0
  506. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  507. do { \
  508. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  509. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  510. } while (0)
  511. #define HTT_H2T_MSG_TYPE_GET(word) \
  512. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  513. /**
  514. * @brief host -> target version number request message definition
  515. *
  516. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  517. *
  518. *
  519. * |31 24|23 16|15 8|7 0|
  520. * |----------------+----------------+----------------+----------------|
  521. * | reserved | msg type |
  522. * |-------------------------------------------------------------------|
  523. * : option request TLV (optional) |
  524. * :...................................................................:
  525. *
  526. * The VER_REQ message may consist of a single 4-byte word, or may be
  527. * extended with TLVs that specify which HTT options the host is requesting
  528. * from the target.
  529. * The following option TLVs may be appended to the VER_REQ message:
  530. * - HL_SUPPRESS_TX_COMPL_IND
  531. * - HL_MAX_TX_QUEUE_GROUPS
  532. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  533. * may be appended to the VER_REQ message (but only one TLV of each type).
  534. *
  535. * Header fields:
  536. * - MSG_TYPE
  537. * Bits 7:0
  538. * Purpose: identifies this as a version number request message
  539. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  540. */
  541. #define HTT_VER_REQ_BYTES 4
  542. /* TBDXXX: figure out a reasonable number */
  543. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  544. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  545. /**
  546. * @brief HTT tx MSDU descriptor
  547. *
  548. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  549. *
  550. * @details
  551. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  552. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  553. * the target firmware needs for the FW's tx processing, particularly
  554. * for creating the HW msdu descriptor.
  555. * The same HTT tx descriptor is used for HL and LL systems, though
  556. * a few fields within the tx descriptor are used only by LL or
  557. * only by HL.
  558. * The HTT tx descriptor is defined in two manners: by a struct with
  559. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  560. * definitions.
  561. * The target should use the struct def, for simplicitly and clarity,
  562. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  563. * neutral. Specifically, the host shall use the get/set macros built
  564. * around the mask + shift defs.
  565. */
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  569. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  572. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  573. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  574. #define HTT_TX_VDEV_ID_WORD 0
  575. #define HTT_TX_VDEV_ID_MASK 0x3f
  576. #define HTT_TX_VDEV_ID_SHIFT 16
  577. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  578. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  579. #define HTT_TX_MSDU_LEN_DWORD 1
  580. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  581. /*
  582. * HTT_VAR_PADDR macros
  583. * Allow physical / bus addresses to be either a single 32-bit value,
  584. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  585. */
  586. #define HTT_VAR_PADDR32(var_name) \
  587. A_UINT32 var_name
  588. #define HTT_VAR_PADDR64_LE(var_name) \
  589. struct { \
  590. /* little-endian: lo precedes hi */ \
  591. A_UINT32 lo; \
  592. A_UINT32 hi; \
  593. } var_name
  594. /*
  595. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  596. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  597. * addresses are stored in a XXX-bit field.
  598. * This macro is used to define both htt_tx_msdu_desc32_t and
  599. * htt_tx_msdu_desc64_t structs.
  600. */
  601. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  602. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  603. { \
  604. /* DWORD 0: flags and meta-data */ \
  605. A_UINT32 \
  606. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  607. \
  608. /* pkt_subtype - \
  609. * Detailed specification of the tx frame contents, extending the \
  610. * general specification provided by pkt_type. \
  611. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  612. * pkt_type | pkt_subtype \
  613. * ============================================================== \
  614. * 802.3 | bit 0:3 - Reserved \
  615. * | bit 4: 0x0 - Copy-Engine Classification Results \
  616. * | not appended to the HTT message \
  617. * | 0x1 - Copy-Engine Classification Results \
  618. * | appended to the HTT message in the \
  619. * | format: \
  620. * | [HTT tx desc, frame header, \
  621. * | CE classification results] \
  622. * | The CE classification results begin \
  623. * | at the next 4-byte boundary after \
  624. * | the frame header. \
  625. * ------------+------------------------------------------------- \
  626. * Eth2 | bit 0:3 - Reserved \
  627. * | bit 4: 0x0 - Copy-Engine Classification Results \
  628. * | not appended to the HTT message \
  629. * | 0x1 - Copy-Engine Classification Results \
  630. * | appended to the HTT message. \
  631. * | See the above specification of the \
  632. * | CE classification results location. \
  633. * ------------+------------------------------------------------- \
  634. * native WiFi | bit 0:3 - Reserved \
  635. * | bit 4: 0x0 - Copy-Engine Classification Results \
  636. * | not appended to the HTT message \
  637. * | 0x1 - Copy-Engine Classification Results \
  638. * | appended to the HTT message. \
  639. * | See the above specification of the \
  640. * | CE classification results location. \
  641. * ------------+------------------------------------------------- \
  642. * mgmt | 0x0 - 802.11 MAC header absent \
  643. * | 0x1 - 802.11 MAC header present \
  644. * ------------+------------------------------------------------- \
  645. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  646. * | 0x1 - 802.11 MAC header present \
  647. * | bit 1: 0x0 - allow aggregation \
  648. * | 0x1 - don't allow aggregation \
  649. * | bit 2: 0x0 - perform encryption \
  650. * | 0x1 - don't perform encryption \
  651. * | bit 3: 0x0 - perform tx classification / queuing \
  652. * | 0x1 - don't perform tx classification; \
  653. * | insert the frame into the "misc" \
  654. * | tx queue \
  655. * | bit 4: 0x0 - Copy-Engine Classification Results \
  656. * | not appended to the HTT message \
  657. * | 0x1 - Copy-Engine Classification Results \
  658. * | appended to the HTT message. \
  659. * | See the above specification of the \
  660. * | CE classification results location. \
  661. */ \
  662. pkt_subtype: 5, \
  663. \
  664. /* pkt_type - \
  665. * General specification of the tx frame contents. \
  666. * The htt_pkt_type enum should be used to specify and check the \
  667. * value of this field. \
  668. */ \
  669. pkt_type: 3, \
  670. \
  671. /* vdev_id - \
  672. * ID for the vdev that is sending this tx frame. \
  673. * For certain non-standard packet types, e.g. pkt_type == raw \
  674. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  675. * This field is used primarily for determining where to queue \
  676. * broadcast and multicast frames. \
  677. */ \
  678. vdev_id: 6, \
  679. /* ext_tid - \
  680. * The extended traffic ID. \
  681. * If the TID is unknown, the extended TID is set to \
  682. * HTT_TX_EXT_TID_INVALID. \
  683. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  684. * value of the QoS TID. \
  685. * If the tx frame is non-QoS data, then the extended TID is set to \
  686. * HTT_TX_EXT_TID_NON_QOS. \
  687. * If the tx frame is multicast or broadcast, then the extended TID \
  688. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  689. */ \
  690. ext_tid: 5, \
  691. \
  692. /* postponed - \
  693. * This flag indicates whether the tx frame has been downloaded to \
  694. * the target before but discarded by the target, and now is being \
  695. * downloaded again; or if this is a new frame that is being \
  696. * downloaded for the first time. \
  697. * This flag allows the target to determine the correct order for \
  698. * transmitting new vs. old frames. \
  699. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  700. * This flag only applies to HL systems, since in LL systems, \
  701. * the tx flow control is handled entirely within the target. \
  702. */ \
  703. postponed: 1, \
  704. \
  705. /* extension - \
  706. * This flag indicates whether a HTT tx MSDU extension descriptor \
  707. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  708. * \
  709. * 0x0 - no extension MSDU descriptor is present \
  710. * 0x1 - an extension MSDU descriptor immediately follows the \
  711. * regular MSDU descriptor \
  712. */ \
  713. extension: 1, \
  714. \
  715. /* cksum_offload - \
  716. * This flag indicates whether checksum offload is enabled or not \
  717. * for this frame. Target FW use this flag to turn on HW checksumming \
  718. * 0x0 - No checksum offload \
  719. * 0x1 - L3 header checksum only \
  720. * 0x2 - L4 checksum only \
  721. * 0x3 - L3 header checksum + L4 checksum \
  722. */ \
  723. cksum_offload: 2, \
  724. \
  725. /* tx_comp_req - \
  726. * This flag indicates whether Tx Completion \
  727. * from fw is required or not. \
  728. * This flag is only relevant if tx completion is not \
  729. * universally enabled. \
  730. * For all LL systems, tx completion is mandatory, \
  731. * so this flag will be irrelevant. \
  732. * For HL systems tx completion is optional, but HL systems in which \
  733. * the bus throughput exceeds the WLAN throughput will \
  734. * probably want to always use tx completion, and thus \
  735. * would not check this flag. \
  736. * This flag is required when tx completions are not used universally, \
  737. * but are still required for certain tx frames for which \
  738. * an OTA delivery acknowledgment is needed by the host. \
  739. * In practice, this would be for HL systems in which the \
  740. * bus throughput is less than the WLAN throughput. \
  741. * \
  742. * 0x0 - Tx Completion Indication from Fw not required \
  743. * 0x1 - Tx Completion Indication from Fw is required \
  744. */ \
  745. tx_compl_req: 1; \
  746. \
  747. \
  748. /* DWORD 1: MSDU length and ID */ \
  749. A_UINT32 \
  750. len: 16, /* MSDU length, in bytes */ \
  751. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  752. * and this id is used to calculate fragmentation \
  753. * descriptor pointer inside the target based on \
  754. * the base address, configured inside the target. \
  755. */ \
  756. \
  757. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  758. /* frags_desc_ptr - \
  759. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  760. * where the tx frame's fragments reside in memory. \
  761. * This field only applies to LL systems, since in HL systems the \
  762. * (degenerate single-fragment) fragmentation descriptor is created \
  763. * within the target. \
  764. */ \
  765. _paddr__frags_desc_ptr_; \
  766. \
  767. /* DWORD 3 (or 4): peerid, chanfreq */ \
  768. /* \
  769. * Peer ID : Target can use this value to know which peer-id packet \
  770. * destined to. \
  771. * It's intended to be specified by host in case of NAWDS. \
  772. */ \
  773. A_UINT16 peerid; \
  774. \
  775. /* \
  776. * Channel frequency: This identifies the desired channel \
  777. * frequency (in mhz) for tx frames. This is used by FW to help \
  778. * determine when it is safe to transmit or drop frames for \
  779. * off-channel operation. \
  780. * The default value of zero indicates to FW that the corresponding \
  781. * VDEV's home channel (if there is one) is the desired channel \
  782. * frequency. \
  783. */ \
  784. A_UINT16 chanfreq; \
  785. \
  786. /* Reason reserved is commented is increasing the htt structure size \
  787. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  788. * A_UINT32 reserved_dword3_bits0_31; \
  789. */ \
  790. } POSTPACK
  791. /* define a htt_tx_msdu_desc32_t type */
  792. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  793. /* define a htt_tx_msdu_desc64_t type */
  794. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  795. /*
  796. * Make htt_tx_msdu_desc_t be an alias for either
  797. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  798. */
  799. #if HTT_PADDR64
  800. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  801. #else
  802. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  803. #endif
  804. /* decriptor information for Management frame*/
  805. /*
  806. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  807. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  808. */
  809. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  810. extern A_UINT32 mgmt_hdr_len;
  811. PREPACK struct htt_mgmt_tx_desc_t {
  812. A_UINT32 msg_type;
  813. #if HTT_PADDR64
  814. A_UINT64 frag_paddr; /* DMAble address of the data */
  815. #else
  816. A_UINT32 frag_paddr; /* DMAble address of the data */
  817. #endif
  818. A_UINT32 desc_id; /* returned to host during completion
  819. * to free the meory*/
  820. A_UINT32 len; /* Fragment length */
  821. A_UINT32 vdev_id; /* virtual device ID*/
  822. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  823. } POSTPACK;
  824. PREPACK struct htt_mgmt_tx_compl_ind {
  825. A_UINT32 desc_id;
  826. A_UINT32 status;
  827. } POSTPACK;
  828. /*
  829. * This SDU header size comes from the summation of the following:
  830. * 1. Max of:
  831. * a. Native WiFi header, for native WiFi frames: 24 bytes
  832. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  833. * b. 802.11 header, for raw frames: 36 bytes
  834. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  835. * QoS header, HT header)
  836. * c. 802.3 header, for ethernet frames: 14 bytes
  837. * (destination address, source address, ethertype / length)
  838. * 2. Max of:
  839. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  840. * b. IPv6 header, up through the Traffic Class: 2 bytes
  841. * 3. 802.1Q VLAN header: 4 bytes
  842. * 4. LLC/SNAP header: 8 bytes
  843. */
  844. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  845. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  846. #define HTT_TX_HDR_SIZE_ETHERNET 14
  847. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  848. A_COMPILE_TIME_ASSERT(
  849. htt_encap_hdr_size_max_check_nwifi,
  850. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  851. A_COMPILE_TIME_ASSERT(
  852. htt_encap_hdr_size_max_check_enet,
  853. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  854. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  855. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  856. #define HTT_TX_HDR_SIZE_802_1Q 4
  857. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  858. #define HTT_COMMON_TX_FRM_HDR_LEN \
  859. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  860. HTT_TX_HDR_SIZE_802_1Q + \
  861. HTT_TX_HDR_SIZE_LLC_SNAP)
  862. #define HTT_HL_TX_FRM_HDR_LEN \
  863. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  864. #define HTT_LL_TX_FRM_HDR_LEN \
  865. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  866. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  867. /* dword 0 */
  868. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  871. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  872. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  875. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  876. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  879. #define HTT_TX_DESC_PKT_TYPE_S 13
  880. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  883. #define HTT_TX_DESC_VDEV_ID_S 16
  884. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  885. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  887. #define HTT_TX_DESC_EXT_TID_S 22
  888. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  891. #define HTT_TX_DESC_POSTPONED_S 27
  892. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  893. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  895. #define HTT_TX_DESC_EXTENSION_S 28
  896. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  897. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  898. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  899. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  900. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  901. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  902. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  903. #define HTT_TX_DESC_TX_COMP_S 31
  904. /* dword 1 */
  905. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  906. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  907. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  908. #define HTT_TX_DESC_FRM_LEN_S 0
  909. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  910. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  911. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  912. #define HTT_TX_DESC_FRM_ID_S 16
  913. /* dword 2 */
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  916. /* for systems using 64-bit format for bus addresses */
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  921. /* for systems using 32-bit format for bus addresses */
  922. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  923. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  924. /* dword 3 */
  925. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  926. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  928. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  930. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  931. #if HTT_PADDR64
  932. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  933. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  934. #else
  935. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  936. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  937. #endif
  938. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  939. #define HTT_TX_DESC_PEER_ID_S 0
  940. /*
  941. * TEMPORARY:
  942. * The original definitions for the PEER_ID fields contained typos
  943. * (with _DESC_PADDR appended to this PEER_ID field name).
  944. * Retain deprecated original names for PEER_ID fields until all code that
  945. * refers to them has been updated.
  946. */
  947. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  948. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  949. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  950. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  951. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  952. HTT_TX_DESC_PEER_ID_M
  953. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  954. HTT_TX_DESC_PEER_ID_S
  955. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  956. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  958. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  960. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  961. #if HTT_PADDR64
  962. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  963. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  964. #else
  965. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  966. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  967. #endif
  968. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  969. #define HTT_TX_DESC_CHAN_FREQ_S 16
  970. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  971. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  972. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  978. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  979. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  985. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  986. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  992. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  993. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  999. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1000. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1007. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1014. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1021. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1028. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1035. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1039. } while (0)
  1040. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1041. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1042. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1043. do { \
  1044. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1045. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1046. } while (0)
  1047. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1048. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1049. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1050. do { \
  1051. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1052. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1053. } while (0)
  1054. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1055. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1056. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1057. do { \
  1058. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1059. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1060. } while (0)
  1061. /* enums used in the HTT tx MSDU extension descriptor */
  1062. enum {
  1063. htt_tx_guard_interval_regular = 0,
  1064. htt_tx_guard_interval_short = 1,
  1065. };
  1066. enum {
  1067. htt_tx_preamble_type_ofdm = 0,
  1068. htt_tx_preamble_type_cck = 1,
  1069. htt_tx_preamble_type_ht = 2,
  1070. htt_tx_preamble_type_vht = 3,
  1071. };
  1072. enum {
  1073. htt_tx_bandwidth_5MHz = 0,
  1074. htt_tx_bandwidth_10MHz = 1,
  1075. htt_tx_bandwidth_20MHz = 2,
  1076. htt_tx_bandwidth_40MHz = 3,
  1077. htt_tx_bandwidth_80MHz = 4,
  1078. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1079. };
  1080. /**
  1081. * @brief HTT tx MSDU extension descriptor
  1082. * @details
  1083. * If the target supports HTT tx MSDU extension descriptors, the host has
  1084. * the option of appending the following struct following the regular
  1085. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1086. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1087. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1088. * tx specs for each frame.
  1089. */
  1090. PREPACK struct htt_tx_msdu_desc_ext_t {
  1091. /* DWORD 0: flags */
  1092. A_UINT32
  1093. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1094. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1095. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1096. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1097. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1098. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1099. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1100. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1101. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1102. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1103. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1104. /* DWORD 1: tx power, tx rate, tx BW */
  1105. A_UINT32
  1106. /* pwr -
  1107. * Specify what power the tx frame needs to be transmitted at.
  1108. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1109. * The value needs to be appropriately sign-extended when extracting
  1110. * the value from the message and storing it in a variable that is
  1111. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1112. * automatically handles this sign-extension.)
  1113. * If the transmission uses multiple tx chains, this power spec is
  1114. * the total transmit power, assuming incoherent combination of
  1115. * per-chain power to produce the total power.
  1116. */
  1117. pwr: 8,
  1118. /* mcs_mask -
  1119. * Specify the allowable values for MCS index (modulation and coding)
  1120. * to use for transmitting the frame.
  1121. *
  1122. * For HT / VHT preamble types, this mask directly corresponds to
  1123. * the HT or VHT MCS indices that are allowed. For each bit N set
  1124. * within the mask, MCS index N is allowed for transmitting the frame.
  1125. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1126. * rates versus OFDM rates, so the host has the option of specifying
  1127. * that the target must transmit the frame with CCK or OFDM rates
  1128. * (not HT or VHT), but leaving the decision to the target whether
  1129. * to use CCK or OFDM.
  1130. *
  1131. * For CCK and OFDM, the bits within this mask are interpreted as
  1132. * follows:
  1133. * bit 0 -> CCK 1 Mbps rate is allowed
  1134. * bit 1 -> CCK 2 Mbps rate is allowed
  1135. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1136. * bit 3 -> CCK 11 Mbps rate is allowed
  1137. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1138. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1139. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1140. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1141. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1142. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1143. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1144. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1145. *
  1146. * The MCS index specification needs to be compatible with the
  1147. * bandwidth mask specification. For example, a MCS index == 9
  1148. * specification is inconsistent with a preamble type == VHT,
  1149. * Nss == 1, and channel bandwidth == 20 MHz.
  1150. *
  1151. * Furthermore, the host has only a limited ability to specify to
  1152. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1153. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1154. */
  1155. mcs_mask: 12,
  1156. /* nss_mask -
  1157. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1158. * Each bit in this mask corresponds to a Nss value:
  1159. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1160. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1161. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1162. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1163. * The values in the Nss mask must be suitable for the recipient, e.g.
  1164. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1165. * recipient which only supports 2x2 MIMO.
  1166. */
  1167. nss_mask: 4,
  1168. /* guard_interval -
  1169. * Specify a htt_tx_guard_interval enum value to indicate whether
  1170. * the transmission should use a regular guard interval or a
  1171. * short guard interval.
  1172. */
  1173. guard_interval: 1,
  1174. /* preamble_type_mask -
  1175. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1176. * may choose from for transmitting this frame.
  1177. * The bits in this mask correspond to the values in the
  1178. * htt_tx_preamble_type enum. For example, to allow the target
  1179. * to transmit the frame as either CCK or OFDM, this field would
  1180. * be set to
  1181. * (1 << htt_tx_preamble_type_ofdm) |
  1182. * (1 << htt_tx_preamble_type_cck)
  1183. */
  1184. preamble_type_mask: 4,
  1185. reserved1_31_29: 3; /* unused, set to 0x0 */
  1186. /* DWORD 2: tx chain mask, tx retries */
  1187. A_UINT32
  1188. /* chain_mask - specify which chains to transmit from */
  1189. chain_mask: 4,
  1190. /* retry_limit -
  1191. * Specify the maximum number of transmissions, including the
  1192. * initial transmission, to attempt before giving up if no ack
  1193. * is received.
  1194. * If the tx rate is specified, then all retries shall use the
  1195. * same rate as the initial transmission.
  1196. * If no tx rate is specified, the target can choose whether to
  1197. * retain the original rate during the retransmissions, or to
  1198. * fall back to a more robust rate.
  1199. */
  1200. retry_limit: 4,
  1201. /* bandwidth_mask -
  1202. * Specify what channel widths may be used for the transmission.
  1203. * A value of zero indicates "don't care" - the target may choose
  1204. * the transmission bandwidth.
  1205. * The bits within this mask correspond to the htt_tx_bandwidth
  1206. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1207. * The bandwidth_mask must be consistent with the preamble_type_mask
  1208. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1209. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1210. */
  1211. bandwidth_mask: 6,
  1212. reserved2_31_14: 18; /* unused, set to 0x0 */
  1213. /* DWORD 3: tx expiry time (TSF) LSBs */
  1214. A_UINT32 expire_tsf_lo;
  1215. /* DWORD 4: tx expiry time (TSF) MSBs */
  1216. A_UINT32 expire_tsf_hi;
  1217. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1218. } POSTPACK;
  1219. /* DWORD 0 */
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1240. /* DWORD 1 */
  1241. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1242. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1243. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1244. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1245. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1246. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1247. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1248. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1249. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1250. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1251. /* DWORD 2 */
  1252. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1253. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1254. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1255. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1256. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1257. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1258. /* DWORD 0 */
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1260. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1265. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1266. } while (0)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1268. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1273. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1274. } while (0)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1276. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1277. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1278. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL( \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1282. ((_var) |= ((_val) \
  1283. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1284. } while (0)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1286. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1287. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL( \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1292. ((_var) |= ((_val) \
  1293. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1310. } while (0)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1312. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1313. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1318. } while (0)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1326. } while (0)
  1327. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1328. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1329. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1330. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1334. } while (0)
  1335. /* DWORD 1 */
  1336. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1337. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1338. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1339. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1340. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1341. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1342. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1343. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1344. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1345. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1352. } while (0)
  1353. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1354. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1355. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1356. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1360. } while (0)
  1361. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1362. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1363. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1364. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1368. } while (0)
  1369. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1370. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1371. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1372. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1373. do { \
  1374. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1375. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1376. } while (0)
  1377. /* DWORD 2 */
  1378. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1379. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1380. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1381. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1384. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1385. } while (0)
  1386. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1387. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1388. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1389. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1390. do { \
  1391. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1392. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1393. } while (0)
  1394. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1395. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1396. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1397. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1398. do { \
  1399. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1400. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1401. } while (0)
  1402. typedef enum {
  1403. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1404. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1405. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1406. } htt_11ax_ltf_subtype_t;
  1407. typedef enum {
  1408. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1409. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1410. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1411. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1412. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1413. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1414. } htt_tx_ext2_preamble_type_t;
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1427. /**
  1428. * @brief HTT tx MSDU extension descriptor v2
  1429. * @details
  1430. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1431. * is received as tcl_exit_base->host_meta_info in firmware.
  1432. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1433. * are already part of tcl_exit_base.
  1434. */
  1435. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1436. /* DWORD 0: flags */
  1437. A_UINT32
  1438. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1439. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1440. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1441. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1442. valid_retries : 1, /* if set, tx retries spec is valid */
  1443. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1444. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1445. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1446. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1447. valid_key_flags : 1, /* if set, key flags is valid */
  1448. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1449. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1450. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1451. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1452. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1453. 1 = ENCRYPT,
  1454. 2 ~ 3 - Reserved */
  1455. /* retry_limit -
  1456. * Specify the maximum number of transmissions, including the
  1457. * initial transmission, to attempt before giving up if no ack
  1458. * is received.
  1459. * If the tx rate is specified, then all retries shall use the
  1460. * same rate as the initial transmission.
  1461. * If no tx rate is specified, the target can choose whether to
  1462. * retain the original rate during the retransmissions, or to
  1463. * fall back to a more robust rate.
  1464. */
  1465. retry_limit : 4,
  1466. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1467. * Valid only for 11ax preamble types HE_SU
  1468. * and HE_EXT_SU
  1469. */
  1470. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1471. * Valid only for 11ax preamble types HE_SU
  1472. * and HE_EXT_SU
  1473. */
  1474. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1475. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1476. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1477. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1478. */
  1479. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1480. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1481. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1482. * Use cases:
  1483. * Any time firmware uses TQM-BYPASS for Data
  1484. * TID, firmware expect host to set this bit.
  1485. */
  1486. /* DWORD 1: tx power, tx rate */
  1487. A_UINT32
  1488. power : 8, /* unit of the power field is 0.5 dbm
  1489. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1490. * signed value ranging from -64dbm to 63.5 dbm
  1491. */
  1492. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1493. * Setting more than one MCS isn't currently
  1494. * supported by the target (but is supported
  1495. * in the interface in case in the future
  1496. * the target supports specifications of
  1497. * a limited set of MCS values.
  1498. */
  1499. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1500. * Setting more than one Nss isn't currently
  1501. * supported by the target (but is supported
  1502. * in the interface in case in the future
  1503. * the target supports specifications of
  1504. * a limited set of Nss values.
  1505. */
  1506. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1507. update_peer_cache : 1; /* When set these custom values will be
  1508. * used for all packets, until the next
  1509. * update via this ext header.
  1510. * This is to make sure not all packets
  1511. * need to include this header.
  1512. */
  1513. /* DWORD 2: tx chain mask, tx retries */
  1514. A_UINT32
  1515. /* chain_mask - specify which chains to transmit from */
  1516. chain_mask : 8,
  1517. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1518. * TODO: Update Enum values for key_flags
  1519. */
  1520. /*
  1521. * Channel frequency: This identifies the desired channel
  1522. * frequency (in MHz) for tx frames. This is used by FW to help
  1523. * determine when it is safe to transmit or drop frames for
  1524. * off-channel operation.
  1525. * The default value of zero indicates to FW that the corresponding
  1526. * VDEV's home channel (if there is one) is the desired channel
  1527. * frequency.
  1528. */
  1529. chanfreq : 16;
  1530. /* DWORD 3: tx expiry time (TSF) LSBs */
  1531. A_UINT32 expire_tsf_lo;
  1532. /* DWORD 4: tx expiry time (TSF) MSBs */
  1533. A_UINT32 expire_tsf_hi;
  1534. /* DWORD 5: flags to control routing / processing of the MSDU */
  1535. A_UINT32
  1536. /* learning_frame
  1537. * When this flag is set, this frame will be dropped by FW
  1538. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1539. */
  1540. learning_frame : 1,
  1541. /* send_as_standalone
  1542. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1543. * i.e. with no A-MSDU or A-MPDU aggregation.
  1544. * The scope is extended to other use-cases.
  1545. */
  1546. send_as_standalone : 1,
  1547. /* is_host_opaque_valid
  1548. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1549. * with valid information.
  1550. */
  1551. is_host_opaque_valid : 1,
  1552. rsvd0 : 29;
  1553. /* DWORD 6 : Host opaque cookie for special frames */
  1554. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1555. rsvd1 : 16;
  1556. /*
  1557. * This structure can be expanded further up to 40 bytes
  1558. * by adding further DWORDs as needed.
  1559. */
  1560. } POSTPACK;
  1561. /* DWORD 0 */
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1588. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1589. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1590. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1591. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1592. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1593. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1594. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1595. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1596. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1597. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1598. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1599. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1600. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1602. /* DWORD 1 */
  1603. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1604. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1605. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1606. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1607. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1608. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1609. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1610. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1611. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1612. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1613. /* DWORD 2 */
  1614. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1615. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1616. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1617. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1618. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1619. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1620. /* DWORD 5 */
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1627. /* DWORD 6 */
  1628. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1629. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1630. /* DWORD 0 */
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1641. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1645. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1646. } while (0)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1649. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1653. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1657. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL( \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1662. ((_var) |= ((_val) \
  1663. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1680. } while (0)
  1681. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1683. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1684. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL( \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1688. ((_var) |= ((_val) \
  1689. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1701. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1709. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1710. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1714. } while (0)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1716. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1717. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1718. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1719. do { \
  1720. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1721. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1722. } while (0)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1724. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1725. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1726. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1727. do { \
  1728. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1729. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1730. } while (0)
  1731. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1732. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1733. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1734. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1735. do { \
  1736. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1737. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1738. } while (0)
  1739. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1743. do { \
  1744. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1745. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1746. } while (0)
  1747. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1748. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1749. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1750. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1753. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1754. } while (0)
  1755. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1756. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1757. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1758. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1759. do { \
  1760. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1761. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1762. } while (0)
  1763. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1767. do { \
  1768. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1769. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1770. } while (0)
  1771. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1772. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1773. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1774. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1777. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1778. } while (0)
  1779. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1786. } while (0)
  1787. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1788. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1789. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1790. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1791. do { \
  1792. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1793. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1794. } while (0)
  1795. /* DWORD 1 */
  1796. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1797. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1798. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1799. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1800. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1801. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1802. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1803. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1804. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1805. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1809. do { \
  1810. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1811. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1812. } while (0)
  1813. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1814. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1815. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1816. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1817. do { \
  1818. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1819. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1820. } while (0)
  1821. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1823. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1824. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1828. } while (0)
  1829. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1830. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1831. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1832. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1833. do { \
  1834. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1835. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1836. } while (0)
  1837. /* DWORD 2 */
  1838. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1845. } while (0)
  1846. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1847. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1848. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1849. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1850. do { \
  1851. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1852. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1853. } while (0)
  1854. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1855. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1856. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1857. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1858. do { \
  1859. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1860. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1861. } while (0)
  1862. /* DWORD 5 */
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1864. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1865. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1867. do { \
  1868. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1869. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1870. } while (0)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1872. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1875. do { \
  1876. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1877. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1878. } while (0)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1880. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1881. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1883. do { \
  1884. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1885. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1886. } while (0)
  1887. /* DWORD 6 */
  1888. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1889. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1890. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1891. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1895. } while (0)
  1896. typedef enum {
  1897. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1898. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1899. } htt_tcl_metadata_type;
  1900. /**
  1901. * @brief HTT TCL command number format
  1902. * @details
  1903. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1904. * available to firmware as tcl_exit_base->tcl_status_number.
  1905. * For regular / multicast packets host will send vdev and mac id and for
  1906. * NAWDS packets, host will send peer id.
  1907. * A_UINT32 is used to avoid endianness conversion problems.
  1908. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1909. */
  1910. typedef struct {
  1911. A_UINT32
  1912. type: 1, /* vdev_id based or peer_id based */
  1913. rsvd: 31;
  1914. } htt_tx_tcl_vdev_or_peer_t;
  1915. typedef struct {
  1916. A_UINT32
  1917. type: 1, /* vdev_id based or peer_id based */
  1918. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1919. vdev_id: 8,
  1920. pdev_id: 2,
  1921. host_inspected:1,
  1922. rsvd: 19;
  1923. } htt_tx_tcl_vdev_metadata;
  1924. typedef struct {
  1925. A_UINT32
  1926. type: 1, /* vdev_id based or peer_id based */
  1927. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1928. peer_id: 14,
  1929. rsvd: 16;
  1930. } htt_tx_tcl_peer_metadata;
  1931. PREPACK struct htt_tx_tcl_metadata {
  1932. union {
  1933. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1934. htt_tx_tcl_vdev_metadata vdev_meta;
  1935. htt_tx_tcl_peer_metadata peer_meta;
  1936. };
  1937. } POSTPACK;
  1938. /* DWORD 0 */
  1939. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1940. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1941. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1942. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1943. /* VDEV metadata */
  1944. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1945. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1946. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1947. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1948. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1949. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1950. /* PEER metadata */
  1951. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1952. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1953. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1954. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1955. HTT_TX_TCL_METADATA_TYPE_S)
  1956. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1960. } while (0)
  1961. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1962. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1963. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1964. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1968. } while (0)
  1969. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1970. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1971. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1972. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1976. } while (0)
  1977. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1978. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1979. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1980. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1984. } while (0)
  1985. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1986. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1987. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1988. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1992. } while (0)
  1993. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1994. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1995. HTT_TX_TCL_METADATA_PEER_ID_S)
  1996. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2000. } while (0)
  2001. typedef enum {
  2002. HTT_TX_FW2WBM_TX_STATUS_OK,
  2003. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2004. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2005. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2006. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2007. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2008. HTT_TX_FW2WBM_TX_STATUS_MAX
  2009. } htt_tx_fw2wbm_tx_status_t;
  2010. typedef enum {
  2011. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2012. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2013. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2014. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2015. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2016. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2017. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2018. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2019. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2020. } htt_tx_fw2wbm_reinject_reason_t;
  2021. /**
  2022. * @brief HTT TX WBM Completion from firmware to host
  2023. * @details
  2024. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2025. * DWORD 3 and 4 for software based completions (Exception frames and
  2026. * TQM bypass frames)
  2027. * For software based completions, wbm_release_ring->release_source_module will
  2028. * be set to release_source_fw
  2029. */
  2030. PREPACK struct htt_tx_wbm_completion {
  2031. A_UINT32
  2032. sch_cmd_id: 24,
  2033. exception_frame: 1, /* If set, this packet was queued via exception path */
  2034. rsvd0_31_25: 7;
  2035. A_UINT32
  2036. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2037. * reception of an ACK or BA, this field indicates
  2038. * the RSSI of the received ACK or BA frame.
  2039. * When the frame is removed as result of a direct
  2040. * remove command from the SW, this field is set
  2041. * to 0x0 (which is never a valid value when real
  2042. * RSSI is available).
  2043. * Units: dB w.r.t noise floor
  2044. */
  2045. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2046. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2047. rsvd1_31_16: 16;
  2048. } POSTPACK;
  2049. /* DWORD 0 */
  2050. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2051. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2052. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2053. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2054. /* DWORD 1 */
  2055. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2056. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2057. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2058. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2059. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2060. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2061. /* DWORD 0 */
  2062. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2063. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2064. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2065. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2069. } while (0)
  2070. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2071. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2072. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2073. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2077. } while (0)
  2078. /* DWORD 1 */
  2079. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2080. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2081. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2082. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2086. } while (0)
  2087. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2088. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2089. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2090. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2094. } while (0)
  2095. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2096. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2097. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2098. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2099. do { \
  2100. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2101. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2102. } while (0)
  2103. /**
  2104. * @brief HTT TX WBM Completion from firmware to host
  2105. * @details
  2106. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2107. * (WBM) offload HW.
  2108. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2109. * For software based completions, release_source_module will
  2110. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2111. * struct wbm_release_ring and then switch to this after looking at
  2112. * release_source_module.
  2113. */
  2114. PREPACK struct htt_tx_wbm_completion_v2 {
  2115. A_UINT32
  2116. used_by_hw0; /* Refer to struct wbm_release_ring */
  2117. A_UINT32
  2118. used_by_hw1; /* Refer to struct wbm_release_ring */
  2119. A_UINT32
  2120. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2121. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2122. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2123. exception_frame: 1,
  2124. rsvd0: 12, /* For future use */
  2125. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2126. rsvd1: 1; /* For future use */
  2127. A_UINT32
  2128. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2129. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2130. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2131. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2132. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2133. */
  2134. A_UINT32
  2135. data1: 32;
  2136. A_UINT32
  2137. data2: 32;
  2138. A_UINT32
  2139. used_by_hw3; /* Refer to struct wbm_release_ring */
  2140. } POSTPACK;
  2141. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2142. /* DWORD 3 */
  2143. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2145. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2146. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2147. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2148. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2149. /* DWORD 3 */
  2150. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2151. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2152. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2153. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2157. } while (0)
  2158. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2159. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2160. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2161. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2165. } while (0)
  2166. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2167. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2168. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2169. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2173. } while (0)
  2174. /**
  2175. * @brief HTT TX WBM transmit status from firmware to host
  2176. * @details
  2177. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2178. * (WBM) offload HW.
  2179. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2180. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2181. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2182. */
  2183. PREPACK struct htt_tx_wbm_transmit_status {
  2184. A_UINT32
  2185. sch_cmd_id: 24,
  2186. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2187. * reception of an ACK or BA, this field indicates
  2188. * the RSSI of the received ACK or BA frame.
  2189. * When the frame is removed as result of a direct
  2190. * remove command from the SW, this field is set
  2191. * to 0x0 (which is never a valid value when real
  2192. * RSSI is available).
  2193. * Units: dB w.r.t noise floor
  2194. */
  2195. A_UINT32
  2196. sw_peer_id: 16,
  2197. tid_num: 5,
  2198. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2199. * and tid_num fields contain valid data.
  2200. * If this "valid" flag is not set, the
  2201. * sw_peer_id and tid_num fields must be ignored.
  2202. */
  2203. mcast: 1,
  2204. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2205. * contains valid data.
  2206. */
  2207. reserved0: 8;
  2208. A_UINT32
  2209. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2210. * packets in the wbm completion path
  2211. */
  2212. } POSTPACK;
  2213. /* DWORD 4 */
  2214. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2215. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2216. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2217. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2218. /* DWORD 5 */
  2219. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2220. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2221. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2222. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2223. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2224. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2225. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2226. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2227. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2228. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2229. /* DWORD 4 */
  2230. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2231. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2232. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2233. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2234. do { \
  2235. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2236. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2237. } while (0)
  2238. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2239. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2240. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2241. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2242. do { \
  2243. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2244. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2245. } while (0)
  2246. /* DWORD 5 */
  2247. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2248. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2249. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2250. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2254. } while (0)
  2255. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2256. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2257. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2258. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2262. } while (0)
  2263. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2264. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2265. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2266. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2270. } while (0)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2278. } while (0)
  2279. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2280. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2281. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2282. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2286. } while (0)
  2287. /**
  2288. * @brief HTT TX WBM reinject status from firmware to host
  2289. * @details
  2290. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2291. * (WBM) offload HW.
  2292. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2293. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2294. */
  2295. PREPACK struct htt_tx_wbm_reinject_status {
  2296. A_UINT32
  2297. reserved0: 32;
  2298. A_UINT32
  2299. reserved1: 32;
  2300. A_UINT32
  2301. reserved2: 32;
  2302. } POSTPACK;
  2303. /**
  2304. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2305. * @details
  2306. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2307. * (WBM) offload HW.
  2308. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2309. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2310. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2311. * STA side.
  2312. */
  2313. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2314. A_UINT32
  2315. mec_sa_addr_31_0;
  2316. A_UINT32
  2317. mec_sa_addr_47_32: 16,
  2318. sa_ast_index: 16;
  2319. A_UINT32
  2320. vdev_id: 8,
  2321. reserved0: 24;
  2322. } POSTPACK;
  2323. /* DWORD 4 - mec_sa_addr_31_0 */
  2324. /* DWORD 5 */
  2325. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2326. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2327. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2328. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2329. /* DWORD 6 */
  2330. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2331. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2332. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2333. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2334. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2335. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2336. do { \
  2337. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2338. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2339. } while (0)
  2340. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2341. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2342. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2343. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2347. } while (0)
  2348. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2349. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2350. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2351. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2355. } while (0)
  2356. typedef enum {
  2357. TX_FLOW_PRIORITY_BE,
  2358. TX_FLOW_PRIORITY_HIGH,
  2359. TX_FLOW_PRIORITY_LOW,
  2360. } htt_tx_flow_priority_t;
  2361. typedef enum {
  2362. TX_FLOW_LATENCY_SENSITIVE,
  2363. TX_FLOW_LATENCY_INSENSITIVE,
  2364. } htt_tx_flow_latency_t;
  2365. typedef enum {
  2366. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2367. TX_FLOW_INTERACTIVE_TRAFFIC,
  2368. TX_FLOW_PERIODIC_TRAFFIC,
  2369. TX_FLOW_BURSTY_TRAFFIC,
  2370. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2371. } htt_tx_flow_traffic_pattern_t;
  2372. /**
  2373. * @brief HTT TX Flow search metadata format
  2374. * @details
  2375. * Host will set this metadata in flow table's flow search entry along with
  2376. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2377. * firmware and TQM ring if the flow search entry wins.
  2378. * This metadata is available to firmware in that first MSDU's
  2379. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2380. * to one of the available flows for specific tid and returns the tqm flow
  2381. * pointer as part of htt_tx_map_flow_info message.
  2382. */
  2383. PREPACK struct htt_tx_flow_metadata {
  2384. A_UINT32
  2385. rsvd0_1_0: 2,
  2386. tid: 4,
  2387. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2388. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2389. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2390. * Else choose final tid based on latency, priority.
  2391. */
  2392. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2393. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2394. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2395. } POSTPACK;
  2396. /* DWORD 0 */
  2397. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2398. #define HTT_TX_FLOW_METADATA_TID_S 2
  2399. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2400. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2401. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2402. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2403. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2404. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2405. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2406. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2407. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2408. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2409. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2410. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2411. /* DWORD 0 */
  2412. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2413. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2414. HTT_TX_FLOW_METADATA_TID_S)
  2415. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2419. } while (0)
  2420. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2421. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2422. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2423. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2427. } while (0)
  2428. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2429. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2430. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2431. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2435. } while (0)
  2436. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2437. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2438. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2439. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2440. do { \
  2441. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2442. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2443. } while (0)
  2444. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2445. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2446. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2447. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2448. do { \
  2449. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2450. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2451. } while (0)
  2452. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2453. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2454. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2455. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2459. } while (0)
  2460. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2461. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2462. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2463. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2466. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2467. } while (0)
  2468. /**
  2469. * @brief host -> target ADD WDS Entry
  2470. *
  2471. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2472. *
  2473. * @brief host -> target DELETE WDS Entry
  2474. *
  2475. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2476. *
  2477. * @details
  2478. * HTT wds entry from source port learning
  2479. * Host will learn wds entries from rx and send this message to firmware
  2480. * to enable firmware to configure/delete AST entries for wds clients.
  2481. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2482. * and when SA's entry is deleted, firmware removes this AST entry
  2483. *
  2484. * The message would appear as follows:
  2485. *
  2486. * |31 30|29 |17 16|15 8|7 0|
  2487. * |----------------+----------------+----------------+----------------|
  2488. * | rsvd0 |PDVID| vdev_id | msg_type |
  2489. * |-------------------------------------------------------------------|
  2490. * | sa_addr_31_0 |
  2491. * |-------------------------------------------------------------------|
  2492. * | | ta_peer_id | sa_addr_47_32 |
  2493. * |-------------------------------------------------------------------|
  2494. * Where PDVID = pdev_id
  2495. *
  2496. * The message is interpreted as follows:
  2497. *
  2498. * dword0 - b'0:7 - msg_type: This will be set to
  2499. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2500. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2501. *
  2502. * dword0 - b'8:15 - vdev_id
  2503. *
  2504. * dword0 - b'16:17 - pdev_id
  2505. *
  2506. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2507. *
  2508. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2509. *
  2510. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2511. *
  2512. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2513. */
  2514. PREPACK struct htt_wds_entry {
  2515. A_UINT32
  2516. msg_type: 8,
  2517. vdev_id: 8,
  2518. pdev_id: 2,
  2519. rsvd0: 14;
  2520. A_UINT32 sa_addr_31_0;
  2521. A_UINT32
  2522. sa_addr_47_32: 16,
  2523. ta_peer_id: 14,
  2524. rsvd2: 2;
  2525. } POSTPACK;
  2526. /* DWORD 0 */
  2527. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2528. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2529. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2530. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2531. /* DWORD 2 */
  2532. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2533. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2534. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2535. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2536. /* DWORD 0 */
  2537. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2538. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2539. HTT_WDS_ENTRY_VDEV_ID_S)
  2540. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2541. do { \
  2542. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2543. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2544. } while (0)
  2545. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2546. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2547. HTT_WDS_ENTRY_PDEV_ID_S)
  2548. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2549. do { \
  2550. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2551. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2552. } while (0)
  2553. /* DWORD 2 */
  2554. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2555. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2556. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2557. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2558. do { \
  2559. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2560. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2561. } while (0)
  2562. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2563. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2564. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2565. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2566. do { \
  2567. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2568. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2569. } while (0)
  2570. /**
  2571. * @brief MAC DMA rx ring setup specification
  2572. *
  2573. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2574. *
  2575. * @details
  2576. * To allow for dynamic rx ring reconfiguration and to avoid race
  2577. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2578. * it uses. Instead, it sends this message to the target, indicating how
  2579. * the rx ring used by the host should be set up and maintained.
  2580. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2581. * specifications.
  2582. *
  2583. * |31 16|15 8|7 0|
  2584. * |---------------------------------------------------------------|
  2585. * header: | reserved | num rings | msg type |
  2586. * |---------------------------------------------------------------|
  2587. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2588. #if HTT_PADDR64
  2589. * | FW_IDX shadow register physical address (bits 63:32) |
  2590. #endif
  2591. * |---------------------------------------------------------------|
  2592. * | rx ring base physical address (bits 31:0) |
  2593. #if HTT_PADDR64
  2594. * | rx ring base physical address (bits 63:32) |
  2595. #endif
  2596. * |---------------------------------------------------------------|
  2597. * | rx ring buffer size | rx ring length |
  2598. * |---------------------------------------------------------------|
  2599. * | FW_IDX initial value | enabled flags |
  2600. * |---------------------------------------------------------------|
  2601. * | MSDU payload offset | 802.11 header offset |
  2602. * |---------------------------------------------------------------|
  2603. * | PPDU end offset | PPDU start offset |
  2604. * |---------------------------------------------------------------|
  2605. * | MPDU end offset | MPDU start offset |
  2606. * |---------------------------------------------------------------|
  2607. * | MSDU end offset | MSDU start offset |
  2608. * |---------------------------------------------------------------|
  2609. * | frag info offset | rx attention offset |
  2610. * |---------------------------------------------------------------|
  2611. * payload 2, if present, has the same format as payload 1
  2612. * Header fields:
  2613. * - MSG_TYPE
  2614. * Bits 7:0
  2615. * Purpose: identifies this as an rx ring configuration message
  2616. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2617. * - NUM_RINGS
  2618. * Bits 15:8
  2619. * Purpose: indicates whether the host is setting up one rx ring or two
  2620. * Value: 1 or 2
  2621. * Payload:
  2622. * for systems using 64-bit format for bus addresses:
  2623. * - IDX_SHADOW_REG_PADDR_LO
  2624. * Bits 31:0
  2625. * Value: lower 4 bytes of physical address of the host's
  2626. * FW_IDX shadow register
  2627. * - IDX_SHADOW_REG_PADDR_HI
  2628. * Bits 31:0
  2629. * Value: upper 4 bytes of physical address of the host's
  2630. * FW_IDX shadow register
  2631. * - RING_BASE_PADDR_LO
  2632. * Bits 31:0
  2633. * Value: lower 4 bytes of physical address of the host's rx ring
  2634. * - RING_BASE_PADDR_HI
  2635. * Bits 31:0
  2636. * Value: uppper 4 bytes of physical address of the host's rx ring
  2637. * for systems using 32-bit format for bus addresses:
  2638. * - IDX_SHADOW_REG_PADDR
  2639. * Bits 31:0
  2640. * Value: physical address of the host's FW_IDX shadow register
  2641. * - RING_BASE_PADDR
  2642. * Bits 31:0
  2643. * Value: physical address of the host's rx ring
  2644. * - RING_LEN
  2645. * Bits 15:0
  2646. * Value: number of elements in the rx ring
  2647. * - RING_BUF_SZ
  2648. * Bits 31:16
  2649. * Value: size of the buffers referenced by the rx ring, in byte units
  2650. * - ENABLED_FLAGS
  2651. * Bits 15:0
  2652. * Value: 1-bit flags to show whether different rx fields are enabled
  2653. * bit 0: 802.11 header enabled (1) or disabled (0)
  2654. * bit 1: MSDU payload enabled (1) or disabled (0)
  2655. * bit 2: PPDU start enabled (1) or disabled (0)
  2656. * bit 3: PPDU end enabled (1) or disabled (0)
  2657. * bit 4: MPDU start enabled (1) or disabled (0)
  2658. * bit 5: MPDU end enabled (1) or disabled (0)
  2659. * bit 6: MSDU start enabled (1) or disabled (0)
  2660. * bit 7: MSDU end enabled (1) or disabled (0)
  2661. * bit 8: rx attention enabled (1) or disabled (0)
  2662. * bit 9: frag info enabled (1) or disabled (0)
  2663. * bit 10: unicast rx enabled (1) or disabled (0)
  2664. * bit 11: multicast rx enabled (1) or disabled (0)
  2665. * bit 12: ctrl rx enabled (1) or disabled (0)
  2666. * bit 13: mgmt rx enabled (1) or disabled (0)
  2667. * bit 14: null rx enabled (1) or disabled (0)
  2668. * bit 15: phy data rx enabled (1) or disabled (0)
  2669. * - IDX_INIT_VAL
  2670. * Bits 31:16
  2671. * Purpose: Specify the initial value for the FW_IDX.
  2672. * Value: the number of buffers initially present in the host's rx ring
  2673. * - OFFSET_802_11_HDR
  2674. * Bits 15:0
  2675. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2676. * - OFFSET_MSDU_PAYLOAD
  2677. * Bits 31:16
  2678. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2679. * - OFFSET_PPDU_START
  2680. * Bits 15:0
  2681. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2682. * - OFFSET_PPDU_END
  2683. * Bits 31:16
  2684. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2685. * - OFFSET_MPDU_START
  2686. * Bits 15:0
  2687. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2688. * - OFFSET_MPDU_END
  2689. * Bits 31:16
  2690. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2691. * - OFFSET_MSDU_START
  2692. * Bits 15:0
  2693. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2694. * - OFFSET_MSDU_END
  2695. * Bits 31:16
  2696. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2697. * - OFFSET_RX_ATTN
  2698. * Bits 15:0
  2699. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2700. * - OFFSET_FRAG_INFO
  2701. * Bits 31:16
  2702. * Value: offset in QUAD-bytes of frag info table
  2703. */
  2704. /* header fields */
  2705. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2706. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2707. /* payload fields */
  2708. /* for systems using a 64-bit format for bus addresses */
  2709. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2710. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2711. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2712. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2713. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2714. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2715. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2716. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2717. /* for systems using a 32-bit format for bus addresses */
  2718. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2719. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2720. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2721. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2722. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2723. #define HTT_RX_RING_CFG_LEN_S 0
  2724. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2725. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2726. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2727. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2728. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2729. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2730. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2731. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2732. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2733. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2734. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2735. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2736. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2737. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2738. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2742. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2743. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2744. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2745. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2746. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2747. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2748. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2749. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2750. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2751. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2752. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2753. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2754. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2755. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2756. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2757. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2758. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2759. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2760. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2761. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2762. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2763. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2764. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2765. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2766. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2767. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2768. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2769. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2770. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2771. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2772. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2776. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2777. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2778. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2779. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2780. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2781. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2782. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2783. #if HTT_PADDR64
  2784. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2785. #else
  2786. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2787. #endif
  2788. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2789. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2790. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2791. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2792. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2795. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2796. } while (0)
  2797. /* degenerate case for 32-bit fields */
  2798. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2799. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2800. ((_var) = (_val))
  2801. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2803. ((_var) = (_val))
  2804. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2805. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2806. ((_var) = (_val))
  2807. /* degenerate case for 32-bit fields */
  2808. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2809. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2810. ((_var) = (_val))
  2811. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2813. ((_var) = (_val))
  2814. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2815. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2816. ((_var) = (_val))
  2817. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2818. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2819. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2822. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2823. } while (0)
  2824. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2825. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2826. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2827. do { \
  2828. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2829. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2830. } while (0)
  2831. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2832. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2833. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2834. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2837. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2838. } while (0)
  2839. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2840. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2841. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2842. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2845. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2846. } while (0)
  2847. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2848. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2849. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2850. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2853. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2854. } while (0)
  2855. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2856. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2857. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2858. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2859. do { \
  2860. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2861. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2862. } while (0)
  2863. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2864. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2865. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2866. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2869. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2870. } while (0)
  2871. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2872. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2873. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2874. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2877. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2878. } while (0)
  2879. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2880. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2881. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2882. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2883. do { \
  2884. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2885. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2886. } while (0)
  2887. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2888. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2889. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2890. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2891. do { \
  2892. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2893. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2894. } while (0)
  2895. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2896. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2897. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2898. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2899. do { \
  2900. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2901. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2902. } while (0)
  2903. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2904. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2905. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2906. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2907. do { \
  2908. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2909. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2910. } while (0)
  2911. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2912. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2913. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2914. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2915. do { \
  2916. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2917. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2918. } while (0)
  2919. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2920. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2921. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2922. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2923. do { \
  2924. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2925. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2926. } while (0)
  2927. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2928. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2929. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2930. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2933. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2934. } while (0)
  2935. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2936. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2937. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2938. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2939. do { \
  2940. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2941. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2942. } while (0)
  2943. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2944. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2945. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2946. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2949. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2950. } while (0)
  2951. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2952. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2953. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2954. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2957. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2958. } while (0)
  2959. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2960. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2961. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2962. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2965. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2966. } while (0)
  2967. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2968. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2969. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2970. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2973. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2974. } while (0)
  2975. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2976. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2977. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2978. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2981. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2982. } while (0)
  2983. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2984. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2985. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2986. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2987. do { \
  2988. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2989. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2990. } while (0)
  2991. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2992. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2993. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2994. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2995. do { \
  2996. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2997. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2998. } while (0)
  2999. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3000. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3001. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3002. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3003. do { \
  3004. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3005. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3006. } while (0)
  3007. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3008. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3009. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3010. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3011. do { \
  3012. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3013. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3014. } while (0)
  3015. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3016. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3017. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3018. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3019. do { \
  3020. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3021. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3022. } while (0)
  3023. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3024. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3025. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3026. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3029. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3030. } while (0)
  3031. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3032. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3033. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3034. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3037. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3038. } while (0)
  3039. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3040. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3041. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3042. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3045. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3046. } while (0)
  3047. /**
  3048. * @brief host -> target FW statistics retrieve
  3049. *
  3050. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3051. *
  3052. * @details
  3053. * The following field definitions describe the format of the HTT host
  3054. * to target FW stats retrieve message. The message specifies the type of
  3055. * stats host wants to retrieve.
  3056. *
  3057. * |31 24|23 16|15 8|7 0|
  3058. * |-----------------------------------------------------------|
  3059. * | stats types request bitmask | msg type |
  3060. * |-----------------------------------------------------------|
  3061. * | stats types reset bitmask | reserved |
  3062. * |-----------------------------------------------------------|
  3063. * | stats type | config value |
  3064. * |-----------------------------------------------------------|
  3065. * | cookie LSBs |
  3066. * |-----------------------------------------------------------|
  3067. * | cookie MSBs |
  3068. * |-----------------------------------------------------------|
  3069. * Header fields:
  3070. * - MSG_TYPE
  3071. * Bits 7:0
  3072. * Purpose: identifies this is a stats upload request message
  3073. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3074. * - UPLOAD_TYPES
  3075. * Bits 31:8
  3076. * Purpose: identifies which types of FW statistics to upload
  3077. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3078. * - RESET_TYPES
  3079. * Bits 31:8
  3080. * Purpose: identifies which types of FW statistics to reset
  3081. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3082. * - CFG_VAL
  3083. * Bits 23:0
  3084. * Purpose: give an opaque configuration value to the specified stats type
  3085. * Value: stats-type specific configuration value
  3086. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3087. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3088. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3089. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3090. * - CFG_STAT_TYPE
  3091. * Bits 31:24
  3092. * Purpose: specify which stats type (if any) the config value applies to
  3093. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3094. * a valid configuration specification
  3095. * - COOKIE_LSBS
  3096. * Bits 31:0
  3097. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3098. * message with its preceding host->target stats request message.
  3099. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3100. * - COOKIE_MSBS
  3101. * Bits 31:0
  3102. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3103. * message with its preceding host->target stats request message.
  3104. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3105. */
  3106. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3107. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3108. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3109. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3110. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3111. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3112. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3114. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3115. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3116. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3117. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3118. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3119. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3120. do { \
  3121. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3122. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3123. } while (0)
  3124. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3125. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3126. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3127. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3128. do { \
  3129. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3130. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3131. } while (0)
  3132. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3133. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3134. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3135. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3136. do { \
  3137. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3138. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3139. } while (0)
  3140. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3141. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3142. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3143. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3144. do { \
  3145. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3146. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3147. } while (0)
  3148. /**
  3149. * @brief host -> target HTT out-of-band sync request
  3150. *
  3151. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3152. *
  3153. * @details
  3154. * The HTT SYNC tells the target to suspend processing of subsequent
  3155. * HTT host-to-target messages until some other target agent locally
  3156. * informs the target HTT FW that the current sync counter is equal to
  3157. * or greater than (in a modulo sense) the sync counter specified in
  3158. * the SYNC message.
  3159. * This allows other host-target components to synchronize their operation
  3160. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3161. * security key has been downloaded to and activated by the target.
  3162. * In the absence of any explicit synchronization counter value
  3163. * specification, the target HTT FW will use zero as the default current
  3164. * sync value.
  3165. *
  3166. * |31 24|23 16|15 8|7 0|
  3167. * |-----------------------------------------------------------|
  3168. * | reserved | sync count | msg type |
  3169. * |-----------------------------------------------------------|
  3170. * Header fields:
  3171. * - MSG_TYPE
  3172. * Bits 7:0
  3173. * Purpose: identifies this as a sync message
  3174. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3175. * - SYNC_COUNT
  3176. * Bits 15:8
  3177. * Purpose: specifies what sync value the HTT FW will wait for from
  3178. * an out-of-band specification to resume its operation
  3179. * Value: in-band sync counter value to compare against the out-of-band
  3180. * counter spec.
  3181. * The HTT target FW will suspend its host->target message processing
  3182. * as long as
  3183. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3184. */
  3185. #define HTT_H2T_SYNC_MSG_SZ 4
  3186. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3187. #define HTT_H2T_SYNC_COUNT_S 8
  3188. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3189. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3190. HTT_H2T_SYNC_COUNT_S)
  3191. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3192. do { \
  3193. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3194. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3195. } while (0)
  3196. /**
  3197. * @brief host -> target HTT aggregation configuration
  3198. *
  3199. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3200. */
  3201. #define HTT_AGGR_CFG_MSG_SZ 4
  3202. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3203. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3204. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3205. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3206. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3207. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3208. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3210. do { \
  3211. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3212. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3213. } while (0)
  3214. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3215. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3216. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3217. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3218. do { \
  3219. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3220. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3221. } while (0)
  3222. /**
  3223. * @brief host -> target HTT configure max amsdu info per vdev
  3224. *
  3225. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3226. *
  3227. * @details
  3228. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3229. *
  3230. * |31 21|20 16|15 8|7 0|
  3231. * |-----------------------------------------------------------|
  3232. * | reserved | vdev id | max amsdu | msg type |
  3233. * |-----------------------------------------------------------|
  3234. * Header fields:
  3235. * - MSG_TYPE
  3236. * Bits 7:0
  3237. * Purpose: identifies this as a aggr cfg ex message
  3238. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3239. * - MAX_NUM_AMSDU_SUBFRM
  3240. * Bits 15:8
  3241. * Purpose: max MSDUs per A-MSDU
  3242. * - VDEV_ID
  3243. * Bits 20:16
  3244. * Purpose: ID of the vdev to which this limit is applied
  3245. */
  3246. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3247. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3248. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3249. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3250. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3251. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3252. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3253. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3254. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3255. do { \
  3256. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3257. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3258. } while (0)
  3259. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3260. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3261. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3262. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3263. do { \
  3264. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3265. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3266. } while (0)
  3267. /**
  3268. * @brief HTT WDI_IPA Config Message
  3269. *
  3270. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3271. *
  3272. * @details
  3273. * The HTT WDI_IPA config message is created/sent by host at driver
  3274. * init time. It contains information about data structures used on
  3275. * WDI_IPA TX and RX path.
  3276. * TX CE ring is used for pushing packet metadata from IPA uC
  3277. * to WLAN FW
  3278. * TX Completion ring is used for generating TX completions from
  3279. * WLAN FW to IPA uC
  3280. * RX Indication ring is used for indicating RX packets from FW
  3281. * to IPA uC
  3282. * RX Ring2 is used as either completion ring or as second
  3283. * indication ring. when Ring2 is used as completion ring, IPA uC
  3284. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3285. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3286. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3287. * indicated in RX Indication ring. Please see WDI_IPA specification
  3288. * for more details.
  3289. * |31 24|23 16|15 8|7 0|
  3290. * |----------------+----------------+----------------+----------------|
  3291. * | tx pkt pool size | Rsvd | msg_type |
  3292. * |-------------------------------------------------------------------|
  3293. * | tx comp ring base (bits 31:0) |
  3294. #if HTT_PADDR64
  3295. * | tx comp ring base (bits 63:32) |
  3296. #endif
  3297. * |-------------------------------------------------------------------|
  3298. * | tx comp ring size |
  3299. * |-------------------------------------------------------------------|
  3300. * | tx comp WR_IDX physical address (bits 31:0) |
  3301. #if HTT_PADDR64
  3302. * | tx comp WR_IDX physical address (bits 63:32) |
  3303. #endif
  3304. * |-------------------------------------------------------------------|
  3305. * | tx CE WR_IDX physical address (bits 31:0) |
  3306. #if HTT_PADDR64
  3307. * | tx CE WR_IDX physical address (bits 63:32) |
  3308. #endif
  3309. * |-------------------------------------------------------------------|
  3310. * | rx indication ring base (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | rx indication ring base (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. * | rx indication ring size |
  3316. * |-------------------------------------------------------------------|
  3317. * | rx ind RD_IDX physical address (bits 31:0) |
  3318. #if HTT_PADDR64
  3319. * | rx ind RD_IDX physical address (bits 63:32) |
  3320. #endif
  3321. * |-------------------------------------------------------------------|
  3322. * | rx ind WR_IDX physical address (bits 31:0) |
  3323. #if HTT_PADDR64
  3324. * | rx ind WR_IDX physical address (bits 63:32) |
  3325. #endif
  3326. * |-------------------------------------------------------------------|
  3327. * |-------------------------------------------------------------------|
  3328. * | rx ring2 base (bits 31:0) |
  3329. #if HTT_PADDR64
  3330. * | rx ring2 base (bits 63:32) |
  3331. #endif
  3332. * |-------------------------------------------------------------------|
  3333. * | rx ring2 size |
  3334. * |-------------------------------------------------------------------|
  3335. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3336. #if HTT_PADDR64
  3337. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3338. #endif
  3339. * |-------------------------------------------------------------------|
  3340. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3341. #if HTT_PADDR64
  3342. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3343. #endif
  3344. * |-------------------------------------------------------------------|
  3345. *
  3346. * Header fields:
  3347. * Header fields:
  3348. * - MSG_TYPE
  3349. * Bits 7:0
  3350. * Purpose: Identifies this as WDI_IPA config message
  3351. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3352. * - TX_PKT_POOL_SIZE
  3353. * Bits 15:0
  3354. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3355. * WDI_IPA TX path
  3356. * For systems using 32-bit format for bus addresses:
  3357. * - TX_COMP_RING_BASE_ADDR
  3358. * Bits 31:0
  3359. * Purpose: TX Completion Ring base address in DDR
  3360. * - TX_COMP_RING_SIZE
  3361. * Bits 31:0
  3362. * Purpose: TX Completion Ring size (must be power of 2)
  3363. * - TX_COMP_WR_IDX_ADDR
  3364. * Bits 31:0
  3365. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3366. * updates the Write Index for WDI_IPA TX completion ring
  3367. * - TX_CE_WR_IDX_ADDR
  3368. * Bits 31:0
  3369. * Purpose: DDR address where IPA uC
  3370. * updates the WR Index for TX CE ring
  3371. * (needed for fusion platforms)
  3372. * - RX_IND_RING_BASE_ADDR
  3373. * Bits 31:0
  3374. * Purpose: RX Indication Ring base address in DDR
  3375. * - RX_IND_RING_SIZE
  3376. * Bits 31:0
  3377. * Purpose: RX Indication Ring size
  3378. * - RX_IND_RD_IDX_ADDR
  3379. * Bits 31:0
  3380. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3381. * RX indication ring
  3382. * - RX_IND_WR_IDX_ADDR
  3383. * Bits 31:0
  3384. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3385. * updates the Write Index for WDI_IPA RX indication ring
  3386. * - RX_RING2_BASE_ADDR
  3387. * Bits 31:0
  3388. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3389. * - RX_RING2_SIZE
  3390. * Bits 31:0
  3391. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3392. * - RX_RING2_RD_IDX_ADDR
  3393. * Bits 31:0
  3394. * Purpose: If Second RX ring is Indication ring, DDR address where
  3395. * IPA uC updates the Read Index for Ring2.
  3396. * If Second RX ring is completion ring, this is NOT used
  3397. * - RX_RING2_WR_IDX_ADDR
  3398. * Bits 31:0
  3399. * Purpose: If Second RX ring is Indication ring, DDR address where
  3400. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3401. * If second RX ring is completion ring, DDR address where
  3402. * IPA uC updates the Write Index for Ring 2.
  3403. * For systems using 64-bit format for bus addresses:
  3404. * - TX_COMP_RING_BASE_ADDR_LO
  3405. * Bits 31:0
  3406. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3407. * - TX_COMP_RING_BASE_ADDR_HI
  3408. * Bits 31:0
  3409. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3410. * - TX_COMP_RING_SIZE
  3411. * Bits 31:0
  3412. * Purpose: TX Completion Ring size (must be power of 2)
  3413. * - TX_COMP_WR_IDX_ADDR_LO
  3414. * Bits 31:0
  3415. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3416. * Lower 4 bytes of DDR address where WIFI FW
  3417. * updates the Write Index for WDI_IPA TX completion ring
  3418. * - TX_COMP_WR_IDX_ADDR_HI
  3419. * Bits 31:0
  3420. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3421. * Higher 4 bytes of DDR address where WIFI FW
  3422. * updates the Write Index for WDI_IPA TX completion ring
  3423. * - TX_CE_WR_IDX_ADDR_LO
  3424. * Bits 31:0
  3425. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3426. * updates the WR Index for TX CE ring
  3427. * (needed for fusion platforms)
  3428. * - TX_CE_WR_IDX_ADDR_HI
  3429. * Bits 31:0
  3430. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3431. * updates the WR Index for TX CE ring
  3432. * (needed for fusion platforms)
  3433. * - RX_IND_RING_BASE_ADDR_LO
  3434. * Bits 31:0
  3435. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3436. * - RX_IND_RING_BASE_ADDR_HI
  3437. * Bits 31:0
  3438. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3439. * - RX_IND_RING_SIZE
  3440. * Bits 31:0
  3441. * Purpose: RX Indication Ring size
  3442. * - RX_IND_RD_IDX_ADDR_LO
  3443. * Bits 31:0
  3444. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3445. * for WDI_IPA RX indication ring
  3446. * - RX_IND_RD_IDX_ADDR_HI
  3447. * Bits 31:0
  3448. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3449. * for WDI_IPA RX indication ring
  3450. * - RX_IND_WR_IDX_ADDR_LO
  3451. * Bits 31:0
  3452. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3453. * Lower 4 bytes of DDR address where WIFI FW
  3454. * updates the Write Index for WDI_IPA RX indication ring
  3455. * - RX_IND_WR_IDX_ADDR_HI
  3456. * Bits 31:0
  3457. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3458. * Higher 4 bytes of DDR address where WIFI FW
  3459. * updates the Write Index for WDI_IPA RX indication ring
  3460. * - RX_RING2_BASE_ADDR_LO
  3461. * Bits 31:0
  3462. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3463. * - RX_RING2_BASE_ADDR_HI
  3464. * Bits 31:0
  3465. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3466. * - RX_RING2_SIZE
  3467. * Bits 31:0
  3468. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3469. * - RX_RING2_RD_IDX_ADDR_LO
  3470. * Bits 31:0
  3471. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3472. * DDR address where IPA uC updates the Read Index for Ring2.
  3473. * If Second RX ring is completion ring, this is NOT used
  3474. * - RX_RING2_RD_IDX_ADDR_HI
  3475. * Bits 31:0
  3476. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3477. * DDR address where IPA uC updates the Read Index for Ring2.
  3478. * If Second RX ring is completion ring, this is NOT used
  3479. * - RX_RING2_WR_IDX_ADDR_LO
  3480. * Bits 31:0
  3481. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3482. * DDR address where WIFI FW updates the Write Index
  3483. * for WDI_IPA RX ring2
  3484. * If second RX ring is completion ring, lower 4 bytes of
  3485. * DDR address where IPA uC updates the Write Index for Ring 2.
  3486. * - RX_RING2_WR_IDX_ADDR_HI
  3487. * Bits 31:0
  3488. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3489. * DDR address where WIFI FW updates the Write Index
  3490. * for WDI_IPA RX ring2
  3491. * If second RX ring is completion ring, higher 4 bytes of
  3492. * DDR address where IPA uC updates the Write Index for Ring 2.
  3493. */
  3494. #if HTT_PADDR64
  3495. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3496. #else
  3497. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3498. #endif
  3499. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3500. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3515. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3517. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3537. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3538. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3541. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3561. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3563. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3567. } while (0)
  3568. /* for systems using 32-bit format for bus addr */
  3569. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3570. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3571. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3574. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3575. } while (0)
  3576. /* for systems using 64-bit format for bus addr */
  3577. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3578. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3579. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3582. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3583. } while (0)
  3584. /* for systems using 64-bit format for bus addr */
  3585. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3586. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3587. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3590. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3591. } while (0)
  3592. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3593. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3594. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3597. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3598. } while (0)
  3599. /* for systems using 32-bit format for bus addr */
  3600. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3601. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3602. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3603. do { \
  3604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3605. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3606. } while (0)
  3607. /* for systems using 64-bit format for bus addr */
  3608. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3609. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3610. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3611. do { \
  3612. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3613. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3614. } while (0)
  3615. /* for systems using 64-bit format for bus addr */
  3616. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3617. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3618. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3621. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3622. } while (0)
  3623. /* for systems using 32-bit format for bus addr */
  3624. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3625. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3626. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3630. } while (0)
  3631. /* for systems using 64-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3634. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3638. } while (0)
  3639. /* for systems using 64-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3642. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3646. } while (0)
  3647. /* for systems using 32-bit format for bus addr */
  3648. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3649. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3650. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3651. do { \
  3652. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3653. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3654. } while (0)
  3655. /* for systems using 64-bit format for bus addr */
  3656. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3657. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3658. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3661. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3662. } while (0)
  3663. /* for systems using 64-bit format for bus addr */
  3664. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3665. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3666. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3669. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3670. } while (0)
  3671. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3672. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3673. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3676. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3677. } while (0)
  3678. /* for systems using 32-bit format for bus addr */
  3679. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3680. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3681. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3684. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3685. } while (0)
  3686. /* for systems using 64-bit format for bus addr */
  3687. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3688. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3689. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3692. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3693. } while (0)
  3694. /* for systems using 64-bit format for bus addr */
  3695. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3696. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3697. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3700. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3701. } while (0)
  3702. /* for systems using 32-bit format for bus addr */
  3703. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3704. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3705. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3706. do { \
  3707. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3708. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3709. } while (0)
  3710. /* for systems using 64-bit format for bus addr */
  3711. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3712. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3713. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3714. do { \
  3715. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3716. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3717. } while (0)
  3718. /* for systems using 64-bit format for bus addr */
  3719. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3720. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3721. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3722. do { \
  3723. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3724. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3725. } while (0)
  3726. /* for systems using 32-bit format for bus addr */
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3728. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3730. do { \
  3731. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3732. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3733. } while (0)
  3734. /* for systems using 64-bit format for bus addr */
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3736. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3738. do { \
  3739. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3740. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3741. } while (0)
  3742. /* for systems using 64-bit format for bus addr */
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3744. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3746. do { \
  3747. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3748. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3749. } while (0)
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3751. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3753. do { \
  3754. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3755. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3756. } while (0)
  3757. /* for systems using 32-bit format for bus addr */
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3759. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3761. do { \
  3762. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3763. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3764. } while (0)
  3765. /* for systems using 64-bit format for bus addr */
  3766. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3767. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3768. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3771. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3772. } while (0)
  3773. /* for systems using 64-bit format for bus addr */
  3774. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3775. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3776. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3779. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3780. } while (0)
  3781. /* for systems using 32-bit format for bus addr */
  3782. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3783. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3784. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3785. do { \
  3786. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3787. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3788. } while (0)
  3789. /* for systems using 64-bit format for bus addr */
  3790. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3791. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3792. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3795. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3796. } while (0)
  3797. /* for systems using 64-bit format for bus addr */
  3798. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3799. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3800. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3803. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3804. } while (0)
  3805. /*
  3806. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3807. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3808. * addresses are stored in a XXX-bit field.
  3809. * This macro is used to define both htt_wdi_ipa_config32_t and
  3810. * htt_wdi_ipa_config64_t structs.
  3811. */
  3812. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3813. _paddr__tx_comp_ring_base_addr_, \
  3814. _paddr__tx_comp_wr_idx_addr_, \
  3815. _paddr__tx_ce_wr_idx_addr_, \
  3816. _paddr__rx_ind_ring_base_addr_, \
  3817. _paddr__rx_ind_rd_idx_addr_, \
  3818. _paddr__rx_ind_wr_idx_addr_, \
  3819. _paddr__rx_ring2_base_addr_,\
  3820. _paddr__rx_ring2_rd_idx_addr_,\
  3821. _paddr__rx_ring2_wr_idx_addr_) \
  3822. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3823. { \
  3824. /* DWORD 0: flags and meta-data */ \
  3825. A_UINT32 \
  3826. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3827. reserved: 8, \
  3828. tx_pkt_pool_size: 16;\
  3829. /* DWORD 1 */\
  3830. _paddr__tx_comp_ring_base_addr_;\
  3831. /* DWORD 2 (or 3)*/\
  3832. A_UINT32 tx_comp_ring_size;\
  3833. /* DWORD 3 (or 4)*/\
  3834. _paddr__tx_comp_wr_idx_addr_;\
  3835. /* DWORD 4 (or 6)*/\
  3836. _paddr__tx_ce_wr_idx_addr_;\
  3837. /* DWORD 5 (or 8)*/\
  3838. _paddr__rx_ind_ring_base_addr_;\
  3839. /* DWORD 6 (or 10)*/\
  3840. A_UINT32 rx_ind_ring_size;\
  3841. /* DWORD 7 (or 11)*/\
  3842. _paddr__rx_ind_rd_idx_addr_;\
  3843. /* DWORD 8 (or 13)*/\
  3844. _paddr__rx_ind_wr_idx_addr_;\
  3845. /* DWORD 9 (or 15)*/\
  3846. _paddr__rx_ring2_base_addr_;\
  3847. /* DWORD 10 (or 17) */\
  3848. A_UINT32 rx_ring2_size;\
  3849. /* DWORD 11 (or 18) */\
  3850. _paddr__rx_ring2_rd_idx_addr_;\
  3851. /* DWORD 12 (or 20) */\
  3852. _paddr__rx_ring2_wr_idx_addr_;\
  3853. } POSTPACK
  3854. /* define a htt_wdi_ipa_config32_t type */
  3855. 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));
  3856. /* define a htt_wdi_ipa_config64_t type */
  3857. 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));
  3858. #if HTT_PADDR64
  3859. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3860. #else
  3861. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3862. #endif
  3863. enum htt_wdi_ipa_op_code {
  3864. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3865. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3866. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3867. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3868. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3869. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3870. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3871. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3872. /* keep this last */
  3873. HTT_WDI_IPA_OPCODE_MAX
  3874. };
  3875. /**
  3876. * @brief HTT WDI_IPA Operation Request Message
  3877. *
  3878. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  3879. *
  3880. * @details
  3881. * HTT WDI_IPA Operation Request message is sent by host
  3882. * to either suspend or resume WDI_IPA TX or RX path.
  3883. * |31 24|23 16|15 8|7 0|
  3884. * |----------------+----------------+----------------+----------------|
  3885. * | op_code | Rsvd | msg_type |
  3886. * |-------------------------------------------------------------------|
  3887. *
  3888. * Header fields:
  3889. * - MSG_TYPE
  3890. * Bits 7:0
  3891. * Purpose: Identifies this as WDI_IPA Operation Request message
  3892. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  3893. * - OP_CODE
  3894. * Bits 31:16
  3895. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3896. * value: = enum htt_wdi_ipa_op_code
  3897. */
  3898. PREPACK struct htt_wdi_ipa_op_request_t
  3899. {
  3900. /* DWORD 0: flags and meta-data */
  3901. A_UINT32
  3902. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3903. reserved: 8,
  3904. op_code: 16;
  3905. } POSTPACK;
  3906. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3907. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3908. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3909. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3910. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3911. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3912. do { \
  3913. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3914. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3915. } while (0)
  3916. /*
  3917. * @brief host -> target HTT_SRING_SETUP message
  3918. *
  3919. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  3920. *
  3921. * @details
  3922. * After target is booted up, Host can send SRING setup message for
  3923. * each host facing LMAC SRING. Target setups up HW registers based
  3924. * on setup message and confirms back to Host if response_required is set.
  3925. * Host should wait for confirmation message before sending new SRING
  3926. * setup message
  3927. *
  3928. * The message would appear as follows:
  3929. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3930. * |--------------- +-----------------+-----------------+-----------------|
  3931. * | ring_type | ring_id | pdev_id | msg_type |
  3932. * |----------------------------------------------------------------------|
  3933. * | ring_base_addr_lo |
  3934. * |----------------------------------------------------------------------|
  3935. * | ring_base_addr_hi |
  3936. * |----------------------------------------------------------------------|
  3937. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3938. * |----------------------------------------------------------------------|
  3939. * | ring_head_offset32_remote_addr_lo |
  3940. * |----------------------------------------------------------------------|
  3941. * | ring_head_offset32_remote_addr_hi |
  3942. * |----------------------------------------------------------------------|
  3943. * | ring_tail_offset32_remote_addr_lo |
  3944. * |----------------------------------------------------------------------|
  3945. * | ring_tail_offset32_remote_addr_hi |
  3946. * |----------------------------------------------------------------------|
  3947. * | ring_msi_addr_lo |
  3948. * |----------------------------------------------------------------------|
  3949. * | ring_msi_addr_hi |
  3950. * |----------------------------------------------------------------------|
  3951. * | ring_msi_data |
  3952. * |----------------------------------------------------------------------|
  3953. * | intr_timer_th |IM| intr_batch_counter_th |
  3954. * |----------------------------------------------------------------------|
  3955. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3956. * |----------------------------------------------------------------------|
  3957. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3958. * |----------------------------------------------------------------------|
  3959. * Where
  3960. * IM = sw_intr_mode
  3961. * RR = response_required
  3962. * PTCF = prefetch_timer_cfg
  3963. * IP = IPA drop flag
  3964. *
  3965. * The message is interpreted as follows:
  3966. * dword0 - b'0:7 - msg_type: This will be set to
  3967. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  3968. * b'8:15 - pdev_id:
  3969. * 0 (for rings at SOC/UMAC level),
  3970. * 1/2/3 mac id (for rings at LMAC level)
  3971. * b'16:23 - ring_id: identify which ring is to setup,
  3972. * more details can be got from enum htt_srng_ring_id
  3973. * b'24:31 - ring_type: identify type of host rings,
  3974. * more details can be got from enum htt_srng_ring_type
  3975. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3976. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3977. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3978. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3979. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3980. * SW_TO_HW_RING.
  3981. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3982. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3983. * Lower 32 bits of memory address of the remote variable
  3984. * storing the 4-byte word offset that identifies the head
  3985. * element within the ring.
  3986. * (The head offset variable has type A_UINT32.)
  3987. * Valid for HW_TO_SW and SW_TO_SW rings.
  3988. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3989. * Upper 32 bits of memory address of the remote variable
  3990. * storing the 4-byte word offset that identifies the head
  3991. * element within the ring.
  3992. * (The head offset variable has type A_UINT32.)
  3993. * Valid for HW_TO_SW and SW_TO_SW rings.
  3994. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3995. * Lower 32 bits of memory address of the remote variable
  3996. * storing the 4-byte word offset that identifies the tail
  3997. * element within the ring.
  3998. * (The tail offset variable has type A_UINT32.)
  3999. * Valid for HW_TO_SW and SW_TO_SW rings.
  4000. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4001. * Upper 32 bits of memory address of the remote variable
  4002. * storing the 4-byte word offset that identifies the tail
  4003. * element within the ring.
  4004. * (The tail offset variable has type A_UINT32.)
  4005. * Valid for HW_TO_SW and SW_TO_SW rings.
  4006. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4007. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4008. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4009. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4010. * dword10 - b'0:31 - ring_msi_data: MSI data
  4011. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4012. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4013. * dword11 - b'0:14 - intr_batch_counter_th:
  4014. * batch counter threshold is in units of 4-byte words.
  4015. * HW internally maintains and increments batch count.
  4016. * (see SRING spec for detail description).
  4017. * When batch count reaches threshold value, an interrupt
  4018. * is generated by HW.
  4019. * b'15 - sw_intr_mode:
  4020. * This configuration shall be static.
  4021. * Only programmed at power up.
  4022. * 0: generate pulse style sw interrupts
  4023. * 1: generate level style sw interrupts
  4024. * b'16:31 - intr_timer_th:
  4025. * The timer init value when timer is idle or is
  4026. * initialized to start downcounting.
  4027. * In 8us units (to cover a range of 0 to 524 ms)
  4028. * dword12 - b'0:15 - intr_low_threshold:
  4029. * Used only by Consumer ring to generate ring_sw_int_p.
  4030. * Ring entries low threshold water mark, that is used
  4031. * in combination with the interrupt timer as well as
  4032. * the the clearing of the level interrupt.
  4033. * b'16:18 - prefetch_timer_cfg:
  4034. * Used only by Consumer ring to set timer mode to
  4035. * support Application prefetch handling.
  4036. * The external tail offset/pointer will be updated
  4037. * at following intervals:
  4038. * 3'b000: (Prefetch feature disabled; used only for debug)
  4039. * 3'b001: 1 usec
  4040. * 3'b010: 4 usec
  4041. * 3'b011: 8 usec (default)
  4042. * 3'b100: 16 usec
  4043. * Others: Reserverd
  4044. * b'19 - response_required:
  4045. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4046. * b'20 - ipa_drop_flag:
  4047. Indicates that host will config ipa drop threshold percentage
  4048. * b'21:31 - reserved: reserved for future use
  4049. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4050. * b'8:15 - ipa drop high threshold percentage:
  4051. * b'16:31 - Reserved
  4052. */
  4053. PREPACK struct htt_sring_setup_t {
  4054. A_UINT32 msg_type: 8,
  4055. pdev_id: 8,
  4056. ring_id: 8,
  4057. ring_type: 8;
  4058. A_UINT32 ring_base_addr_lo;
  4059. A_UINT32 ring_base_addr_hi;
  4060. A_UINT32 ring_size: 16,
  4061. ring_entry_size: 8,
  4062. ring_misc_cfg_flag: 8;
  4063. A_UINT32 ring_head_offset32_remote_addr_lo;
  4064. A_UINT32 ring_head_offset32_remote_addr_hi;
  4065. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4066. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4067. A_UINT32 ring_msi_addr_lo;
  4068. A_UINT32 ring_msi_addr_hi;
  4069. A_UINT32 ring_msi_data;
  4070. A_UINT32 intr_batch_counter_th: 15,
  4071. sw_intr_mode: 1,
  4072. intr_timer_th: 16;
  4073. A_UINT32 intr_low_threshold: 16,
  4074. prefetch_timer_cfg: 3,
  4075. response_required: 1,
  4076. ipa_drop_flag: 1,
  4077. reserved1: 11;
  4078. A_UINT32 ipa_drop_low_threshold: 8,
  4079. ipa_drop_high_threshold: 8,
  4080. reserved: 16;
  4081. } POSTPACK;
  4082. enum htt_srng_ring_type {
  4083. HTT_HW_TO_SW_RING = 0,
  4084. HTT_SW_TO_HW_RING,
  4085. HTT_SW_TO_SW_RING,
  4086. /* Insert new ring types above this line */
  4087. };
  4088. enum htt_srng_ring_id {
  4089. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4090. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4091. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4092. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4093. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4094. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4095. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4096. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4097. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4098. /* Add Other SRING which can't be directly configured by host software above this line */
  4099. };
  4100. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4101. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4102. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4103. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4104. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4105. HTT_SRING_SETUP_PDEV_ID_S)
  4106. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4109. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4110. } while (0)
  4111. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4112. #define HTT_SRING_SETUP_RING_ID_S 16
  4113. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4114. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4115. HTT_SRING_SETUP_RING_ID_S)
  4116. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4119. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4120. } while (0)
  4121. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4122. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4123. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4124. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4125. HTT_SRING_SETUP_RING_TYPE_S)
  4126. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4129. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4130. } while (0)
  4131. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4132. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4133. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4134. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4135. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4136. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4139. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4140. } while (0)
  4141. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4142. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4143. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4144. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4145. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4146. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4149. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4150. } while (0)
  4151. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4152. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4153. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4154. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4155. HTT_SRING_SETUP_RING_SIZE_S)
  4156. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4159. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4160. } while (0)
  4161. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4162. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4163. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4164. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4165. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4166. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4169. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4170. } while (0)
  4171. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4172. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4173. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4175. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4176. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4180. } while (0)
  4181. /* This control bit is applicable to only Producer, which updates Ring ID field
  4182. * of each descriptor before pushing into the ring.
  4183. * 0: updates ring_id(default)
  4184. * 1: ring_id updating disabled */
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4186. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4188. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4189. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4190. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4193. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4194. } while (0)
  4195. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4196. * of each descriptor before pushing into the ring.
  4197. * 0: updates Loopcnt(default)
  4198. * 1: Loopcnt updating disabled */
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4202. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4203. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4207. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4208. } while (0)
  4209. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4210. * into security_id port of GXI/AXI. */
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4214. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4215. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4216. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4219. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4220. } while (0)
  4221. /* During MSI write operation, SRNG drives value of this register bit into
  4222. * swap bit of GXI/AXI. */
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4226. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4227. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4228. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4231. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4232. } while (0)
  4233. /* During Pointer write operation, SRNG drives value of this register bit into
  4234. * swap bit of GXI/AXI. */
  4235. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4238. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4239. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4240. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4243. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4244. } while (0)
  4245. /* During any data or TLV write operation, SRNG drives value of this register
  4246. * bit into swap bit of GXI/AXI. */
  4247. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4248. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4249. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4250. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4251. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4252. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4255. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4256. } while (0)
  4257. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4258. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4259. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4260. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4261. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4262. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4263. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4264. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4265. do { \
  4266. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4267. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4268. } while (0)
  4269. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4270. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4271. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4272. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4273. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4274. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4275. do { \
  4276. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4277. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4278. } while (0)
  4279. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4280. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4281. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4282. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4283. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4284. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4287. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4288. } while (0)
  4289. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4290. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4291. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4292. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4293. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4294. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4295. do { \
  4296. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4297. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4298. } while (0)
  4299. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4300. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4301. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4302. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4303. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4304. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4307. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4308. } while (0)
  4309. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4310. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4311. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4312. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4313. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4314. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4317. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4318. } while (0)
  4319. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4320. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4321. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4322. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4323. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4324. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4325. do { \
  4326. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4327. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4328. } while (0)
  4329. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4330. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4331. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4332. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4333. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4334. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4335. do { \
  4336. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4337. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4338. } while (0)
  4339. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4340. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4341. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4342. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4343. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4344. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4345. do { \
  4346. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4347. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4348. } while (0)
  4349. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4350. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4351. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4352. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4353. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4354. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4355. do { \
  4356. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4357. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4358. } while (0)
  4359. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4360. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4361. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4362. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4363. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4364. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4367. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4368. } while (0)
  4369. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4370. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4371. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4372. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4373. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4374. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4375. do { \
  4376. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4377. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4378. } while (0)
  4379. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4380. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4381. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4382. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4383. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4384. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4385. do { \
  4386. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4387. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4388. } while (0)
  4389. /**
  4390. * @brief host -> target RX ring selection config message
  4391. *
  4392. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4393. *
  4394. * @details
  4395. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4396. * configure RXDMA rings.
  4397. * The configuration is per ring based and includes both packet subtypes
  4398. * and PPDU/MPDU TLVs.
  4399. *
  4400. * The message would appear as follows:
  4401. *
  4402. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4403. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4404. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4405. * |-------------------------------------------------------------------|
  4406. * | rsvd2 | ring_buffer_size |
  4407. * |-------------------------------------------------------------------|
  4408. * | packet_type_enable_flags_0 |
  4409. * |-------------------------------------------------------------------|
  4410. * | packet_type_enable_flags_1 |
  4411. * |-------------------------------------------------------------------|
  4412. * | packet_type_enable_flags_2 |
  4413. * |-------------------------------------------------------------------|
  4414. * | packet_type_enable_flags_3 |
  4415. * |-------------------------------------------------------------------|
  4416. * | tlv_filter_in_flags |
  4417. * |-------------------------------------------------------------------|
  4418. * | rx_header_offset | rx_packet_offset |
  4419. * |-------------------------------------------------------------------|
  4420. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4421. * |-------------------------------------------------------------------|
  4422. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4423. * |-------------------------------------------------------------------|
  4424. * | rsvd3 | rx_attention_offset |
  4425. * |-------------------------------------------------------------------|
  4426. * | rsvd4 | mo| fp| rx_drop_threshold |
  4427. * | |ndp|ndp| |
  4428. * |-------------------------------------------------------------------|
  4429. * Where:
  4430. * PS = pkt_swap
  4431. * SS = status_swap
  4432. * OV = rx_offsets_valid
  4433. * DT = drop_thresh_valid
  4434. * The message is interpreted as follows:
  4435. * dword0 - b'0:7 - msg_type: This will be set to
  4436. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4437. * b'8:15 - pdev_id:
  4438. * 0 (for rings at SOC/UMAC level),
  4439. * 1/2/3 mac id (for rings at LMAC level)
  4440. * b'16:23 - ring_id : Identify the ring to configure.
  4441. * More details can be got from enum htt_srng_ring_id
  4442. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4443. * BUF_RING_CFG_0 defs within HW .h files,
  4444. * e.g. wmac_top_reg_seq_hwioreg.h
  4445. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4446. * BUF_RING_CFG_0 defs within HW .h files,
  4447. * e.g. wmac_top_reg_seq_hwioreg.h
  4448. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4449. * configuration fields are valid
  4450. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4451. * rx_drop_threshold field is valid
  4452. * b'28:31 - rsvd1: reserved for future use
  4453. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4454. * in byte units.
  4455. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4456. * - b'16:31 - rsvd2: Reserved for future use
  4457. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4458. * Enable MGMT packet from 0b0000 to 0b1001
  4459. * bits from low to high: FP, MD, MO - 3 bits
  4460. * FP: Filter_Pass
  4461. * MD: Monitor_Direct
  4462. * MO: Monitor_Other
  4463. * 10 mgmt subtypes * 3 bits -> 30 bits
  4464. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4465. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4466. * Enable MGMT packet from 0b1010 to 0b1111
  4467. * bits from low to high: FP, MD, MO - 3 bits
  4468. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4469. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4470. * Enable CTRL packet from 0b0000 to 0b1001
  4471. * bits from low to high: FP, MD, MO - 3 bits
  4472. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4473. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4474. * Enable CTRL packet from 0b1010 to 0b1111,
  4475. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4476. * bits from low to high: FP, MD, MO - 3 bits
  4477. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4478. * dword6 - b'0:31 - tlv_filter_in_flags:
  4479. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4480. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4481. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4482. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4483. * A value of 0 will be considered as ignore this config.
  4484. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4485. * e.g. wmac_top_reg_seq_hwioreg.h
  4486. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4487. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4488. * A value of 0 will be considered as ignore this config.
  4489. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4490. * e.g. wmac_top_reg_seq_hwioreg.h
  4491. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4492. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4493. * A value of 0 will be considered as ignore this config.
  4494. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4495. * e.g. wmac_top_reg_seq_hwioreg.h
  4496. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4497. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4498. * A value of 0 will be considered as ignore this config.
  4499. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4500. * e.g. wmac_top_reg_seq_hwioreg.h
  4501. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4502. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4503. * A value of 0 will be considered as ignore this config.
  4504. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4505. * e.g. wmac_top_reg_seq_hwioreg.h
  4506. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4507. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4508. * A value of 0 will be considered as ignore this config.
  4509. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4510. * e.g. wmac_top_reg_seq_hwioreg.h
  4511. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4512. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4513. * A value of 0 will be considered as ignore this config.
  4514. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4515. * e.g. wmac_top_reg_seq_hwioreg.h
  4516. * - b'16:31 - rsvd3 for future use
  4517. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4518. * to source rings. Consumer drops packets if the available
  4519. * words in the ring falls below the configured threshold
  4520. * value.
  4521. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4522. * by host. 1 -> subscribed
  4523. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4524. * by host. 1 -> subscribed
  4525. */
  4526. PREPACK struct htt_rx_ring_selection_cfg_t {
  4527. A_UINT32 msg_type: 8,
  4528. pdev_id: 8,
  4529. ring_id: 8,
  4530. status_swap: 1,
  4531. pkt_swap: 1,
  4532. rx_offsets_valid: 1,
  4533. drop_thresh_valid: 1,
  4534. rsvd1: 4;
  4535. A_UINT32 ring_buffer_size: 16,
  4536. rsvd2: 16;
  4537. A_UINT32 packet_type_enable_flags_0;
  4538. A_UINT32 packet_type_enable_flags_1;
  4539. A_UINT32 packet_type_enable_flags_2;
  4540. A_UINT32 packet_type_enable_flags_3;
  4541. A_UINT32 tlv_filter_in_flags;
  4542. A_UINT32 rx_packet_offset: 16,
  4543. rx_header_offset: 16;
  4544. A_UINT32 rx_mpdu_end_offset: 16,
  4545. rx_mpdu_start_offset: 16;
  4546. A_UINT32 rx_msdu_end_offset: 16,
  4547. rx_msdu_start_offset: 16;
  4548. A_UINT32 rx_attn_offset: 16,
  4549. rsvd3: 16;
  4550. A_UINT32 rx_drop_threshold: 10,
  4551. fp_ndp: 1,
  4552. mo_ndp: 1,
  4553. rsvd4: 20;
  4554. } POSTPACK;
  4555. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4556. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4557. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4558. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4559. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4560. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4561. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4565. } while (0)
  4566. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4567. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4568. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4569. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4570. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4571. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4575. } while (0)
  4576. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4577. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4578. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4579. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4580. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4581. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4582. do { \
  4583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4585. } while (0)
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4589. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4590. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4592. do { \
  4593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4595. } while (0)
  4596. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4599. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4600. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4602. do { \
  4603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4605. } while (0)
  4606. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4607. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4608. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4609. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4610. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4611. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4612. do { \
  4613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4615. } while (0)
  4616. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4617. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4618. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4619. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4620. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4621. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4622. do { \
  4623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4625. } while (0)
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4629. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4630. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4632. do { \
  4633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4635. } while (0)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4639. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4640. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4642. do { \
  4643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4645. } while (0)
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4649. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4650. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4652. do { \
  4653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4655. } while (0)
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4659. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4660. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4662. do { \
  4663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4665. } while (0)
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4669. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4670. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4672. do { \
  4673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4675. } while (0)
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4677. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4679. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4680. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4682. do { \
  4683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4685. } while (0)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4687. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4689. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4690. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4692. do { \
  4693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4695. } while (0)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4699. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4700. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4702. do { \
  4703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4705. } while (0)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4707. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4709. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4710. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4712. do { \
  4713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4715. } while (0)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4717. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4719. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4720. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4722. do { \
  4723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4725. } while (0)
  4726. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4727. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4728. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4729. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4730. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4732. do { \
  4733. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4734. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4735. } while (0)
  4736. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4737. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4738. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4739. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4740. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4741. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4745. } while (0)
  4746. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4747. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4748. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4749. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4750. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4751. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4754. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4755. } while (0)
  4756. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4757. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4758. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4759. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4760. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4761. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4764. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4765. } while (0)
  4766. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4767. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4768. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4769. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4770. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4771. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4774. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4775. } while (0)
  4776. /*
  4777. * Subtype based MGMT frames enable bits.
  4778. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4779. */
  4780. /* association request */
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4787. /* association response */
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4794. /* Reassociation request */
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4801. /* Reassociation response */
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4808. /* Probe request */
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4815. /* Probe response */
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4822. /* Timing Advertisement */
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4829. /* Reserved */
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4836. /* Beacon */
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4843. /* ATIM */
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4850. /* Disassociation */
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4857. /* Authentication */
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4864. /* Deauthentication */
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4871. /* Action */
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4878. /* Action No Ack */
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4885. /* Reserved */
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4892. /*
  4893. * Subtype based CTRL frames enable bits.
  4894. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4895. */
  4896. /* Reserved */
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4903. /* Reserved */
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4910. /* Reserved */
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4917. /* Reserved */
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4924. /* Reserved */
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4931. /* Reserved */
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4938. /* Reserved */
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4945. /* Control Wrapper */
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4952. /* Block Ack Request */
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4959. /* Block Ack*/
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4966. /* PS-POLL */
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4973. /* RTS */
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4980. /* CTS */
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4987. /* ACK */
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4994. /* CF-END */
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5001. /* CF-END + CF-ACK */
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5008. /* Multicast data */
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5015. /* Unicast data */
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5022. /* NULL data */
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5030. do { \
  5031. HTT_CHECK_SET_VAL(httsym, value); \
  5032. (word) |= (value) << httsym##_S; \
  5033. } while (0)
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5035. (((word) & httsym##_M) >> httsym##_S)
  5036. #define htt_rx_ring_pkt_enable_subtype_set( \
  5037. word, flag, mode, type, subtype, val) \
  5038. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5039. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5040. #define htt_rx_ring_pkt_enable_subtype_get( \
  5041. word, flag, mode, type, subtype) \
  5042. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5043. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5044. /* Definition to filter in TLVs */
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5070. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5071. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5072. do { \
  5073. HTT_CHECK_SET_VAL(httsym, enable); \
  5074. (word) |= (enable) << httsym##_S; \
  5075. } while (0)
  5076. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5077. (((word) & httsym##_M) >> httsym##_S)
  5078. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5079. HTT_RX_RING_TLV_ENABLE_SET( \
  5080. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5081. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5082. HTT_RX_RING_TLV_ENABLE_GET( \
  5083. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5084. /**
  5085. * @brief host --> target Receive Flow Steering configuration message definition
  5086. *
  5087. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5088. *
  5089. * host --> target Receive Flow Steering configuration message definition.
  5090. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5091. * The reason for this is we want RFS to be configured and ready before MAC
  5092. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5093. *
  5094. * |31 24|23 16|15 9|8|7 0|
  5095. * |----------------+----------------+----------------+----------------|
  5096. * | reserved |E| msg type |
  5097. * |-------------------------------------------------------------------|
  5098. * Where E = RFS enable flag
  5099. *
  5100. * The RFS_CONFIG message consists of a single 4-byte word.
  5101. *
  5102. * Header fields:
  5103. * - MSG_TYPE
  5104. * Bits 7:0
  5105. * Purpose: identifies this as a RFS config msg
  5106. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5107. * - RFS_CONFIG
  5108. * Bit 8
  5109. * Purpose: Tells target whether to enable (1) or disable (0)
  5110. * flow steering feature when sending rx indication messages to host
  5111. */
  5112. #define HTT_H2T_RFS_CONFIG_M 0x100
  5113. #define HTT_H2T_RFS_CONFIG_S 8
  5114. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5115. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5116. HTT_H2T_RFS_CONFIG_S)
  5117. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5118. do { \
  5119. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5120. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5121. } while (0)
  5122. #define HTT_RFS_CFG_REQ_BYTES 4
  5123. /**
  5124. * @brief host -> target FW extended statistics retrieve
  5125. *
  5126. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5127. *
  5128. * @details
  5129. * The following field definitions describe the format of the HTT host
  5130. * to target FW extended stats retrieve message.
  5131. * The message specifies the type of stats the host wants to retrieve.
  5132. *
  5133. * |31 24|23 16|15 8|7 0|
  5134. * |-----------------------------------------------------------|
  5135. * | reserved | stats type | pdev_mask | msg type |
  5136. * |-----------------------------------------------------------|
  5137. * | config param [0] |
  5138. * |-----------------------------------------------------------|
  5139. * | config param [1] |
  5140. * |-----------------------------------------------------------|
  5141. * | config param [2] |
  5142. * |-----------------------------------------------------------|
  5143. * | config param [3] |
  5144. * |-----------------------------------------------------------|
  5145. * | reserved |
  5146. * |-----------------------------------------------------------|
  5147. * | cookie LSBs |
  5148. * |-----------------------------------------------------------|
  5149. * | cookie MSBs |
  5150. * |-----------------------------------------------------------|
  5151. * Header fields:
  5152. * - MSG_TYPE
  5153. * Bits 7:0
  5154. * Purpose: identifies this is a extended stats upload request message
  5155. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  5156. * - PDEV_MASK
  5157. * Bits 8:15
  5158. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5159. * Value: This is a overloaded field, refer to usage and interpretation of
  5160. * PDEV in interface document.
  5161. * Bit 8 : Reserved for SOC stats
  5162. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5163. * Indicates MACID_MASK in DBS
  5164. * - STATS_TYPE
  5165. * Bits 23:16
  5166. * Purpose: identifies which FW statistics to upload
  5167. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5168. * - Reserved
  5169. * Bits 31:24
  5170. * - CONFIG_PARAM [0]
  5171. * Bits 31:0
  5172. * Purpose: give an opaque configuration value to the specified stats type
  5173. * Value: stats-type specific configuration value
  5174. * Refer to htt_stats.h for interpretation for each stats sub_type
  5175. * - CONFIG_PARAM [1]
  5176. * Bits 31:0
  5177. * Purpose: give an opaque configuration value to the specified stats type
  5178. * Value: stats-type specific configuration value
  5179. * Refer to htt_stats.h for interpretation for each stats sub_type
  5180. * - CONFIG_PARAM [2]
  5181. * Bits 31:0
  5182. * Purpose: give an opaque configuration value to the specified stats type
  5183. * Value: stats-type specific configuration value
  5184. * Refer to htt_stats.h for interpretation for each stats sub_type
  5185. * - CONFIG_PARAM [3]
  5186. * Bits 31:0
  5187. * Purpose: give an opaque configuration value to the specified stats type
  5188. * Value: stats-type specific configuration value
  5189. * Refer to htt_stats.h for interpretation for each stats sub_type
  5190. * - Reserved [31:0] for future use.
  5191. * - COOKIE_LSBS
  5192. * Bits 31:0
  5193. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5194. * message with its preceding host->target stats request message.
  5195. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5196. * - COOKIE_MSBS
  5197. * Bits 31:0
  5198. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5199. * message with its preceding host->target stats request message.
  5200. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5201. */
  5202. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5203. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5204. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5205. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5206. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5207. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5208. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5209. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5210. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5211. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5212. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5215. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5216. } while (0)
  5217. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5218. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5219. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5220. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5223. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5224. } while (0)
  5225. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5226. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5227. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5228. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5229. do { \
  5230. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5231. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5232. } while (0)
  5233. /**
  5234. * @brief host -> target FW PPDU_STATS request message
  5235. *
  5236. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  5237. *
  5238. * @details
  5239. * The following field definitions describe the format of the HTT host
  5240. * to target FW for PPDU_STATS_CFG msg.
  5241. * The message allows the host to configure the PPDU_STATS_IND messages
  5242. * produced by the target.
  5243. *
  5244. * |31 24|23 16|15 8|7 0|
  5245. * |-----------------------------------------------------------|
  5246. * | REQ bit mask | pdev_mask | msg type |
  5247. * |-----------------------------------------------------------|
  5248. * Header fields:
  5249. * - MSG_TYPE
  5250. * Bits 7:0
  5251. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5252. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  5253. * - PDEV_MASK
  5254. * Bits 8:15
  5255. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5256. * Value: This is a overloaded field, refer to usage and interpretation of
  5257. * PDEV in interface document.
  5258. * Bit 8 : Reserved for SOC stats
  5259. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5260. * Indicates MACID_MASK in DBS
  5261. * - REQ_TLV_BIT_MASK
  5262. * Bits 16:31
  5263. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5264. * needs to be included in the target's PPDU_STATS_IND messages.
  5265. * Value: refer htt_ppdu_stats_tlv_tag_t
  5266. *
  5267. */
  5268. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5269. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5270. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5271. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5272. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5273. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5274. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5275. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5276. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5277. do { \
  5278. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5279. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5280. } while (0)
  5281. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5282. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5283. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5284. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5285. do { \
  5286. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5287. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5288. } while (0)
  5289. /**
  5290. * @brief Host-->target HTT RX FSE setup message
  5291. *
  5292. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5293. *
  5294. * @details
  5295. * Through this message, the host will provide details of the flow tables
  5296. * in host DDR along with hash keys.
  5297. * This message can be sent per SOC or per PDEV, which is differentiated
  5298. * by pdev id values.
  5299. * The host will allocate flow search table and sends table size,
  5300. * physical DMA address of flow table, and hash keys to firmware to
  5301. * program into the RXOLE FSE HW block.
  5302. *
  5303. * The following field definitions describe the format of the RX FSE setup
  5304. * message sent from the host to target
  5305. *
  5306. * Header fields:
  5307. * dword0 - b'7:0 - msg_type: This will be set to
  5308. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  5309. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5310. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5311. * pdev's LMAC ring.
  5312. * b'31:16 - reserved : Reserved for future use
  5313. * dword1 - b'19:0 - number of records: This field indicates the number of
  5314. * entries in the flow table. For example: 8k number of
  5315. * records is equivalent to
  5316. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5317. * b'27:20 - max search: This field specifies the skid length to FSE
  5318. * parser HW module whenever match is not found at the
  5319. * exact index pointed by hash.
  5320. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5321. * Refer htt_ip_da_sa_prefix below for more details.
  5322. * b'31:30 - reserved: Reserved for future use
  5323. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5324. * table allocated by host in DDR
  5325. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5326. * table allocated by host in DDR
  5327. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5328. * entry hashing
  5329. *
  5330. *
  5331. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5332. * |---------------------------------------------------------------|
  5333. * | reserved | pdev_id | MSG_TYPE |
  5334. * |---------------------------------------------------------------|
  5335. * |resvd|IPDSA| max_search | Number of records |
  5336. * |---------------------------------------------------------------|
  5337. * | base address lo |
  5338. * |---------------------------------------------------------------|
  5339. * | base address high |
  5340. * |---------------------------------------------------------------|
  5341. * | toeplitz key 31_0 |
  5342. * |---------------------------------------------------------------|
  5343. * | toeplitz key 63_32 |
  5344. * |---------------------------------------------------------------|
  5345. * | toeplitz key 95_64 |
  5346. * |---------------------------------------------------------------|
  5347. * | toeplitz key 127_96 |
  5348. * |---------------------------------------------------------------|
  5349. * | toeplitz key 159_128 |
  5350. * |---------------------------------------------------------------|
  5351. * | toeplitz key 191_160 |
  5352. * |---------------------------------------------------------------|
  5353. * | toeplitz key 223_192 |
  5354. * |---------------------------------------------------------------|
  5355. * | toeplitz key 255_224 |
  5356. * |---------------------------------------------------------------|
  5357. * | toeplitz key 287_256 |
  5358. * |---------------------------------------------------------------|
  5359. * | reserved | toeplitz key 314_288(26:0 bits) |
  5360. * |---------------------------------------------------------------|
  5361. * where:
  5362. * IPDSA = ip_da_sa
  5363. */
  5364. /**
  5365. * @brief: htt_ip_da_sa_prefix
  5366. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5367. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5368. * documentation per RFC3849
  5369. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5370. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5371. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5372. */
  5373. enum htt_ip_da_sa_prefix {
  5374. HTT_RX_IPV6_20010db8,
  5375. HTT_RX_IPV4_MAPPED_IPV6,
  5376. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5377. HTT_RX_IPV6_64FF9B,
  5378. };
  5379. /**
  5380. * @brief Host-->target HTT RX FISA configure and enable
  5381. *
  5382. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5383. *
  5384. * @details
  5385. * The host will send this command down to configure and enable the FISA
  5386. * operational params.
  5387. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5388. * register.
  5389. * Should configure both the MACs.
  5390. *
  5391. * dword0 - b'7:0 - msg_type:
  5392. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  5393. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5394. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5395. * pdev's LMAC ring.
  5396. * b'31:16 - reserved : Reserved for future use
  5397. *
  5398. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5399. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5400. * packets. 1 flow search will be skipped
  5401. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5402. * tcp,udp packets
  5403. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5404. * calculation
  5405. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5406. * calculation
  5407. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5408. * calculation
  5409. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5410. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5411. * length
  5412. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5413. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5414. * length
  5415. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5416. * num jump
  5417. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5418. * num jump
  5419. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5420. * data type switch has happend for MPDU Sequence num jump
  5421. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5422. * for MPDU Sequence num jump
  5423. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5424. * for decrypt errors
  5425. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5426. * while aggregating a msdu
  5427. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5428. * The aggregation is done until (number of MSDUs aggregated
  5429. * < LIMIT + 1)
  5430. * b'31:18 - Reserved
  5431. *
  5432. * fisa_control_value - 32bit value FW can write to register
  5433. *
  5434. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5435. * Threshold value for FISA timeout (units are microseconds).
  5436. * When the global timestamp exceeds this threshold, FISA
  5437. * aggregation will be restarted.
  5438. * A value of 0 means timeout is disabled.
  5439. * Compare the threshold register with timestamp field in
  5440. * flow entry to generate timeout for the flow.
  5441. *
  5442. * |31 18 |17 16|15 8|7 0|
  5443. * |-------------------------------------------------------------|
  5444. * | reserved | pdev_mask | msg type |
  5445. * |-------------------------------------------------------------|
  5446. * | reserved | FISA_CTRL |
  5447. * |-------------------------------------------------------------|
  5448. * | FISA_TIMEOUT_THRESH |
  5449. * |-------------------------------------------------------------|
  5450. */
  5451. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5452. A_UINT32 msg_type:8,
  5453. pdev_id:8,
  5454. reserved0:16;
  5455. /**
  5456. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5457. * [17:0]
  5458. */
  5459. union {
  5460. /*
  5461. * fisa_control_bits structure is deprecated.
  5462. * Please use fisa_control_bits_v2 going forward.
  5463. */
  5464. struct {
  5465. A_UINT32 fisa_enable: 1,
  5466. ipsec_skip_search: 1,
  5467. nontcp_skip_search: 1,
  5468. add_ipv4_fixed_hdr_len: 1,
  5469. add_ipv6_fixed_hdr_len: 1,
  5470. add_tcp_fixed_hdr_len: 1,
  5471. add_udp_hdr_len: 1,
  5472. chksum_cum_ip_len_en: 1,
  5473. disable_tid_check: 1,
  5474. disable_ta_check: 1,
  5475. disable_qos_check: 1,
  5476. disable_raw_check: 1,
  5477. disable_decrypt_err_check: 1,
  5478. disable_msdu_drop_check: 1,
  5479. fisa_aggr_limit: 4,
  5480. reserved: 14;
  5481. } fisa_control_bits;
  5482. struct {
  5483. A_UINT32 fisa_enable: 1,
  5484. fisa_aggr_limit: 4,
  5485. reserved: 27;
  5486. } fisa_control_bits_v2;
  5487. A_UINT32 fisa_control_value;
  5488. } u_fisa_control;
  5489. /**
  5490. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5491. * timeout threshold for aggregation. Unit in usec.
  5492. * [31:0]
  5493. */
  5494. A_UINT32 fisa_timeout_threshold;
  5495. } POSTPACK;
  5496. /* DWord 0: pdev-ID */
  5497. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5498. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5499. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5500. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5501. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5502. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5505. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5506. } while (0)
  5507. /* Dword 1: fisa_control_value fisa config */
  5508. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5509. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5510. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5511. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5512. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5513. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5517. } while (0)
  5518. /* Dword 1: fisa_control_value ipsec_skip_search */
  5519. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5520. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5521. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5522. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5523. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5524. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5527. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5528. } while (0)
  5529. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5530. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5531. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5532. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5533. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5534. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5535. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5536. do { \
  5537. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5538. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5539. } while (0)
  5540. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5541. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5542. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5543. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5544. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5545. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5546. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5549. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5550. } while (0)
  5551. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5552. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5553. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5554. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5555. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5556. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5557. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5558. do { \
  5559. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5560. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5561. } while (0)
  5562. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5563. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5564. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5565. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5566. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5567. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5568. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5572. } while (0)
  5573. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5574. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5575. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5576. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5577. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5578. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5579. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5583. } while (0)
  5584. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5585. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5586. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5587. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5588. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5589. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5590. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5591. do { \
  5592. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5593. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5594. } while (0)
  5595. /* Dword 1: fisa_control_value disable_tid_check */
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5598. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5599. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5600. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5601. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5605. } while (0)
  5606. /* Dword 1: fisa_control_value disable_ta_check */
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5609. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5610. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5611. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5612. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5613. do { \
  5614. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5615. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5616. } while (0)
  5617. /* Dword 1: fisa_control_value disable_qos_check */
  5618. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5619. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5620. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5621. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5622. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5623. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5627. } while (0)
  5628. /* Dword 1: fisa_control_value disable_raw_check */
  5629. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5630. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5631. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5632. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5633. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5634. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5637. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5638. } while (0)
  5639. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5640. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5641. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5642. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5643. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5644. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5645. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5646. do { \
  5647. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5648. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5649. } while (0)
  5650. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5651. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5652. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5653. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5654. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5655. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5656. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5657. do { \
  5658. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5659. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5660. } while (0)
  5661. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5662. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5663. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5664. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5665. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5666. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5667. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5668. do { \
  5669. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5670. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5671. } while (0)
  5672. /* Dword 1: fisa_control_value fisa config */
  5673. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5674. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5675. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5676. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5677. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5678. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5679. do { \
  5680. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5681. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5682. } while (0)
  5683. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5684. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5685. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5686. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5687. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5688. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5689. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5692. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5693. } while (0)
  5694. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5695. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5696. pdev_id:8,
  5697. reserved0:16;
  5698. A_UINT32 num_records:20,
  5699. max_search:8,
  5700. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5701. reserved1:2;
  5702. A_UINT32 base_addr_lo;
  5703. A_UINT32 base_addr_hi;
  5704. A_UINT32 toeplitz31_0;
  5705. A_UINT32 toeplitz63_32;
  5706. A_UINT32 toeplitz95_64;
  5707. A_UINT32 toeplitz127_96;
  5708. A_UINT32 toeplitz159_128;
  5709. A_UINT32 toeplitz191_160;
  5710. A_UINT32 toeplitz223_192;
  5711. A_UINT32 toeplitz255_224;
  5712. A_UINT32 toeplitz287_256;
  5713. A_UINT32 toeplitz314_288:27,
  5714. reserved2:5;
  5715. } POSTPACK;
  5716. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5717. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5718. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5719. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5720. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5721. /* DWORD 0: Pdev ID */
  5722. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5723. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5724. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5725. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5726. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5727. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5728. do { \
  5729. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5730. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5731. } while (0)
  5732. /* DWORD 1:num of records */
  5733. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5734. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5735. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5736. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5737. HTT_RX_FSE_SETUP_NUM_REC_S)
  5738. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5739. do { \
  5740. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5741. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5742. } while (0)
  5743. /* DWORD 1:max_search */
  5744. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5745. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5746. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5747. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5748. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5749. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5750. do { \
  5751. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5752. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5753. } while (0)
  5754. /* DWORD 1:ip_da_sa prefix */
  5755. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5756. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5757. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5758. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5759. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5760. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5761. do { \
  5762. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5763. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5764. } while (0)
  5765. /* DWORD 2: Base Address LO */
  5766. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5767. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5768. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5769. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5770. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5771. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5772. do { \
  5773. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5774. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5775. } while (0)
  5776. /* DWORD 3: Base Address High */
  5777. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5778. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5779. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5780. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5781. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5782. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5783. do { \
  5784. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5785. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5786. } while (0)
  5787. /* DWORD 4-12: Hash Value */
  5788. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5789. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5790. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5791. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5792. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5793. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5794. do { \
  5795. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5796. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5797. } while (0)
  5798. /* DWORD 13: Hash Value 314:288 bits */
  5799. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5800. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5801. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5802. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5803. do { \
  5804. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5805. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5806. } while (0)
  5807. /**
  5808. * @brief Host-->target HTT RX FSE operation message
  5809. *
  5810. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5811. *
  5812. * @details
  5813. * The host will send this Flow Search Engine (FSE) operation message for
  5814. * every flow add/delete operation.
  5815. * The FSE operation includes FSE full cache invalidation or individual entry
  5816. * invalidation.
  5817. * This message can be sent per SOC or per PDEV which is differentiated
  5818. * by pdev id values.
  5819. *
  5820. * |31 16|15 8|7 1|0|
  5821. * |-------------------------------------------------------------|
  5822. * | reserved | pdev_id | MSG_TYPE |
  5823. * |-------------------------------------------------------------|
  5824. * | reserved | operation |I|
  5825. * |-------------------------------------------------------------|
  5826. * | ip_src_addr_31_0 |
  5827. * |-------------------------------------------------------------|
  5828. * | ip_src_addr_63_32 |
  5829. * |-------------------------------------------------------------|
  5830. * | ip_src_addr_95_64 |
  5831. * |-------------------------------------------------------------|
  5832. * | ip_src_addr_127_96 |
  5833. * |-------------------------------------------------------------|
  5834. * | ip_dst_addr_31_0 |
  5835. * |-------------------------------------------------------------|
  5836. * | ip_dst_addr_63_32 |
  5837. * |-------------------------------------------------------------|
  5838. * | ip_dst_addr_95_64 |
  5839. * |-------------------------------------------------------------|
  5840. * | ip_dst_addr_127_96 |
  5841. * |-------------------------------------------------------------|
  5842. * | l4_dst_port | l4_src_port |
  5843. * | (32-bit SPI incase of IPsec) |
  5844. * |-------------------------------------------------------------|
  5845. * | reserved | l4_proto |
  5846. * |-------------------------------------------------------------|
  5847. *
  5848. * where I is 1-bit ipsec_valid.
  5849. *
  5850. * The following field definitions describe the format of the RX FSE operation
  5851. * message sent from the host to target for every add/delete flow entry to flow
  5852. * table.
  5853. *
  5854. * Header fields:
  5855. * dword0 - b'7:0 - msg_type: This will be set to
  5856. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  5857. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5858. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5859. * specified pdev's LMAC ring.
  5860. * b'31:16 - reserved : Reserved for future use
  5861. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5862. * (Internet Protocol Security).
  5863. * IPsec describes the framework for providing security at
  5864. * IP layer. IPsec is defined for both versions of IP:
  5865. * IPV4 and IPV6.
  5866. * Please refer to htt_rx_flow_proto enumeration below for
  5867. * more info.
  5868. * ipsec_valid = 1 for IPSEC packets
  5869. * ipsec_valid = 0 for IP Packets
  5870. * b'7:1 - operation: This indicates types of FSE operation.
  5871. * Refer to htt_rx_fse_operation enumeration:
  5872. * 0 - No Cache Invalidation required
  5873. * 1 - Cache invalidate only one entry given by IP
  5874. * src/dest address at DWORD[2:9]
  5875. * 2 - Complete FSE Cache Invalidation
  5876. * 3 - FSE Disable
  5877. * 4 - FSE Enable
  5878. * b'31:8 - reserved: Reserved for future use
  5879. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5880. * for per flow addition/deletion
  5881. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5882. * and the subsequent 3 A_UINT32 will be padding bytes.
  5883. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5884. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5885. * from 0 to 65535 but only 0 to 1023 are designated as
  5886. * well-known ports. Refer to [RFC1700] for more details.
  5887. * This field is valid only if
  5888. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5889. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5890. * range from 0 to 65535 but only 0 to 1023 are designated
  5891. * as well-known ports. Refer to [RFC1700] for more details.
  5892. * This field is valid only if
  5893. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5894. * - SPI (31:0): Security Parameters Index is an
  5895. * identification tag added to the header while using IPsec
  5896. * for tunneling the IP traffici.
  5897. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5898. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5899. * Assigned Internet Protocol Numbers.
  5900. * l4_proto numbers for standard protocol like UDP/TCP
  5901. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5902. * l4_proto = 17 for UDP etc.
  5903. * b'31:8 - reserved: Reserved for future use.
  5904. *
  5905. */
  5906. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5907. A_UINT32 msg_type:8,
  5908. pdev_id:8,
  5909. reserved0:16;
  5910. A_UINT32 ipsec_valid:1,
  5911. operation:7,
  5912. reserved1:24;
  5913. A_UINT32 ip_src_addr_31_0;
  5914. A_UINT32 ip_src_addr_63_32;
  5915. A_UINT32 ip_src_addr_95_64;
  5916. A_UINT32 ip_src_addr_127_96;
  5917. A_UINT32 ip_dest_addr_31_0;
  5918. A_UINT32 ip_dest_addr_63_32;
  5919. A_UINT32 ip_dest_addr_95_64;
  5920. A_UINT32 ip_dest_addr_127_96;
  5921. union {
  5922. A_UINT32 spi;
  5923. struct {
  5924. A_UINT32 l4_src_port:16,
  5925. l4_dest_port:16;
  5926. } ip;
  5927. } u;
  5928. A_UINT32 l4_proto:8,
  5929. reserved:24;
  5930. } POSTPACK;
  5931. /**
  5932. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5933. *
  5934. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  5935. *
  5936. * @details
  5937. * The host will send this Full monitor mode register configuration message.
  5938. * This message can be sent per SOC or per PDEV which is differentiated
  5939. * by pdev id values.
  5940. *
  5941. * |31 16|15 11|10 8|7 3|2|1|0|
  5942. * |-------------------------------------------------------------|
  5943. * | reserved | pdev_id | MSG_TYPE |
  5944. * |-------------------------------------------------------------|
  5945. * | reserved |Release Ring |N|Z|E|
  5946. * |-------------------------------------------------------------|
  5947. *
  5948. * where E is 1-bit full monitor mode enable/disable.
  5949. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5950. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5951. *
  5952. * The following field definitions describe the format of the full monitor
  5953. * mode configuration message sent from the host to target for each pdev.
  5954. *
  5955. * Header fields:
  5956. * dword0 - b'7:0 - msg_type: This will be set to
  5957. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  5958. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5959. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5960. * specified pdev's LMAC ring.
  5961. * b'31:16 - reserved : Reserved for future use.
  5962. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5963. * monitor mode rxdma register is to be enabled or disabled.
  5964. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5965. * additional descriptors at ppdu end for zero mpdus
  5966. * enabled or disabled.
  5967. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5968. * additional descriptors at ppdu end for non zero mpdus
  5969. * enabled or disabled.
  5970. * b'10:3 - release_ring: This indicates the destination ring
  5971. * selection for the descriptor at the end of PPDU
  5972. * 0 - REO ring select
  5973. * 1 - FW ring select
  5974. * 2 - SW ring select
  5975. * 3 - Release ring select
  5976. * Refer to htt_rx_full_mon_release_ring.
  5977. * b'31:11 - reserved for future use
  5978. */
  5979. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5980. A_UINT32 msg_type:8,
  5981. pdev_id:8,
  5982. reserved0:16;
  5983. A_UINT32 full_monitor_mode_enable:1,
  5984. addnl_descs_zero_mpdus_end:1,
  5985. addnl_descs_non_zero_mpdus_end:1,
  5986. release_ring:8,
  5987. reserved1:21;
  5988. } POSTPACK;
  5989. /**
  5990. * Enumeration for full monitor mode destination ring select
  5991. * 0 - REO destination ring select
  5992. * 1 - FW destination ring select
  5993. * 2 - SW destination ring select
  5994. * 3 - Release destination ring select
  5995. */
  5996. enum htt_rx_full_mon_release_ring {
  5997. HTT_RX_MON_RING_REO,
  5998. HTT_RX_MON_RING_FW,
  5999. HTT_RX_MON_RING_SW,
  6000. HTT_RX_MON_RING_RELEASE,
  6001. };
  6002. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6003. /* DWORD 0: Pdev ID */
  6004. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6005. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6006. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6007. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6008. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6009. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6010. do { \
  6011. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6012. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6013. } while (0)
  6014. /* DWORD 1:ENABLE */
  6015. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6016. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6017. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6018. do { \
  6019. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6020. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6021. } while (0)
  6022. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6023. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6024. /* DWORD 1:ZERO_MPDU */
  6025. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6026. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6027. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6028. do { \
  6029. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6030. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6031. } while (0)
  6032. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6033. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6034. /* DWORD 1:NON_ZERO_MPDU */
  6035. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6036. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6037. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6038. do { \
  6039. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6040. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6041. } while (0)
  6042. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6043. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6044. /* DWORD 1:RELEASE_RINGS */
  6045. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6046. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6047. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6048. do { \
  6049. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6050. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6051. } while (0)
  6052. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6053. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6054. /**
  6055. * Enumeration for IP Protocol or IPSEC Protocol
  6056. * IPsec describes the framework for providing security at IP layer.
  6057. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6058. */
  6059. enum htt_rx_flow_proto {
  6060. HTT_RX_FLOW_IP_PROTO,
  6061. HTT_RX_FLOW_IPSEC_PROTO,
  6062. };
  6063. /**
  6064. * Enumeration for FSE Cache Invalidation
  6065. * 0 - No Cache Invalidation required
  6066. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6067. * 2 - Complete FSE Cache Invalidation
  6068. * 3 - FSE Disable
  6069. * 4 - FSE Enable
  6070. */
  6071. enum htt_rx_fse_operation {
  6072. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6073. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6074. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6075. HTT_RX_FSE_DISABLE,
  6076. HTT_RX_FSE_ENABLE,
  6077. };
  6078. /* DWORD 0: Pdev ID */
  6079. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6080. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6081. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6082. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6083. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6084. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6085. do { \
  6086. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6087. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6088. } while (0)
  6089. /* DWORD 1:IP PROTO or IPSEC */
  6090. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6091. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6092. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6093. do { \
  6094. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6095. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6096. } while (0)
  6097. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6098. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6099. /* DWORD 1:FSE Operation */
  6100. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6101. #define HTT_RX_FSE_OPERATION_S 1
  6102. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6103. do { \
  6104. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6105. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6106. } while (0)
  6107. #define HTT_RX_FSE_OPERATION_GET(word) \
  6108. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6109. /* DWORD 2-9:IP Address */
  6110. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6111. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6112. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6113. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6114. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6115. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6116. do { \
  6117. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6118. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6119. } while (0)
  6120. /* DWORD 10:Source Port Number */
  6121. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6122. #define HTT_RX_FSE_SOURCEPORT_S 0
  6123. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6124. do { \
  6125. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6126. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6127. } while (0)
  6128. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6129. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6130. /* DWORD 11:Destination Port Number */
  6131. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6132. #define HTT_RX_FSE_DESTPORT_S 16
  6133. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6134. do { \
  6135. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6136. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6137. } while (0)
  6138. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6139. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6140. /* DWORD 10-11:SPI (In case of IPSEC) */
  6141. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6142. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6143. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6144. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6145. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6146. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6147. do { \
  6148. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6149. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6150. } while (0)
  6151. /* DWORD 12:L4 PROTO */
  6152. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6153. #define HTT_RX_FSE_L4_PROTO_S 0
  6154. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6155. do { \
  6156. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6157. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6158. } while (0)
  6159. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6160. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6161. /**
  6162. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  6163. *
  6164. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6165. *
  6166. * |31 24|23 |15 8|7 2|1|0|
  6167. * |----------------+----------------+----------------+----------------|
  6168. * | reserved | pdev_id | msg_type |
  6169. * |---------------------------------+----------------+----------------|
  6170. * | reserved |E|F|
  6171. * |---------------------------------+----------------+----------------|
  6172. * Where E = Configure the target to provide the 3-tuple hash value in
  6173. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6174. * F = Configure the target to provide the 3-tuple hash value in
  6175. * flow_id_toeplitz field of rx_msdu_start tlv
  6176. *
  6177. * The following field definitions describe the format of the 3 tuple hash value
  6178. * message sent from the host to target as part of initialization sequence.
  6179. *
  6180. * Header fields:
  6181. * dword0 - b'7:0 - msg_type: This will be set to
  6182. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  6183. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6184. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6185. * specified pdev's LMAC ring.
  6186. * b'31:16 - reserved : Reserved for future use
  6187. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6188. * b'1 - toeplitz_hash_2_or_4_field_enable
  6189. * b'31:2 - reserved : Reserved for future use
  6190. * ---------+------+----------------------------------------------------------
  6191. * bit1 | bit0 | Functionality
  6192. * ---------+------+----------------------------------------------------------
  6193. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6194. * | | in flow_id_toeplitz field
  6195. * ---------+------+----------------------------------------------------------
  6196. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6197. * | | in toeplitz_hash_2_or_4 field
  6198. * ---------+------+----------------------------------------------------------
  6199. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6200. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6201. * ---------+------+----------------------------------------------------------
  6202. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6203. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6204. * | | toeplitz_hash_2_or_4 field
  6205. *----------------------------------------------------------------------------
  6206. */
  6207. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6208. A_UINT32 msg_type :8,
  6209. pdev_id :8,
  6210. reserved0 :16;
  6211. A_UINT32 flow_id_toeplitz_field_enable :1,
  6212. toeplitz_hash_2_or_4_field_enable :1,
  6213. reserved1 :30;
  6214. } POSTPACK;
  6215. /* DWORD0 : pdev_id configuration Macros */
  6216. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6217. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6218. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6219. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6220. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6221. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6222. do { \
  6223. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6224. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6225. } while (0)
  6226. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6227. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6228. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6229. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6230. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6231. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6232. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6235. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6236. } while (0)
  6237. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6238. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6239. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6240. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6241. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6242. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6243. do { \
  6244. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6245. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6246. } while (0)
  6247. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6248. /**
  6249. * @brief host --> target Host PA Address Size
  6250. *
  6251. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6252. *
  6253. * @details
  6254. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6255. * provide the physical start address and size of each of the memory
  6256. * areas within host DDR that the target FW may need to access.
  6257. *
  6258. * For example, the host can use this message to allow the target FW
  6259. * to set up access to the host's pools of TQM link descriptors.
  6260. * The message would appear as follows:
  6261. *
  6262. * |31 24|23 16|15 8|7 0|
  6263. * |----------------+----------------+----------------+----------------|
  6264. * | reserved | num_entries | msg_type |
  6265. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6266. * | mem area 0 size |
  6267. * |----------------+----------------+----------------+----------------|
  6268. * | mem area 0 physical_address_lo |
  6269. * |----------------+----------------+----------------+----------------|
  6270. * | mem area 0 physical_address_hi |
  6271. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6272. * | mem area 1 size |
  6273. * |----------------+----------------+----------------+----------------|
  6274. * | mem area 1 physical_address_lo |
  6275. * |----------------+----------------+----------------+----------------|
  6276. * | mem area 1 physical_address_hi |
  6277. * |----------------+----------------+----------------+----------------|
  6278. * ...
  6279. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6280. * | mem area N size |
  6281. * |----------------+----------------+----------------+----------------|
  6282. * | mem area N physical_address_lo |
  6283. * |----------------+----------------+----------------+----------------|
  6284. * | mem area N physical_address_hi |
  6285. * |----------------+----------------+----------------+----------------|
  6286. *
  6287. * The message is interpreted as follows:
  6288. * dword0 - b'0:7 - msg_type: This will be set to
  6289. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  6290. * b'8:15 - number_entries: Indicated the number of host memory
  6291. * areas specified within the remainder of the message
  6292. * b'16:31 - reserved.
  6293. * dword1 - b'0:31 - memory area 0 size in bytes
  6294. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6295. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6296. * and similar for memory area 1 through memory area N.
  6297. */
  6298. PREPACK struct htt_h2t_host_paddr_size {
  6299. A_UINT32 msg_type: 8,
  6300. num_entries: 8,
  6301. reserved: 16;
  6302. } POSTPACK;
  6303. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6304. A_UINT32 size;
  6305. A_UINT32 physical_address_lo;
  6306. A_UINT32 physical_address_hi;
  6307. } POSTPACK;
  6308. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6309. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6310. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6311. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6312. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6313. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6314. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6317. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6318. } while (0)
  6319. /*=== target -> host messages ===============================================*/
  6320. enum htt_t2h_msg_type {
  6321. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6322. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6323. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6324. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6325. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6326. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6327. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6328. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6329. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6330. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6331. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6332. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6333. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6334. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6335. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6336. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6337. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6338. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6339. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6340. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6341. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6342. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6343. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6344. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6345. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6346. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6347. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6348. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6349. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6350. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6351. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6352. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6353. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6354. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6355. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6356. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6357. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6358. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6359. /* TX_OFFLOAD_DELIVER_IND:
  6360. * Forward the target's locally-generated packets to the host,
  6361. * to provide to the monitor mode interface.
  6362. */
  6363. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6364. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6365. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6366. HTT_T2H_MSG_TYPE_TEST,
  6367. /* keep this last */
  6368. HTT_T2H_NUM_MSGS
  6369. };
  6370. /*
  6371. * HTT target to host message type -
  6372. * stored in bits 7:0 of the first word of the message
  6373. */
  6374. #define HTT_T2H_MSG_TYPE_M 0xff
  6375. #define HTT_T2H_MSG_TYPE_S 0
  6376. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6377. do { \
  6378. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6379. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6380. } while (0)
  6381. #define HTT_T2H_MSG_TYPE_GET(word) \
  6382. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6383. /**
  6384. * @brief target -> host version number confirmation message definition
  6385. *
  6386. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  6387. *
  6388. * |31 24|23 16|15 8|7 0|
  6389. * |----------------+----------------+----------------+----------------|
  6390. * | reserved | major number | minor number | msg type |
  6391. * |-------------------------------------------------------------------|
  6392. * : option request TLV (optional) |
  6393. * :...................................................................:
  6394. *
  6395. * The VER_CONF message may consist of a single 4-byte word, or may be
  6396. * extended with TLVs that specify HTT options selected by the target.
  6397. * The following option TLVs may be appended to the VER_CONF message:
  6398. * - LL_BUS_ADDR_SIZE
  6399. * - HL_SUPPRESS_TX_COMPL_IND
  6400. * - MAX_TX_QUEUE_GROUPS
  6401. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6402. * may be appended to the VER_CONF message (but only one TLV of each type).
  6403. *
  6404. * Header fields:
  6405. * - MSG_TYPE
  6406. * Bits 7:0
  6407. * Purpose: identifies this as a version number confirmation message
  6408. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  6409. * - VER_MINOR
  6410. * Bits 15:8
  6411. * Purpose: Specify the minor number of the HTT message library version
  6412. * in use by the target firmware.
  6413. * The minor number specifies the specific revision within a range
  6414. * of fundamentally compatible HTT message definition revisions.
  6415. * Compatible revisions involve adding new messages or perhaps
  6416. * adding new fields to existing messages, in a backwards-compatible
  6417. * manner.
  6418. * Incompatible revisions involve changing the message type values,
  6419. * or redefining existing messages.
  6420. * Value: minor number
  6421. * - VER_MAJOR
  6422. * Bits 15:8
  6423. * Purpose: Specify the major number of the HTT message library version
  6424. * in use by the target firmware.
  6425. * The major number specifies the family of minor revisions that are
  6426. * fundamentally compatible with each other, but not with prior or
  6427. * later families.
  6428. * Value: major number
  6429. */
  6430. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6431. #define HTT_VER_CONF_MINOR_S 8
  6432. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6433. #define HTT_VER_CONF_MAJOR_S 16
  6434. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6437. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6438. } while (0)
  6439. #define HTT_VER_CONF_MINOR_GET(word) \
  6440. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6441. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6444. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6445. } while (0)
  6446. #define HTT_VER_CONF_MAJOR_GET(word) \
  6447. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6448. #define HTT_VER_CONF_BYTES 4
  6449. /**
  6450. * @brief - target -> host HTT Rx In order indication message
  6451. *
  6452. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  6453. *
  6454. * @details
  6455. *
  6456. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6457. * |----------------+-------------------+---------------------+---------------|
  6458. * | peer ID | P| F| O| ext TID | msg type |
  6459. * |--------------------------------------------------------------------------|
  6460. * | MSDU count | Reserved | vdev id |
  6461. * |--------------------------------------------------------------------------|
  6462. * | MSDU 0 bus address (bits 31:0) |
  6463. #if HTT_PADDR64
  6464. * | MSDU 0 bus address (bits 63:32) |
  6465. #endif
  6466. * |--------------------------------------------------------------------------|
  6467. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6468. * |--------------------------------------------------------------------------|
  6469. * | MSDU 1 bus address (bits 31:0) |
  6470. #if HTT_PADDR64
  6471. * | MSDU 1 bus address (bits 63:32) |
  6472. #endif
  6473. * |--------------------------------------------------------------------------|
  6474. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6475. * |--------------------------------------------------------------------------|
  6476. */
  6477. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6478. *
  6479. * @details
  6480. * bits
  6481. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6482. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6483. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6484. * | | frag | | | | fail |chksum fail|
  6485. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6486. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6487. */
  6488. struct htt_rx_in_ord_paddr_ind_hdr_t
  6489. {
  6490. A_UINT32 /* word 0 */
  6491. msg_type: 8,
  6492. ext_tid: 5,
  6493. offload: 1,
  6494. frag: 1,
  6495. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6496. peer_id: 16;
  6497. A_UINT32 /* word 1 */
  6498. vap_id: 8,
  6499. /* NOTE:
  6500. * This reserved_1 field is not truly reserved - certain targets use
  6501. * this field internally to store debug information, and do not zero
  6502. * out the contents of the field before uploading the message to the
  6503. * host. Thus, any host-target communication supported by this field
  6504. * is limited to using values that are never used by the debug
  6505. * information stored by certain targets in the reserved_1 field.
  6506. * In particular, the targets in question don't use the value 0x3
  6507. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6508. * so this previously-unused value within these bits is available to
  6509. * use as the host / target PKT_CAPTURE_MODE flag.
  6510. */
  6511. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6512. /* if pkt_capture_mode == 0x3, host should
  6513. * send rx frames to monitor mode interface
  6514. */
  6515. msdu_cnt: 16;
  6516. };
  6517. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6518. {
  6519. A_UINT32 dma_addr;
  6520. A_UINT32
  6521. length: 16,
  6522. fw_desc: 8,
  6523. msdu_info:8;
  6524. };
  6525. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6526. {
  6527. A_UINT32 dma_addr_lo;
  6528. A_UINT32 dma_addr_hi;
  6529. A_UINT32
  6530. length: 16,
  6531. fw_desc: 8,
  6532. msdu_info:8;
  6533. };
  6534. #if HTT_PADDR64
  6535. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6536. #else
  6537. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6538. #endif
  6539. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6540. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6541. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6542. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6543. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6544. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6545. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6546. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6547. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6548. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6549. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6550. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6551. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6552. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6553. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6554. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6555. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6556. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6557. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6558. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6559. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6560. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6561. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6562. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6563. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6564. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6565. /* for systems using 64-bit format for bus addresses */
  6566. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6567. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6568. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6569. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6570. /* for systems using 32-bit format for bus addresses */
  6571. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6572. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6573. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6574. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6575. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6576. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6577. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6578. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6579. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6580. do { \
  6581. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6582. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6583. } while (0)
  6584. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6585. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6586. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6587. do { \
  6588. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6589. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6590. } while (0)
  6591. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6592. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6593. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6594. do { \
  6595. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6596. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6597. } while (0)
  6598. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6599. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6600. /*
  6601. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6602. * deliver the rx frames to the monitor mode interface.
  6603. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6604. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6605. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6606. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6607. */
  6608. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6609. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6610. do { \
  6611. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6612. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6613. } while (0)
  6614. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6615. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6616. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6617. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6618. do { \
  6619. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6620. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6621. } while (0)
  6622. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6623. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6624. /* for systems using 64-bit format for bus addresses */
  6625. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6626. do { \
  6627. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6628. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6629. } while (0)
  6630. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6631. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6632. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6633. do { \
  6634. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6635. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6636. } while (0)
  6637. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6638. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6639. /* for systems using 32-bit format for bus addresses */
  6640. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6643. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6644. } while (0)
  6645. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6646. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6647. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6648. do { \
  6649. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6650. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6651. } while (0)
  6652. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6653. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6654. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6655. do { \
  6656. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6657. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6658. } while (0)
  6659. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6660. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6661. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6664. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6665. } while (0)
  6666. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6667. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6668. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6669. do { \
  6670. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6671. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6672. } while (0)
  6673. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6674. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6675. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6676. do { \
  6677. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6678. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6679. } while (0)
  6680. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6681. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6682. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6683. do { \
  6684. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6685. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6686. } while (0)
  6687. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6688. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6689. /* definitions used within target -> host rx indication message */
  6690. PREPACK struct htt_rx_ind_hdr_prefix_t
  6691. {
  6692. A_UINT32 /* word 0 */
  6693. msg_type: 8,
  6694. ext_tid: 5,
  6695. release_valid: 1,
  6696. flush_valid: 1,
  6697. reserved0: 1,
  6698. peer_id: 16;
  6699. A_UINT32 /* word 1 */
  6700. flush_start_seq_num: 6,
  6701. flush_end_seq_num: 6,
  6702. release_start_seq_num: 6,
  6703. release_end_seq_num: 6,
  6704. num_mpdu_ranges: 8;
  6705. } POSTPACK;
  6706. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6707. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6708. #define HTT_TGT_RSSI_INVALID 0x80
  6709. PREPACK struct htt_rx_ppdu_desc_t
  6710. {
  6711. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6712. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6713. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6714. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6715. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6716. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6717. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6718. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6719. A_UINT32 /* word 0 */
  6720. rssi_cmb: 8,
  6721. timestamp_submicrosec: 8,
  6722. phy_err_code: 8,
  6723. phy_err: 1,
  6724. legacy_rate: 4,
  6725. legacy_rate_sel: 1,
  6726. end_valid: 1,
  6727. start_valid: 1;
  6728. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6729. union {
  6730. A_UINT32 /* word 1 */
  6731. rssi0_pri20: 8,
  6732. rssi0_ext20: 8,
  6733. rssi0_ext40: 8,
  6734. rssi0_ext80: 8;
  6735. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6736. } u0;
  6737. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6738. union {
  6739. A_UINT32 /* word 2 */
  6740. rssi1_pri20: 8,
  6741. rssi1_ext20: 8,
  6742. rssi1_ext40: 8,
  6743. rssi1_ext80: 8;
  6744. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6745. } u1;
  6746. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6747. union {
  6748. A_UINT32 /* word 3 */
  6749. rssi2_pri20: 8,
  6750. rssi2_ext20: 8,
  6751. rssi2_ext40: 8,
  6752. rssi2_ext80: 8;
  6753. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6754. } u2;
  6755. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6756. union {
  6757. A_UINT32 /* word 4 */
  6758. rssi3_pri20: 8,
  6759. rssi3_ext20: 8,
  6760. rssi3_ext40: 8,
  6761. rssi3_ext80: 8;
  6762. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6763. } u3;
  6764. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6765. A_UINT32 tsf32; /* word 5 */
  6766. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6767. A_UINT32 timestamp_microsec; /* word 6 */
  6768. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6769. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6770. A_UINT32 /* word 7 */
  6771. vht_sig_a1: 24,
  6772. preamble_type: 8;
  6773. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6774. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6775. A_UINT32 /* word 8 */
  6776. vht_sig_a2: 24,
  6777. /* sa_ant_matrix
  6778. * For cases where a single rx chain has options to be connected to
  6779. * different rx antennas, show which rx antennas were in use during
  6780. * receipt of a given PPDU.
  6781. * This sa_ant_matrix provides a bitmask of the antennas used while
  6782. * receiving this frame.
  6783. */
  6784. sa_ant_matrix: 8;
  6785. } POSTPACK;
  6786. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6787. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6788. PREPACK struct htt_rx_ind_hdr_suffix_t
  6789. {
  6790. A_UINT32 /* word 0 */
  6791. fw_rx_desc_bytes: 16,
  6792. reserved0: 16;
  6793. } POSTPACK;
  6794. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6795. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6796. PREPACK struct htt_rx_ind_hdr_t
  6797. {
  6798. struct htt_rx_ind_hdr_prefix_t prefix;
  6799. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6800. struct htt_rx_ind_hdr_suffix_t suffix;
  6801. } POSTPACK;
  6802. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6803. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6804. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6805. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6806. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6807. /*
  6808. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6809. * the offset into the HTT rx indication message at which the
  6810. * FW rx PPDU descriptor resides
  6811. */
  6812. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6813. /*
  6814. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6815. * the offset into the HTT rx indication message at which the
  6816. * header suffix (FW rx MSDU byte count) resides
  6817. */
  6818. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6819. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6820. /*
  6821. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6822. * the offset into the HTT rx indication message at which the per-MSDU
  6823. * information starts
  6824. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6825. * per-MSDU information portion of the message. The per-MSDU info itself
  6826. * starts at byte 12.
  6827. */
  6828. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6829. /**
  6830. * @brief target -> host rx indication message definition
  6831. *
  6832. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  6833. *
  6834. * @details
  6835. * The following field definitions describe the format of the rx indication
  6836. * message sent from the target to the host.
  6837. * The message consists of three major sections:
  6838. * 1. a fixed-length header
  6839. * 2. a variable-length list of firmware rx MSDU descriptors
  6840. * 3. one or more 4-octet MPDU range information elements
  6841. * The fixed length header itself has two sub-sections
  6842. * 1. the message meta-information, including identification of the
  6843. * sender and type of the received data, and a 4-octet flush/release IE
  6844. * 2. the firmware rx PPDU descriptor
  6845. *
  6846. * The format of the message is depicted below.
  6847. * in this depiction, the following abbreviations are used for information
  6848. * elements within the message:
  6849. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6850. * elements associated with the PPDU start are valid.
  6851. * Specifically, the following fields are valid only if SV is set:
  6852. * RSSI (all variants), L, legacy rate, preamble type, service,
  6853. * VHT-SIG-A
  6854. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6855. * elements associated with the PPDU end are valid.
  6856. * Specifically, the following fields are valid only if EV is set:
  6857. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6858. * - L - Legacy rate selector - if legacy rates are used, this flag
  6859. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6860. * (L == 0) PHY.
  6861. * - P - PHY error flag - boolean indication of whether the rx frame had
  6862. * a PHY error
  6863. *
  6864. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6865. * |----------------+-------------------+---------------------+---------------|
  6866. * | peer ID | |RV|FV| ext TID | msg type |
  6867. * |--------------------------------------------------------------------------|
  6868. * | num | release | release | flush | flush |
  6869. * | MPDU | end | start | end | start |
  6870. * | ranges | seq num | seq num | seq num | seq num |
  6871. * |==========================================================================|
  6872. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6873. * |V|V| | rate | | | timestamp | RSSI |
  6874. * |--------------------------------------------------------------------------|
  6875. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6876. * |--------------------------------------------------------------------------|
  6877. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6878. * |--------------------------------------------------------------------------|
  6879. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6880. * |--------------------------------------------------------------------------|
  6881. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6882. * |--------------------------------------------------------------------------|
  6883. * | TSF LSBs |
  6884. * |--------------------------------------------------------------------------|
  6885. * | microsec timestamp |
  6886. * |--------------------------------------------------------------------------|
  6887. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6888. * |--------------------------------------------------------------------------|
  6889. * | service | HT-SIG / VHT-SIG-A2 |
  6890. * |==========================================================================|
  6891. * | reserved | FW rx desc bytes |
  6892. * |--------------------------------------------------------------------------|
  6893. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6894. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6895. * |--------------------------------------------------------------------------|
  6896. * : : :
  6897. * |--------------------------------------------------------------------------|
  6898. * | alignment | MSDU Rx |
  6899. * | padding | desc Bn |
  6900. * |--------------------------------------------------------------------------|
  6901. * | reserved | MPDU range status | MPDU count |
  6902. * |--------------------------------------------------------------------------|
  6903. * : reserved : MPDU range status : MPDU count :
  6904. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6905. *
  6906. * Header fields:
  6907. * - MSG_TYPE
  6908. * Bits 7:0
  6909. * Purpose: identifies this as an rx indication message
  6910. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  6911. * - EXT_TID
  6912. * Bits 12:8
  6913. * Purpose: identify the traffic ID of the rx data, including
  6914. * special "extended" TID values for multicast, broadcast, and
  6915. * non-QoS data frames
  6916. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6917. * - FLUSH_VALID (FV)
  6918. * Bit 13
  6919. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6920. * is valid
  6921. * Value:
  6922. * 1 -> flush IE is valid and needs to be processed
  6923. * 0 -> flush IE is not valid and should be ignored
  6924. * - REL_VALID (RV)
  6925. * Bit 13
  6926. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6927. * is valid
  6928. * Value:
  6929. * 1 -> release IE is valid and needs to be processed
  6930. * 0 -> release IE is not valid and should be ignored
  6931. * - PEER_ID
  6932. * Bits 31:16
  6933. * Purpose: Identify, by ID, which peer sent the rx data
  6934. * Value: ID of the peer who sent the rx data
  6935. * - FLUSH_SEQ_NUM_START
  6936. * Bits 5:0
  6937. * Purpose: Indicate the start of a series of MPDUs to flush
  6938. * Not all MPDUs within this series are necessarily valid - the host
  6939. * must check each sequence number within this range to see if the
  6940. * corresponding MPDU is actually present.
  6941. * This field is only valid if the FV bit is set.
  6942. * Value:
  6943. * The sequence number for the first MPDUs to check to flush.
  6944. * The sequence number is masked by 0x3f.
  6945. * - FLUSH_SEQ_NUM_END
  6946. * Bits 11:6
  6947. * Purpose: Indicate the end of a series of MPDUs to flush
  6948. * Value:
  6949. * The sequence number one larger than the sequence number of the
  6950. * last MPDU to check to flush.
  6951. * The sequence number is masked by 0x3f.
  6952. * Not all MPDUs within this series are necessarily valid - the host
  6953. * must check each sequence number within this range to see if the
  6954. * corresponding MPDU is actually present.
  6955. * This field is only valid if the FV bit is set.
  6956. * - REL_SEQ_NUM_START
  6957. * Bits 17:12
  6958. * Purpose: Indicate the start of a series of MPDUs to release.
  6959. * All MPDUs within this series are present and valid - the host
  6960. * need not check each sequence number within this range to see if
  6961. * the corresponding MPDU is actually present.
  6962. * This field is only valid if the RV bit is set.
  6963. * Value:
  6964. * The sequence number for the first MPDUs to check to release.
  6965. * The sequence number is masked by 0x3f.
  6966. * - REL_SEQ_NUM_END
  6967. * Bits 23:18
  6968. * Purpose: Indicate the end of a series of MPDUs to release.
  6969. * Value:
  6970. * The sequence number one larger than the sequence number of the
  6971. * last MPDU to check to release.
  6972. * The sequence number is masked by 0x3f.
  6973. * All MPDUs within this series are present and valid - the host
  6974. * need not check each sequence number within this range to see if
  6975. * the corresponding MPDU is actually present.
  6976. * This field is only valid if the RV bit is set.
  6977. * - NUM_MPDU_RANGES
  6978. * Bits 31:24
  6979. * Purpose: Indicate how many ranges of MPDUs are present.
  6980. * Each MPDU range consists of a series of contiguous MPDUs within the
  6981. * rx frame sequence which all have the same MPDU status.
  6982. * Value: 1-63 (typically a small number, like 1-3)
  6983. *
  6984. * Rx PPDU descriptor fields:
  6985. * - RSSI_CMB
  6986. * Bits 7:0
  6987. * Purpose: Combined RSSI from all active rx chains, across the active
  6988. * bandwidth.
  6989. * Value: RSSI dB units w.r.t. noise floor
  6990. * - TIMESTAMP_SUBMICROSEC
  6991. * Bits 15:8
  6992. * Purpose: high-resolution timestamp
  6993. * Value:
  6994. * Sub-microsecond time of PPDU reception.
  6995. * This timestamp ranges from [0,MAC clock MHz).
  6996. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6997. * to form a high-resolution, large range rx timestamp.
  6998. * - PHY_ERR_CODE
  6999. * Bits 23:16
  7000. * Purpose:
  7001. * If the rx frame processing resulted in a PHY error, indicate what
  7002. * type of rx PHY error occurred.
  7003. * Value:
  7004. * This field is valid if the "P" (PHY_ERR) flag is set.
  7005. * TBD: document/specify the values for this field
  7006. * - PHY_ERR
  7007. * Bit 24
  7008. * Purpose: indicate whether the rx PPDU had a PHY error
  7009. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  7010. * - LEGACY_RATE
  7011. * Bits 28:25
  7012. * Purpose:
  7013. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  7014. * specify which rate was used.
  7015. * Value:
  7016. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  7017. * flag.
  7018. * If LEGACY_RATE_SEL is 0:
  7019. * 0x8: OFDM 48 Mbps
  7020. * 0x9: OFDM 24 Mbps
  7021. * 0xA: OFDM 12 Mbps
  7022. * 0xB: OFDM 6 Mbps
  7023. * 0xC: OFDM 54 Mbps
  7024. * 0xD: OFDM 36 Mbps
  7025. * 0xE: OFDM 18 Mbps
  7026. * 0xF: OFDM 9 Mbps
  7027. * If LEGACY_RATE_SEL is 1:
  7028. * 0x8: CCK 11 Mbps long preamble
  7029. * 0x9: CCK 5.5 Mbps long preamble
  7030. * 0xA: CCK 2 Mbps long preamble
  7031. * 0xB: CCK 1 Mbps long preamble
  7032. * 0xC: CCK 11 Mbps short preamble
  7033. * 0xD: CCK 5.5 Mbps short preamble
  7034. * 0xE: CCK 2 Mbps short preamble
  7035. * - LEGACY_RATE_SEL
  7036. * Bit 29
  7037. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  7038. * Value:
  7039. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  7040. * used a legacy rate.
  7041. * 0 -> OFDM, 1 -> CCK
  7042. * - END_VALID
  7043. * Bit 30
  7044. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7045. * the start of the PPDU are valid. Specifically, the following
  7046. * fields are only valid if END_VALID is set:
  7047. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  7048. * TIMESTAMP_SUBMICROSEC
  7049. * Value:
  7050. * 0 -> rx PPDU desc end fields are not valid
  7051. * 1 -> rx PPDU desc end fields are valid
  7052. * - START_VALID
  7053. * Bit 31
  7054. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  7055. * the end of the PPDU are valid. Specifically, the following
  7056. * fields are only valid if START_VALID is set:
  7057. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7058. * VHT-SIG-A
  7059. * Value:
  7060. * 0 -> rx PPDU desc start fields are not valid
  7061. * 1 -> rx PPDU desc start fields are valid
  7062. * - RSSI0_PRI20
  7063. * Bits 7:0
  7064. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7065. * Value: RSSI dB units w.r.t. noise floor
  7066. *
  7067. * - RSSI0_EXT20
  7068. * Bits 7:0
  7069. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7070. * (if the rx bandwidth was >= 40 MHz)
  7071. * Value: RSSI dB units w.r.t. noise floor
  7072. * - RSSI0_EXT40
  7073. * Bits 7:0
  7074. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7075. * (if the rx bandwidth was >= 80 MHz)
  7076. * Value: RSSI dB units w.r.t. noise floor
  7077. * - RSSI0_EXT80
  7078. * Bits 7:0
  7079. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7080. * (if the rx bandwidth was >= 160 MHz)
  7081. * Value: RSSI dB units w.r.t. noise floor
  7082. *
  7083. * - RSSI1_PRI20
  7084. * Bits 7:0
  7085. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7086. * Value: RSSI dB units w.r.t. noise floor
  7087. * - RSSI1_EXT20
  7088. * Bits 7:0
  7089. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7090. * (if the rx bandwidth was >= 40 MHz)
  7091. * Value: RSSI dB units w.r.t. noise floor
  7092. * - RSSI1_EXT40
  7093. * Bits 7:0
  7094. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7095. * (if the rx bandwidth was >= 80 MHz)
  7096. * Value: RSSI dB units w.r.t. noise floor
  7097. * - RSSI1_EXT80
  7098. * Bits 7:0
  7099. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7100. * (if the rx bandwidth was >= 160 MHz)
  7101. * Value: RSSI dB units w.r.t. noise floor
  7102. *
  7103. * - RSSI2_PRI20
  7104. * Bits 7:0
  7105. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7106. * Value: RSSI dB units w.r.t. noise floor
  7107. * - RSSI2_EXT20
  7108. * Bits 7:0
  7109. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7110. * (if the rx bandwidth was >= 40 MHz)
  7111. * Value: RSSI dB units w.r.t. noise floor
  7112. * - RSSI2_EXT40
  7113. * Bits 7:0
  7114. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7115. * (if the rx bandwidth was >= 80 MHz)
  7116. * Value: RSSI dB units w.r.t. noise floor
  7117. * - RSSI2_EXT80
  7118. * Bits 7:0
  7119. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7120. * (if the rx bandwidth was >= 160 MHz)
  7121. * Value: RSSI dB units w.r.t. noise floor
  7122. *
  7123. * - RSSI3_PRI20
  7124. * Bits 7:0
  7125. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7126. * Value: RSSI dB units w.r.t. noise floor
  7127. * - RSSI3_EXT20
  7128. * Bits 7:0
  7129. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7130. * (if the rx bandwidth was >= 40 MHz)
  7131. * Value: RSSI dB units w.r.t. noise floor
  7132. * - RSSI3_EXT40
  7133. * Bits 7:0
  7134. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7135. * (if the rx bandwidth was >= 80 MHz)
  7136. * Value: RSSI dB units w.r.t. noise floor
  7137. * - RSSI3_EXT80
  7138. * Bits 7:0
  7139. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7140. * (if the rx bandwidth was >= 160 MHz)
  7141. * Value: RSSI dB units w.r.t. noise floor
  7142. *
  7143. * - TSF32
  7144. * Bits 31:0
  7145. * Purpose: specify the time the rx PPDU was received, in TSF units
  7146. * Value: 32 LSBs of the TSF
  7147. * - TIMESTAMP_MICROSEC
  7148. * Bits 31:0
  7149. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7150. * Value: PPDU rx time, in microseconds
  7151. * - VHT_SIG_A1
  7152. * Bits 23:0
  7153. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7154. * from the rx PPDU
  7155. * Value:
  7156. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7157. * VHT-SIG-A1 data.
  7158. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7159. * first 24 bits of the HT-SIG data.
  7160. * Otherwise, this field is invalid.
  7161. * Refer to the the 802.11 protocol for the definition of the
  7162. * HT-SIG and VHT-SIG-A1 fields
  7163. * - VHT_SIG_A2
  7164. * Bits 23:0
  7165. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7166. * from the rx PPDU
  7167. * Value:
  7168. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7169. * VHT-SIG-A2 data.
  7170. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7171. * last 24 bits of the HT-SIG data.
  7172. * Otherwise, this field is invalid.
  7173. * Refer to the the 802.11 protocol for the definition of the
  7174. * HT-SIG and VHT-SIG-A2 fields
  7175. * - PREAMBLE_TYPE
  7176. * Bits 31:24
  7177. * Purpose: indicate the PHY format of the received burst
  7178. * Value:
  7179. * 0x4: Legacy (OFDM/CCK)
  7180. * 0x8: HT
  7181. * 0x9: HT with TxBF
  7182. * 0xC: VHT
  7183. * 0xD: VHT with TxBF
  7184. * - SERVICE
  7185. * Bits 31:24
  7186. * Purpose: TBD
  7187. * Value: TBD
  7188. *
  7189. * Rx MSDU descriptor fields:
  7190. * - FW_RX_DESC_BYTES
  7191. * Bits 15:0
  7192. * Purpose: Indicate how many bytes in the Rx indication are used for
  7193. * FW Rx descriptors
  7194. *
  7195. * Payload fields:
  7196. * - MPDU_COUNT
  7197. * Bits 7:0
  7198. * Purpose: Indicate how many sequential MPDUs share the same status.
  7199. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7200. * - MPDU_STATUS
  7201. * Bits 15:8
  7202. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7203. * received successfully.
  7204. * Value:
  7205. * 0x1: success
  7206. * 0x2: FCS error
  7207. * 0x3: duplicate error
  7208. * 0x4: replay error
  7209. * 0x5: invalid peer
  7210. */
  7211. /* header fields */
  7212. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7213. #define HTT_RX_IND_EXT_TID_S 8
  7214. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7215. #define HTT_RX_IND_FLUSH_VALID_S 13
  7216. #define HTT_RX_IND_REL_VALID_M 0x4000
  7217. #define HTT_RX_IND_REL_VALID_S 14
  7218. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7219. #define HTT_RX_IND_PEER_ID_S 16
  7220. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7221. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7222. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7223. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7224. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7225. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7226. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7227. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7228. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7229. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7230. /* rx PPDU descriptor fields */
  7231. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7232. #define HTT_RX_IND_RSSI_CMB_S 0
  7233. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7234. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7235. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7236. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7237. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7238. #define HTT_RX_IND_PHY_ERR_S 24
  7239. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7240. #define HTT_RX_IND_LEGACY_RATE_S 25
  7241. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7242. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7243. #define HTT_RX_IND_END_VALID_M 0x40000000
  7244. #define HTT_RX_IND_END_VALID_S 30
  7245. #define HTT_RX_IND_START_VALID_M 0x80000000
  7246. #define HTT_RX_IND_START_VALID_S 31
  7247. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7248. #define HTT_RX_IND_RSSI_PRI20_S 0
  7249. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7250. #define HTT_RX_IND_RSSI_EXT20_S 8
  7251. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7252. #define HTT_RX_IND_RSSI_EXT40_S 16
  7253. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7254. #define HTT_RX_IND_RSSI_EXT80_S 24
  7255. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7256. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7257. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7258. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7259. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7260. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7261. #define HTT_RX_IND_SERVICE_M 0xff000000
  7262. #define HTT_RX_IND_SERVICE_S 24
  7263. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7264. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7265. /* rx MSDU descriptor fields */
  7266. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7267. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7268. /* payload fields */
  7269. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7270. #define HTT_RX_IND_MPDU_COUNT_S 0
  7271. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7272. #define HTT_RX_IND_MPDU_STATUS_S 8
  7273. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7276. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7277. } while (0)
  7278. #define HTT_RX_IND_EXT_TID_GET(word) \
  7279. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7280. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7281. do { \
  7282. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7283. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7284. } while (0)
  7285. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7286. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7287. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7290. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7291. } while (0)
  7292. #define HTT_RX_IND_REL_VALID_GET(word) \
  7293. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7294. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7295. do { \
  7296. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7297. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7298. } while (0)
  7299. #define HTT_RX_IND_PEER_ID_GET(word) \
  7300. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7301. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7302. do { \
  7303. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7304. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7305. } while (0)
  7306. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7307. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7308. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7309. do { \
  7310. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7311. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7312. } while (0)
  7313. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7314. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7315. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7316. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7317. do { \
  7318. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7319. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7320. } while (0)
  7321. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7322. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7323. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7324. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7325. do { \
  7326. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7327. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7328. } while (0)
  7329. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7330. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7331. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7332. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7333. do { \
  7334. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7335. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7336. } while (0)
  7337. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7338. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7339. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7340. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7343. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7344. } while (0)
  7345. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7346. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7347. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7348. /* FW rx PPDU descriptor fields */
  7349. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7352. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7353. } while (0)
  7354. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7355. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7356. HTT_RX_IND_RSSI_CMB_S)
  7357. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7358. do { \
  7359. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7360. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7361. } while (0)
  7362. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7363. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7364. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7365. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7368. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7369. } while (0)
  7370. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7371. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7372. HTT_RX_IND_PHY_ERR_CODE_S)
  7373. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7376. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7377. } while (0)
  7378. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7379. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7380. HTT_RX_IND_PHY_ERR_S)
  7381. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7382. do { \
  7383. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7384. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7385. } while (0)
  7386. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7387. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7388. HTT_RX_IND_LEGACY_RATE_S)
  7389. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7390. do { \
  7391. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7392. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7393. } while (0)
  7394. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7395. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7396. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7397. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7398. do { \
  7399. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7400. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7401. } while (0)
  7402. #define HTT_RX_IND_END_VALID_GET(word) \
  7403. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7404. HTT_RX_IND_END_VALID_S)
  7405. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7406. do { \
  7407. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7408. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7409. } while (0)
  7410. #define HTT_RX_IND_START_VALID_GET(word) \
  7411. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7412. HTT_RX_IND_START_VALID_S)
  7413. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7416. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7417. } while (0)
  7418. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7419. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7420. HTT_RX_IND_RSSI_PRI20_S)
  7421. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7422. do { \
  7423. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7424. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7425. } while (0)
  7426. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7427. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7428. HTT_RX_IND_RSSI_EXT20_S)
  7429. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7430. do { \
  7431. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7432. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7433. } while (0)
  7434. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7435. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7436. HTT_RX_IND_RSSI_EXT40_S)
  7437. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7438. do { \
  7439. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7440. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7441. } while (0)
  7442. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7443. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7444. HTT_RX_IND_RSSI_EXT80_S)
  7445. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7446. do { \
  7447. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7448. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7449. } while (0)
  7450. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7451. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7452. HTT_RX_IND_VHT_SIG_A1_S)
  7453. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7454. do { \
  7455. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7456. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7457. } while (0)
  7458. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7459. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7460. HTT_RX_IND_VHT_SIG_A2_S)
  7461. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7462. do { \
  7463. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7464. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7465. } while (0)
  7466. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7467. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7468. HTT_RX_IND_PREAMBLE_TYPE_S)
  7469. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7470. do { \
  7471. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7472. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7473. } while (0)
  7474. #define HTT_RX_IND_SERVICE_GET(word) \
  7475. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7476. HTT_RX_IND_SERVICE_S)
  7477. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7478. do { \
  7479. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7480. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7481. } while (0)
  7482. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7483. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7484. HTT_RX_IND_SA_ANT_MATRIX_S)
  7485. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7486. do { \
  7487. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7488. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7489. } while (0)
  7490. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7491. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7492. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7493. do { \
  7494. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7495. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7496. } while (0)
  7497. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7498. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7499. #define HTT_RX_IND_HL_BYTES \
  7500. (HTT_RX_IND_HDR_BYTES + \
  7501. 4 /* single FW rx MSDU descriptor */ + \
  7502. 4 /* single MPDU range information element */)
  7503. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7504. /* Could we use one macro entry? */
  7505. #define HTT_WORD_SET(word, field, value) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(field, value); \
  7508. (word) |= ((value) << field ## _S); \
  7509. } while (0)
  7510. #define HTT_WORD_GET(word, field) \
  7511. (((word) & field ## _M) >> field ## _S)
  7512. PREPACK struct hl_htt_rx_ind_base {
  7513. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7514. } POSTPACK;
  7515. /*
  7516. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7517. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7518. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7519. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7520. * htt_rx_ind_hl_rx_desc_t.
  7521. */
  7522. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7523. struct htt_rx_ind_hl_rx_desc_t {
  7524. A_UINT8 ver;
  7525. A_UINT8 len;
  7526. struct {
  7527. A_UINT8
  7528. first_msdu: 1,
  7529. last_msdu: 1,
  7530. c3_failed: 1,
  7531. c4_failed: 1,
  7532. ipv6: 1,
  7533. tcp: 1,
  7534. udp: 1,
  7535. reserved: 1;
  7536. } flags;
  7537. /* NOTE: no reserved space - don't append any new fields here */
  7538. };
  7539. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7540. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7541. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7542. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7543. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7544. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7545. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7546. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7547. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7548. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7549. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7550. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7551. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7552. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7553. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7554. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7555. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7556. /* This structure is used in HL, the basic descriptor information
  7557. * used by host. the structure is translated by FW from HW desc
  7558. * or generated by FW. But in HL monitor mode, the host would use
  7559. * the same structure with LL.
  7560. */
  7561. PREPACK struct hl_htt_rx_desc_base {
  7562. A_UINT32
  7563. seq_num:12,
  7564. encrypted:1,
  7565. chan_info_present:1,
  7566. resv0:2,
  7567. mcast_bcast:1,
  7568. fragment:1,
  7569. key_id_oct:8,
  7570. resv1:6;
  7571. A_UINT32
  7572. pn_31_0;
  7573. union {
  7574. struct {
  7575. A_UINT16 pn_47_32;
  7576. A_UINT16 pn_63_48;
  7577. } pn16;
  7578. A_UINT32 pn_63_32;
  7579. } u0;
  7580. A_UINT32
  7581. pn_95_64;
  7582. A_UINT32
  7583. pn_127_96;
  7584. } POSTPACK;
  7585. /*
  7586. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7587. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7588. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7589. * Please see htt_chan_change_t for description of the fields.
  7590. */
  7591. PREPACK struct htt_chan_info_t
  7592. {
  7593. A_UINT32 primary_chan_center_freq_mhz: 16,
  7594. contig_chan1_center_freq_mhz: 16;
  7595. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7596. phy_mode: 8,
  7597. reserved: 8;
  7598. } POSTPACK;
  7599. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7600. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7601. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7602. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7603. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7604. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7605. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7606. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7607. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7608. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7609. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7610. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7611. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7612. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7613. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7614. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7615. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7616. /* Channel information */
  7617. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7618. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7619. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7620. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7621. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7622. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7623. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7624. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7625. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7626. do { \
  7627. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7628. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7629. } while (0)
  7630. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7631. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7632. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7633. do { \
  7634. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7635. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7636. } while (0)
  7637. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7638. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7639. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7640. do { \
  7641. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7642. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7643. } while (0)
  7644. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7645. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7646. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7647. do { \
  7648. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7649. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7650. } while (0)
  7651. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7652. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7653. /*
  7654. * @brief target -> host message definition for FW offloaded pkts
  7655. *
  7656. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7657. *
  7658. * @details
  7659. * The following field definitions describe the format of the firmware
  7660. * offload deliver message sent from the target to the host.
  7661. *
  7662. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7663. *
  7664. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7665. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7666. * | reserved_1 | msg type |
  7667. * |--------------------------------------------------------------------------|
  7668. * | phy_timestamp_l32 |
  7669. * |--------------------------------------------------------------------------|
  7670. * | WORD2 (see below) |
  7671. * |--------------------------------------------------------------------------|
  7672. * | seqno | framectrl |
  7673. * |--------------------------------------------------------------------------|
  7674. * | reserved_3 | vdev_id | tid_num|
  7675. * |--------------------------------------------------------------------------|
  7676. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7677. * |--------------------------------------------------------------------------|
  7678. *
  7679. * where:
  7680. * STAT = status
  7681. * F = format (802.3 vs. 802.11)
  7682. *
  7683. * definition for word 2
  7684. *
  7685. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7686. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7687. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7688. * |--------------------------------------------------------------------------|
  7689. *
  7690. * where:
  7691. * PR = preamble
  7692. * BF = beamformed
  7693. */
  7694. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7695. {
  7696. A_UINT32 /* word 0 */
  7697. msg_type:8, /* [ 7: 0] */
  7698. reserved_1:24; /* [31: 8] */
  7699. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7700. A_UINT32 /* word 2 */
  7701. /* preamble:
  7702. * 0-OFDM,
  7703. * 1-CCk,
  7704. * 2-HT,
  7705. * 3-VHT
  7706. */
  7707. preamble: 2, /* [1:0] */
  7708. /* mcs:
  7709. * In case of HT preamble interpret
  7710. * MCS along with NSS.
  7711. * Valid values for HT are 0 to 7.
  7712. * HT mcs 0 with NSS 2 is mcs 8.
  7713. * Valid values for VHT are 0 to 9.
  7714. */
  7715. mcs: 4, /* [5:2] */
  7716. /* rate:
  7717. * This is applicable only for
  7718. * CCK and OFDM preamble type
  7719. * rate 0: OFDM 48 Mbps,
  7720. * 1: OFDM 24 Mbps,
  7721. * 2: OFDM 12 Mbps
  7722. * 3: OFDM 6 Mbps
  7723. * 4: OFDM 54 Mbps
  7724. * 5: OFDM 36 Mbps
  7725. * 6: OFDM 18 Mbps
  7726. * 7: OFDM 9 Mbps
  7727. * rate 0: CCK 11 Mbps Long
  7728. * 1: CCK 5.5 Mbps Long
  7729. * 2: CCK 2 Mbps Long
  7730. * 3: CCK 1 Mbps Long
  7731. * 4: CCK 11 Mbps Short
  7732. * 5: CCK 5.5 Mbps Short
  7733. * 6: CCK 2 Mbps Short
  7734. */
  7735. rate : 3, /* [ 8: 6] */
  7736. rssi : 8, /* [16: 9] units=dBm */
  7737. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7738. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7739. stbc : 1, /* [22] */
  7740. sgi : 1, /* [23] */
  7741. ldpc : 1, /* [24] */
  7742. beamformed: 1, /* [25] */
  7743. reserved_2: 6; /* [31:26] */
  7744. A_UINT32 /* word 3 */
  7745. framectrl:16, /* [15: 0] */
  7746. seqno:16; /* [31:16] */
  7747. A_UINT32 /* word 4 */
  7748. tid_num:5, /* [ 4: 0] actual TID number */
  7749. vdev_id:8, /* [12: 5] */
  7750. reserved_3:19; /* [31:13] */
  7751. A_UINT32 /* word 5 */
  7752. /* status:
  7753. * 0: tx_ok
  7754. * 1: retry
  7755. * 2: drop
  7756. * 3: filtered
  7757. * 4: abort
  7758. * 5: tid delete
  7759. * 6: sw abort
  7760. * 7: dropped by peer migration
  7761. */
  7762. status:3, /* [2:0] */
  7763. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7764. tx_mpdu_bytes:16, /* [19:4] */
  7765. /* Indicates retry count of offloaded/local generated Data tx frames */
  7766. tx_retry_cnt:6, /* [25:20] */
  7767. reserved_4:6; /* [31:26] */
  7768. } POSTPACK;
  7769. /* FW offload deliver ind message header fields */
  7770. /* DWORD one */
  7771. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7772. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7773. /* DWORD two */
  7774. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7775. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7776. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7777. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7778. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7779. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7780. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7781. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7782. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7783. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7784. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7785. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7786. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7787. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7788. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7789. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7790. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7791. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7792. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7793. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7794. /* DWORD three*/
  7795. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7796. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7797. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7798. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7799. /* DWORD four */
  7800. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7801. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7802. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7803. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7804. /* DWORD five */
  7805. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7806. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7807. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7808. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7809. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7810. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7811. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7812. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7813. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7814. do { \
  7815. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7816. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7817. } while (0)
  7818. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7819. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7820. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7821. do { \
  7822. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7823. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7824. } while (0)
  7825. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7826. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7827. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7828. do { \
  7829. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7830. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7831. } while (0)
  7832. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7833. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7834. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7835. do { \
  7836. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7837. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7838. } while (0)
  7839. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7840. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7841. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7842. do { \
  7843. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7844. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7845. } while (0)
  7846. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7847. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7848. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7849. do { \
  7850. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7851. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7852. } while (0)
  7853. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7854. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7855. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7856. do { \
  7857. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7858. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7859. } while (0)
  7860. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7861. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7862. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7863. do { \
  7864. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7865. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7866. } while (0)
  7867. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7868. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7869. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7870. do { \
  7871. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7872. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7873. } while (0)
  7874. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7875. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7876. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7877. do { \
  7878. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7879. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7880. } while (0)
  7881. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7882. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7883. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7886. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7887. } while (0)
  7888. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7889. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7890. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7893. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7894. } while (0)
  7895. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7896. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7897. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7900. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7901. } while (0)
  7902. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7903. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7904. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7905. do { \
  7906. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7907. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7908. } while (0)
  7909. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7910. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7911. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7914. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7915. } while (0)
  7916. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7917. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7918. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7921. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7922. } while (0)
  7923. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7924. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7925. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7926. do { \
  7927. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7928. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7929. } while (0)
  7930. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7931. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7932. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7933. do { \
  7934. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7935. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7936. } while (0)
  7937. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7938. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7939. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7942. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7943. } while (0)
  7944. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7945. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7946. /*
  7947. * @brief target -> host rx reorder flush message definition
  7948. *
  7949. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  7950. *
  7951. * @details
  7952. * The following field definitions describe the format of the rx flush
  7953. * message sent from the target to the host.
  7954. * The message consists of a 4-octet header, followed by one or more
  7955. * 4-octet payload information elements.
  7956. *
  7957. * |31 24|23 8|7 0|
  7958. * |--------------------------------------------------------------|
  7959. * | TID | peer ID | msg type |
  7960. * |--------------------------------------------------------------|
  7961. * | seq num end | seq num start | MPDU status | reserved |
  7962. * |--------------------------------------------------------------|
  7963. * First DWORD:
  7964. * - MSG_TYPE
  7965. * Bits 7:0
  7966. * Purpose: identifies this as an rx flush message
  7967. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  7968. * - PEER_ID
  7969. * Bits 23:8 (only bits 18:8 actually used)
  7970. * Purpose: identify which peer's rx data is being flushed
  7971. * Value: (rx) peer ID
  7972. * - TID
  7973. * Bits 31:24 (only bits 27:24 actually used)
  7974. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7975. * Value: traffic identifier
  7976. * Second DWORD:
  7977. * - MPDU_STATUS
  7978. * Bits 15:8
  7979. * Purpose:
  7980. * Indicate whether the flushed MPDUs should be discarded or processed.
  7981. * Value:
  7982. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7983. * stages of rx processing
  7984. * other: discard the MPDUs
  7985. * It is anticipated that flush messages will always have
  7986. * MPDU status == 1, but the status flag is included for
  7987. * flexibility.
  7988. * - SEQ_NUM_START
  7989. * Bits 23:16
  7990. * Purpose:
  7991. * Indicate the start of a series of consecutive MPDUs being flushed.
  7992. * Not all MPDUs within this range are necessarily valid - the host
  7993. * must check each sequence number within this range to see if the
  7994. * corresponding MPDU is actually present.
  7995. * Value:
  7996. * The sequence number for the first MPDU in the sequence.
  7997. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7998. * - SEQ_NUM_END
  7999. * Bits 30:24
  8000. * Purpose:
  8001. * Indicate the end of a series of consecutive MPDUs being flushed.
  8002. * Value:
  8003. * The sequence number one larger than the sequence number of the
  8004. * last MPDU being flushed.
  8005. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8006. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  8007. * are to be released for further rx processing.
  8008. * Not all MPDUs within this range are necessarily valid - the host
  8009. * must check each sequence number within this range to see if the
  8010. * corresponding MPDU is actually present.
  8011. */
  8012. /* first DWORD */
  8013. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  8014. #define HTT_RX_FLUSH_PEER_ID_S 8
  8015. #define HTT_RX_FLUSH_TID_M 0xff000000
  8016. #define HTT_RX_FLUSH_TID_S 24
  8017. /* second DWORD */
  8018. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  8019. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  8020. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  8021. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  8022. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  8023. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  8024. #define HTT_RX_FLUSH_BYTES 8
  8025. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  8026. do { \
  8027. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  8028. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  8029. } while (0)
  8030. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  8031. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  8032. #define HTT_RX_FLUSH_TID_SET(word, value) \
  8033. do { \
  8034. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  8035. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  8036. } while (0)
  8037. #define HTT_RX_FLUSH_TID_GET(word) \
  8038. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  8039. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  8040. do { \
  8041. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  8042. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  8043. } while (0)
  8044. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  8045. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  8046. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  8047. do { \
  8048. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  8049. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  8050. } while (0)
  8051. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  8052. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  8053. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  8054. do { \
  8055. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  8056. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  8057. } while (0)
  8058. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  8059. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  8060. /*
  8061. * @brief target -> host rx pn check indication message
  8062. *
  8063. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  8064. *
  8065. * @details
  8066. * The following field definitions describe the format of the Rx PN check
  8067. * indication message sent from the target to the host.
  8068. * The message consists of a 4-octet header, followed by the start and
  8069. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8070. * IE is one octet containing the sequence number that failed the PN
  8071. * check.
  8072. *
  8073. * |31 24|23 8|7 0|
  8074. * |--------------------------------------------------------------|
  8075. * | TID | peer ID | msg type |
  8076. * |--------------------------------------------------------------|
  8077. * | Reserved | PN IE count | seq num end | seq num start|
  8078. * |--------------------------------------------------------------|
  8079. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8080. * |--------------------------------------------------------------|
  8081. * First DWORD:
  8082. * - MSG_TYPE
  8083. * Bits 7:0
  8084. * Purpose: Identifies this as an rx pn check indication message
  8085. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  8086. * - PEER_ID
  8087. * Bits 23:8 (only bits 18:8 actually used)
  8088. * Purpose: identify which peer
  8089. * Value: (rx) peer ID
  8090. * - TID
  8091. * Bits 31:24 (only bits 27:24 actually used)
  8092. * Purpose: identify traffic identifier
  8093. * Value: traffic identifier
  8094. * Second DWORD:
  8095. * - SEQ_NUM_START
  8096. * Bits 7:0
  8097. * Purpose:
  8098. * Indicates the starting sequence number of the MPDU in this
  8099. * series of MPDUs that went though PN check.
  8100. * Value:
  8101. * The sequence number for the first MPDU in the sequence.
  8102. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8103. * - SEQ_NUM_END
  8104. * Bits 15:8
  8105. * Purpose:
  8106. * Indicates the ending sequence number of the MPDU in this
  8107. * series of MPDUs that went though PN check.
  8108. * Value:
  8109. * The sequence number one larger then the sequence number of the last
  8110. * MPDU being flushed.
  8111. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8112. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8113. * for invalid PN numbers and are ready to be released for further processing.
  8114. * Not all MPDUs within this range are necessarily valid - the host
  8115. * must check each sequence number within this range to see if the
  8116. * corresponding MPDU is actually present.
  8117. * - PN_IE_COUNT
  8118. * Bits 23:16
  8119. * Purpose:
  8120. * Used to determine the variable number of PN information elements in this
  8121. * message
  8122. *
  8123. * PN information elements:
  8124. * - PN_IE_x-
  8125. * Purpose:
  8126. * Each PN information element contains the sequence number of the MPDU that
  8127. * has failed the target PN check.
  8128. * Value:
  8129. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8130. * that failed the PN check.
  8131. */
  8132. /* first DWORD */
  8133. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8134. #define HTT_RX_PN_IND_PEER_ID_S 8
  8135. #define HTT_RX_PN_IND_TID_M 0xff000000
  8136. #define HTT_RX_PN_IND_TID_S 24
  8137. /* second DWORD */
  8138. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8139. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8140. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8141. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8142. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8143. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8144. #define HTT_RX_PN_IND_BYTES 8
  8145. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8146. do { \
  8147. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8148. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8149. } while (0)
  8150. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8151. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8152. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8153. do { \
  8154. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8155. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8156. } while (0)
  8157. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8158. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8159. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8160. do { \
  8161. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8162. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8163. } while (0)
  8164. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8165. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8166. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8167. do { \
  8168. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8169. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8170. } while (0)
  8171. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8172. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8173. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8174. do { \
  8175. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8176. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8177. } while (0)
  8178. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8179. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8180. /*
  8181. * @brief target -> host rx offload deliver message for LL system
  8182. *
  8183. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  8184. *
  8185. * @details
  8186. * In a low latency system this message is sent whenever the offload
  8187. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8188. * The DMA of the actual packets into host memory is done before sending out
  8189. * this message. This message indicates only how many MSDUs to reap. The
  8190. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8191. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8192. * DMA'd by the MAC directly into host memory these packets do not contain
  8193. * the MAC descriptors in the header portion of the packet. Instead they contain
  8194. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8195. * message, the packets are delivered directly to the NW stack without going
  8196. * through the regular reorder buffering and PN checking path since it has
  8197. * already been done in target.
  8198. *
  8199. * |31 24|23 16|15 8|7 0|
  8200. * |-----------------------------------------------------------------------|
  8201. * | Total MSDU count | reserved | msg type |
  8202. * |-----------------------------------------------------------------------|
  8203. *
  8204. * @brief target -> host rx offload deliver message for HL system
  8205. *
  8206. * @details
  8207. * In a high latency system this message is sent whenever the offload manager
  8208. * flushes out the packets it has coalesced in its coalescing buffer. The
  8209. * actual packets are also carried along with this message. When the host
  8210. * receives this message, it is expected to deliver these packets to the NW
  8211. * stack directly instead of routing them through the reorder buffering and
  8212. * PN checking path since it has already been done in target.
  8213. *
  8214. * |31 24|23 16|15 8|7 0|
  8215. * |-----------------------------------------------------------------------|
  8216. * | Total MSDU count | reserved | msg type |
  8217. * |-----------------------------------------------------------------------|
  8218. * | peer ID | MSDU length |
  8219. * |-----------------------------------------------------------------------|
  8220. * | MSDU payload | FW Desc | tid | vdev ID |
  8221. * |-----------------------------------------------------------------------|
  8222. * | MSDU payload contd. |
  8223. * |-----------------------------------------------------------------------|
  8224. * | peer ID | MSDU length |
  8225. * |-----------------------------------------------------------------------|
  8226. * | MSDU payload | FW Desc | tid | vdev ID |
  8227. * |-----------------------------------------------------------------------|
  8228. * | MSDU payload contd. |
  8229. * |-----------------------------------------------------------------------|
  8230. *
  8231. */
  8232. /* first DWORD */
  8233. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8234. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8235. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8236. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8237. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8238. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8239. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8240. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8241. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8242. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8243. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8244. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8245. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8246. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8247. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8248. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8249. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8250. do { \
  8251. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8252. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8253. } while (0)
  8254. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8255. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8256. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8257. do { \
  8258. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8259. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8260. } while (0)
  8261. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8262. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8263. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8264. do { \
  8265. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8266. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8267. } while (0)
  8268. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8269. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8270. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8271. do { \
  8272. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8273. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8274. } while (0)
  8275. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8276. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8277. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8280. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8281. } while (0)
  8282. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8283. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8284. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8285. do { \
  8286. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8287. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8288. } while (0)
  8289. /**
  8290. * @brief target -> host rx peer map/unmap message definition
  8291. *
  8292. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  8293. *
  8294. * @details
  8295. * The following diagram shows the format of the rx peer map message sent
  8296. * from the target to the host. This layout assumes the target operates
  8297. * as little-endian.
  8298. *
  8299. * This message always contains a SW peer ID. The main purpose of the
  8300. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8301. * with, so that the host can use that peer ID to determine which peer
  8302. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8303. * other purposes, such as identifying during tx completions which peer
  8304. * the tx frames in question were transmitted to.
  8305. *
  8306. * In certain generations of chips, the peer map message also contains
  8307. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8308. * to identify which peer the frame needs to be forwarded to (i.e. the
  8309. * peer assocated with the Destination MAC Address within the packet),
  8310. * and particularly which vdev needs to transmit the frame (for cases
  8311. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8312. * meaning as AST_INDEX_0.
  8313. * This DA-based peer ID that is provided for certain rx frames
  8314. * (the rx frames that need to be re-transmitted as tx frames)
  8315. * is the ID that the HW uses for referring to the peer in question,
  8316. * rather than the peer ID that the SW+FW use to refer to the peer.
  8317. *
  8318. *
  8319. * |31 24|23 16|15 8|7 0|
  8320. * |-----------------------------------------------------------------------|
  8321. * | SW peer ID | VDEV ID | msg type |
  8322. * |-----------------------------------------------------------------------|
  8323. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8324. * |-----------------------------------------------------------------------|
  8325. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8326. * |-----------------------------------------------------------------------|
  8327. *
  8328. *
  8329. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  8330. *
  8331. * The following diagram shows the format of the rx peer unmap message sent
  8332. * from the target to the host.
  8333. *
  8334. * |31 24|23 16|15 8|7 0|
  8335. * |-----------------------------------------------------------------------|
  8336. * | SW peer ID | VDEV ID | msg type |
  8337. * |-----------------------------------------------------------------------|
  8338. *
  8339. * The following field definitions describe the format of the rx peer map
  8340. * and peer unmap messages sent from the target to the host.
  8341. * - MSG_TYPE
  8342. * Bits 7:0
  8343. * Purpose: identifies this as an rx peer map or peer unmap message
  8344. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  8345. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  8346. * - VDEV_ID
  8347. * Bits 15:8
  8348. * Purpose: Indicates which virtual device the peer is associated
  8349. * with.
  8350. * Value: vdev ID (used in the host to look up the vdev object)
  8351. * - PEER_ID (a.k.a. SW_PEER_ID)
  8352. * Bits 31:16
  8353. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8354. * freeing (unmap)
  8355. * Value: (rx) peer ID
  8356. * - MAC_ADDR_L32 (peer map only)
  8357. * Bits 31:0
  8358. * Purpose: Identifies which peer node the peer ID is for.
  8359. * Value: lower 4 bytes of peer node's MAC address
  8360. * - MAC_ADDR_U16 (peer map only)
  8361. * Bits 15:0
  8362. * Purpose: Identifies which peer node the peer ID is for.
  8363. * Value: upper 2 bytes of peer node's MAC address
  8364. * - HW_PEER_ID
  8365. * Bits 31:16
  8366. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8367. * address, so for rx frames marked for rx --> tx forwarding, the
  8368. * host can determine from the HW peer ID provided as meta-data with
  8369. * the rx frame which peer the frame is supposed to be forwarded to.
  8370. * Value: ID used by the MAC HW to identify the peer
  8371. */
  8372. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8373. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8374. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8375. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8376. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8377. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8378. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8379. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8380. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8381. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8382. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8383. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8384. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8385. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8386. do { \
  8387. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8388. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8389. } while (0)
  8390. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8391. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8392. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8393. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8394. do { \
  8395. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8396. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8397. } while (0)
  8398. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8399. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8400. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8401. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8402. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8403. do { \
  8404. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8405. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8406. } while (0)
  8407. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8408. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8409. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8410. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8411. #define HTT_RX_PEER_MAP_BYTES 12
  8412. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8413. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8414. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8415. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8416. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8417. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8418. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8419. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8420. #define HTT_RX_PEER_UNMAP_BYTES 4
  8421. /**
  8422. * @brief target -> host rx peer map V2 message definition
  8423. *
  8424. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  8425. *
  8426. * @details
  8427. * The following diagram shows the format of the rx peer map v2 message sent
  8428. * from the target to the host. This layout assumes the target operates
  8429. * as little-endian.
  8430. *
  8431. * This message always contains a SW peer ID. The main purpose of the
  8432. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8433. * with, so that the host can use that peer ID to determine which peer
  8434. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8435. * other purposes, such as identifying during tx completions which peer
  8436. * the tx frames in question were transmitted to.
  8437. *
  8438. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8439. * is used during rx --> tx frame forwarding to identify which peer the
  8440. * frame needs to be forwarded to (i.e. the peer assocated with the
  8441. * Destination MAC Address within the packet), and particularly which vdev
  8442. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8443. * This DA-based peer ID that is provided for certain rx frames
  8444. * (the rx frames that need to be re-transmitted as tx frames)
  8445. * is the ID that the HW uses for referring to the peer in question,
  8446. * rather than the peer ID that the SW+FW use to refer to the peer.
  8447. *
  8448. * The HW peer id here is the same meaning as AST_INDEX_0.
  8449. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8450. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8451. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8452. * AST is valid.
  8453. *
  8454. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8455. * |-------------------------------------------------------------------------|
  8456. * | SW peer ID | VDEV ID | msg type |
  8457. * |-------------------------------------------------------------------------|
  8458. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8459. * |-------------------------------------------------------------------------|
  8460. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8461. * |-------------------------------------------------------------------------|
  8462. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8463. * |-------------------------------------------------------------------------|
  8464. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8465. * |-------------------------------------------------------------------------|
  8466. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8467. * |-------------------------------------------------------------------------|
  8468. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8469. * |-------------------------------------------------------------------------|
  8470. * | Reserved_2 |
  8471. * |-------------------------------------------------------------------------|
  8472. * Where:
  8473. * NH = Next Hop
  8474. * ASTVM = AST valid mask
  8475. * OA = on-chip AST valid bit
  8476. * ASTFM = AST flow mask
  8477. *
  8478. * The following field definitions describe the format of the rx peer map v2
  8479. * messages sent from the target to the host.
  8480. * - MSG_TYPE
  8481. * Bits 7:0
  8482. * Purpose: identifies this as an rx peer map v2 message
  8483. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  8484. * - VDEV_ID
  8485. * Bits 15:8
  8486. * Purpose: Indicates which virtual device the peer is associated with.
  8487. * Value: vdev ID (used in the host to look up the vdev object)
  8488. * - SW_PEER_ID
  8489. * Bits 31:16
  8490. * Purpose: The peer ID (index) that WAL is allocating
  8491. * Value: (rx) peer ID
  8492. * - MAC_ADDR_L32
  8493. * Bits 31:0
  8494. * Purpose: Identifies which peer node the peer ID is for.
  8495. * Value: lower 4 bytes of peer node's MAC address
  8496. * - MAC_ADDR_U16
  8497. * Bits 15:0
  8498. * Purpose: Identifies which peer node the peer ID is for.
  8499. * Value: upper 2 bytes of peer node's MAC address
  8500. * - HW_PEER_ID / AST_INDEX_0
  8501. * Bits 31:16
  8502. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8503. * address, so for rx frames marked for rx --> tx forwarding, the
  8504. * host can determine from the HW peer ID provided as meta-data with
  8505. * the rx frame which peer the frame is supposed to be forwarded to.
  8506. * Value: ID used by the MAC HW to identify the peer
  8507. * - AST_HASH_VALUE
  8508. * Bits 15:0
  8509. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8510. * override feature.
  8511. * - NEXT_HOP
  8512. * Bit 16
  8513. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8514. * (Wireless Distribution System).
  8515. * - AST_VALID_MASK
  8516. * Bits 19:17
  8517. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8518. * - ONCHIP_AST_VALID_FLAG
  8519. * Bit 20
  8520. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8521. * is valid.
  8522. * - AST_INDEX_1
  8523. * Bits 15:0
  8524. * Purpose: indicate the second AST index for this peer
  8525. * - AST_0_FLOW_MASK
  8526. * Bits 19:16
  8527. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8528. * - AST_1_FLOW_MASK
  8529. * Bits 23:20
  8530. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8531. * - AST_2_FLOW_MASK
  8532. * Bits 27:24
  8533. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8534. * - AST_3_FLOW_MASK
  8535. * Bits 31:28
  8536. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8537. * - AST_INDEX_2
  8538. * Bits 15:0
  8539. * Purpose: indicate the third AST index for this peer
  8540. * - TID_VALID_HI_PRI
  8541. * Bits 23:16
  8542. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8543. * - TID_VALID_LOW_PRI
  8544. * Bits 31:24
  8545. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8546. * - AST_INDEX_3
  8547. * Bits 15:0
  8548. * Purpose: indicate the fourth AST index for this peer
  8549. * - ONCHIP_AST_IDX / RESERVED
  8550. * Bits 31:16
  8551. * Purpose: This field is valid only when split AST feature is enabled.
  8552. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8553. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8554. * address, this ast_idx is used for LMAC modules for RXPCU.
  8555. * Value: ID used by the LMAC HW to identify the peer
  8556. */
  8557. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8558. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8559. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8560. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8561. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8562. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8563. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8564. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8565. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8566. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8567. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8568. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8569. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8570. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8571. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8572. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8573. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8574. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8575. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8576. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8577. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8578. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8579. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8580. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8581. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8582. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8583. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8584. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8585. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8586. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8587. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8588. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8589. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8590. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8591. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8592. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8593. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8594. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8595. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8596. do { \
  8597. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8598. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8599. } while (0)
  8600. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8601. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8602. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8603. do { \
  8604. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8605. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8606. } while (0)
  8607. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8608. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8609. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8610. do { \
  8611. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8612. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8613. } while (0)
  8614. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8615. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8616. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8617. do { \
  8618. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8619. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8620. } while (0)
  8621. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8622. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8623. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8624. do { \
  8625. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8626. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8627. } while (0)
  8628. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8629. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8630. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8631. do { \
  8632. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8633. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8634. } while (0)
  8635. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8636. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8637. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8638. do { \
  8639. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8640. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8641. } while (0)
  8642. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8643. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8644. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8645. do { \
  8646. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8647. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8648. } while (0)
  8649. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8650. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8651. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8652. do { \
  8653. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8654. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8655. } while (0)
  8656. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8657. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8658. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8659. do { \
  8660. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8661. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8662. } while (0)
  8663. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8664. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8665. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8666. do { \
  8667. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8668. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8669. } while (0)
  8670. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8671. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8672. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8673. do { \
  8674. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8675. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8676. } while (0)
  8677. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8678. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8679. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8680. do { \
  8681. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8682. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8683. } while (0)
  8684. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8685. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8686. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8689. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8690. } while (0)
  8691. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8692. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8693. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8694. do { \
  8695. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8696. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8697. } while (0)
  8698. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8699. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8700. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8701. do { \
  8702. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8703. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8704. } while (0)
  8705. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8706. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8707. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8708. do { \
  8709. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8710. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8711. } while (0)
  8712. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8713. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8714. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8715. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8716. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8717. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8718. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8719. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8720. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8721. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8722. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8723. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8724. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8725. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8726. /**
  8727. * @brief target -> host rx peer unmap V2 message definition
  8728. *
  8729. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  8730. *
  8731. * The following diagram shows the format of the rx peer unmap message sent
  8732. * from the target to the host.
  8733. *
  8734. * |31 24|23 16|15 8|7 0|
  8735. * |-----------------------------------------------------------------------|
  8736. * | SW peer ID | VDEV ID | msg type |
  8737. * |-----------------------------------------------------------------------|
  8738. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8739. * |-----------------------------------------------------------------------|
  8740. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8741. * |-----------------------------------------------------------------------|
  8742. * | Peer Delete Duration |
  8743. * |-----------------------------------------------------------------------|
  8744. * | Reserved_0 | WDS Free Count |
  8745. * |-----------------------------------------------------------------------|
  8746. * | Reserved_1 |
  8747. * |-----------------------------------------------------------------------|
  8748. * | Reserved_2 |
  8749. * |-----------------------------------------------------------------------|
  8750. *
  8751. *
  8752. * The following field definitions describe the format of the rx peer unmap
  8753. * messages sent from the target to the host.
  8754. * - MSG_TYPE
  8755. * Bits 7:0
  8756. * Purpose: identifies this as an rx peer unmap v2 message
  8757. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  8758. * - VDEV_ID
  8759. * Bits 15:8
  8760. * Purpose: Indicates which virtual device the peer is associated
  8761. * with.
  8762. * Value: vdev ID (used in the host to look up the vdev object)
  8763. * - SW_PEER_ID
  8764. * Bits 31:16
  8765. * Purpose: The peer ID (index) that WAL is freeing
  8766. * Value: (rx) peer ID
  8767. * - MAC_ADDR_L32
  8768. * Bits 31:0
  8769. * Purpose: Identifies which peer node the peer ID is for.
  8770. * Value: lower 4 bytes of peer node's MAC address
  8771. * - MAC_ADDR_U16
  8772. * Bits 15:0
  8773. * Purpose: Identifies which peer node the peer ID is for.
  8774. * Value: upper 2 bytes of peer node's MAC address
  8775. * - NEXT_HOP
  8776. * Bits 16
  8777. * Purpose: Bit indicates next_hop AST entry used for WDS
  8778. * (Wireless Distribution System).
  8779. * - PEER_DELETE_DURATION
  8780. * Bits 31:0
  8781. * Purpose: Time taken to delete peer, in msec,
  8782. * Used for monitoring / debugging PEER delete response delay
  8783. * - PEER_WDS_FREE_COUNT
  8784. * Bits 15:0
  8785. * Purpose: Count of WDS entries deleted associated to peer deleted
  8786. */
  8787. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8788. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8789. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8790. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8791. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8792. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8793. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8794. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8795. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8796. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8797. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8798. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8799. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8800. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8801. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8802. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8803. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8804. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8805. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8806. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8807. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8810. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8811. } while (0)
  8812. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8813. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8814. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8817. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8818. } while (0)
  8819. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8820. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8821. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8822. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8823. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8824. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8825. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8826. /**
  8827. * @brief target -> host message specifying security parameters
  8828. *
  8829. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  8830. *
  8831. * @details
  8832. * The following diagram shows the format of the security specification
  8833. * message sent from the target to the host.
  8834. * This security specification message tells the host whether a PN check is
  8835. * necessary on rx data frames, and if so, how large the PN counter is.
  8836. * This message also tells the host about the security processing to apply
  8837. * to defragmented rx frames - specifically, whether a Message Integrity
  8838. * Check is required, and the Michael key to use.
  8839. *
  8840. * |31 24|23 16|15|14 8|7 0|
  8841. * |-----------------------------------------------------------------------|
  8842. * | peer ID | U| security type | msg type |
  8843. * |-----------------------------------------------------------------------|
  8844. * | Michael Key K0 |
  8845. * |-----------------------------------------------------------------------|
  8846. * | Michael Key K1 |
  8847. * |-----------------------------------------------------------------------|
  8848. * | WAPI RSC Low0 |
  8849. * |-----------------------------------------------------------------------|
  8850. * | WAPI RSC Low1 |
  8851. * |-----------------------------------------------------------------------|
  8852. * | WAPI RSC Hi0 |
  8853. * |-----------------------------------------------------------------------|
  8854. * | WAPI RSC Hi1 |
  8855. * |-----------------------------------------------------------------------|
  8856. *
  8857. * The following field definitions describe the format of the security
  8858. * indication message sent from the target to the host.
  8859. * - MSG_TYPE
  8860. * Bits 7:0
  8861. * Purpose: identifies this as a security specification message
  8862. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  8863. * - SEC_TYPE
  8864. * Bits 14:8
  8865. * Purpose: specifies which type of security applies to the peer
  8866. * Value: htt_sec_type enum value
  8867. * - UNICAST
  8868. * Bit 15
  8869. * Purpose: whether this security is applied to unicast or multicast data
  8870. * Value: 1 -> unicast, 0 -> multicast
  8871. * - PEER_ID
  8872. * Bits 31:16
  8873. * Purpose: The ID number for the peer the security specification is for
  8874. * Value: peer ID
  8875. * - MICHAEL_KEY_K0
  8876. * Bits 31:0
  8877. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8878. * Value: Michael Key K0 (if security type is TKIP)
  8879. * - MICHAEL_KEY_K1
  8880. * Bits 31:0
  8881. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8882. * Value: Michael Key K1 (if security type is TKIP)
  8883. * - WAPI_RSC_LOW0
  8884. * Bits 31:0
  8885. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8886. * Value: WAPI RSC Low0 (if security type is WAPI)
  8887. * - WAPI_RSC_LOW1
  8888. * Bits 31:0
  8889. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8890. * Value: WAPI RSC Low1 (if security type is WAPI)
  8891. * - WAPI_RSC_HI0
  8892. * Bits 31:0
  8893. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8894. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8895. * - WAPI_RSC_HI1
  8896. * Bits 31:0
  8897. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8898. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8899. */
  8900. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8901. #define HTT_SEC_IND_SEC_TYPE_S 8
  8902. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8903. #define HTT_SEC_IND_UNICAST_S 15
  8904. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8905. #define HTT_SEC_IND_PEER_ID_S 16
  8906. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8907. do { \
  8908. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8909. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8910. } while (0)
  8911. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8912. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8913. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8914. do { \
  8915. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8916. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8917. } while (0)
  8918. #define HTT_SEC_IND_UNICAST_GET(word) \
  8919. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8920. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8921. do { \
  8922. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8923. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8924. } while (0)
  8925. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8926. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8927. #define HTT_SEC_IND_BYTES 28
  8928. /**
  8929. * @brief target -> host rx ADDBA / DELBA message definitions
  8930. *
  8931. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  8932. *
  8933. * @details
  8934. * The following diagram shows the format of the rx ADDBA message sent
  8935. * from the target to the host:
  8936. *
  8937. * |31 20|19 16|15 8|7 0|
  8938. * |---------------------------------------------------------------------|
  8939. * | peer ID | TID | window size | msg type |
  8940. * |---------------------------------------------------------------------|
  8941. *
  8942. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  8943. *
  8944. * The following diagram shows the format of the rx DELBA message sent
  8945. * from the target to the host:
  8946. *
  8947. * |31 20|19 16|15 10|9 8|7 0|
  8948. * |---------------------------------------------------------------------|
  8949. * | peer ID | TID | window size | IR| msg type |
  8950. * |---------------------------------------------------------------------|
  8951. *
  8952. * The following field definitions describe the format of the rx ADDBA
  8953. * and DELBA messages sent from the target to the host.
  8954. * - MSG_TYPE
  8955. * Bits 7:0
  8956. * Purpose: identifies this as an rx ADDBA or DELBA message
  8957. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  8958. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  8959. * - IR (initiator / recipient)
  8960. * Bits 9:8 (DELBA only)
  8961. * Purpose: specify whether the DELBA handshake was initiated by the
  8962. * local STA/AP, or by the peer STA/AP
  8963. * Value:
  8964. * 0 - unspecified
  8965. * 1 - initiator (a.k.a. originator)
  8966. * 2 - recipient (a.k.a. responder)
  8967. * 3 - unused / reserved
  8968. * - WIN_SIZE
  8969. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8970. * Purpose: Specifies the length of the block ack window (max = 64).
  8971. * Value:
  8972. * block ack window length specified by the received ADDBA/DELBA
  8973. * management message.
  8974. * - TID
  8975. * Bits 19:16
  8976. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8977. * Value:
  8978. * TID specified by the received ADDBA or DELBA management message.
  8979. * - PEER_ID
  8980. * Bits 31:20
  8981. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8982. * Value:
  8983. * ID (hash value) used by the host for fast, direct lookup of
  8984. * host SW peer info, including rx reorder states.
  8985. */
  8986. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8987. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8988. #define HTT_RX_ADDBA_TID_M 0xf0000
  8989. #define HTT_RX_ADDBA_TID_S 16
  8990. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8991. #define HTT_RX_ADDBA_PEER_ID_S 20
  8992. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8995. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8996. } while (0)
  8997. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8998. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8999. #define HTT_RX_ADDBA_TID_SET(word, value) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  9002. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  9003. } while (0)
  9004. #define HTT_RX_ADDBA_TID_GET(word) \
  9005. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  9006. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  9007. do { \
  9008. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  9009. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  9010. } while (0)
  9011. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  9012. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  9013. #define HTT_RX_ADDBA_BYTES 4
  9014. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  9015. #define HTT_RX_DELBA_INITIATOR_S 8
  9016. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  9017. #define HTT_RX_DELBA_WIN_SIZE_S 10
  9018. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  9019. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  9020. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  9021. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  9022. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  9023. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  9024. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  9025. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  9026. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  9029. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  9030. } while (0)
  9031. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  9032. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  9033. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  9034. do { \
  9035. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  9036. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  9037. } while (0)
  9038. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  9039. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  9040. #define HTT_RX_DELBA_BYTES 4
  9041. /**
  9042. * @brief tx queue group information element definition
  9043. *
  9044. * @details
  9045. * The following diagram shows the format of the tx queue group
  9046. * information element, which can be included in target --> host
  9047. * messages to specify the number of tx "credits" (tx descriptors
  9048. * for LL, or tx buffers for HL) available to a particular group
  9049. * of host-side tx queues, and which host-side tx queues belong to
  9050. * the group.
  9051. *
  9052. * |31|30 24|23 16|15|14|13 0|
  9053. * |------------------------------------------------------------------------|
  9054. * | X| reserved | tx queue grp ID | A| S| credit count |
  9055. * |------------------------------------------------------------------------|
  9056. * | vdev ID mask | AC mask |
  9057. * |------------------------------------------------------------------------|
  9058. *
  9059. * The following definitions describe the fields within the tx queue group
  9060. * information element:
  9061. * - credit_count
  9062. * Bits 13:1
  9063. * Purpose: specify how many tx credits are available to the tx queue group
  9064. * Value: An absolute or relative, positive or negative credit value
  9065. * The 'A' bit specifies whether the value is absolute or relative.
  9066. * The 'S' bit specifies whether the value is positive or negative.
  9067. * A negative value can only be relative, not absolute.
  9068. * An absolute value replaces any prior credit value the host has for
  9069. * the tx queue group in question.
  9070. * A relative value is added to the prior credit value the host has for
  9071. * the tx queue group in question.
  9072. * - sign
  9073. * Bit 14
  9074. * Purpose: specify whether the credit count is positive or negative
  9075. * Value: 0 -> positive, 1 -> negative
  9076. * - absolute
  9077. * Bit 15
  9078. * Purpose: specify whether the credit count is absolute or relative
  9079. * Value: 0 -> relative, 1 -> absolute
  9080. * - txq_group_id
  9081. * Bits 23:16
  9082. * Purpose: indicate which tx queue group's credit and/or membership are
  9083. * being specified
  9084. * Value: 0 to max_tx_queue_groups-1
  9085. * - reserved
  9086. * Bits 30:16
  9087. * Value: 0x0
  9088. * - eXtension
  9089. * Bit 31
  9090. * Purpose: specify whether another tx queue group info element follows
  9091. * Value: 0 -> no more tx queue group information elements
  9092. * 1 -> another tx queue group information element immediately follows
  9093. * - ac_mask
  9094. * Bits 15:0
  9095. * Purpose: specify which Access Categories belong to the tx queue group
  9096. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9097. * the tx queue group.
  9098. * The AC bit-mask values are obtained by left-shifting by the
  9099. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9100. * - vdev_id_mask
  9101. * Bits 31:16
  9102. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9103. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9104. * belong to the tx queue group.
  9105. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9106. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9107. */
  9108. PREPACK struct htt_txq_group {
  9109. A_UINT32
  9110. credit_count: 14,
  9111. sign: 1,
  9112. absolute: 1,
  9113. tx_queue_group_id: 8,
  9114. reserved0: 7,
  9115. extension: 1;
  9116. A_UINT32
  9117. ac_mask: 16,
  9118. vdev_id_mask: 16;
  9119. } POSTPACK;
  9120. /* first word */
  9121. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9122. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9123. #define HTT_TXQ_GROUP_SIGN_S 14
  9124. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9125. #define HTT_TXQ_GROUP_ABS_S 15
  9126. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9127. #define HTT_TXQ_GROUP_ID_S 16
  9128. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9129. #define HTT_TXQ_GROUP_EXT_S 31
  9130. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9131. /* second word */
  9132. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9133. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9134. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9135. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9136. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9137. do { \
  9138. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9139. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9140. } while (0)
  9141. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9142. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9143. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9144. do { \
  9145. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9146. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9147. } while (0)
  9148. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9149. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9150. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9151. do { \
  9152. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9153. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9154. } while (0)
  9155. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9156. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9157. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9158. do { \
  9159. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9160. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9161. } while (0)
  9162. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9163. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9164. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9167. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9168. } while (0)
  9169. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9170. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9171. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9172. do { \
  9173. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9174. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9175. } while (0)
  9176. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9177. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9178. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9179. do { \
  9180. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9181. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9182. } while (0)
  9183. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9184. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9185. /**
  9186. * @brief target -> host TX completion indication message definition
  9187. *
  9188. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  9189. *
  9190. * @details
  9191. * The following diagram shows the format of the TX completion indication sent
  9192. * from the target to the host
  9193. *
  9194. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9195. * |-------------------------------------------------------------------|
  9196. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9197. * |-------------------------------------------------------------------|
  9198. * payload:| MSDU1 ID | MSDU0 ID |
  9199. * |-------------------------------------------------------------------|
  9200. * : MSDU3 ID | MSDU2 ID :
  9201. * |-------------------------------------------------------------------|
  9202. * | struct htt_tx_compl_ind_append_retries |
  9203. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9204. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9205. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9206. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9207. * |-------------------------------------------------------------------|
  9208. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9209. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9210. * | MSDU0 tx_tsf64_low |
  9211. * |-------------------------------------------------------------------|
  9212. * | MSDU0 tx_tsf64_high |
  9213. * |-------------------------------------------------------------------|
  9214. * | MSDU1 tx_tsf64_low |
  9215. * |-------------------------------------------------------------------|
  9216. * | MSDU1 tx_tsf64_high |
  9217. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9218. * | phy_timestamp |
  9219. * |-------------------------------------------------------------------|
  9220. * | rate specs (see below) |
  9221. * |-------------------------------------------------------------------|
  9222. * | seqctrl | framectrl |
  9223. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9224. * Where:
  9225. * A0 = append (a.k.a. append0)
  9226. * A1 = append1
  9227. * TP = MSDU tx power presence
  9228. * A2 = append2
  9229. * A3 = append3
  9230. * A4 = append4
  9231. *
  9232. * The following field definitions describe the format of the TX completion
  9233. * indication sent from the target to the host
  9234. * Header fields:
  9235. * - msg_type
  9236. * Bits 7:0
  9237. * Purpose: identifies this as HTT TX completion indication
  9238. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  9239. * - status
  9240. * Bits 10:8
  9241. * Purpose: the TX completion status of payload fragmentations descriptors
  9242. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9243. * - tid
  9244. * Bits 14:11
  9245. * Purpose: the tid associated with those fragmentation descriptors. It is
  9246. * valid or not, depending on the tid_invalid bit.
  9247. * Value: 0 to 15
  9248. * - tid_invalid
  9249. * Bits 15:15
  9250. * Purpose: this bit indicates whether the tid field is valid or not
  9251. * Value: 0 indicates valid; 1 indicates invalid
  9252. * - num
  9253. * Bits 23:16
  9254. * Purpose: the number of payload in this indication
  9255. * Value: 1 to 255
  9256. * - append (a.k.a. append0)
  9257. * Bits 24:24
  9258. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9259. * the number of tx retries for one MSDU at the end of this message
  9260. * Value: 0 indicates no appending; 1 indicates appending
  9261. * - append1
  9262. * Bits 25:25
  9263. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9264. * contains the timestamp info for each TX msdu id in payload.
  9265. * The order of the timestamps matches the order of the MSDU IDs.
  9266. * Note that a big-endian host needs to account for the reordering
  9267. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9268. * conversion) when determining which tx timestamp corresponds to
  9269. * which MSDU ID.
  9270. * Value: 0 indicates no appending; 1 indicates appending
  9271. * - msdu_tx_power_presence
  9272. * Bits 26:26
  9273. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9274. * for each MSDU referenced by the TX_COMPL_IND message.
  9275. * The tx power is reported in 0.5 dBm units.
  9276. * The order of the per-MSDU tx power reports matches the order
  9277. * of the MSDU IDs.
  9278. * Note that a big-endian host needs to account for the reordering
  9279. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9280. * conversion) when determining which Tx Power corresponds to
  9281. * which MSDU ID.
  9282. * Value: 0 indicates MSDU tx power reports are not appended,
  9283. * 1 indicates MSDU tx power reports are appended
  9284. * - append2
  9285. * Bits 27:27
  9286. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9287. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9288. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9289. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9290. * for each MSDU, for convenience.
  9291. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9292. * this append2 bit is set).
  9293. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9294. * dB above the noise floor.
  9295. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9296. * 1 indicates MSDU ACK RSSI values are appended.
  9297. * - append3
  9298. * Bits 28:28
  9299. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9300. * contains the tx tsf info based on wlan global TSF for
  9301. * each TX msdu id in payload.
  9302. * The order of the tx tsf matches the order of the MSDU IDs.
  9303. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9304. * values to indicate the the lower 32 bits and higher 32 bits of
  9305. * the tx tsf.
  9306. * The tx_tsf64 here represents the time MSDU was acked and the
  9307. * tx_tsf64 has microseconds units.
  9308. * Value: 0 indicates no appending; 1 indicates appending
  9309. * - append4
  9310. * Bits 29:29
  9311. * Purpose: Indicate whether data frame control fields and fields required
  9312. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9313. * message. The order of the this message matches the order of
  9314. * the MSDU IDs.
  9315. * Value: 0 indicates frame control fields and fields required for
  9316. * radio tap header values are not appended,
  9317. * 1 indicates frame control fields and fields required for
  9318. * radio tap header values are appended.
  9319. * Payload fields:
  9320. * - hmsdu_id
  9321. * Bits 15:0
  9322. * Purpose: this ID is used to track the Tx buffer in host
  9323. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9324. */
  9325. PREPACK struct htt_tx_data_hdr_information {
  9326. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9327. A_UINT32 /* word 1 */
  9328. /* preamble:
  9329. * 0-OFDM,
  9330. * 1-CCk,
  9331. * 2-HT,
  9332. * 3-VHT
  9333. */
  9334. preamble: 2, /* [1:0] */
  9335. /* mcs:
  9336. * In case of HT preamble interpret
  9337. * MCS along with NSS.
  9338. * Valid values for HT are 0 to 7.
  9339. * HT mcs 0 with NSS 2 is mcs 8.
  9340. * Valid values for VHT are 0 to 9.
  9341. */
  9342. mcs: 4, /* [5:2] */
  9343. /* rate:
  9344. * This is applicable only for
  9345. * CCK and OFDM preamble type
  9346. * rate 0: OFDM 48 Mbps,
  9347. * 1: OFDM 24 Mbps,
  9348. * 2: OFDM 12 Mbps
  9349. * 3: OFDM 6 Mbps
  9350. * 4: OFDM 54 Mbps
  9351. * 5: OFDM 36 Mbps
  9352. * 6: OFDM 18 Mbps
  9353. * 7: OFDM 9 Mbps
  9354. * rate 0: CCK 11 Mbps Long
  9355. * 1: CCK 5.5 Mbps Long
  9356. * 2: CCK 2 Mbps Long
  9357. * 3: CCK 1 Mbps Long
  9358. * 4: CCK 11 Mbps Short
  9359. * 5: CCK 5.5 Mbps Short
  9360. * 6: CCK 2 Mbps Short
  9361. */
  9362. rate : 3, /* [ 8: 6] */
  9363. rssi : 8, /* [16: 9] units=dBm */
  9364. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9365. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9366. stbc : 1, /* [22] */
  9367. sgi : 1, /* [23] */
  9368. ldpc : 1, /* [24] */
  9369. beamformed: 1, /* [25] */
  9370. /* tx_retry_cnt:
  9371. * Indicates retry count of data tx frames provided by the host.
  9372. */
  9373. tx_retry_cnt: 6; /* [31:26] */
  9374. A_UINT32 /* word 2 */
  9375. framectrl:16, /* [15: 0] */
  9376. seqno:16; /* [31:16] */
  9377. } POSTPACK;
  9378. #define HTT_TX_COMPL_IND_STATUS_S 8
  9379. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9380. #define HTT_TX_COMPL_IND_TID_S 11
  9381. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9382. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9383. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9384. #define HTT_TX_COMPL_IND_NUM_S 16
  9385. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9386. #define HTT_TX_COMPL_IND_APPEND_S 24
  9387. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9388. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9389. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9390. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9391. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9392. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9393. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9394. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9395. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9396. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9397. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9398. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9399. do { \
  9400. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9401. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9402. } while (0)
  9403. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9404. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9405. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9406. do { \
  9407. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9408. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9409. } while (0)
  9410. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9411. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9412. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9413. do { \
  9414. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9415. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9416. } while (0)
  9417. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9418. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9419. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9420. do { \
  9421. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9422. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9423. } while (0)
  9424. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9425. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9426. HTT_TX_COMPL_IND_TID_INV_S)
  9427. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9430. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9431. } while (0)
  9432. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9433. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9434. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9437. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9438. } while (0)
  9439. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9440. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9441. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9444. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9445. } while (0)
  9446. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9447. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9448. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9451. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9452. } while (0)
  9453. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9454. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9455. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9458. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9459. } while (0)
  9460. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9461. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9462. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9463. do { \
  9464. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9465. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9466. } while (0)
  9467. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9468. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9469. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9470. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9471. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9472. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9473. #define HTT_TX_COMPL_IND_STAT_OK 0
  9474. /* DISCARD:
  9475. * current meaning:
  9476. * MSDUs were queued for transmission but filtered by HW or SW
  9477. * without any over the air attempts
  9478. * legacy meaning (HL Rome):
  9479. * MSDUs were discarded by the target FW without any over the air
  9480. * attempts due to lack of space
  9481. */
  9482. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9483. /* NO_ACK:
  9484. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9485. */
  9486. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9487. /* POSTPONE:
  9488. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9489. * be downloaded again later (in the appropriate order), when they are
  9490. * deliverable.
  9491. */
  9492. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9493. /*
  9494. * The PEER_DEL tx completion status is used for HL cases
  9495. * where the peer the frame is for has been deleted.
  9496. * The host has already discarded its copy of the frame, but
  9497. * it still needs the tx completion to restore its credit.
  9498. */
  9499. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9500. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9501. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9502. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9503. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9504. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9505. PREPACK struct htt_tx_compl_ind_base {
  9506. A_UINT32 hdr;
  9507. A_UINT16 payload[1/*or more*/];
  9508. } POSTPACK;
  9509. PREPACK struct htt_tx_compl_ind_append_retries {
  9510. A_UINT16 msdu_id;
  9511. A_UINT8 tx_retries;
  9512. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9513. 0: this is the last append_retries struct */
  9514. } POSTPACK;
  9515. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9516. A_UINT32 timestamp[1/*or more*/];
  9517. } POSTPACK;
  9518. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9519. A_UINT32 tx_tsf64_low;
  9520. A_UINT32 tx_tsf64_high;
  9521. } POSTPACK;
  9522. /* htt_tx_data_hdr_information payload extension fields: */
  9523. /* DWORD zero */
  9524. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9525. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9526. /* DWORD one */
  9527. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9528. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9529. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9530. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9531. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9532. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9533. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9534. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9535. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9536. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9537. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9538. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9539. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9540. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9541. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9542. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9543. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9544. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9545. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9546. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9547. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9548. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9549. /* DWORD two */
  9550. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9551. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9552. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9553. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9554. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9555. do { \
  9556. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9557. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9558. } while (0)
  9559. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9560. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9561. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9562. do { \
  9563. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9564. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9565. } while (0)
  9566. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9567. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9568. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9569. do { \
  9570. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9571. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9572. } while (0)
  9573. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9574. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9575. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9576. do { \
  9577. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9578. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9579. } while (0)
  9580. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9581. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9582. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9583. do { \
  9584. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9585. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9586. } while (0)
  9587. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9588. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9589. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9590. do { \
  9591. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9592. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9593. } while (0)
  9594. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9595. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9596. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9599. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9600. } while (0)
  9601. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9602. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9603. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9604. do { \
  9605. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9606. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9607. } while (0)
  9608. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9609. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9610. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9611. do { \
  9612. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9613. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9614. } while (0)
  9615. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9616. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9617. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9618. do { \
  9619. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9620. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9621. } while (0)
  9622. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9623. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9624. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9625. do { \
  9626. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9627. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9628. } while (0)
  9629. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9630. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9631. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9634. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9635. } while (0)
  9636. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9637. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9638. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9639. do { \
  9640. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9641. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9642. } while (0)
  9643. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9644. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9645. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9646. do { \
  9647. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9648. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9649. } while (0)
  9650. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9651. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9652. /**
  9653. * @brief target -> host rate-control update indication message
  9654. *
  9655. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  9656. *
  9657. * @details
  9658. * The following diagram shows the format of the RC Update message
  9659. * sent from the target to the host, while processing the tx-completion
  9660. * of a transmitted PPDU.
  9661. *
  9662. * |31 24|23 16|15 8|7 0|
  9663. * |-------------------------------------------------------------|
  9664. * | peer ID | vdev ID | msg_type |
  9665. * |-------------------------------------------------------------|
  9666. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9667. * |-------------------------------------------------------------|
  9668. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9669. * |-------------------------------------------------------------|
  9670. * | : |
  9671. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9672. * | : |
  9673. * |-------------------------------------------------------------|
  9674. * | : |
  9675. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9676. * | : |
  9677. * |-------------------------------------------------------------|
  9678. * : :
  9679. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9680. *
  9681. */
  9682. typedef struct {
  9683. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9684. A_UINT32 rate_code_flags;
  9685. A_UINT32 flags; /* Encodes information such as excessive
  9686. retransmission, aggregate, some info
  9687. from .11 frame control,
  9688. STBC, LDPC, (SGI and Tx Chain Mask
  9689. are encoded in ptx_rc->flags field),
  9690. AMPDU truncation (BT/time based etc.),
  9691. RTS/CTS attempt */
  9692. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9693. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9694. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9695. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9696. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9697. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9698. } HTT_RC_TX_DONE_PARAMS;
  9699. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9700. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9701. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9702. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9703. #define HTT_RC_UPDATE_VDEVID_S 8
  9704. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9705. #define HTT_RC_UPDATE_PEERID_S 16
  9706. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9707. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9708. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9709. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9712. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9713. } while (0)
  9714. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9715. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9716. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9717. do { \
  9718. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9719. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9720. } while (0)
  9721. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9722. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9723. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9724. do { \
  9725. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9726. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9727. } while (0)
  9728. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9729. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9730. /**
  9731. * @brief target -> host rx fragment indication message definition
  9732. *
  9733. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  9734. *
  9735. * @details
  9736. * The following field definitions describe the format of the rx fragment
  9737. * indication message sent from the target to the host.
  9738. * The rx fragment indication message shares the format of the
  9739. * rx indication message, but not all fields from the rx indication message
  9740. * are relevant to the rx fragment indication message.
  9741. *
  9742. *
  9743. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9744. * |-----------+-------------------+---------------------+-------------|
  9745. * | peer ID | |FV| ext TID | msg type |
  9746. * |-------------------------------------------------------------------|
  9747. * | | flush | flush |
  9748. * | | end | start |
  9749. * | | seq num | seq num |
  9750. * |-------------------------------------------------------------------|
  9751. * | reserved | FW rx desc bytes |
  9752. * |-------------------------------------------------------------------|
  9753. * | | FW MSDU Rx |
  9754. * | | desc B0 |
  9755. * |-------------------------------------------------------------------|
  9756. * Header fields:
  9757. * - MSG_TYPE
  9758. * Bits 7:0
  9759. * Purpose: identifies this as an rx fragment indication message
  9760. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  9761. * - EXT_TID
  9762. * Bits 12:8
  9763. * Purpose: identify the traffic ID of the rx data, including
  9764. * special "extended" TID values for multicast, broadcast, and
  9765. * non-QoS data frames
  9766. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9767. * - FLUSH_VALID (FV)
  9768. * Bit 13
  9769. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9770. * is valid
  9771. * Value:
  9772. * 1 -> flush IE is valid and needs to be processed
  9773. * 0 -> flush IE is not valid and should be ignored
  9774. * - PEER_ID
  9775. * Bits 31:16
  9776. * Purpose: Identify, by ID, which peer sent the rx data
  9777. * Value: ID of the peer who sent the rx data
  9778. * - FLUSH_SEQ_NUM_START
  9779. * Bits 5:0
  9780. * Purpose: Indicate the start of a series of MPDUs to flush
  9781. * Not all MPDUs within this series are necessarily valid - the host
  9782. * must check each sequence number within this range to see if the
  9783. * corresponding MPDU is actually present.
  9784. * This field is only valid if the FV bit is set.
  9785. * Value:
  9786. * The sequence number for the first MPDUs to check to flush.
  9787. * The sequence number is masked by 0x3f.
  9788. * - FLUSH_SEQ_NUM_END
  9789. * Bits 11:6
  9790. * Purpose: Indicate the end of a series of MPDUs to flush
  9791. * Value:
  9792. * The sequence number one larger than the sequence number of the
  9793. * last MPDU to check to flush.
  9794. * The sequence number is masked by 0x3f.
  9795. * Not all MPDUs within this series are necessarily valid - the host
  9796. * must check each sequence number within this range to see if the
  9797. * corresponding MPDU is actually present.
  9798. * This field is only valid if the FV bit is set.
  9799. * Rx descriptor fields:
  9800. * - FW_RX_DESC_BYTES
  9801. * Bits 15:0
  9802. * Purpose: Indicate how many bytes in the Rx indication are used for
  9803. * FW Rx descriptors
  9804. * Value: 1
  9805. */
  9806. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9807. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9808. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9809. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9810. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9811. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9812. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9813. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9814. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9815. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9816. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9817. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9818. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9819. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9820. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9821. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9822. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9823. #define HTT_RX_FRAG_IND_BYTES \
  9824. (4 /* msg hdr */ + \
  9825. 4 /* flush spec */ + \
  9826. 4 /* (unused) FW rx desc bytes spec */ + \
  9827. 4 /* FW rx desc */)
  9828. /**
  9829. * @brief target -> host test message definition
  9830. *
  9831. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  9832. *
  9833. * @details
  9834. * The following field definitions describe the format of the test
  9835. * message sent from the target to the host.
  9836. * The message consists of a 4-octet header, followed by a variable
  9837. * number of 32-bit integer values, followed by a variable number
  9838. * of 8-bit character values.
  9839. *
  9840. * |31 16|15 8|7 0|
  9841. * |-----------------------------------------------------------|
  9842. * | num chars | num ints | msg type |
  9843. * |-----------------------------------------------------------|
  9844. * | int 0 |
  9845. * |-----------------------------------------------------------|
  9846. * | int 1 |
  9847. * |-----------------------------------------------------------|
  9848. * | ... |
  9849. * |-----------------------------------------------------------|
  9850. * | char 3 | char 2 | char 1 | char 0 |
  9851. * |-----------------------------------------------------------|
  9852. * | | | ... | char 4 |
  9853. * |-----------------------------------------------------------|
  9854. * - MSG_TYPE
  9855. * Bits 7:0
  9856. * Purpose: identifies this as a test message
  9857. * Value: HTT_MSG_TYPE_TEST
  9858. * - NUM_INTS
  9859. * Bits 15:8
  9860. * Purpose: indicate how many 32-bit integers follow the message header
  9861. * - NUM_CHARS
  9862. * Bits 31:16
  9863. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9864. */
  9865. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9866. #define HTT_RX_TEST_NUM_INTS_S 8
  9867. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9868. #define HTT_RX_TEST_NUM_CHARS_S 16
  9869. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9870. do { \
  9871. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9872. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9873. } while (0)
  9874. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9875. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9876. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9877. do { \
  9878. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9879. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9880. } while (0)
  9881. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9882. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9883. /**
  9884. * @brief target -> host packet log message
  9885. *
  9886. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  9887. *
  9888. * @details
  9889. * The following field definitions describe the format of the packet log
  9890. * message sent from the target to the host.
  9891. * The message consists of a 4-octet header,followed by a variable number
  9892. * of 32-bit character values.
  9893. *
  9894. * |31 16|15 12|11 10|9 8|7 0|
  9895. * |------------------------------------------------------------------|
  9896. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9897. * |------------------------------------------------------------------|
  9898. * | payload |
  9899. * |------------------------------------------------------------------|
  9900. * - MSG_TYPE
  9901. * Bits 7:0
  9902. * Purpose: identifies this as a pktlog message
  9903. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  9904. * - mac_id
  9905. * Bits 9:8
  9906. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9907. * Value: 0-3
  9908. * - pdev_id
  9909. * Bits 11:10
  9910. * Purpose: pdev_id
  9911. * Value: 0-3
  9912. * 0 (for rings at SOC level),
  9913. * 1/2/3 PDEV -> 0/1/2
  9914. * - payload_size
  9915. * Bits 31:16
  9916. * Purpose: explicitly specify the payload size
  9917. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9918. */
  9919. PREPACK struct htt_pktlog_msg {
  9920. A_UINT32 header;
  9921. A_UINT32 payload[1/* or more */];
  9922. } POSTPACK;
  9923. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9924. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9925. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9926. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9927. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9928. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9929. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9932. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9933. } while (0)
  9934. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9935. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9936. HTT_T2H_PKTLOG_MAC_ID_S)
  9937. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9940. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9941. } while (0)
  9942. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9943. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9944. HTT_T2H_PKTLOG_PDEV_ID_S)
  9945. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9946. do { \
  9947. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9948. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9949. } while (0)
  9950. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9951. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9952. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9953. /*
  9954. * Rx reorder statistics
  9955. * NB: all the fields must be defined in 4 octets size.
  9956. */
  9957. struct rx_reorder_stats {
  9958. /* Non QoS MPDUs received */
  9959. A_UINT32 deliver_non_qos;
  9960. /* MPDUs received in-order */
  9961. A_UINT32 deliver_in_order;
  9962. /* Flush due to reorder timer expired */
  9963. A_UINT32 deliver_flush_timeout;
  9964. /* Flush due to move out of window */
  9965. A_UINT32 deliver_flush_oow;
  9966. /* Flush due to DELBA */
  9967. A_UINT32 deliver_flush_delba;
  9968. /* MPDUs dropped due to FCS error */
  9969. A_UINT32 fcs_error;
  9970. /* MPDUs dropped due to monitor mode non-data packet */
  9971. A_UINT32 mgmt_ctrl;
  9972. /* Unicast-data MPDUs dropped due to invalid peer */
  9973. A_UINT32 invalid_peer;
  9974. /* MPDUs dropped due to duplication (non aggregation) */
  9975. A_UINT32 dup_non_aggr;
  9976. /* MPDUs dropped due to processed before */
  9977. A_UINT32 dup_past;
  9978. /* MPDUs dropped due to duplicate in reorder queue */
  9979. A_UINT32 dup_in_reorder;
  9980. /* Reorder timeout happened */
  9981. A_UINT32 reorder_timeout;
  9982. /* invalid bar ssn */
  9983. A_UINT32 invalid_bar_ssn;
  9984. /* reorder reset due to bar ssn */
  9985. A_UINT32 ssn_reset;
  9986. /* Flush due to delete peer */
  9987. A_UINT32 deliver_flush_delpeer;
  9988. /* Flush due to offload*/
  9989. A_UINT32 deliver_flush_offload;
  9990. /* Flush due to out of buffer*/
  9991. A_UINT32 deliver_flush_oob;
  9992. /* MPDUs dropped due to PN check fail */
  9993. A_UINT32 pn_fail;
  9994. /* MPDUs dropped due to unable to allocate memory */
  9995. A_UINT32 store_fail;
  9996. /* Number of times the tid pool alloc succeeded */
  9997. A_UINT32 tid_pool_alloc_succ;
  9998. /* Number of times the MPDU pool alloc succeeded */
  9999. A_UINT32 mpdu_pool_alloc_succ;
  10000. /* Number of times the MSDU pool alloc succeeded */
  10001. A_UINT32 msdu_pool_alloc_succ;
  10002. /* Number of times the tid pool alloc failed */
  10003. A_UINT32 tid_pool_alloc_fail;
  10004. /* Number of times the MPDU pool alloc failed */
  10005. A_UINT32 mpdu_pool_alloc_fail;
  10006. /* Number of times the MSDU pool alloc failed */
  10007. A_UINT32 msdu_pool_alloc_fail;
  10008. /* Number of times the tid pool freed */
  10009. A_UINT32 tid_pool_free;
  10010. /* Number of times the MPDU pool freed */
  10011. A_UINT32 mpdu_pool_free;
  10012. /* Number of times the MSDU pool freed */
  10013. A_UINT32 msdu_pool_free;
  10014. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  10015. A_UINT32 msdu_queued;
  10016. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  10017. A_UINT32 msdu_recycled;
  10018. /* Number of MPDUs with invalid peer but A2 found in AST */
  10019. A_UINT32 invalid_peer_a2_in_ast;
  10020. /* Number of MPDUs with invalid peer but A3 found in AST */
  10021. A_UINT32 invalid_peer_a3_in_ast;
  10022. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  10023. A_UINT32 invalid_peer_bmc_mpdus;
  10024. /* Number of MSDUs with err attention word */
  10025. A_UINT32 rxdesc_err_att;
  10026. /* Number of MSDUs with flag of peer_idx_invalid */
  10027. A_UINT32 rxdesc_err_peer_idx_inv;
  10028. /* Number of MSDUs with flag of peer_idx_timeout */
  10029. A_UINT32 rxdesc_err_peer_idx_to;
  10030. /* Number of MSDUs with flag of overflow */
  10031. A_UINT32 rxdesc_err_ov;
  10032. /* Number of MSDUs with flag of msdu_length_err */
  10033. A_UINT32 rxdesc_err_msdu_len;
  10034. /* Number of MSDUs with flag of mpdu_length_err */
  10035. A_UINT32 rxdesc_err_mpdu_len;
  10036. /* Number of MSDUs with flag of tkip_mic_err */
  10037. A_UINT32 rxdesc_err_tkip_mic;
  10038. /* Number of MSDUs with flag of decrypt_err */
  10039. A_UINT32 rxdesc_err_decrypt;
  10040. /* Number of MSDUs with flag of fcs_err */
  10041. A_UINT32 rxdesc_err_fcs;
  10042. /* Number of Unicast (bc_mc bit is not set in attention word)
  10043. * frames with invalid peer handler
  10044. */
  10045. A_UINT32 rxdesc_uc_msdus_inv_peer;
  10046. /* Number of unicast frame directly (direct bit is set in attention word)
  10047. * to DUT with invalid peer handler
  10048. */
  10049. A_UINT32 rxdesc_direct_msdus_inv_peer;
  10050. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  10051. * frames with invalid peer handler
  10052. */
  10053. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  10054. /* Number of MSDUs dropped due to no first MSDU flag */
  10055. A_UINT32 rxdesc_no_1st_msdu;
  10056. /* Number of MSDUs droped due to ring overflow */
  10057. A_UINT32 msdu_drop_ring_ov;
  10058. /* Number of MSDUs dropped due to FC mismatch */
  10059. A_UINT32 msdu_drop_fc_mismatch;
  10060. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  10061. A_UINT32 msdu_drop_mgmt_remote_ring;
  10062. /* Number of MSDUs dropped due to errors not reported in attention word */
  10063. A_UINT32 msdu_drop_misc;
  10064. /* Number of MSDUs go to offload before reorder */
  10065. A_UINT32 offload_msdu_wal;
  10066. /* Number of data frame dropped by offload after reorder */
  10067. A_UINT32 offload_msdu_reorder;
  10068. /* Number of MPDUs with sequence number in the past and within the BA window */
  10069. A_UINT32 dup_past_within_window;
  10070. /* Number of MPDUs with sequence number in the past and outside the BA window */
  10071. A_UINT32 dup_past_outside_window;
  10072. /* Number of MSDUs with decrypt/MIC error */
  10073. A_UINT32 rxdesc_err_decrypt_mic;
  10074. /* Number of data MSDUs received on both local and remote rings */
  10075. A_UINT32 data_msdus_on_both_rings;
  10076. /* MPDUs never filled */
  10077. A_UINT32 holes_not_filled;
  10078. };
  10079. /*
  10080. * Rx Remote buffer statistics
  10081. * NB: all the fields must be defined in 4 octets size.
  10082. */
  10083. struct rx_remote_buffer_mgmt_stats {
  10084. /* Total number of MSDUs reaped for Rx processing */
  10085. A_UINT32 remote_reaped;
  10086. /* MSDUs recycled within firmware */
  10087. A_UINT32 remote_recycled;
  10088. /* MSDUs stored by Data Rx */
  10089. A_UINT32 data_rx_msdus_stored;
  10090. /* Number of HTT indications from WAL Rx MSDU */
  10091. A_UINT32 wal_rx_ind;
  10092. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10093. A_UINT32 wal_rx_ind_unconsumed;
  10094. /* Number of HTT indications from Data Rx MSDU */
  10095. A_UINT32 data_rx_ind;
  10096. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10097. A_UINT32 data_rx_ind_unconsumed;
  10098. /* Number of HTT indications from ATHBUF */
  10099. A_UINT32 athbuf_rx_ind;
  10100. /* Number of remote buffers requested for refill */
  10101. A_UINT32 refill_buf_req;
  10102. /* Number of remote buffers filled by the host */
  10103. A_UINT32 refill_buf_rsp;
  10104. /* Number of times MAC hw_index = f/w write_index */
  10105. A_INT32 mac_no_bufs;
  10106. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10107. A_INT32 fw_indices_equal;
  10108. /* Number of times f/w finds no buffers to post */
  10109. A_INT32 host_no_bufs;
  10110. };
  10111. /*
  10112. * TXBF MU/SU packets and NDPA statistics
  10113. * NB: all the fields must be defined in 4 octets size.
  10114. */
  10115. struct rx_txbf_musu_ndpa_pkts_stats {
  10116. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10117. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10118. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10119. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10120. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10121. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10122. };
  10123. /*
  10124. * htt_dbg_stats_status -
  10125. * present - The requested stats have been delivered in full.
  10126. * This indicates that either the stats information was contained
  10127. * in its entirety within this message, or else this message
  10128. * completes the delivery of the requested stats info that was
  10129. * partially delivered through earlier STATS_CONF messages.
  10130. * partial - The requested stats have been delivered in part.
  10131. * One or more subsequent STATS_CONF messages with the same
  10132. * cookie value will be sent to deliver the remainder of the
  10133. * information.
  10134. * error - The requested stats could not be delivered, for example due
  10135. * to a shortage of memory to construct a message holding the
  10136. * requested stats.
  10137. * invalid - The requested stat type is either not recognized, or the
  10138. * target is configured to not gather the stats type in question.
  10139. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10140. * series_done - This special value indicates that no further stats info
  10141. * elements are present within a series of stats info elems
  10142. * (within a stats upload confirmation message).
  10143. */
  10144. enum htt_dbg_stats_status {
  10145. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10146. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10147. HTT_DBG_STATS_STATUS_ERROR = 2,
  10148. HTT_DBG_STATS_STATUS_INVALID = 3,
  10149. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10150. };
  10151. /**
  10152. * @brief target -> host statistics upload
  10153. *
  10154. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  10155. *
  10156. * @details
  10157. * The following field definitions describe the format of the HTT target
  10158. * to host stats upload confirmation message.
  10159. * The message contains a cookie echoed from the HTT host->target stats
  10160. * upload request, which identifies which request the confirmation is
  10161. * for, and a series of tag-length-value stats information elements.
  10162. * The tag-length header for each stats info element also includes a
  10163. * status field, to indicate whether the request for the stat type in
  10164. * question was fully met, partially met, unable to be met, or invalid
  10165. * (if the stat type in question is disabled in the target).
  10166. * A special value of all 1's in this status field is used to indicate
  10167. * the end of the series of stats info elements.
  10168. *
  10169. *
  10170. * |31 16|15 8|7 5|4 0|
  10171. * |------------------------------------------------------------|
  10172. * | reserved | msg type |
  10173. * |------------------------------------------------------------|
  10174. * | cookie LSBs |
  10175. * |------------------------------------------------------------|
  10176. * | cookie MSBs |
  10177. * |------------------------------------------------------------|
  10178. * | stats entry length | reserved | S |stat type|
  10179. * |------------------------------------------------------------|
  10180. * | |
  10181. * | type-specific stats info |
  10182. * | |
  10183. * |------------------------------------------------------------|
  10184. * | stats entry length | reserved | S |stat type|
  10185. * |------------------------------------------------------------|
  10186. * | |
  10187. * | type-specific stats info |
  10188. * | |
  10189. * |------------------------------------------------------------|
  10190. * | n/a | reserved | 111 | n/a |
  10191. * |------------------------------------------------------------|
  10192. * Header fields:
  10193. * - MSG_TYPE
  10194. * Bits 7:0
  10195. * Purpose: identifies this is a statistics upload confirmation message
  10196. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  10197. * - COOKIE_LSBS
  10198. * Bits 31:0
  10199. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10200. * message with its preceding host->target stats request message.
  10201. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10202. * - COOKIE_MSBS
  10203. * Bits 31:0
  10204. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10205. * message with its preceding host->target stats request message.
  10206. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10207. *
  10208. * Stats Information Element tag-length header fields:
  10209. * - STAT_TYPE
  10210. * Bits 4:0
  10211. * Purpose: identifies the type of statistics info held in the
  10212. * following information element
  10213. * Value: htt_dbg_stats_type
  10214. * - STATUS
  10215. * Bits 7:5
  10216. * Purpose: indicate whether the requested stats are present
  10217. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10218. * the completion of the stats entry series
  10219. * - LENGTH
  10220. * Bits 31:16
  10221. * Purpose: indicate the stats information size
  10222. * Value: This field specifies the number of bytes of stats information
  10223. * that follows the element tag-length header.
  10224. * It is expected but not required that this length is a multiple of
  10225. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10226. * subsequent stats entry header will begin on a 4-byte aligned
  10227. * boundary.
  10228. */
  10229. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10230. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10231. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10232. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10233. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10234. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10235. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10236. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10237. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10238. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10239. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10240. do { \
  10241. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10242. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10243. } while (0)
  10244. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10245. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10246. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10247. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10248. do { \
  10249. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10250. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10251. } while (0)
  10252. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10253. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10254. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10255. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10256. do { \
  10257. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10258. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10259. } while (0)
  10260. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10261. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10262. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10263. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10264. #define HTT_MAX_AGGR 64
  10265. #define HTT_HL_MAX_AGGR 18
  10266. /**
  10267. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10268. *
  10269. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  10270. *
  10271. * @details
  10272. * The following field definitions describe the format of the HTT host
  10273. * to target frag_desc/msdu_ext bank configuration message.
  10274. * The message contains the based address and the min and max id of the
  10275. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10276. * MSDU_EXT/FRAG_DESC.
  10277. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10278. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10279. * the hardware does the mapping/translation.
  10280. *
  10281. * Total banks that can be configured is configured to 16.
  10282. *
  10283. * This should be called before any TX has be initiated by the HTT
  10284. *
  10285. * |31 16|15 8|7 5|4 0|
  10286. * |------------------------------------------------------------|
  10287. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10288. * |------------------------------------------------------------|
  10289. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10290. #if HTT_PADDR64
  10291. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10292. #endif
  10293. * |------------------------------------------------------------|
  10294. * | ... |
  10295. * |------------------------------------------------------------|
  10296. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10297. #if HTT_PADDR64
  10298. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10299. #endif
  10300. * |------------------------------------------------------------|
  10301. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10302. * |------------------------------------------------------------|
  10303. * | ... |
  10304. * |------------------------------------------------------------|
  10305. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10306. * |------------------------------------------------------------|
  10307. * Header fields:
  10308. * - MSG_TYPE
  10309. * Bits 7:0
  10310. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  10311. * for systems with 64-bit format for bus addresses:
  10312. * - BANKx_BASE_ADDRESS_LO
  10313. * Bits 31:0
  10314. * Purpose: Provide a mechanism to specify the base address of the
  10315. * MSDU_EXT bank physical/bus address.
  10316. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10317. * - BANKx_BASE_ADDRESS_HI
  10318. * Bits 31:0
  10319. * Purpose: Provide a mechanism to specify the base address of the
  10320. * MSDU_EXT bank physical/bus address.
  10321. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10322. * for systems with 32-bit format for bus addresses:
  10323. * - BANKx_BASE_ADDRESS
  10324. * Bits 31:0
  10325. * Purpose: Provide a mechanism to specify the base address of the
  10326. * MSDU_EXT bank physical/bus address.
  10327. * Value: MSDU_EXT bank physical / bus address
  10328. * - BANKx_MIN_ID
  10329. * Bits 15:0
  10330. * Purpose: Provide a mechanism to specify the min index that needs to
  10331. * mapped.
  10332. * - BANKx_MAX_ID
  10333. * Bits 31:16
  10334. * Purpose: Provide a mechanism to specify the max index that needs to
  10335. * mapped.
  10336. *
  10337. */
  10338. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10339. * safe value.
  10340. * @note MAX supported banks is 16.
  10341. */
  10342. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10343. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10344. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10345. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10346. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10347. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10348. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10349. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10350. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10351. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10352. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10353. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10354. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10355. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10358. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10359. } while (0)
  10360. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10361. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10362. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10363. do { \
  10364. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10365. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10366. } while (0)
  10367. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10368. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10369. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10370. do { \
  10371. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10372. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10373. } while (0)
  10374. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10375. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10376. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10379. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10380. } while (0)
  10381. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10382. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10383. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10384. do { \
  10385. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10386. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10387. } while (0)
  10388. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10389. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10390. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10391. do { \
  10392. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10393. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10394. } while (0)
  10395. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10396. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10397. /*
  10398. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10399. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10400. * addresses are stored in a XXX-bit field.
  10401. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10402. * htt_tx_frag_desc64_bank_cfg_t structs.
  10403. */
  10404. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10405. _paddr_bits_, \
  10406. _paddr__bank_base_address_) \
  10407. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10408. /** word 0 \
  10409. * msg_type: 8, \
  10410. * pdev_id: 2, \
  10411. * swap: 1, \
  10412. * reserved0: 5, \
  10413. * num_banks: 8, \
  10414. * desc_size: 8; \
  10415. */ \
  10416. A_UINT32 word0; \
  10417. /* \
  10418. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10419. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10420. * the second A_UINT32). \
  10421. */ \
  10422. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10423. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10424. } POSTPACK
  10425. /* define htt_tx_frag_desc32_bank_cfg_t */
  10426. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10427. /* define htt_tx_frag_desc64_bank_cfg_t */
  10428. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10429. /*
  10430. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10431. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10432. */
  10433. #if HTT_PADDR64
  10434. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10435. #else
  10436. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10437. #endif
  10438. /**
  10439. * @brief target -> host HTT TX Credit total count update message definition
  10440. *
  10441. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  10442. *
  10443. *|31 16|15|14 9| 8 |7 0 |
  10444. *|---------------------+--+----------+-------+----------|
  10445. *|cur htt credit delta | Q| reserved | sign | msg type |
  10446. *|------------------------------------------------------|
  10447. *
  10448. * Header fields:
  10449. * - MSG_TYPE
  10450. * Bits 7:0
  10451. * Purpose: identifies this as a htt tx credit delta update message
  10452. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  10453. * - SIGN
  10454. * Bits 8
  10455. * identifies whether credit delta is positive or negative
  10456. * Value:
  10457. * - 0x0: credit delta is positive, rebalance in some buffers
  10458. * - 0x1: credit delta is negative, rebalance out some buffers
  10459. * - reserved
  10460. * Bits 14:9
  10461. * Value: 0x0
  10462. * - TXQ_GRP
  10463. * Bit 15
  10464. * Purpose: indicates whether any tx queue group information elements
  10465. * are appended to the tx credit update message
  10466. * Value: 0 -> no tx queue group information element is present
  10467. * 1 -> a tx queue group information element immediately follows
  10468. * - DELTA_COUNT
  10469. * Bits 31:16
  10470. * Purpose: Specify current htt credit delta absolute count
  10471. */
  10472. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10473. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10474. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10475. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10476. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10477. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10478. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10481. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10482. } while (0)
  10483. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10484. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10485. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10486. do { \
  10487. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10488. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10489. } while (0)
  10490. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10491. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10492. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10495. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10496. } while (0)
  10497. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10498. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10499. #define HTT_TX_CREDIT_MSG_BYTES 4
  10500. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10501. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10502. /**
  10503. * @brief HTT WDI_IPA Operation Response Message
  10504. *
  10505. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  10506. *
  10507. * @details
  10508. * HTT WDI_IPA Operation Response message is sent by target
  10509. * to host confirming suspend or resume operation.
  10510. * |31 24|23 16|15 8|7 0|
  10511. * |----------------+----------------+----------------+----------------|
  10512. * | op_code | Rsvd | msg_type |
  10513. * |-------------------------------------------------------------------|
  10514. * | Rsvd | Response len |
  10515. * |-------------------------------------------------------------------|
  10516. * | |
  10517. * | Response-type specific info |
  10518. * | |
  10519. * | |
  10520. * |-------------------------------------------------------------------|
  10521. * Header fields:
  10522. * - MSG_TYPE
  10523. * Bits 7:0
  10524. * Purpose: Identifies this as WDI_IPA Operation Response message
  10525. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  10526. * - OP_CODE
  10527. * Bits 31:16
  10528. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10529. * value: = enum htt_wdi_ipa_op_code
  10530. * - RSP_LEN
  10531. * Bits 16:0
  10532. * Purpose: length for the response-type specific info
  10533. * value: = length in bytes for response-type specific info
  10534. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10535. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10536. */
  10537. PREPACK struct htt_wdi_ipa_op_response_t
  10538. {
  10539. /* DWORD 0: flags and meta-data */
  10540. A_UINT32
  10541. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10542. reserved1: 8,
  10543. op_code: 16;
  10544. A_UINT32
  10545. rsp_len: 16,
  10546. reserved2: 16;
  10547. } POSTPACK;
  10548. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10549. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10550. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10551. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10552. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10553. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10554. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10555. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10556. do { \
  10557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10558. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10559. } while (0)
  10560. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10561. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10562. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10563. do { \
  10564. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10565. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10566. } while (0)
  10567. enum htt_phy_mode {
  10568. htt_phy_mode_11a = 0,
  10569. htt_phy_mode_11g = 1,
  10570. htt_phy_mode_11b = 2,
  10571. htt_phy_mode_11g_only = 3,
  10572. htt_phy_mode_11na_ht20 = 4,
  10573. htt_phy_mode_11ng_ht20 = 5,
  10574. htt_phy_mode_11na_ht40 = 6,
  10575. htt_phy_mode_11ng_ht40 = 7,
  10576. htt_phy_mode_11ac_vht20 = 8,
  10577. htt_phy_mode_11ac_vht40 = 9,
  10578. htt_phy_mode_11ac_vht80 = 10,
  10579. htt_phy_mode_11ac_vht20_2g = 11,
  10580. htt_phy_mode_11ac_vht40_2g = 12,
  10581. htt_phy_mode_11ac_vht80_2g = 13,
  10582. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10583. htt_phy_mode_11ac_vht160 = 15,
  10584. htt_phy_mode_max,
  10585. };
  10586. /**
  10587. * @brief target -> host HTT channel change indication
  10588. *
  10589. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  10590. *
  10591. * @details
  10592. * Specify when a channel change occurs.
  10593. * This allows the host to precisely determine which rx frames arrived
  10594. * on the old channel and which rx frames arrived on the new channel.
  10595. *
  10596. *|31 |7 0 |
  10597. *|-------------------------------------------+----------|
  10598. *| reserved | msg type |
  10599. *|------------------------------------------------------|
  10600. *| primary_chan_center_freq_mhz |
  10601. *|------------------------------------------------------|
  10602. *| contiguous_chan1_center_freq_mhz |
  10603. *|------------------------------------------------------|
  10604. *| contiguous_chan2_center_freq_mhz |
  10605. *|------------------------------------------------------|
  10606. *| phy_mode |
  10607. *|------------------------------------------------------|
  10608. *
  10609. * Header fields:
  10610. * - MSG_TYPE
  10611. * Bits 7:0
  10612. * Purpose: identifies this as a htt channel change indication message
  10613. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  10614. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10615. * Bits 31:0
  10616. * Purpose: identify the (center of the) new 20 MHz primary channel
  10617. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10618. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10619. * Bits 31:0
  10620. * Purpose: identify the (center of the) contiguous frequency range
  10621. * comprising the new channel.
  10622. * For example, if the new channel is a 80 MHz channel extending
  10623. * 60 MHz beyond the primary channel, this field would be 30 larger
  10624. * than the primary channel center frequency field.
  10625. * Value: center frequency of the contiguous frequency range comprising
  10626. * the full channel in MHz units
  10627. * (80+80 channels also use the CONTIG_CHAN2 field)
  10628. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10629. * Bits 31:0
  10630. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10631. * within a VHT 80+80 channel.
  10632. * This field is only relevant for VHT 80+80 channels.
  10633. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10634. * channel (arbitrary value for cases besides VHT 80+80)
  10635. * - PHY_MODE
  10636. * Bits 31:0
  10637. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10638. * and band
  10639. * Value: htt_phy_mode enum value
  10640. */
  10641. PREPACK struct htt_chan_change_t
  10642. {
  10643. /* DWORD 0: flags and meta-data */
  10644. A_UINT32
  10645. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10646. reserved1: 24;
  10647. A_UINT32 primary_chan_center_freq_mhz;
  10648. A_UINT32 contig_chan1_center_freq_mhz;
  10649. A_UINT32 contig_chan2_center_freq_mhz;
  10650. A_UINT32 phy_mode;
  10651. } POSTPACK;
  10652. /*
  10653. * Due to historical / backwards-compatibility reasons, maintain the
  10654. * below htt_chan_change_msg struct definition, which needs to be
  10655. * consistent with the above htt_chan_change_t struct definition
  10656. * (aside from the htt_chan_change_t definition including the msg_type
  10657. * dword within the message, and the htt_chan_change_msg only containing
  10658. * the payload of the message that follows the msg_type dword).
  10659. */
  10660. PREPACK struct htt_chan_change_msg {
  10661. A_UINT32 chan_mhz; /* frequency in mhz */
  10662. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  10663. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10664. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10665. } POSTPACK;
  10666. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10667. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10668. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10669. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10670. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10671. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10672. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10673. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10674. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10675. do { \
  10676. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10677. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10678. } while (0)
  10679. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10680. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10681. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10682. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10683. do { \
  10684. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10685. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10686. } while (0)
  10687. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10688. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10689. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10690. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10691. do { \
  10692. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10693. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10694. } while (0)
  10695. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10696. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10697. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10698. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10699. do { \
  10700. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10701. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10702. } while (0)
  10703. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10704. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10705. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10706. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10707. /**
  10708. * @brief rx offload packet error message
  10709. *
  10710. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  10711. *
  10712. * @details
  10713. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10714. * of target payload like mic err.
  10715. *
  10716. * |31 24|23 16|15 8|7 0|
  10717. * |----------------+----------------+----------------+----------------|
  10718. * | tid | vdev_id | msg_sub_type | msg_type |
  10719. * |-------------------------------------------------------------------|
  10720. * : (sub-type dependent content) :
  10721. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10722. * Header fields:
  10723. * - msg_type
  10724. * Bits 7:0
  10725. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10726. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10727. * - msg_sub_type
  10728. * Bits 15:8
  10729. * Purpose: Identifies which type of rx error is reported by this message
  10730. * value: htt_rx_ofld_pkt_err_type
  10731. * - vdev_id
  10732. * Bits 23:16
  10733. * Purpose: Identifies which vdev received the erroneous rx frame
  10734. * value:
  10735. * - tid
  10736. * Bits 31:24
  10737. * Purpose: Identifies the traffic type of the rx frame
  10738. * value:
  10739. *
  10740. * - The payload fields used if the sub-type == MIC error are shown below.
  10741. * Note - MIC err is per MSDU, while PN is per MPDU.
  10742. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10743. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10744. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10745. * instead of sending separate HTT messages for each wrong MSDU within
  10746. * the MPDU.
  10747. *
  10748. * |31 24|23 16|15 8|7 0|
  10749. * |----------------+----------------+----------------+----------------|
  10750. * | Rsvd | key_id | peer_id |
  10751. * |-------------------------------------------------------------------|
  10752. * | receiver MAC addr 31:0 |
  10753. * |-------------------------------------------------------------------|
  10754. * | Rsvd | receiver MAC addr 47:32 |
  10755. * |-------------------------------------------------------------------|
  10756. * | transmitter MAC addr 31:0 |
  10757. * |-------------------------------------------------------------------|
  10758. * | Rsvd | transmitter MAC addr 47:32 |
  10759. * |-------------------------------------------------------------------|
  10760. * | PN 31:0 |
  10761. * |-------------------------------------------------------------------|
  10762. * | Rsvd | PN 47:32 |
  10763. * |-------------------------------------------------------------------|
  10764. * - peer_id
  10765. * Bits 15:0
  10766. * Purpose: identifies which peer is frame is from
  10767. * value:
  10768. * - key_id
  10769. * Bits 23:16
  10770. * Purpose: identifies key_id of rx frame
  10771. * value:
  10772. * - RA_31_0 (receiver MAC addr 31:0)
  10773. * Bits 31:0
  10774. * Purpose: identifies by MAC address which vdev received the frame
  10775. * value: MAC address lower 4 bytes
  10776. * - RA_47_32 (receiver MAC addr 47:32)
  10777. * Bits 15:0
  10778. * Purpose: identifies by MAC address which vdev received the frame
  10779. * value: MAC address upper 2 bytes
  10780. * - TA_31_0 (transmitter MAC addr 31:0)
  10781. * Bits 31:0
  10782. * Purpose: identifies by MAC address which peer transmitted the frame
  10783. * value: MAC address lower 4 bytes
  10784. * - TA_47_32 (transmitter MAC addr 47:32)
  10785. * Bits 15:0
  10786. * Purpose: identifies by MAC address which peer transmitted the frame
  10787. * value: MAC address upper 2 bytes
  10788. * - PN_31_0
  10789. * Bits 31:0
  10790. * Purpose: Identifies pn of rx frame
  10791. * value: PN lower 4 bytes
  10792. * - PN_47_32
  10793. * Bits 15:0
  10794. * Purpose: Identifies pn of rx frame
  10795. * value:
  10796. * TKIP or CCMP: PN upper 2 bytes
  10797. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10798. */
  10799. enum htt_rx_ofld_pkt_err_type {
  10800. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10801. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10802. };
  10803. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10804. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10805. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10806. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10807. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10808. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10809. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10810. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10811. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10812. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10813. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10814. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10815. do { \
  10816. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10817. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10818. } while (0)
  10819. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10820. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10821. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10822. do { \
  10823. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10824. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10825. } while (0)
  10826. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10827. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10828. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10829. do { \
  10830. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10831. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10832. } while (0)
  10833. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10834. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10835. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10836. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10837. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10838. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10839. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10840. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10841. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10842. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10843. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10844. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10845. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10846. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10847. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10848. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10849. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10850. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10851. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10852. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10853. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10854. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10855. do { \
  10856. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10857. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10858. } while (0)
  10859. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10860. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10861. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10862. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10863. do { \
  10864. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10865. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10866. } while (0)
  10867. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10868. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10869. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10870. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10871. do { \
  10872. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10873. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10874. } while (0)
  10875. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10876. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10877. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10878. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10879. do { \
  10880. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10881. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10882. } while (0)
  10883. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10884. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10885. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10886. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10887. do { \
  10888. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10889. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10890. } while (0)
  10891. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10892. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10893. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10894. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10895. do { \
  10896. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10897. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10898. } while (0)
  10899. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10900. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10901. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10902. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10903. do { \
  10904. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10905. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10906. } while (0)
  10907. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10908. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10909. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10910. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10911. do { \
  10912. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10913. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10914. } while (0)
  10915. /**
  10916. * @brief target -> host peer rate report message
  10917. *
  10918. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  10919. *
  10920. * @details
  10921. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10922. * justified rate of all the peers.
  10923. *
  10924. * |31 24|23 16|15 8|7 0|
  10925. * |----------------+----------------+----------------+----------------|
  10926. * | peer_count | | msg_type |
  10927. * |-------------------------------------------------------------------|
  10928. * : Payload (variant number of peer rate report) :
  10929. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10930. * Header fields:
  10931. * - msg_type
  10932. * Bits 7:0
  10933. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10934. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10935. * - reserved
  10936. * Bits 15:8
  10937. * Purpose:
  10938. * value:
  10939. * - peer_count
  10940. * Bits 31:16
  10941. * Purpose: Specify how many peer rate report elements are present in the payload.
  10942. * value:
  10943. *
  10944. * Payload:
  10945. * There are variant number of peer rate report follow the first 32 bits.
  10946. * The peer rate report is defined as follows.
  10947. *
  10948. * |31 20|19 16|15 0|
  10949. * |-----------------------+---------+---------------------------------|-
  10950. * | reserved | phy | peer_id | \
  10951. * |-------------------------------------------------------------------| -> report #0
  10952. * | rate | /
  10953. * |-----------------------+---------+---------------------------------|-
  10954. * | reserved | phy | peer_id | \
  10955. * |-------------------------------------------------------------------| -> report #1
  10956. * | rate | /
  10957. * |-----------------------+---------+---------------------------------|-
  10958. * | reserved | phy | peer_id | \
  10959. * |-------------------------------------------------------------------| -> report #2
  10960. * | rate | /
  10961. * |-------------------------------------------------------------------|-
  10962. * : :
  10963. * : :
  10964. * : :
  10965. * :-------------------------------------------------------------------:
  10966. *
  10967. * - peer_id
  10968. * Bits 15:0
  10969. * Purpose: identify the peer
  10970. * value:
  10971. * - phy
  10972. * Bits 19:16
  10973. * Purpose: identify which phy is in use
  10974. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10975. * Please see enum htt_peer_report_phy_type for detail.
  10976. * - reserved
  10977. * Bits 31:20
  10978. * Purpose:
  10979. * value:
  10980. * - rate
  10981. * Bits 31:0
  10982. * Purpose: represent the justified rate of the peer specified by peer_id
  10983. * value:
  10984. */
  10985. enum htt_peer_rate_report_phy_type {
  10986. HTT_PEER_RATE_REPORT_11B = 0,
  10987. HTT_PEER_RATE_REPORT_11A_G,
  10988. HTT_PEER_RATE_REPORT_11N,
  10989. HTT_PEER_RATE_REPORT_11AC,
  10990. };
  10991. #define HTT_PEER_RATE_REPORT_SIZE 8
  10992. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10993. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10994. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10995. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10996. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10997. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10998. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10999. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  11000. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  11001. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  11004. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  11005. } while (0)
  11006. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  11007. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  11008. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  11009. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  11010. do { \
  11011. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  11012. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  11013. } while (0)
  11014. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  11015. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  11016. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  11017. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  11018. do { \
  11019. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  11020. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  11021. } while (0)
  11022. /**
  11023. * @brief target -> host flow pool map message
  11024. *
  11025. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  11026. *
  11027. * @details
  11028. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  11029. * a flow of descriptors.
  11030. *
  11031. * This message is in TLV format and indicates the parameters to be setup a
  11032. * flow in the host. Each entry indicates that a particular flow ID is ready to
  11033. * receive descriptors from a specified pool.
  11034. *
  11035. * The message would appear as follows:
  11036. *
  11037. * |31 24|23 16|15 8|7 0|
  11038. * |----------------+----------------+----------------+----------------|
  11039. * header | reserved | num_flows | msg_type |
  11040. * |-------------------------------------------------------------------|
  11041. * | |
  11042. * : payload :
  11043. * | |
  11044. * |-------------------------------------------------------------------|
  11045. *
  11046. * The header field is one DWORD long and is interpreted as follows:
  11047. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  11048. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  11049. * this message
  11050. * b'16-31 - reserved: These bits are reserved for future use
  11051. *
  11052. * Payload:
  11053. * The payload would contain multiple objects of the following structure. Each
  11054. * object represents a flow.
  11055. *
  11056. * |31 24|23 16|15 8|7 0|
  11057. * |----------------+----------------+----------------+----------------|
  11058. * header | reserved | num_flows | msg_type |
  11059. * |-------------------------------------------------------------------|
  11060. * payload0| flow_type |
  11061. * |-------------------------------------------------------------------|
  11062. * | flow_id |
  11063. * |-------------------------------------------------------------------|
  11064. * | reserved0 | flow_pool_id |
  11065. * |-------------------------------------------------------------------|
  11066. * | reserved1 | flow_pool_size |
  11067. * |-------------------------------------------------------------------|
  11068. * | reserved2 |
  11069. * |-------------------------------------------------------------------|
  11070. * payload1| flow_type |
  11071. * |-------------------------------------------------------------------|
  11072. * | flow_id |
  11073. * |-------------------------------------------------------------------|
  11074. * | reserved0 | flow_pool_id |
  11075. * |-------------------------------------------------------------------|
  11076. * | reserved1 | flow_pool_size |
  11077. * |-------------------------------------------------------------------|
  11078. * | reserved2 |
  11079. * |-------------------------------------------------------------------|
  11080. * | . |
  11081. * | . |
  11082. * | . |
  11083. * |-------------------------------------------------------------------|
  11084. *
  11085. * Each payload is 5 DWORDS long and is interpreted as follows:
  11086. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  11087. * this flow is associated. It can be VDEV, peer,
  11088. * or tid (AC). Based on enum htt_flow_type.
  11089. *
  11090. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11091. * object. For flow_type vdev it is set to the
  11092. * vdevid, for peer it is peerid and for tid, it is
  11093. * tid_num.
  11094. *
  11095. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  11096. * in the host for this flow
  11097. * b'16:31 - reserved0: This field in reserved for the future. In case
  11098. * we have a hierarchical implementation (HCM) of
  11099. * pools, it can be used to indicate the ID of the
  11100. * parent-pool.
  11101. *
  11102. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  11103. * Descriptors for this flow will be
  11104. * allocated from this pool in the host.
  11105. * b'16:31 - reserved1: This field in reserved for the future. In case
  11106. * we have a hierarchical implementation of pools,
  11107. * it can be used to indicate the max number of
  11108. * descriptors in the pool. The b'0:15 can be used
  11109. * to indicate min number of descriptors in the
  11110. * HCM scheme.
  11111. *
  11112. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  11113. * we have a hierarchical implementation of pools,
  11114. * b'0:15 can be used to indicate the
  11115. * priority-based borrowing (PBB) threshold of
  11116. * the flow's pool. The b'16:31 are still left
  11117. * reserved.
  11118. */
  11119. enum htt_flow_type {
  11120. FLOW_TYPE_VDEV = 0,
  11121. /* Insert new flow types above this line */
  11122. };
  11123. PREPACK struct htt_flow_pool_map_payload_t {
  11124. A_UINT32 flow_type;
  11125. A_UINT32 flow_id;
  11126. A_UINT32 flow_pool_id:16,
  11127. reserved0:16;
  11128. A_UINT32 flow_pool_size:16,
  11129. reserved1:16;
  11130. A_UINT32 reserved2;
  11131. } POSTPACK;
  11132. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11133. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11134. (sizeof(struct htt_flow_pool_map_payload_t))
  11135. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11136. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11137. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11138. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11139. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11140. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11141. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11142. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11143. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11144. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11145. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11146. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11147. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11148. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11149. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11150. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11151. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11152. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11153. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11154. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11155. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11156. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11157. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11158. do { \
  11159. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11160. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11161. } while (0)
  11162. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11165. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11166. } while (0)
  11167. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11168. do { \
  11169. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11170. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11171. } while (0)
  11172. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11173. do { \
  11174. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11175. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11176. } while (0)
  11177. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11178. do { \
  11179. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11180. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11181. } while (0)
  11182. /**
  11183. * @brief target -> host flow pool unmap message
  11184. *
  11185. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11186. *
  11187. * @details
  11188. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11189. * down a flow of descriptors.
  11190. * This message indicates that for the flow (whose ID is provided) is wanting
  11191. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11192. * pool of descriptors from where descriptors are being allocated for this
  11193. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11194. * be unmapped by the host.
  11195. *
  11196. * The message would appear as follows:
  11197. *
  11198. * |31 24|23 16|15 8|7 0|
  11199. * |----------------+----------------+----------------+----------------|
  11200. * | reserved0 | msg_type |
  11201. * |-------------------------------------------------------------------|
  11202. * | flow_type |
  11203. * |-------------------------------------------------------------------|
  11204. * | flow_id |
  11205. * |-------------------------------------------------------------------|
  11206. * | reserved1 | flow_pool_id |
  11207. * |-------------------------------------------------------------------|
  11208. *
  11209. * The message is interpreted as follows:
  11210. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  11211. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  11212. * b'8:31 - reserved0: Reserved for future use
  11213. *
  11214. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11215. * this flow is associated. It can be VDEV, peer,
  11216. * or tid (AC). Based on enum htt_flow_type.
  11217. *
  11218. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11219. * object. For flow_type vdev it is set to the
  11220. * vdevid, for peer it is peerid and for tid, it is
  11221. * tid_num.
  11222. *
  11223. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11224. * used in the host for this flow
  11225. * b'16:31 - reserved0: This field in reserved for the future.
  11226. *
  11227. */
  11228. PREPACK struct htt_flow_pool_unmap_t {
  11229. A_UINT32 msg_type:8,
  11230. reserved0:24;
  11231. A_UINT32 flow_type;
  11232. A_UINT32 flow_id;
  11233. A_UINT32 flow_pool_id:16,
  11234. reserved1:16;
  11235. } POSTPACK;
  11236. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11237. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11238. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11239. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11240. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11241. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11242. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11243. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11244. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11245. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11246. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11247. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11248. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11249. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11250. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11251. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11252. do { \
  11253. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11254. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11255. } while (0)
  11256. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11257. do { \
  11258. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11259. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11260. } while (0)
  11261. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11262. do { \
  11263. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11264. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11265. } while (0)
  11266. /**
  11267. * @brief target -> host SRING setup done message
  11268. *
  11269. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11270. *
  11271. * @details
  11272. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11273. * SRNG ring setup is done
  11274. *
  11275. * This message indicates whether the last setup operation is successful.
  11276. * It will be sent to host when host set respose_required bit in
  11277. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11278. * The message would appear as follows:
  11279. *
  11280. * |31 24|23 16|15 8|7 0|
  11281. * |--------------- +----------------+----------------+----------------|
  11282. * | setup_status | ring_id | pdev_id | msg_type |
  11283. * |-------------------------------------------------------------------|
  11284. *
  11285. * The message is interpreted as follows:
  11286. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  11287. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  11288. * b'8:15 - pdev_id:
  11289. * 0 (for rings at SOC/UMAC level),
  11290. * 1/2/3 mac id (for rings at LMAC level)
  11291. * b'16:23 - ring_id: Identify the ring which is set up
  11292. * More details can be got from enum htt_srng_ring_id
  11293. * b'24:31 - setup_status: Indicate status of setup operation
  11294. * Refer to htt_ring_setup_status
  11295. */
  11296. PREPACK struct htt_sring_setup_done_t {
  11297. A_UINT32 msg_type: 8,
  11298. pdev_id: 8,
  11299. ring_id: 8,
  11300. setup_status: 8;
  11301. } POSTPACK;
  11302. enum htt_ring_setup_status {
  11303. htt_ring_setup_status_ok = 0,
  11304. htt_ring_setup_status_error,
  11305. };
  11306. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11307. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11308. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11309. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11310. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11311. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11312. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11315. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11316. } while (0)
  11317. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11318. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11319. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11320. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11321. HTT_SRING_SETUP_DONE_RING_ID_S)
  11322. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11323. do { \
  11324. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11325. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11326. } while (0)
  11327. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11328. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11329. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11330. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11331. HTT_SRING_SETUP_DONE_STATUS_S)
  11332. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11333. do { \
  11334. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11335. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11336. } while (0)
  11337. /**
  11338. * @brief target -> flow map flow info
  11339. *
  11340. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11341. *
  11342. * @details
  11343. * HTT TX map flow entry with tqm flow pointer
  11344. * Sent from firmware to host to add tqm flow pointer in corresponding
  11345. * flow search entry. Flow metadata is replayed back to host as part of this
  11346. * struct to enable host to find the specific flow search entry
  11347. *
  11348. * The message would appear as follows:
  11349. *
  11350. * |31 28|27 18|17 14|13 8|7 0|
  11351. * |-------+------------------------------------------+----------------|
  11352. * | rsvd0 | fse_hsh_idx | msg_type |
  11353. * |-------------------------------------------------------------------|
  11354. * | rsvd1 | tid | peer_id |
  11355. * |-------------------------------------------------------------------|
  11356. * | tqm_flow_pntr_lo |
  11357. * |-------------------------------------------------------------------|
  11358. * | tqm_flow_pntr_hi |
  11359. * |-------------------------------------------------------------------|
  11360. * | fse_meta_data |
  11361. * |-------------------------------------------------------------------|
  11362. *
  11363. * The message is interpreted as follows:
  11364. *
  11365. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  11366. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  11367. *
  11368. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11369. * for this flow entry
  11370. *
  11371. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11372. *
  11373. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11374. *
  11375. * dword1 - b'14:17 - tid
  11376. *
  11377. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11378. *
  11379. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11380. *
  11381. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11382. *
  11383. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11384. * given by host
  11385. */
  11386. PREPACK struct htt_tx_map_flow_info {
  11387. A_UINT32
  11388. msg_type: 8,
  11389. fse_hsh_idx: 20,
  11390. rsvd0: 4;
  11391. A_UINT32
  11392. peer_id: 14,
  11393. tid: 4,
  11394. rsvd1: 14;
  11395. A_UINT32 tqm_flow_pntr_lo;
  11396. A_UINT32 tqm_flow_pntr_hi;
  11397. struct htt_tx_flow_metadata fse_meta_data;
  11398. } POSTPACK;
  11399. /* DWORD 0 */
  11400. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11401. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11402. /* DWORD 1 */
  11403. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11404. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11405. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11406. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11407. /* DWORD 0 */
  11408. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11409. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11410. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11411. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11414. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11415. } while (0)
  11416. /* DWORD 1 */
  11417. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11418. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11419. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11420. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11421. do { \
  11422. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11423. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11424. } while (0)
  11425. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11426. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11427. HTT_TX_MAP_FLOW_INFO_TID_S)
  11428. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11429. do { \
  11430. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11431. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11432. } while (0)
  11433. /*
  11434. * htt_dbg_ext_stats_status -
  11435. * present - The requested stats have been delivered in full.
  11436. * This indicates that either the stats information was contained
  11437. * in its entirety within this message, or else this message
  11438. * completes the delivery of the requested stats info that was
  11439. * partially delivered through earlier STATS_CONF messages.
  11440. * partial - The requested stats have been delivered in part.
  11441. * One or more subsequent STATS_CONF messages with the same
  11442. * cookie value will be sent to deliver the remainder of the
  11443. * information.
  11444. * error - The requested stats could not be delivered, for example due
  11445. * to a shortage of memory to construct a message holding the
  11446. * requested stats.
  11447. * invalid - The requested stat type is either not recognized, or the
  11448. * target is configured to not gather the stats type in question.
  11449. */
  11450. enum htt_dbg_ext_stats_status {
  11451. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11452. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11453. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11454. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11455. };
  11456. /**
  11457. * @brief target -> host ppdu stats upload
  11458. *
  11459. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  11460. *
  11461. * @details
  11462. * The following field definitions describe the format of the HTT target
  11463. * to host ppdu stats indication message.
  11464. *
  11465. *
  11466. * |31 16|15 12|11 10|9 8|7 0 |
  11467. * |----------------------------------------------------------------------|
  11468. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11469. * |----------------------------------------------------------------------|
  11470. * | ppdu_id |
  11471. * |----------------------------------------------------------------------|
  11472. * | Timestamp in us |
  11473. * |----------------------------------------------------------------------|
  11474. * | reserved |
  11475. * |----------------------------------------------------------------------|
  11476. * | type-specific stats info |
  11477. * | (see htt_ppdu_stats.h) |
  11478. * |----------------------------------------------------------------------|
  11479. * Header fields:
  11480. * - MSG_TYPE
  11481. * Bits 7:0
  11482. * Purpose: Identifies this is a PPDU STATS indication
  11483. * message.
  11484. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  11485. * - mac_id
  11486. * Bits 9:8
  11487. * Purpose: mac_id of this ppdu_id
  11488. * Value: 0-3
  11489. * - pdev_id
  11490. * Bits 11:10
  11491. * Purpose: pdev_id of this ppdu_id
  11492. * Value: 0-3
  11493. * 0 (for rings at SOC level),
  11494. * 1/2/3 PDEV -> 0/1/2
  11495. * - payload_size
  11496. * Bits 31:16
  11497. * Purpose: total tlv size
  11498. * Value: payload_size in bytes
  11499. */
  11500. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11501. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11502. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11503. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11504. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11505. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11506. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11507. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11508. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11509. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11510. do { \
  11511. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11512. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11513. } while (0)
  11514. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11515. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11516. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11517. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11518. do { \
  11519. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11520. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11521. } while (0)
  11522. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11523. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11524. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11525. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11526. do { \
  11527. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11528. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11529. } while (0)
  11530. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11531. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11532. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11533. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11534. do { \
  11535. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11536. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11537. } while (0)
  11538. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11539. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11540. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11541. /* htt_t2h_ppdu_stats_ind_hdr_t
  11542. * This struct contains the fields within the header of the
  11543. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11544. * stats info.
  11545. * This struct assumes little-endian layout, and thus is only
  11546. * suitable for use within processors known to be little-endian
  11547. * (such as the target).
  11548. * In contrast, the above macros provide endian-portable methods
  11549. * to get and set the bitfields within this PPDU_STATS_IND header.
  11550. */
  11551. typedef struct {
  11552. A_UINT32 msg_type: 8, /* bits 7:0 */
  11553. mac_id: 2, /* bits 9:8 */
  11554. pdev_id: 2, /* bits 11:10 */
  11555. reserved1: 4, /* bits 15:12 */
  11556. payload_size: 16; /* bits 31:16 */
  11557. A_UINT32 ppdu_id;
  11558. A_UINT32 timestamp_us;
  11559. A_UINT32 reserved2;
  11560. } htt_t2h_ppdu_stats_ind_hdr_t;
  11561. /**
  11562. * @brief target -> host extended statistics upload
  11563. *
  11564. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  11565. *
  11566. * @details
  11567. * The following field definitions describe the format of the HTT target
  11568. * to host stats upload confirmation message.
  11569. * The message contains a cookie echoed from the HTT host->target stats
  11570. * upload request, which identifies which request the confirmation is
  11571. * for, and a single stats can span over multiple HTT stats indication
  11572. * due to the HTT message size limitation so every HTT ext stats indication
  11573. * will have tag-length-value stats information elements.
  11574. * The tag-length header for each HTT stats IND message also includes a
  11575. * status field, to indicate whether the request for the stat type in
  11576. * question was fully met, partially met, unable to be met, or invalid
  11577. * (if the stat type in question is disabled in the target).
  11578. * A Done bit 1's indicate the end of the of stats info elements.
  11579. *
  11580. *
  11581. * |31 16|15 12|11|10 8|7 5|4 0|
  11582. * |--------------------------------------------------------------|
  11583. * | reserved | msg type |
  11584. * |--------------------------------------------------------------|
  11585. * | cookie LSBs |
  11586. * |--------------------------------------------------------------|
  11587. * | cookie MSBs |
  11588. * |--------------------------------------------------------------|
  11589. * | stats entry length | rsvd | D| S | stat type |
  11590. * |--------------------------------------------------------------|
  11591. * | type-specific stats info |
  11592. * | (see htt_stats.h) |
  11593. * |--------------------------------------------------------------|
  11594. * Header fields:
  11595. * - MSG_TYPE
  11596. * Bits 7:0
  11597. * Purpose: Identifies this is a extended statistics upload confirmation
  11598. * message.
  11599. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  11600. * - COOKIE_LSBS
  11601. * Bits 31:0
  11602. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11603. * message with its preceding host->target stats request message.
  11604. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11605. * - COOKIE_MSBS
  11606. * Bits 31:0
  11607. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11608. * message with its preceding host->target stats request message.
  11609. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11610. *
  11611. * Stats Information Element tag-length header fields:
  11612. * - STAT_TYPE
  11613. * Bits 7:0
  11614. * Purpose: identifies the type of statistics info held in the
  11615. * following information element
  11616. * Value: htt_dbg_ext_stats_type
  11617. * - STATUS
  11618. * Bits 10:8
  11619. * Purpose: indicate whether the requested stats are present
  11620. * Value: htt_dbg_ext_stats_status
  11621. * - DONE
  11622. * Bits 11
  11623. * Purpose:
  11624. * Indicates the completion of the stats entry, this will be the last
  11625. * stats conf HTT segment for the requested stats type.
  11626. * Value:
  11627. * 0 -> the stats retrieval is ongoing
  11628. * 1 -> the stats retrieval is complete
  11629. * - LENGTH
  11630. * Bits 31:16
  11631. * Purpose: indicate the stats information size
  11632. * Value: This field specifies the number of bytes of stats information
  11633. * that follows the element tag-length header.
  11634. * It is expected but not required that this length is a multiple of
  11635. * 4 bytes.
  11636. */
  11637. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11638. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11639. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11640. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11641. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11642. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11643. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11644. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11645. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11646. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11647. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11648. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11649. do { \
  11650. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11651. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11652. } while (0)
  11653. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11654. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11655. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11656. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11657. do { \
  11658. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11659. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11660. } while (0)
  11661. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11662. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11663. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11664. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11665. do { \
  11666. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11667. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11668. } while (0)
  11669. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11670. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11671. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11672. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11673. do { \
  11674. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11675. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11676. } while (0)
  11677. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11678. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11679. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11680. typedef enum {
  11681. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11682. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11683. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11684. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11685. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11686. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11687. /* Reserved from 128 - 255 for target internal use.*/
  11688. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11689. } HTT_PEER_TYPE;
  11690. /** macro to convert MAC address from char array to HTT word format */
  11691. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11692. (phtt_mac_addr)->mac_addr31to0 = \
  11693. (((c_macaddr)[0] << 0) | \
  11694. ((c_macaddr)[1] << 8) | \
  11695. ((c_macaddr)[2] << 16) | \
  11696. ((c_macaddr)[3] << 24)); \
  11697. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11698. } while (0)
  11699. /**
  11700. * @brief target -> host monitor mac header indication message
  11701. *
  11702. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  11703. *
  11704. * @details
  11705. * The following diagram shows the format of the monitor mac header message
  11706. * sent from the target to the host.
  11707. * This message is primarily sent when promiscuous rx mode is enabled.
  11708. * One message is sent per rx PPDU.
  11709. *
  11710. * |31 24|23 16|15 8|7 0|
  11711. * |-------------------------------------------------------------|
  11712. * | peer_id | reserved0 | msg_type |
  11713. * |-------------------------------------------------------------|
  11714. * | reserved1 | num_mpdu |
  11715. * |-------------------------------------------------------------|
  11716. * | struct hw_rx_desc |
  11717. * | (see wal_rx_desc.h) |
  11718. * |-------------------------------------------------------------|
  11719. * | struct ieee80211_frame_addr4 |
  11720. * | (see ieee80211_defs.h) |
  11721. * |-------------------------------------------------------------|
  11722. * | struct ieee80211_frame_addr4 |
  11723. * | (see ieee80211_defs.h) |
  11724. * |-------------------------------------------------------------|
  11725. * | ...... |
  11726. * |-------------------------------------------------------------|
  11727. *
  11728. * Header fields:
  11729. * - msg_type
  11730. * Bits 7:0
  11731. * Purpose: Identifies this is a monitor mac header indication message.
  11732. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  11733. * - peer_id
  11734. * Bits 31:16
  11735. * Purpose: Software peer id given by host during association,
  11736. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11737. * for rx PPDUs received from unassociated peers.
  11738. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11739. * - num_mpdu
  11740. * Bits 15:0
  11741. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11742. * delivered within the message.
  11743. * Value: 1 to 32
  11744. * num_mpdu is limited to a maximum value of 32, due to buffer
  11745. * size limits. For PPDUs with more than 32 MPDUs, only the
  11746. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11747. * the PPDU will be provided.
  11748. */
  11749. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11750. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11751. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11752. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11753. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11754. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11755. do { \
  11756. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11757. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11758. } while (0)
  11759. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11760. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11761. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11762. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11765. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11766. } while (0)
  11767. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11768. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11769. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11770. /**
  11771. * @brief target -> host flow pool resize Message
  11772. *
  11773. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11774. *
  11775. * @details
  11776. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11777. * the flow pool associated with the specified ID is resized
  11778. *
  11779. * The message would appear as follows:
  11780. *
  11781. * |31 16|15 8|7 0|
  11782. * |---------------------------------+----------------+----------------|
  11783. * | reserved0 | Msg type |
  11784. * |-------------------------------------------------------------------|
  11785. * | flow pool new size | flow pool ID |
  11786. * |-------------------------------------------------------------------|
  11787. *
  11788. * The message is interpreted as follows:
  11789. * b'0:7 - msg_type: This will be set to 0x21
  11790. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  11791. *
  11792. * b'0:15 - flow pool ID: Existing flow pool ID
  11793. *
  11794. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11795. *
  11796. */
  11797. PREPACK struct htt_flow_pool_resize_t {
  11798. A_UINT32 msg_type:8,
  11799. reserved0:24;
  11800. A_UINT32 flow_pool_id:16,
  11801. flow_pool_new_size:16;
  11802. } POSTPACK;
  11803. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11804. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11805. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11806. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11807. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11808. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11809. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11810. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11811. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11814. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11815. } while (0)
  11816. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11817. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11818. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11819. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11820. do { \
  11821. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11822. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11823. } while (0)
  11824. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11825. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11826. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11827. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11828. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11829. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11830. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11831. /*
  11832. * The read and write indices point to the data within the host buffer.
  11833. * Because the first 4 bytes of the host buffer is used for the read index and
  11834. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11835. * The read index and write index are the byte offsets from the base of the
  11836. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11837. * Refer the ASCII text picture below.
  11838. */
  11839. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11840. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11841. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11842. /*
  11843. ***************************************************************************
  11844. *
  11845. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11846. *
  11847. ***************************************************************************
  11848. *
  11849. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11850. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11851. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11852. * written into the Host memory region mentioned below.
  11853. *
  11854. * Read index is updated by the Host. At any point of time, the read index will
  11855. * indicate the index that will next be read by the Host. The read index is
  11856. * in units of bytes offset from the base of the meta-data buffer.
  11857. *
  11858. * Write index is updated by the FW. At any point of time, the write index will
  11859. * indicate from where the FW can start writing any new data. The write index is
  11860. * in units of bytes offset from the base of the meta-data buffer.
  11861. *
  11862. * If the Host is not fast enough in reading the CFR data, any new capture data
  11863. * would be dropped if there is no space left to write the new captures.
  11864. *
  11865. * The last 4 bytes of the memory region will have the magic pattern
  11866. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11867. * not overrun the host buffer.
  11868. *
  11869. * ,--------------------. read and write indices store the
  11870. * | | byte offset from the base of the
  11871. * | ,--------+--------. meta-data buffer to the next
  11872. * | | | | location within the data buffer
  11873. * | | v v that will be read / written
  11874. * ************************************************************************
  11875. * * Read * Write * * Magic *
  11876. * * index * index * CFR data1 ...... CFR data N * pattern *
  11877. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11878. * ************************************************************************
  11879. * |<---------- data buffer ---------->|
  11880. *
  11881. * |<----------------- meta-data buffer allocated in Host ----------------|
  11882. *
  11883. * Note:
  11884. * - Considering the 4 bytes needed to store the Read index (R) and the
  11885. * Write index (W), the initial value is as follows:
  11886. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11887. * - Buffer empty condition:
  11888. * R = W
  11889. *
  11890. * Regarding CFR data format:
  11891. * --------------------------
  11892. *
  11893. * Each CFR tone is stored in HW as 16-bits with the following format:
  11894. * {bits[15:12], bits[11:6], bits[5:0]} =
  11895. * {unsigned exponent (4 bits),
  11896. * signed mantissa_real (6 bits),
  11897. * signed mantissa_imag (6 bits)}
  11898. *
  11899. * CFR_real = mantissa_real * 2^(exponent-5)
  11900. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11901. *
  11902. *
  11903. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11904. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11905. *
  11906. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11907. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11908. * .
  11909. * .
  11910. * .
  11911. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11912. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11913. */
  11914. /* Bandwidth of peer CFR captures */
  11915. typedef enum {
  11916. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11917. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11918. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11919. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11920. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11921. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11922. } HTT_PEER_CFR_CAPTURE_BW;
  11923. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11924. * was captured
  11925. */
  11926. typedef enum {
  11927. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11928. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11929. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11930. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11931. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11932. } HTT_PEER_CFR_CAPTURE_MODE;
  11933. typedef enum {
  11934. /* This message type is currently used for the below purpose:
  11935. *
  11936. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11937. * wmi_peer_cfr_capture_cmd.
  11938. * If payload_present bit is set to 0 then the associated memory region
  11939. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11940. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11941. * message; the CFR dump will be present at the end of the message,
  11942. * after the chan_phy_mode.
  11943. */
  11944. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11945. /* Always keep this last */
  11946. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11947. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11948. /**
  11949. * @brief target -> host CFR dump completion indication message definition
  11950. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11951. *
  11952. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11953. *
  11954. * @details
  11955. * The following diagram shows the format of the Channel Frequency Response
  11956. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11957. * the channel capture of a peer is copied by Firmware into the Host memory
  11958. *
  11959. * **************************************************************************
  11960. *
  11961. * Message format when the CFR capture message type is
  11962. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11963. *
  11964. * **************************************************************************
  11965. *
  11966. * |31 16|15 |8|7 0|
  11967. * |----------------------------------------------------------------|
  11968. * header: | reserved |P| msg_type |
  11969. * word 0 | | | |
  11970. * |----------------------------------------------------------------|
  11971. * payload: | cfr_capture_msg_type |
  11972. * word 1 | |
  11973. * |----------------------------------------------------------------|
  11974. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11975. * word 2 | | | | | | | | |
  11976. * |----------------------------------------------------------------|
  11977. * | mac_addr31to0 |
  11978. * word 3 | |
  11979. * |----------------------------------------------------------------|
  11980. * | unused / reserved | mac_addr47to32 |
  11981. * word 4 | | |
  11982. * |----------------------------------------------------------------|
  11983. * | index |
  11984. * word 5 | |
  11985. * |----------------------------------------------------------------|
  11986. * | length |
  11987. * word 6 | |
  11988. * |----------------------------------------------------------------|
  11989. * | timestamp |
  11990. * word 7 | |
  11991. * |----------------------------------------------------------------|
  11992. * | counter |
  11993. * word 8 | |
  11994. * |----------------------------------------------------------------|
  11995. * | chan_mhz |
  11996. * word 9 | |
  11997. * |----------------------------------------------------------------|
  11998. * | band_center_freq1 |
  11999. * word 10 | |
  12000. * |----------------------------------------------------------------|
  12001. * | band_center_freq2 |
  12002. * word 11 | |
  12003. * |----------------------------------------------------------------|
  12004. * | chan_phy_mode |
  12005. * word 12 | |
  12006. * |----------------------------------------------------------------|
  12007. * where,
  12008. * P - payload present bit (payload_present explained below)
  12009. * req_id - memory request id (mem_req_id explained below)
  12010. * S - status field (status explained below)
  12011. * capbw - capture bandwidth (capture_bw explained below)
  12012. * mode - mode of capture (mode explained below)
  12013. * sts - space time streams (sts_count explained below)
  12014. * chbw - channel bandwidth (channel_bw explained below)
  12015. * captype - capture type (cap_type explained below)
  12016. *
  12017. * The following field definitions describe the format of the CFR dump
  12018. * completion indication sent from the target to the host
  12019. *
  12020. * Header fields:
  12021. *
  12022. * Word 0
  12023. * - msg_type
  12024. * Bits 7:0
  12025. * Purpose: Identifies this as CFR TX completion indication
  12026. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  12027. * - payload_present
  12028. * Bit 8
  12029. * Purpose: Identifies how CFR data is sent to host
  12030. * Value: 0 - If CFR Payload is written to host memory
  12031. * 1 - If CFR Payload is sent as part of HTT message
  12032. * (This is the requirement for SDIO/USB where it is
  12033. * not possible to write CFR data to host memory)
  12034. * - reserved
  12035. * Bits 31:9
  12036. * Purpose: Reserved
  12037. * Value: 0
  12038. *
  12039. * Payload fields:
  12040. *
  12041. * Word 1
  12042. * - cfr_capture_msg_type
  12043. * Bits 31:0
  12044. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  12045. * to specify the format used for the remainder of the message
  12046. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12047. * (currently only MSG_TYPE_1 is defined)
  12048. *
  12049. * Word 2
  12050. * - mem_req_id
  12051. * Bits 6:0
  12052. * Purpose: Contain the mem request id of the region where the CFR capture
  12053. * has been stored - of type WMI_HOST_MEM_REQ_ID
  12054. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  12055. this value is invalid)
  12056. * - status
  12057. * Bit 7
  12058. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  12059. * Value: 1 (True) - Successful; 0 (False) - Not successful
  12060. * - capture_bw
  12061. * Bits 10:8
  12062. * Purpose: Carry the bandwidth of the CFR capture
  12063. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  12064. * - mode
  12065. * Bits 13:11
  12066. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  12067. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  12068. * - sts_count
  12069. * Bits 16:14
  12070. * Purpose: Carry the number of space time streams
  12071. * Value: Number of space time streams
  12072. * - channel_bw
  12073. * Bits 19:17
  12074. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  12075. * measurement
  12076. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  12077. * - cap_type
  12078. * Bits 23:20
  12079. * Purpose: Carry the type of the capture
  12080. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  12081. * - vdev_id
  12082. * Bits 31:24
  12083. * Purpose: Carry the virtual device id
  12084. * Value: vdev ID
  12085. *
  12086. * Word 3
  12087. * - mac_addr31to0
  12088. * Bits 31:0
  12089. * Purpose: Contain the bits 31:0 of the peer MAC address
  12090. * Value: Bits 31:0 of the peer MAC address
  12091. *
  12092. * Word 4
  12093. * - mac_addr47to32
  12094. * Bits 15:0
  12095. * Purpose: Contain the bits 47:32 of the peer MAC address
  12096. * Value: Bits 47:32 of the peer MAC address
  12097. *
  12098. * Word 5
  12099. * - index
  12100. * Bits 31:0
  12101. * Purpose: Contain the index at which this CFR dump was written in the Host
  12102. * allocated memory. This index is the number of bytes from the base address.
  12103. * Value: Index position
  12104. *
  12105. * Word 6
  12106. * - length
  12107. * Bits 31:0
  12108. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12109. * Value: Length of the CFR capture of the peer
  12110. *
  12111. * Word 7
  12112. * - timestamp
  12113. * Bits 31:0
  12114. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12115. * clock used for this timestamp is private to the target and not visible to
  12116. * the host i.e., Host can interpret only the relative timestamp deltas from
  12117. * one message to the next, but can't interpret the absolute timestamp from a
  12118. * single message.
  12119. * Value: Timestamp in microseconds
  12120. *
  12121. * Word 8
  12122. * - counter
  12123. * Bits 31:0
  12124. * Purpose: Carry the count of the current CFR capture from FW. This is
  12125. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12126. * in host memory)
  12127. * Value: Count of the current CFR capture
  12128. *
  12129. * Word 9
  12130. * - chan_mhz
  12131. * Bits 31:0
  12132. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12133. * Value: Primary 20 channel frequency
  12134. *
  12135. * Word 10
  12136. * - band_center_freq1
  12137. * Bits 31:0
  12138. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12139. * Value: Center frequency 1 in MHz
  12140. *
  12141. * Word 11
  12142. * - band_center_freq2
  12143. * Bits 31:0
  12144. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12145. * the VDEV
  12146. * 80plus80 mode
  12147. * Value: Center frequency 2 in MHz
  12148. *
  12149. * Word 12
  12150. * - chan_phy_mode
  12151. * Bits 31:0
  12152. * Purpose: Carry the phy mode of the channel, of the VDEV
  12153. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12154. */
  12155. PREPACK struct htt_cfr_dump_ind_type_1 {
  12156. A_UINT32 mem_req_id:7,
  12157. status:1,
  12158. capture_bw:3,
  12159. mode:3,
  12160. sts_count:3,
  12161. channel_bw:3,
  12162. cap_type:4,
  12163. vdev_id:8;
  12164. htt_mac_addr addr;
  12165. A_UINT32 index;
  12166. A_UINT32 length;
  12167. A_UINT32 timestamp;
  12168. A_UINT32 counter;
  12169. struct htt_chan_change_msg chan;
  12170. } POSTPACK;
  12171. PREPACK struct htt_cfr_dump_compl_ind {
  12172. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12173. union {
  12174. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12175. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12176. /* If there is a need to change the memory layout and its associated
  12177. * HTT indication format, a new CFR capture message type can be
  12178. * introduced and added into this union.
  12179. */
  12180. };
  12181. } POSTPACK;
  12182. /*
  12183. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12184. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12185. */
  12186. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12187. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12188. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12189. do { \
  12190. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12191. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12192. } while(0)
  12193. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12194. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12195. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12196. /*
  12197. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12198. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12199. */
  12200. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12201. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12202. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12203. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12204. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12205. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12206. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12207. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12208. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12209. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12210. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12211. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12212. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12213. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12214. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12215. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12216. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12217. do { \
  12218. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12219. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12220. } while (0)
  12221. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12222. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12223. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12224. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12225. do { \
  12226. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12227. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12228. } while (0)
  12229. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12230. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12231. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12232. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12233. do { \
  12234. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12235. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12236. } while (0)
  12237. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12238. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12239. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12240. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12241. do { \
  12242. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12243. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12244. } while (0)
  12245. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12246. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12247. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12248. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12249. do { \
  12250. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12251. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12252. } while (0)
  12253. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12254. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12255. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12256. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12259. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12260. } while (0)
  12261. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12262. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12263. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12264. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12265. do { \
  12266. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12267. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12268. } while (0)
  12269. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12270. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12271. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12272. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12273. do { \
  12274. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12275. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12276. } while (0)
  12277. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12278. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12279. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12280. /**
  12281. * @brief target -> host peer (PPDU) stats message
  12282. *
  12283. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12284. *
  12285. * @details
  12286. * This message is generated by FW when FW is sending stats to host
  12287. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12288. * This message is sent autonomously by the target rather than upon request
  12289. * by the host.
  12290. * The following field definitions describe the format of the HTT target
  12291. * to host peer stats indication message.
  12292. *
  12293. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12294. * or more PPDU stats records.
  12295. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12296. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12297. * then the message would start with the
  12298. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12299. * below.
  12300. *
  12301. * |31 16|15|14|13 11|10 9|8|7 0|
  12302. * |-------------------------------------------------------------|
  12303. * | reserved |MSG_TYPE |
  12304. * |-------------------------------------------------------------|
  12305. * rec 0 | TLV header |
  12306. * rec 0 |-------------------------------------------------------------|
  12307. * rec 0 | ppdu successful bytes |
  12308. * rec 0 |-------------------------------------------------------------|
  12309. * rec 0 | ppdu retry bytes |
  12310. * rec 0 |-------------------------------------------------------------|
  12311. * rec 0 | ppdu failed bytes |
  12312. * rec 0 |-------------------------------------------------------------|
  12313. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12314. * rec 0 |-------------------------------------------------------------|
  12315. * rec 0 | retried MSDUs | successful MSDUs |
  12316. * rec 0 |-------------------------------------------------------------|
  12317. * rec 0 | TX duration | failed MSDUs |
  12318. * rec 0 |-------------------------------------------------------------|
  12319. * ...
  12320. * |-------------------------------------------------------------|
  12321. * rec N | TLV header |
  12322. * rec N |-------------------------------------------------------------|
  12323. * rec N | ppdu successful bytes |
  12324. * rec N |-------------------------------------------------------------|
  12325. * rec N | ppdu retry bytes |
  12326. * rec N |-------------------------------------------------------------|
  12327. * rec N | ppdu failed bytes |
  12328. * rec N |-------------------------------------------------------------|
  12329. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12330. * rec N |-------------------------------------------------------------|
  12331. * rec N | retried MSDUs | successful MSDUs |
  12332. * rec N |-------------------------------------------------------------|
  12333. * rec N | TX duration | failed MSDUs |
  12334. * rec N |-------------------------------------------------------------|
  12335. *
  12336. * where:
  12337. * A = is A-MPDU flag
  12338. * BA = block-ack failure flags
  12339. * BW = bandwidth spec
  12340. * SG = SGI enabled spec
  12341. * S = skipped rate ctrl
  12342. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12343. *
  12344. * Header
  12345. * ------
  12346. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  12347. * dword0 - b'8:31 - reserved : Reserved for future use
  12348. *
  12349. * payload include below peer_stats information
  12350. * --------------------------------------------
  12351. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12352. * @tx_success_bytes : total successful bytes in the PPDU.
  12353. * @tx_retry_bytes : total retried bytes in the PPDU.
  12354. * @tx_failed_bytes : total failed bytes in the PPDU.
  12355. * @tx_ratecode : rate code used for the PPDU.
  12356. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12357. * @ba_ack_failed : BA/ACK failed for this PPDU
  12358. * b00 -> BA received
  12359. * b01 -> BA failed once
  12360. * b10 -> BA failed twice, when HW retry is enabled.
  12361. * @bw : BW
  12362. * b00 -> 20 MHz
  12363. * b01 -> 40 MHz
  12364. * b10 -> 80 MHz
  12365. * b11 -> 160 MHz (or 80+80)
  12366. * @sg : SGI enabled
  12367. * @s : skipped ratectrl
  12368. * @peer_id : peer id
  12369. * @tx_success_msdus : successful MSDUs
  12370. * @tx_retry_msdus : retried MSDUs
  12371. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12372. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12373. */
  12374. /**
  12375. * @brief target -> host backpressure event
  12376. *
  12377. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12378. *
  12379. * @details
  12380. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12381. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12382. * This message will only be sent if the backpressure condition has existed
  12383. * continuously for an initial period (100 ms).
  12384. * Repeat messages with updated information will be sent after each
  12385. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12386. * This message indicates the ring id along with current head and tail index
  12387. * locations (i.e. write and read indices).
  12388. * The backpressure time indicates the time in ms for which continous
  12389. * backpressure has been observed in the ring.
  12390. *
  12391. * The message format is as follows:
  12392. *
  12393. * |31 24|23 16|15 8|7 0|
  12394. * |----------------+----------------+----------------+----------------|
  12395. * | ring_id | ring_type | pdev_id | msg_type |
  12396. * |-------------------------------------------------------------------|
  12397. * | tail_idx | head_idx |
  12398. * |-------------------------------------------------------------------|
  12399. * | backpressure_time_ms |
  12400. * |-------------------------------------------------------------------|
  12401. *
  12402. * The message is interpreted as follows:
  12403. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  12404. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  12405. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12406. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12407. the msg is for LMAC ring.
  12408. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12409. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12410. * htt_backpressure_lmac_ring_id. This represents
  12411. * the ring id for which continous backpressure is seen
  12412. *
  12413. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12414. * the ring indicated by the ring_id
  12415. *
  12416. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12417. * the ring indicated by the ring id
  12418. *
  12419. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12420. * backpressure has been seen in the ring
  12421. * indicated by the ring_id.
  12422. * Units = milliseconds
  12423. */
  12424. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12425. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12426. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12427. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12428. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12429. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12430. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12431. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12432. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12433. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12434. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12435. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12436. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12437. do { \
  12438. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12439. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12440. } while (0)
  12441. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12442. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12443. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12444. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12445. do { \
  12446. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12447. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12448. } while (0)
  12449. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12450. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12451. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12452. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12453. do { \
  12454. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12455. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12456. } while (0)
  12457. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12458. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12459. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12460. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12461. do { \
  12462. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12463. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12464. } while (0)
  12465. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12466. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12467. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12468. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12469. do { \
  12470. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12471. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12472. } while (0)
  12473. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12474. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12475. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12476. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12477. do { \
  12478. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12479. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12480. } while (0)
  12481. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12482. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12483. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12484. enum htt_backpressure_ring_type {
  12485. HTT_SW_RING_TYPE_UMAC,
  12486. HTT_SW_RING_TYPE_LMAC,
  12487. HTT_SW_RING_TYPE_MAX,
  12488. };
  12489. /* Ring id for which the message is sent to host */
  12490. enum htt_backpressure_umac_ringid {
  12491. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12492. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12493. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12494. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12495. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12496. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12497. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12498. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12499. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12500. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12501. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12502. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12503. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12504. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12505. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12506. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12507. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12508. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12509. HTT_SW_UMAC_RING_IDX_MAX,
  12510. };
  12511. enum htt_backpressure_lmac_ringid {
  12512. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12513. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12514. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12515. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12516. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12517. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12518. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12519. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12520. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12521. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12522. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12523. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12524. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12525. HTT_SW_LMAC_RING_IDX_MAX,
  12526. };
  12527. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12528. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12529. pdev_id: 8,
  12530. ring_type: 8, /* htt_backpressure_ring_type */
  12531. /*
  12532. * ring_id holds an enum value from either
  12533. * htt_backpressure_umac_ringid or
  12534. * htt_backpressure_lmac_ringid, based on
  12535. * the ring_type setting.
  12536. */
  12537. ring_id: 8;
  12538. A_UINT16 head_idx;
  12539. A_UINT16 tail_idx;
  12540. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12541. } POSTPACK;
  12542. /*
  12543. * Defines two 32 bit words that can be used by the target to indicate a per
  12544. * user RU allocation and rate information.
  12545. *
  12546. * This information is currently provided in the "sw_response_reference_ptr"
  12547. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12548. * "rx_ppdu_end_user_stats" TLV.
  12549. *
  12550. * VALID:
  12551. * The consumer of these words must explicitly check the valid bit,
  12552. * and only attempt interpretation of any of the remaining fields if
  12553. * the valid bit is set to 1.
  12554. *
  12555. * VERSION:
  12556. * The consumer of these words must also explicitly check the version bit,
  12557. * and only use the V0 definition if the VERSION field is set to 0.
  12558. *
  12559. * Version 1 is currently undefined, with the exception of the VALID and
  12560. * VERSION fields.
  12561. *
  12562. * Version 0:
  12563. *
  12564. * The fields below are duplicated per BW.
  12565. *
  12566. * The consumer must determine which BW field to use, based on the UL OFDMA
  12567. * PPDU BW indicated by HW.
  12568. *
  12569. * RU_START: RU26 start index for the user.
  12570. * Note that this is always using the RU26 index, regardless
  12571. * of the actual RU assigned to the user
  12572. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12573. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12574. *
  12575. * For example, 20MHz (the value in the top row is RU_START)
  12576. *
  12577. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12578. * RU Size 1 (52): | | | | | |
  12579. * RU Size 2 (106): | | | |
  12580. * RU Size 3 (242): | |
  12581. *
  12582. * RU_SIZE: Indicates the RU size, as defined by enum
  12583. * htt_ul_ofdma_user_info_ru_size.
  12584. *
  12585. * LDPC: LDPC enabled (if 0, BCC is used)
  12586. *
  12587. * DCM: DCM enabled
  12588. *
  12589. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12590. * |---------------------------------+--------------------------------|
  12591. * |Ver|Valid| FW internal |
  12592. * |---------------------------------+--------------------------------|
  12593. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12594. * |---------------------------------+--------------------------------|
  12595. */
  12596. enum htt_ul_ofdma_user_info_ru_size {
  12597. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12598. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12599. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12600. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12601. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12602. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12603. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12604. };
  12605. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12606. struct htt_ul_ofdma_user_info_v0 {
  12607. A_UINT32 word0;
  12608. A_UINT32 word1;
  12609. };
  12610. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12611. A_UINT32 w0_fw_rsvd:30; \
  12612. A_UINT32 w0_valid:1; \
  12613. A_UINT32 w0_version:1;
  12614. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12615. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12616. };
  12617. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12618. A_UINT32 w1_nss:3; \
  12619. A_UINT32 w1_mcs:4; \
  12620. A_UINT32 w1_ldpc:1; \
  12621. A_UINT32 w1_dcm:1; \
  12622. A_UINT32 w1_ru_start:7; \
  12623. A_UINT32 w1_ru_size:3; \
  12624. A_UINT32 w1_trig_type:4; \
  12625. A_UINT32 w1_unused:9;
  12626. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12627. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12628. };
  12629. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12630. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12631. union {
  12632. A_UINT32 word0;
  12633. struct {
  12634. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12635. };
  12636. };
  12637. union {
  12638. A_UINT32 word1;
  12639. struct {
  12640. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12641. };
  12642. };
  12643. } POSTPACK;
  12644. enum HTT_UL_OFDMA_TRIG_TYPE {
  12645. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12646. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12647. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12648. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12649. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12650. };
  12651. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12652. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12653. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12654. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12655. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12656. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12657. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12658. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12659. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12660. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12661. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12662. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12663. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12664. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12665. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12666. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12667. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12668. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12669. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12670. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12671. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12672. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12673. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12674. /*--- word 0 ---*/
  12675. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12676. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12677. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12678. do { \
  12679. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12680. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12681. } while (0)
  12682. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12683. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12684. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12685. do { \
  12686. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12687. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12688. } while (0)
  12689. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12690. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12691. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12692. do { \
  12693. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12694. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12695. } while (0)
  12696. /*--- word 1 ---*/
  12697. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12698. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12699. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12700. do { \
  12701. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12702. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12703. } while (0)
  12704. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12705. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12706. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12707. do { \
  12708. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12709. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12710. } while (0)
  12711. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12712. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12713. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12714. do { \
  12715. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12716. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12717. } while (0)
  12718. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12719. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12720. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12721. do { \
  12722. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12723. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12724. } while (0)
  12725. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12726. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12727. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12728. do { \
  12729. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12730. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12731. } while (0)
  12732. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12733. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12734. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12735. do { \
  12736. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12737. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12738. } while (0)
  12739. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12740. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12741. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12742. do { \
  12743. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12744. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12745. } while (0)
  12746. /**
  12747. * @brief target -> host channel calibration data message
  12748. *
  12749. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  12750. *
  12751. * @brief host -> target channel calibration data message
  12752. *
  12753. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  12754. *
  12755. * @details
  12756. * The following field definitions describe the format of the channel
  12757. * calibration data message sent from the target to the host when
  12758. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12759. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12760. * The message is defined as htt_chan_caldata_msg followed by a variable
  12761. * number of 32-bit character values.
  12762. *
  12763. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12764. * |------------------------------------------------------------------|
  12765. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12766. * |------------------------------------------------------------------|
  12767. * | payload size | mhz |
  12768. * |------------------------------------------------------------------|
  12769. * | center frequency 2 | center frequency 1 |
  12770. * |------------------------------------------------------------------|
  12771. * | check sum |
  12772. * |------------------------------------------------------------------|
  12773. * | payload |
  12774. * |------------------------------------------------------------------|
  12775. * message info field:
  12776. * - MSG_TYPE
  12777. * Bits 7:0
  12778. * Purpose: identifies this as a channel calibration data message
  12779. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  12780. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  12781. * - SUB_TYPE
  12782. * Bits 11:8
  12783. * Purpose: T2H: indicates whether target is providing chan cal data
  12784. * to the host to store, or requesting that the host
  12785. * download previously-stored data.
  12786. * H2T: indicates whether the host is providing the requested
  12787. * channel cal data, or if it is rejecting the data
  12788. * request because it does not have the requested data.
  12789. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12790. * - CHKSUM_VALID
  12791. * Bit 12
  12792. * Purpose: indicates if the checksum field is valid
  12793. * value:
  12794. * - FRAG
  12795. * Bit 19:16
  12796. * Purpose: indicates the fragment index for message
  12797. * value: 0 for first fragment, 1 for second fragment, ...
  12798. * - APPEND
  12799. * Bit 20
  12800. * Purpose: indicates if this is the last fragment
  12801. * value: 0 = final fragment, 1 = more fragments will be appended
  12802. *
  12803. * channel and payload size field
  12804. * - MHZ
  12805. * Bits 15:0
  12806. * Purpose: indicates the channel primary frequency
  12807. * Value:
  12808. * - PAYLOAD_SIZE
  12809. * Bits 31:16
  12810. * Purpose: indicates the bytes of calibration data in payload
  12811. * Value:
  12812. *
  12813. * center frequency field
  12814. * - CENTER FREQUENCY 1
  12815. * Bits 15:0
  12816. * Purpose: indicates the channel center frequency
  12817. * Value: channel center frequency, in MHz units
  12818. * - CENTER FREQUENCY 2
  12819. * Bits 31:16
  12820. * Purpose: indicates the secondary channel center frequency,
  12821. * only for 11acvht 80plus80 mode
  12822. * Value: secondary channel center frequeny, in MHz units, if applicable
  12823. *
  12824. * checksum field
  12825. * - CHECK_SUM
  12826. * Bits 31:0
  12827. * Purpose: check the payload data, it is just for this fragment.
  12828. * This is intended for the target to check that the channel
  12829. * calibration data returned by the host is the unmodified data
  12830. * that was previously provided to the host by the target.
  12831. * value: checksum of fragment payload
  12832. */
  12833. PREPACK struct htt_chan_caldata_msg {
  12834. /* DWORD 0: message info */
  12835. A_UINT32
  12836. msg_type: 8,
  12837. sub_type: 4 ,
  12838. chksum_valid: 1, /** 1:valid, 0:invalid */
  12839. reserved1: 3,
  12840. frag_idx: 4, /** fragment index for calibration data */
  12841. appending: 1, /** 0: no fragment appending,
  12842. * 1: extra fragment appending */
  12843. reserved2: 11;
  12844. /* DWORD 1: channel and payload size */
  12845. A_UINT32
  12846. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12847. payload_size: 16; /** unit: bytes */
  12848. /* DWORD 2: center frequency */
  12849. A_UINT32
  12850. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12851. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12852. * valid only for 11acvht 80plus80 mode */
  12853. /* DWORD 3: check sum */
  12854. A_UINT32 chksum;
  12855. /* variable length for calibration data */
  12856. A_UINT32 payload[1/* or more */];
  12857. } POSTPACK;
  12858. /* T2H SUBTYPE */
  12859. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12860. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12861. /* H2T SUBTYPE */
  12862. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12863. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12864. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12865. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12866. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12867. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12868. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12869. do { \
  12870. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12871. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12872. } while (0)
  12873. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12874. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12875. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12876. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12877. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12878. do { \
  12879. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12880. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12881. } while (0)
  12882. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12883. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12884. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12885. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12886. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12887. do { \
  12888. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12889. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12890. } while (0)
  12891. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12892. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12893. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12894. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12895. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12896. do { \
  12897. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12898. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12899. } while (0)
  12900. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12901. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12902. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12903. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12904. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12905. do { \
  12906. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12907. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12908. } while (0)
  12909. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12910. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12911. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12912. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12913. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12914. do { \
  12915. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12916. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12917. } while (0)
  12918. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12919. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12920. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12921. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12922. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12923. do { \
  12924. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12925. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12926. } while (0)
  12927. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12928. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12929. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12930. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12931. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12932. do { \
  12933. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12934. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12935. } while (0)
  12936. /**
  12937. * @brief target -> host FSE CMEM based send
  12938. *
  12939. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  12940. *
  12941. * @details
  12942. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  12943. * FSE placement in CMEM is enabled.
  12944. *
  12945. * This message sends the non-secure CMEM base address.
  12946. * It will be sent to host in response to message
  12947. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  12948. * The message would appear as follows:
  12949. *
  12950. * |31 24|23 16|15 8|7 0|
  12951. * |----------------+----------------+----------------+----------------|
  12952. * | reserved | num_entries | msg_type |
  12953. * |----------------+----------------+----------------+----------------|
  12954. * | base_address_lo |
  12955. * |----------------+----------------+----------------+----------------|
  12956. * | base_address_hi |
  12957. * |-------------------------------------------------------------------|
  12958. *
  12959. * The message is interpreted as follows:
  12960. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  12961. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  12962. * b'8:15 - number_entries: Indicated the number of entries
  12963. * programmed.
  12964. * b'16:31 - reserved.
  12965. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  12966. * CMEM base address
  12967. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  12968. * CMEM base address
  12969. */
  12970. PREPACK struct htt_cmem_base_send_t {
  12971. A_UINT32 msg_type: 8,
  12972. num_entries: 8,
  12973. reserved: 16;
  12974. A_UINT32 base_address_lo;
  12975. A_UINT32 base_address_hi;
  12976. } POSTPACK;
  12977. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  12978. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  12979. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  12980. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  12981. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  12982. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  12983. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  12984. do { \
  12985. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  12986. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12987. } while (0)
  12988. /**
  12989. * @brief - HTT PPDU ID format
  12990. *
  12991. * @details
  12992. * The following field definitions describe the format of the PPDU ID.
  12993. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12994. *
  12995. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12996. * +--------------------------------------------------------------------------
  12997. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12998. * +--------------------------------------------------------------------------
  12999. *
  13000. * sch id :Schedule command id
  13001. * Bits [11 : 0] : monotonically increasing counter to track the
  13002. * PPDU posted to a specific transmit queue.
  13003. *
  13004. * hwq_id: Hardware Queue ID.
  13005. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  13006. *
  13007. * mac_id: MAC ID
  13008. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  13009. *
  13010. * seq_idx: Sequence index.
  13011. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  13012. * a particular TXOP.
  13013. *
  13014. * tqm_cmd: HWSCH/TQM flag.
  13015. * Bit [23] : Always set to 0.
  13016. *
  13017. * seq_cmd_type: Sequence command type.
  13018. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  13019. * Refer to enum HTT_STATS_FTYPE for values.
  13020. */
  13021. PREPACK struct htt_ppdu_id {
  13022. A_UINT32
  13023. sch_id: 12,
  13024. hwq_id: 5,
  13025. mac_id: 2,
  13026. seq_idx: 2,
  13027. reserved1: 2,
  13028. tqm_cmd: 1,
  13029. seq_cmd_type: 6,
  13030. reserved2: 2;
  13031. } POSTPACK;
  13032. #define HTT_PPDU_ID_SCH_ID_S 0
  13033. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  13034. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  13035. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  13036. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  13037. do { \
  13038. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  13039. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  13040. } while (0)
  13041. #define HTT_PPDU_ID_HWQ_ID_S 12
  13042. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  13043. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  13044. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  13045. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  13046. do { \
  13047. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  13048. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  13049. } while (0)
  13050. #define HTT_PPDU_ID_MAC_ID_S 17
  13051. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  13052. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  13053. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  13054. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  13055. do { \
  13056. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  13057. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  13058. } while (0)
  13059. #define HTT_PPDU_ID_SEQ_IDX_S 19
  13060. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  13061. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  13062. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  13063. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  13064. do { \
  13065. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  13066. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  13067. } while (0)
  13068. #define HTT_PPDU_ID_TQM_CMD_S 23
  13069. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  13070. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  13071. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  13072. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  13073. do { \
  13074. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  13075. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  13076. } while (0)
  13077. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  13078. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  13079. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  13080. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  13081. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  13082. do { \
  13083. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  13084. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  13085. } while (0)
  13086. /**
  13087. * @brief target -> RX PEER METADATA V0 format
  13088. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13089. * message from target, and will confirm to the target which peer metadata
  13090. * version to use in the wmi_init message.
  13091. *
  13092. * The following diagram shows the format of the RX PEER METADATA.
  13093. *
  13094. * |31 24|23 16|15 8|7 0|
  13095. * |-----------------------------------------------------------------------|
  13096. * | Reserved | VDEV ID | PEER ID |
  13097. * |-----------------------------------------------------------------------|
  13098. */
  13099. PREPACK struct htt_rx_peer_metadata_v0 {
  13100. A_UINT32
  13101. peer_id: 16,
  13102. vdev_id: 8,
  13103. reserved1: 8;
  13104. } POSTPACK;
  13105. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13106. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13107. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13108. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13109. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13112. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13113. } while (0)
  13114. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13115. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13116. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13117. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13118. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13119. do { \
  13120. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13121. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13122. } while (0)
  13123. /**
  13124. * @brief target -> RX PEER METADATA V1 format
  13125. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13126. * message from target, and will confirm to the target which peer metadata
  13127. * version to use in the wmi_init message.
  13128. *
  13129. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13130. *
  13131. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13132. * |-----------------------------------------------------------------------|
  13133. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13134. * |-----------------------------------------------------------------------|
  13135. */
  13136. PREPACK struct htt_rx_peer_metadata_v1 {
  13137. A_UINT32
  13138. peer_id: 13,
  13139. ml_peer_valid: 1,
  13140. reserved1: 2,
  13141. vdev_id: 8,
  13142. lmac_id: 2,
  13143. chip_id: 3,
  13144. reserved2: 3;
  13145. } POSTPACK;
  13146. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13147. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13148. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13149. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13150. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13151. do { \
  13152. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13153. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13154. } while (0)
  13155. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13156. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13157. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13158. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13159. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13160. do { \
  13161. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13162. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13163. } while (0)
  13164. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13165. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13166. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13167. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13168. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13169. do { \
  13170. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13171. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13172. } while (0)
  13173. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13174. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13175. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13176. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13177. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13178. do { \
  13179. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13180. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13181. } while (0)
  13182. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13183. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13184. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13185. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13186. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13187. do { \
  13188. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13189. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13190. } while (0)
  13191. /*
  13192. * In some systems, the host SW wants to specify priorities between
  13193. * different MSDU / flow queues within the same peer-TID.
  13194. * The below enums are used for the host to identify to the target
  13195. * which MSDU queue's priority it wants to adjust.
  13196. */
  13197. /*
  13198. * The MSDUQ index describe index of TCL HW, where each index is
  13199. * used for queuing particular types of MSDUs.
  13200. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  13201. */
  13202. enum HTT_MSDUQ_INDEX {
  13203. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  13204. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  13205. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  13206. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  13207. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  13208. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  13209. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  13210. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  13211. HTT_MSDUQ_MAX_INDEX,
  13212. };
  13213. /* MSDU qtype definition */
  13214. enum HTT_MSDU_QTYPE {
  13215. /*
  13216. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  13217. * relative priority. Instead, the relative priority of CRIT_0 versus
  13218. * CRIT_1 is controlled by the FW, through the configuration parameters
  13219. * it applies to the queues.
  13220. */
  13221. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  13222. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  13223. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  13224. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  13225. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  13226. /* New MSDU_QTYPE should be added above this line */
  13227. /*
  13228. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  13229. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  13230. * any host/target message definitions. The QTYPE_MAX value can
  13231. * only be used internally within the host or within the target.
  13232. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  13233. * it must regard the unexpected value as a default qtype value,
  13234. * or ignore it.
  13235. */
  13236. HTT_MSDU_QTYPE_MAX,
  13237. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  13238. };
  13239. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  13240. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  13241. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  13242. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  13243. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  13244. };
  13245. #endif