htt.h 502 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145
  1. /*
  2. * Copyright (c) 2011-2018 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. */
  170. #define HTT_CURRENT_VERSION_MAJOR 3
  171. #define HTT_CURRENT_VERSION_MINOR 58
  172. #define HTT_NUM_TX_FRAG_DESC 1024
  173. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  174. #define HTT_CHECK_SET_VAL(field, val) \
  175. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  176. /* macros to assist in sign-extending fields from HTT messages */
  177. #define HTT_SIGN_BIT_MASK(field) \
  178. ((field ## _M + (1 << field ## _S)) >> 1)
  179. #define HTT_SIGN_BIT(_val, field) \
  180. (_val & HTT_SIGN_BIT_MASK(field))
  181. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  182. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  183. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  184. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  185. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  186. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  187. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  188. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  189. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  190. /*
  191. * TEMPORARY:
  192. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  193. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  194. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  195. * updated.
  196. */
  197. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  198. /*
  199. * TEMPORARY:
  200. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  201. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  202. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  203. * updated.
  204. */
  205. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  206. /* HTT Access Category values */
  207. enum HTT_AC_WMM {
  208. /* WMM Access Categories */
  209. HTT_AC_WMM_BE = 0x0,
  210. HTT_AC_WMM_BK = 0x1,
  211. HTT_AC_WMM_VI = 0x2,
  212. HTT_AC_WMM_VO = 0x3,
  213. /* extension Access Categories */
  214. HTT_AC_EXT_NON_QOS = 0x4,
  215. HTT_AC_EXT_UCAST_MGMT = 0x5,
  216. HTT_AC_EXT_MCAST_DATA = 0x6,
  217. HTT_AC_EXT_MCAST_MGMT = 0x7,
  218. };
  219. enum HTT_AC_WMM_MASK {
  220. /* WMM Access Categories */
  221. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  222. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  223. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  224. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  225. /* extension Access Categories */
  226. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  227. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  228. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  229. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  230. };
  231. #define HTT_AC_MASK_WMM \
  232. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  233. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  234. #define HTT_AC_MASK_EXT \
  235. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  236. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  237. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  238. /*
  239. * htt_dbg_stats_type -
  240. * bit positions for each stats type within a stats type bitmask
  241. * The bitmask contains 24 bits.
  242. */
  243. enum htt_dbg_stats_type {
  244. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  245. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  246. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  247. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  248. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  249. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  250. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  251. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  252. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  253. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  254. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  255. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  256. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  257. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  258. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  259. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  260. /* bits 16-23 currently reserved */
  261. /* keep this last */
  262. HTT_DBG_NUM_STATS
  263. };
  264. /*=== HTT option selection TLVs ===
  265. * Certain HTT messages have alternatives or options.
  266. * For such cases, the host and target need to agree on which option to use.
  267. * Option specification TLVs can be appended to the VERSION_REQ and
  268. * VERSION_CONF messages to select options other than the default.
  269. * These TLVs are entirely optional - if they are not provided, there is a
  270. * well-defined default for each option. If they are provided, they can be
  271. * provided in any order. Each TLV can be present or absent independent of
  272. * the presence / absence of other TLVs.
  273. *
  274. * The HTT option selection TLVs use the following format:
  275. * |31 16|15 8|7 0|
  276. * |---------------------------------+----------------+----------------|
  277. * | value (payload) | length | tag |
  278. * |-------------------------------------------------------------------|
  279. * The value portion need not be only 2 bytes; it can be extended by any
  280. * integer number of 4-byte units. The total length of the TLV, including
  281. * the tag and length fields, must be a multiple of 4 bytes. The length
  282. * field specifies the total TLV size in 4-byte units. Thus, the typical
  283. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  284. * field, would store 0x1 in its length field, to show that the TLV occupies
  285. * a single 4-byte unit.
  286. */
  287. /*--- TLV header format - applies to all HTT option TLVs ---*/
  288. enum HTT_OPTION_TLV_TAGS {
  289. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  290. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  291. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  292. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  293. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  294. };
  295. PREPACK struct htt_option_tlv_header_t {
  296. A_UINT8 tag;
  297. A_UINT8 length;
  298. } POSTPACK;
  299. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  300. #define HTT_OPTION_TLV_TAG_S 0
  301. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  302. #define HTT_OPTION_TLV_LENGTH_S 8
  303. /*
  304. * value0 - 16 bit value field stored in word0
  305. * The TLV's value field may be longer than 2 bytes, in which case
  306. * the remainder of the value is stored in word1, word2, etc.
  307. */
  308. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  309. #define HTT_OPTION_TLV_VALUE0_S 16
  310. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  311. do { \
  312. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  313. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  314. } while (0)
  315. #define HTT_OPTION_TLV_TAG_GET(word) \
  316. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  317. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  318. do { \
  319. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  320. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  321. } while (0)
  322. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  323. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  324. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  325. do { \
  326. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  327. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  328. } while (0)
  329. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  330. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  331. /*--- format of specific HTT option TLVs ---*/
  332. /*
  333. * HTT option TLV for specifying LL bus address size
  334. * Some chips require bus addresses used by the target to access buffers
  335. * within the host's memory to be 32 bits; others require bus addresses
  336. * used by the target to access buffers within the host's memory to be
  337. * 64 bits.
  338. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  339. * a suffix to the VERSION_CONF message to specify which bus address format
  340. * the target requires.
  341. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  342. * default to providing bus addresses to the target in 32-bit format.
  343. */
  344. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  345. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  346. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  347. };
  348. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  349. struct htt_option_tlv_header_t hdr;
  350. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  351. } POSTPACK;
  352. /*
  353. * HTT option TLV for specifying whether HL systems should indicate
  354. * over-the-air tx completion for individual frames, or should instead
  355. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  356. * requests an OTA tx completion for a particular tx frame.
  357. * This option does not apply to LL systems, where the TX_COMPL_IND
  358. * is mandatory.
  359. * This option is primarily intended for HL systems in which the tx frame
  360. * downloads over the host --> target bus are as slow as or slower than
  361. * the transmissions over the WLAN PHY. For cases where the bus is faster
  362. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  363. * and consquently will send one TX_COMPL_IND message that covers several
  364. * tx frames. For cases where the WLAN PHY is faster than the bus,
  365. * the target will end up transmitting very short A-MPDUs, and consequently
  366. * sending many TX_COMPL_IND messages, which each cover a very small number
  367. * of tx frames.
  368. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  369. * a suffix to the VERSION_REQ message to request whether the host desires to
  370. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  371. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  372. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  373. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  374. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  375. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  376. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  377. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  378. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  379. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  380. * TLV.
  381. */
  382. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  383. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  384. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  385. };
  386. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  387. struct htt_option_tlv_header_t hdr;
  388. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  389. } POSTPACK;
  390. /*
  391. * HTT option TLV for specifying how many tx queue groups the target
  392. * may establish.
  393. * This TLV specifies the maximum value the target may send in the
  394. * txq_group_id field of any TXQ_GROUP information elements sent by
  395. * the target to the host. This allows the host to pre-allocate an
  396. * appropriate number of tx queue group structs.
  397. *
  398. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  399. * a suffix to the VERSION_REQ message to specify whether the host supports
  400. * tx queue groups at all, and if so if there is any limit on the number of
  401. * tx queue groups that the host supports.
  402. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  403. * a suffix to the VERSION_CONF message. If the host has specified in the
  404. * VER_REQ message a limit on the number of tx queue groups the host can
  405. * supprt, the target shall limit its specification of the maximum tx groups
  406. * to be no larger than this host-specified limit.
  407. *
  408. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  409. * shall preallocate 4 tx queue group structs, and the target shall not
  410. * specify a txq_group_id larger than 3.
  411. */
  412. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  413. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  414. /*
  415. * values 1 through N specify the max number of tx queue groups
  416. * the sender supports
  417. */
  418. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  419. };
  420. /* TEMPORARY backwards-compatibility alias for a typo fix -
  421. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  422. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  423. * to support the old name (with the typo) until all references to the
  424. * old name are replaced with the new name.
  425. */
  426. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  427. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  428. struct htt_option_tlv_header_t hdr;
  429. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  430. } POSTPACK;
  431. /*
  432. * HTT option TLV for specifying whether the target supports an extended
  433. * version of the HTT tx descriptor. If the target provides this TLV
  434. * and specifies in the TLV that the target supports an extended version
  435. * of the HTT tx descriptor, the target must check the "extension" bit in
  436. * the HTT tx descriptor, and if the extension bit is set, to expect a
  437. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  438. * descriptor. Furthermore, the target must provide room for the HTT
  439. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  440. * This option is intended for systems where the host needs to explicitly
  441. * control the transmission parameters such as tx power for individual
  442. * tx frames.
  443. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  444. * as a suffix to the VERSION_CONF message to explicitly specify whether
  445. * the target supports the HTT tx MSDU extension descriptor.
  446. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  447. * by the host as lack of target support for the HTT tx MSDU extension
  448. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  449. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  450. * the HTT tx MSDU extension descriptor.
  451. * The host is not required to provide the HTT tx MSDU extension descriptor
  452. * just because the target supports it; the target must check the
  453. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  454. * extension descriptor is present.
  455. */
  456. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  457. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  458. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  459. };
  460. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  461. struct htt_option_tlv_header_t hdr;
  462. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  463. } POSTPACK;
  464. /*=== host -> target messages ===============================================*/
  465. enum htt_h2t_msg_type {
  466. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  467. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  468. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  469. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  470. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  471. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  472. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  473. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  474. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  475. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  476. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  477. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  478. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  479. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  480. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  481. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  482. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  483. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  484. /* keep this last */
  485. HTT_H2T_NUM_MSGS
  486. };
  487. /*
  488. * HTT host to target message type -
  489. * stored in bits 7:0 of the first word of the message
  490. */
  491. #define HTT_H2T_MSG_TYPE_M 0xff
  492. #define HTT_H2T_MSG_TYPE_S 0
  493. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  494. do { \
  495. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  496. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  497. } while (0)
  498. #define HTT_H2T_MSG_TYPE_GET(word) \
  499. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  500. /**
  501. * @brief host -> target version number request message definition
  502. *
  503. * |31 24|23 16|15 8|7 0|
  504. * |----------------+----------------+----------------+----------------|
  505. * | reserved | msg type |
  506. * |-------------------------------------------------------------------|
  507. * : option request TLV (optional) |
  508. * :...................................................................:
  509. *
  510. * The VER_REQ message may consist of a single 4-byte word, or may be
  511. * extended with TLVs that specify which HTT options the host is requesting
  512. * from the target.
  513. * The following option TLVs may be appended to the VER_REQ message:
  514. * - HL_SUPPRESS_TX_COMPL_IND
  515. * - HL_MAX_TX_QUEUE_GROUPS
  516. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  517. * may be appended to the VER_REQ message (but only one TLV of each type).
  518. *
  519. * Header fields:
  520. * - MSG_TYPE
  521. * Bits 7:0
  522. * Purpose: identifies this as a version number request message
  523. * Value: 0x0
  524. */
  525. #define HTT_VER_REQ_BYTES 4
  526. /* TBDXXX: figure out a reasonable number */
  527. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  528. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  529. /**
  530. * @brief HTT tx MSDU descriptor
  531. *
  532. * @details
  533. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  534. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  535. * the target firmware needs for the FW's tx processing, particularly
  536. * for creating the HW msdu descriptor.
  537. * The same HTT tx descriptor is used for HL and LL systems, though
  538. * a few fields within the tx descriptor are used only by LL or
  539. * only by HL.
  540. * The HTT tx descriptor is defined in two manners: by a struct with
  541. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  542. * definitions.
  543. * The target should use the struct def, for simplicitly and clarity,
  544. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  545. * neutral. Specifically, the host shall use the get/set macros built
  546. * around the mask + shift defs.
  547. */
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  556. #define HTT_TX_VDEV_ID_WORD 0
  557. #define HTT_TX_VDEV_ID_MASK 0x3f
  558. #define HTT_TX_VDEV_ID_SHIFT 16
  559. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  560. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  561. #define HTT_TX_MSDU_LEN_DWORD 1
  562. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  563. /*
  564. * HTT_VAR_PADDR macros
  565. * Allow physical / bus addresses to be either a single 32-bit value,
  566. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  567. */
  568. #define HTT_VAR_PADDR32(var_name) \
  569. A_UINT32 var_name
  570. #define HTT_VAR_PADDR64_LE(var_name) \
  571. struct { \
  572. /* little-endian: lo precedes hi */ \
  573. A_UINT32 lo; \
  574. A_UINT32 hi; \
  575. } var_name
  576. /*
  577. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  578. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  579. * addresses are stored in a XXX-bit field.
  580. * This macro is used to define both htt_tx_msdu_desc32_t and
  581. * htt_tx_msdu_desc64_t structs.
  582. */
  583. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  584. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  585. { \
  586. /* DWORD 0: flags and meta-data */ \
  587. A_UINT32 \
  588. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  589. \
  590. /* pkt_subtype - \
  591. * Detailed specification of the tx frame contents, extending the \
  592. * general specification provided by pkt_type. \
  593. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  594. * pkt_type | pkt_subtype \
  595. * ============================================================== \
  596. * 802.3 | bit 0:3 - Reserved \
  597. * | bit 4: 0x0 - Copy-Engine Classification Results \
  598. * | not appended to the HTT message \
  599. * | 0x1 - Copy-Engine Classification Results \
  600. * | appended to the HTT message in the \
  601. * | format: \
  602. * | [HTT tx desc, frame header, \
  603. * | CE classification results] \
  604. * | The CE classification results begin \
  605. * | at the next 4-byte boundary after \
  606. * | the frame header. \
  607. * ------------+------------------------------------------------- \
  608. * Eth2 | bit 0:3 - Reserved \
  609. * | bit 4: 0x0 - Copy-Engine Classification Results \
  610. * | not appended to the HTT message \
  611. * | 0x1 - Copy-Engine Classification Results \
  612. * | appended to the HTT message. \
  613. * | See the above specification of the \
  614. * | CE classification results location. \
  615. * ------------+------------------------------------------------- \
  616. * native WiFi | bit 0:3 - Reserved \
  617. * | bit 4: 0x0 - Copy-Engine Classification Results \
  618. * | not appended to the HTT message \
  619. * | 0x1 - Copy-Engine Classification Results \
  620. * | appended to the HTT message. \
  621. * | See the above specification of the \
  622. * | CE classification results location. \
  623. * ------------+------------------------------------------------- \
  624. * mgmt | 0x0 - 802.11 MAC header absent \
  625. * | 0x1 - 802.11 MAC header present \
  626. * ------------+------------------------------------------------- \
  627. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  628. * | 0x1 - 802.11 MAC header present \
  629. * | bit 1: 0x0 - allow aggregation \
  630. * | 0x1 - don't allow aggregation \
  631. * | bit 2: 0x0 - perform encryption \
  632. * | 0x1 - don't perform encryption \
  633. * | bit 3: 0x0 - perform tx classification / queuing \
  634. * | 0x1 - don't perform tx classification; \
  635. * | insert the frame into the "misc" \
  636. * | tx queue \
  637. * | bit 4: 0x0 - Copy-Engine Classification Results \
  638. * | not appended to the HTT message \
  639. * | 0x1 - Copy-Engine Classification Results \
  640. * | appended to the HTT message. \
  641. * | See the above specification of the \
  642. * | CE classification results location. \
  643. */ \
  644. pkt_subtype: 5, \
  645. \
  646. /* pkt_type - \
  647. * General specification of the tx frame contents. \
  648. * The htt_pkt_type enum should be used to specify and check the \
  649. * value of this field. \
  650. */ \
  651. pkt_type: 3, \
  652. \
  653. /* vdev_id - \
  654. * ID for the vdev that is sending this tx frame. \
  655. * For certain non-standard packet types, e.g. pkt_type == raw \
  656. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  657. * This field is used primarily for determining where to queue \
  658. * broadcast and multicast frames. \
  659. */ \
  660. vdev_id: 6, \
  661. /* ext_tid - \
  662. * The extended traffic ID. \
  663. * If the TID is unknown, the extended TID is set to \
  664. * HTT_TX_EXT_TID_INVALID. \
  665. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  666. * value of the QoS TID. \
  667. * If the tx frame is non-QoS data, then the extended TID is set to \
  668. * HTT_TX_EXT_TID_NON_QOS. \
  669. * If the tx frame is multicast or broadcast, then the extended TID \
  670. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  671. */ \
  672. ext_tid: 5, \
  673. \
  674. /* postponed - \
  675. * This flag indicates whether the tx frame has been downloaded to \
  676. * the target before but discarded by the target, and now is being \
  677. * downloaded again; or if this is a new frame that is being \
  678. * downloaded for the first time. \
  679. * This flag allows the target to determine the correct order for \
  680. * transmitting new vs. old frames. \
  681. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  682. * This flag only applies to HL systems, since in LL systems, \
  683. * the tx flow control is handled entirely within the target. \
  684. */ \
  685. postponed: 1, \
  686. \
  687. /* extension - \
  688. * This flag indicates whether a HTT tx MSDU extension descriptor \
  689. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  690. * \
  691. * 0x0 - no extension MSDU descriptor is present \
  692. * 0x1 - an extension MSDU descriptor immediately follows the \
  693. * regular MSDU descriptor \
  694. */ \
  695. extension: 1, \
  696. \
  697. /* cksum_offload - \
  698. * This flag indicates whether checksum offload is enabled or not \
  699. * for this frame. Target FW use this flag to turn on HW checksumming \
  700. * 0x0 - No checksum offload \
  701. * 0x1 - L3 header checksum only \
  702. * 0x2 - L4 checksum only \
  703. * 0x3 - L3 header checksum + L4 checksum \
  704. */ \
  705. cksum_offload: 2, \
  706. \
  707. /* tx_comp_req - \
  708. * This flag indicates whether Tx Completion \
  709. * from fw is required or not. \
  710. * This flag is only relevant if tx completion is not \
  711. * universally enabled. \
  712. * For all LL systems, tx completion is mandatory, \
  713. * so this flag will be irrelevant. \
  714. * For HL systems tx completion is optional, but HL systems in which \
  715. * the bus throughput exceeds the WLAN throughput will \
  716. * probably want to always use tx completion, and thus \
  717. * would not check this flag. \
  718. * This flag is required when tx completions are not used universally, \
  719. * but are still required for certain tx frames for which \
  720. * an OTA delivery acknowledgment is needed by the host. \
  721. * In practice, this would be for HL systems in which the \
  722. * bus throughput is less than the WLAN throughput. \
  723. * \
  724. * 0x0 - Tx Completion Indication from Fw not required \
  725. * 0x1 - Tx Completion Indication from Fw is required \
  726. */ \
  727. tx_compl_req: 1; \
  728. \
  729. \
  730. /* DWORD 1: MSDU length and ID */ \
  731. A_UINT32 \
  732. len: 16, /* MSDU length, in bytes */ \
  733. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  734. * and this id is used to calculate fragmentation \
  735. * descriptor pointer inside the target based on \
  736. * the base address, configured inside the target. \
  737. */ \
  738. \
  739. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  740. /* frags_desc_ptr - \
  741. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  742. * where the tx frame's fragments reside in memory. \
  743. * This field only applies to LL systems, since in HL systems the \
  744. * (degenerate single-fragment) fragmentation descriptor is created \
  745. * within the target. \
  746. */ \
  747. _paddr__frags_desc_ptr_; \
  748. \
  749. /* DWORD 3 (or 4): peerid, chanfreq */ \
  750. /* \
  751. * Peer ID : Target can use this value to know which peer-id packet \
  752. * destined to. \
  753. * It's intended to be specified by host in case of NAWDS. \
  754. */ \
  755. A_UINT16 peerid; \
  756. \
  757. /* \
  758. * Channel frequency: This identifies the desired channel \
  759. * frequency (in mhz) for tx frames. This is used by FW to help \
  760. * determine when it is safe to transmit or drop frames for \
  761. * off-channel operation. \
  762. * The default value of zero indicates to FW that the corresponding \
  763. * VDEV's home channel (if there is one) is the desired channel \
  764. * frequency. \
  765. */ \
  766. A_UINT16 chanfreq; \
  767. \
  768. /* Reason reserved is commented is increasing the htt structure size \
  769. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  770. * A_UINT32 reserved_dword3_bits0_31; \
  771. */ \
  772. } POSTPACK
  773. /* define a htt_tx_msdu_desc32_t type */
  774. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  775. /* define a htt_tx_msdu_desc64_t type */
  776. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  777. /*
  778. * Make htt_tx_msdu_desc_t be an alias for either
  779. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  780. */
  781. #if HTT_PADDR64
  782. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  783. #else
  784. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  785. #endif
  786. /* decriptor information for Management frame*/
  787. /*
  788. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  789. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  790. */
  791. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  792. extern A_UINT32 mgmt_hdr_len;
  793. PREPACK struct htt_mgmt_tx_desc_t {
  794. A_UINT32 msg_type;
  795. #if HTT_PADDR64
  796. A_UINT64 frag_paddr; /* DMAble address of the data */
  797. #else
  798. A_UINT32 frag_paddr; /* DMAble address of the data */
  799. #endif
  800. A_UINT32 desc_id; /* returned to host during completion
  801. * to free the meory*/
  802. A_UINT32 len; /* Fragment length */
  803. A_UINT32 vdev_id; /* virtual device ID*/
  804. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  805. } POSTPACK;
  806. PREPACK struct htt_mgmt_tx_compl_ind {
  807. A_UINT32 desc_id;
  808. A_UINT32 status;
  809. } POSTPACK;
  810. /*
  811. * This SDU header size comes from the summation of the following:
  812. * 1. Max of:
  813. * a. Native WiFi header, for native WiFi frames: 24 bytes
  814. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  815. * b. 802.11 header, for raw frames: 36 bytes
  816. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  817. * QoS header, HT header)
  818. * c. 802.3 header, for ethernet frames: 14 bytes
  819. * (destination address, source address, ethertype / length)
  820. * 2. Max of:
  821. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  822. * b. IPv6 header, up through the Traffic Class: 2 bytes
  823. * 3. 802.1Q VLAN header: 4 bytes
  824. * 4. LLC/SNAP header: 8 bytes
  825. */
  826. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  827. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  828. #define HTT_TX_HDR_SIZE_ETHERNET 14
  829. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  830. A_COMPILE_TIME_ASSERT(
  831. htt_encap_hdr_size_max_check_nwifi,
  832. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  833. A_COMPILE_TIME_ASSERT(
  834. htt_encap_hdr_size_max_check_enet,
  835. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  836. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  837. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  838. #define HTT_TX_HDR_SIZE_802_1Q 4
  839. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  840. #define HTT_COMMON_TX_FRM_HDR_LEN \
  841. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  842. HTT_TX_HDR_SIZE_802_1Q + \
  843. HTT_TX_HDR_SIZE_LLC_SNAP)
  844. #define HTT_HL_TX_FRM_HDR_LEN \
  845. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  846. #define HTT_LL_TX_FRM_HDR_LEN \
  847. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  848. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  849. /* dword 0 */
  850. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  851. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  852. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  853. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  854. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  857. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  858. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  861. #define HTT_TX_DESC_PKT_TYPE_S 13
  862. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  865. #define HTT_TX_DESC_VDEV_ID_S 16
  866. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  869. #define HTT_TX_DESC_EXT_TID_S 22
  870. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  873. #define HTT_TX_DESC_POSTPONED_S 27
  874. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  875. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  877. #define HTT_TX_DESC_EXTENSION_S 28
  878. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  881. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  882. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  885. #define HTT_TX_DESC_TX_COMP_S 31
  886. /* dword 1 */
  887. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  888. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  889. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  890. #define HTT_TX_DESC_FRM_LEN_S 0
  891. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  892. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  893. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  894. #define HTT_TX_DESC_FRM_ID_S 16
  895. /* dword 2 */
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  898. /* for systems using 64-bit format for bus addresses */
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  903. /* for systems using 32-bit format for bus addresses */
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  905. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  906. /* dword 3 */
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  910. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  912. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  913. #if HTT_PADDR64
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  916. #else
  917. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  919. #endif
  920. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  921. #define HTT_TX_DESC_PEER_ID_S 0
  922. /*
  923. * TEMPORARY:
  924. * The original definitions for the PEER_ID fields contained typos
  925. * (with _DESC_PADDR appended to this PEER_ID field name).
  926. * Retain deprecated original names for PEER_ID fields until all code that
  927. * refers to them has been updated.
  928. */
  929. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  930. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  931. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  932. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  933. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  934. HTT_TX_DESC_PEER_ID_M
  935. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  936. HTT_TX_DESC_PEER_ID_S
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  940. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  942. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  943. #if HTT_PADDR64
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  946. #else
  947. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  949. #endif
  950. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  951. #define HTT_TX_DESC_CHAN_FREQ_S 16
  952. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  953. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  954. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  955. do { \
  956. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  957. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  958. } while (0)
  959. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  960. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  961. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  962. do { \
  963. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  964. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  965. } while (0)
  966. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  967. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  968. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  969. do { \
  970. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  971. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  972. } while (0)
  973. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  974. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  975. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  976. do { \
  977. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  978. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  979. } while (0)
  980. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  981. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  982. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  983. do { \
  984. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  985. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  986. } while (0)
  987. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  988. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  989. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  990. do { \
  991. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  992. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  993. } while (0)
  994. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  995. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  996. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  997. do { \
  998. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  999. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1000. } while (0)
  1001. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1002. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1003. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1004. do { \
  1005. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1006. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1007. } while (0)
  1008. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1009. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1010. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1011. do { \
  1012. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1013. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1014. } while (0)
  1015. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1016. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1017. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1018. do { \
  1019. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1020. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1021. } while (0)
  1022. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1023. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1024. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1025. do { \
  1026. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1027. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1028. } while (0)
  1029. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1030. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1031. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1032. do { \
  1033. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1034. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1035. } while (0)
  1036. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1037. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1038. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1039. do { \
  1040. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1041. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1042. } while (0)
  1043. /* enums used in the HTT tx MSDU extension descriptor */
  1044. enum {
  1045. htt_tx_guard_interval_regular = 0,
  1046. htt_tx_guard_interval_short = 1,
  1047. };
  1048. enum {
  1049. htt_tx_preamble_type_ofdm = 0,
  1050. htt_tx_preamble_type_cck = 1,
  1051. htt_tx_preamble_type_ht = 2,
  1052. htt_tx_preamble_type_vht = 3,
  1053. };
  1054. enum {
  1055. htt_tx_bandwidth_5MHz = 0,
  1056. htt_tx_bandwidth_10MHz = 1,
  1057. htt_tx_bandwidth_20MHz = 2,
  1058. htt_tx_bandwidth_40MHz = 3,
  1059. htt_tx_bandwidth_80MHz = 4,
  1060. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1061. };
  1062. /**
  1063. * @brief HTT tx MSDU extension descriptor
  1064. * @details
  1065. * If the target supports HTT tx MSDU extension descriptors, the host has
  1066. * the option of appending the following struct following the regular
  1067. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1068. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1069. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1070. * tx specs for each frame.
  1071. */
  1072. PREPACK struct htt_tx_msdu_desc_ext_t {
  1073. /* DWORD 0: flags */
  1074. A_UINT32
  1075. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1076. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1077. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1078. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1079. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1080. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1081. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1082. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1083. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1084. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1085. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1086. /* DWORD 1: tx power, tx rate, tx BW */
  1087. A_UINT32
  1088. /* pwr -
  1089. * Specify what power the tx frame needs to be transmitted at.
  1090. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1091. * The value needs to be appropriately sign-extended when extracting
  1092. * the value from the message and storing it in a variable that is
  1093. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1094. * automatically handles this sign-extension.)
  1095. * If the transmission uses multiple tx chains, this power spec is
  1096. * the total transmit power, assuming incoherent combination of
  1097. * per-chain power to produce the total power.
  1098. */
  1099. pwr: 8,
  1100. /* mcs_mask -
  1101. * Specify the allowable values for MCS index (modulation and coding)
  1102. * to use for transmitting the frame.
  1103. *
  1104. * For HT / VHT preamble types, this mask directly corresponds to
  1105. * the HT or VHT MCS indices that are allowed. For each bit N set
  1106. * within the mask, MCS index N is allowed for transmitting the frame.
  1107. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1108. * rates versus OFDM rates, so the host has the option of specifying
  1109. * that the target must transmit the frame with CCK or OFDM rates
  1110. * (not HT or VHT), but leaving the decision to the target whether
  1111. * to use CCK or OFDM.
  1112. *
  1113. * For CCK and OFDM, the bits within this mask are interpreted as
  1114. * follows:
  1115. * bit 0 -> CCK 1 Mbps rate is allowed
  1116. * bit 1 -> CCK 2 Mbps rate is allowed
  1117. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1118. * bit 3 -> CCK 11 Mbps rate is allowed
  1119. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1120. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1121. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1122. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1123. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1124. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1125. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1126. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1127. *
  1128. * The MCS index specification needs to be compatible with the
  1129. * bandwidth mask specification. For example, a MCS index == 9
  1130. * specification is inconsistent with a preamble type == VHT,
  1131. * Nss == 1, and channel bandwidth == 20 MHz.
  1132. *
  1133. * Furthermore, the host has only a limited ability to specify to
  1134. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1135. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1136. */
  1137. mcs_mask: 12,
  1138. /* nss_mask -
  1139. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1140. * Each bit in this mask corresponds to a Nss value:
  1141. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1142. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1143. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1144. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1145. * The values in the Nss mask must be suitable for the recipient, e.g.
  1146. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1147. * recipient which only supports 2x2 MIMO.
  1148. */
  1149. nss_mask: 4,
  1150. /* guard_interval -
  1151. * Specify a htt_tx_guard_interval enum value to indicate whether
  1152. * the transmission should use a regular guard interval or a
  1153. * short guard interval.
  1154. */
  1155. guard_interval: 1,
  1156. /* preamble_type_mask -
  1157. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1158. * may choose from for transmitting this frame.
  1159. * The bits in this mask correspond to the values in the
  1160. * htt_tx_preamble_type enum. For example, to allow the target
  1161. * to transmit the frame as either CCK or OFDM, this field would
  1162. * be set to
  1163. * (1 << htt_tx_preamble_type_ofdm) |
  1164. * (1 << htt_tx_preamble_type_cck)
  1165. */
  1166. preamble_type_mask: 4,
  1167. reserved1_31_29: 3; /* unused, set to 0x0 */
  1168. /* DWORD 2: tx chain mask, tx retries */
  1169. A_UINT32
  1170. /* chain_mask - specify which chains to transmit from */
  1171. chain_mask: 4,
  1172. /* retry_limit -
  1173. * Specify the maximum number of transmissions, including the
  1174. * initial transmission, to attempt before giving up if no ack
  1175. * is received.
  1176. * If the tx rate is specified, then all retries shall use the
  1177. * same rate as the initial transmission.
  1178. * If no tx rate is specified, the target can choose whether to
  1179. * retain the original rate during the retransmissions, or to
  1180. * fall back to a more robust rate.
  1181. */
  1182. retry_limit: 4,
  1183. /* bandwidth_mask -
  1184. * Specify what channel widths may be used for the transmission.
  1185. * A value of zero indicates "don't care" - the target may choose
  1186. * the transmission bandwidth.
  1187. * The bits within this mask correspond to the htt_tx_bandwidth
  1188. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1189. * The bandwidth_mask must be consistent with the preamble_type_mask
  1190. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1191. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1192. */
  1193. bandwidth_mask: 6,
  1194. reserved2_31_14: 18; /* unused, set to 0x0 */
  1195. /* DWORD 3: tx expiry time (TSF) LSBs */
  1196. A_UINT32 expire_tsf_lo;
  1197. /* DWORD 4: tx expiry time (TSF) MSBs */
  1198. A_UINT32 expire_tsf_hi;
  1199. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1200. } POSTPACK;
  1201. /* DWORD 0 */
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1222. /* DWORD 1 */
  1223. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1224. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1225. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1226. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1227. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1228. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1229. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1230. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1231. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1232. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1233. /* DWORD 2 */
  1234. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1235. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1236. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1237. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1238. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1239. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1240. /* DWORD 0 */
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1242. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1243. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1248. } while (0)
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1250. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1251. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1253. do { \
  1254. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1255. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1256. } while (0)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1258. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1259. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL( \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1264. ((_var) |= ((_val) \
  1265. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1266. } while (0)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1268. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL( \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1274. ((_var) |= ((_val) \
  1275. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1284. } while (0)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1286. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1287. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1292. } while (0)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1294. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1300. } while (0)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1302. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1308. } while (0)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1310. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1311. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1312. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1316. } while (0)
  1317. /* DWORD 1 */
  1318. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1319. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1320. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1321. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1322. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1323. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1324. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1325. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1326. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1327. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1328. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1329. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1330. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1334. } while (0)
  1335. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1336. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1337. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1338. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1342. } while (0)
  1343. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1344. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1345. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1346. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1349. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1350. } while (0)
  1351. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1352. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1353. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1354. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1357. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1358. } while (0)
  1359. /* DWORD 2 */
  1360. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1361. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1362. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1363. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1364. do { \
  1365. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1366. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1367. } while (0)
  1368. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1369. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1370. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1371. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1372. do { \
  1373. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1374. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1375. } while (0)
  1376. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1377. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1378. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1379. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1380. do { \
  1381. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1382. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1383. } while (0)
  1384. typedef enum {
  1385. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1386. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1387. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1388. } htt_11ax_ltf_subtype_t;
  1389. typedef enum {
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1396. } htt_tx_ext2_preamble_type_t;
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1409. /**
  1410. * @brief HTT tx MSDU extension descriptor v2
  1411. * @details
  1412. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1413. * is received as tcl_exit_base->host_meta_info in firmware.
  1414. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1415. * are already part of tcl_exit_base.
  1416. */
  1417. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1418. /* DWORD 0: flags */
  1419. A_UINT32
  1420. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1421. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1422. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1423. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1424. valid_retries : 1, /* if set, tx retries spec is valid */
  1425. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1426. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1427. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1428. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1429. valid_key_flags : 1, /* if set, key flags is valid */
  1430. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1431. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1432. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1433. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1434. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1435. 1 = ENCRYPT,
  1436. 2 ~ 3 - Reserved */
  1437. /* retry_limit -
  1438. * Specify the maximum number of transmissions, including the
  1439. * initial transmission, to attempt before giving up if no ack
  1440. * is received.
  1441. * If the tx rate is specified, then all retries shall use the
  1442. * same rate as the initial transmission.
  1443. * If no tx rate is specified, the target can choose whether to
  1444. * retain the original rate during the retransmissions, or to
  1445. * fall back to a more robust rate.
  1446. */
  1447. retry_limit : 4,
  1448. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1449. * Valid only for 11ax preamble types HE_SU
  1450. * and HE_EXT_SU
  1451. */
  1452. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1453. * Valid only for 11ax preamble types HE_SU
  1454. * and HE_EXT_SU
  1455. */
  1456. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1457. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1458. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1459. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1460. */
  1461. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1462. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1463. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1464. * Use cases:
  1465. * Any time firmware uses TQM-BYPASS for Data
  1466. * TID, firmware expect host to set this bit.
  1467. */
  1468. /* DWORD 1: tx power, tx rate */
  1469. A_UINT32
  1470. power : 8, /* unit of the power field is 0.5 dbm
  1471. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1472. * signed value ranging from -64dbm to 63.5 dbm
  1473. */
  1474. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1475. * Setting more than one MCS isn't currently
  1476. * supported by the target (but is supported
  1477. * in the interface in case in the future
  1478. * the target supports specifications of
  1479. * a limited set of MCS values.
  1480. */
  1481. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1482. * Setting more than one Nss isn't currently
  1483. * supported by the target (but is supported
  1484. * in the interface in case in the future
  1485. * the target supports specifications of
  1486. * a limited set of Nss values.
  1487. */
  1488. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1489. update_peer_cache : 1; /* When set these custom values will be
  1490. * used for all packets, until the next
  1491. * update via this ext header.
  1492. * This is to make sure not all packets
  1493. * need to include this header.
  1494. */
  1495. /* DWORD 2: tx chain mask, tx retries */
  1496. A_UINT32
  1497. /* chain_mask - specify which chains to transmit from */
  1498. chain_mask : 8,
  1499. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1500. * TODO: Update Enum values for key_flags
  1501. */
  1502. /*
  1503. * Channel frequency: This identifies the desired channel
  1504. * frequency (in MHz) for tx frames. This is used by FW to help
  1505. * determine when it is safe to transmit or drop frames for
  1506. * off-channel operation.
  1507. * The default value of zero indicates to FW that the corresponding
  1508. * VDEV's home channel (if there is one) is the desired channel
  1509. * frequency.
  1510. */
  1511. chanfreq : 16;
  1512. /* DWORD 3: tx expiry time (TSF) LSBs */
  1513. A_UINT32 expire_tsf_lo;
  1514. /* DWORD 4: tx expiry time (TSF) MSBs */
  1515. A_UINT32 expire_tsf_hi;
  1516. /* DWORD 5: reserved
  1517. * This structure can be expanded further up to 60 bytes
  1518. * by adding further DWORDs as needed.
  1519. */
  1520. A_UINT32
  1521. /* learning_frame
  1522. * When this flag is set, this frame will be dropped by FW
  1523. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1524. */
  1525. learning_frame : 1,
  1526. rsvd0 : 31;
  1527. } POSTPACK;
  1528. /* DWORD 0 */
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1555. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1556. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1557. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1558. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1559. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1560. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1561. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1562. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1563. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1564. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1565. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1566. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1567. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1568. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1569. /* DWORD 1 */
  1570. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1571. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1572. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1573. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1574. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1575. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1576. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1577. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1578. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1579. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1580. /* DWORD 2 */
  1581. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1582. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1583. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1584. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1585. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1586. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1587. /* DWORD 5 */
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1590. /* DWORD 0 */
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1593. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1597. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1598. } while (0)
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1600. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1601. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1603. do { \
  1604. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1605. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1609. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1610. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1613. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1617. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL( \
  1621. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1622. ((_var) |= ((_val) \
  1623. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1624. } while (0)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1627. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL( \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1648. ((_var) |= ((_val) \
  1649. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1701. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1702. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1709. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1710. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1714. } while (0)
  1715. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1716. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1717. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1718. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1719. do { \
  1720. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1721. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1722. } while (0)
  1723. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1724. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1725. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1726. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1727. do { \
  1728. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1729. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1730. } while (0)
  1731. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1732. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1733. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1734. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1735. do { \
  1736. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1737. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1738. } while (0)
  1739. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1743. do { \
  1744. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1745. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1746. } while (0)
  1747. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1748. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1749. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1750. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1753. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1754. } while (0)
  1755. /* DWORD 1 */
  1756. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1757. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1758. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1759. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1760. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1761. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1762. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1763. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1764. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1765. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1788. } while (0)
  1789. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1790. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1791. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1792. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1795. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1796. } while (0)
  1797. /* DWORD 2 */
  1798. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1799. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1800. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1801. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1802. do { \
  1803. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1804. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1805. } while (0)
  1806. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1807. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1808. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1809. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1810. do { \
  1811. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1812. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1813. } while (0)
  1814. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1815. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1816. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1817. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1818. do { \
  1819. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1820. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1821. } while (0)
  1822. /* DWORD 5 */
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1824. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1825. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1827. do { \
  1828. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1829. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1830. } while (0)
  1831. typedef enum {
  1832. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1833. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1834. } htt_tcl_metadata_type;
  1835. /**
  1836. * @brief HTT TCL command number format
  1837. * @details
  1838. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1839. * available to firmware as tcl_exit_base->tcl_status_number.
  1840. * For regular / multicast packets host will send vdev and mac id and for
  1841. * NAWDS packets, host will send peer id.
  1842. * A_UINT32 is used to avoid endianness conversion problems.
  1843. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1844. */
  1845. typedef struct {
  1846. A_UINT32
  1847. type: 1, /* vdev_id based or peer_id based */
  1848. rsvd: 31;
  1849. } htt_tx_tcl_vdev_or_peer_t;
  1850. typedef struct {
  1851. A_UINT32
  1852. type: 1, /* vdev_id based or peer_id based */
  1853. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1854. vdev_id: 8,
  1855. pdev_id: 2,
  1856. host_inspected:1,
  1857. rsvd: 19;
  1858. } htt_tx_tcl_vdev_metadata;
  1859. typedef struct {
  1860. A_UINT32
  1861. type: 1, /* vdev_id based or peer_id based */
  1862. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1863. peer_id: 14,
  1864. rsvd: 16;
  1865. } htt_tx_tcl_peer_metadata;
  1866. PREPACK struct htt_tx_tcl_metadata {
  1867. union {
  1868. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1869. htt_tx_tcl_vdev_metadata vdev_meta;
  1870. htt_tx_tcl_peer_metadata peer_meta;
  1871. };
  1872. } POSTPACK;
  1873. /* DWORD 0 */
  1874. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1875. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1876. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1877. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1878. /* VDEV metadata */
  1879. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1880. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1881. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1882. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1883. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1884. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1885. /* PEER metadata */
  1886. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1887. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1888. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1889. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1890. HTT_TX_TCL_METADATA_TYPE_S)
  1891. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1895. } while (0)
  1896. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1897. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1898. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1899. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1900. do { \
  1901. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1902. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1903. } while (0)
  1904. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1905. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1906. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1907. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1908. do { \
  1909. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1910. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1911. } while (0)
  1912. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1913. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1914. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1915. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1918. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1919. } while (0)
  1920. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1921. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1922. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1923. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1924. do { \
  1925. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1926. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1927. } while (0)
  1928. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1929. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1930. HTT_TX_TCL_METADATA_PEER_ID_S)
  1931. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1932. do { \
  1933. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1934. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1935. } while (0)
  1936. typedef enum {
  1937. HTT_TX_FW2WBM_TX_STATUS_OK,
  1938. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1939. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1940. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1941. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1942. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1943. HTT_TX_FW2WBM_TX_STATUS_MAX
  1944. } htt_tx_fw2wbm_tx_status_t;
  1945. typedef enum {
  1946. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1947. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1948. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1949. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1950. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1951. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1952. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1953. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1954. } htt_tx_fw2wbm_reinject_reason_t;
  1955. /**
  1956. * @brief HTT TX WBM Completion from firmware to host
  1957. * @details
  1958. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1959. * DWORD 3 and 4 for software based completions (Exception frames and
  1960. * TQM bypass frames)
  1961. * For software based completions, wbm_release_ring->release_source_module will
  1962. * be set to release_source_fw
  1963. */
  1964. PREPACK struct htt_tx_wbm_completion {
  1965. A_UINT32
  1966. sch_cmd_id: 24,
  1967. exception_frame: 1, /* If set, this packet was queued via exception path */
  1968. rsvd0_31_25: 7;
  1969. A_UINT32
  1970. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1971. * reception of an ACK or BA, this field indicates
  1972. * the RSSI of the received ACK or BA frame.
  1973. * When the frame is removed as result of a direct
  1974. * remove command from the SW, this field is set
  1975. * to 0x0 (which is never a valid value when real
  1976. * RSSI is available).
  1977. * Units: dB w.r.t noise floor
  1978. */
  1979. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1980. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1981. rsvd1_31_16: 16;
  1982. } POSTPACK;
  1983. /* DWORD 0 */
  1984. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1985. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1986. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1987. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1988. /* DWORD 1 */
  1989. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1990. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1991. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1992. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1993. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1994. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1995. /* DWORD 0 */
  1996. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1997. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1998. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1999. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2003. } while (0)
  2004. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2005. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2006. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2007. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2011. } while (0)
  2012. /* DWORD 1 */
  2013. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2014. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2015. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2016. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2020. } while (0)
  2021. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2022. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2023. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2024. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2028. } while (0)
  2029. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2030. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2031. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2032. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2036. } while (0)
  2037. /**
  2038. * @brief HTT TX WBM Completion from firmware to host
  2039. * @details
  2040. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2041. * (WBM) offload HW.
  2042. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2043. * For software based completions, release_source_module will
  2044. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2045. * struct wbm_release_ring and then switch to this after looking at
  2046. * release_source_module.
  2047. */
  2048. PREPACK struct htt_tx_wbm_completion_v2 {
  2049. A_UINT32
  2050. used_by_hw0; /* Refer to struct wbm_release_ring */
  2051. A_UINT32
  2052. used_by_hw1; /* Refer to struct wbm_release_ring */
  2053. A_UINT32
  2054. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2055. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2056. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2057. exception_frame: 1,
  2058. rsvd0: 12, /* For future use */
  2059. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2060. rsvd1: 1; /* For future use */
  2061. A_UINT32
  2062. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2063. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2064. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2065. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2066. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2067. */
  2068. A_UINT32
  2069. data1: 32;
  2070. A_UINT32
  2071. data2: 32;
  2072. A_UINT32
  2073. used_by_hw3; /* Refer to struct wbm_release_ring */
  2074. } POSTPACK;
  2075. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2076. /* DWORD 3 */
  2077. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2078. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2079. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2080. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2081. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2082. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2083. /* DWORD 3 */
  2084. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2086. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2087. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2091. } while (0)
  2092. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2093. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2094. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2095. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2099. } while (0)
  2100. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2101. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2102. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2103. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2106. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2107. } while (0)
  2108. /**
  2109. * @brief HTT TX WBM transmit status from firmware to host
  2110. * @details
  2111. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2112. * (WBM) offload HW.
  2113. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2114. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2115. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2116. */
  2117. PREPACK struct htt_tx_wbm_transmit_status {
  2118. A_UINT32
  2119. sch_cmd_id: 24,
  2120. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2121. * reception of an ACK or BA, this field indicates
  2122. * the RSSI of the received ACK or BA frame.
  2123. * When the frame is removed as result of a direct
  2124. * remove command from the SW, this field is set
  2125. * to 0x0 (which is never a valid value when real
  2126. * RSSI is available).
  2127. * Units: dB w.r.t noise floor
  2128. */
  2129. A_UINT32
  2130. sw_peer_id: 16,
  2131. tid_num: 5,
  2132. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2133. * and tid_num fields contain valid data.
  2134. * If this "valid" flag is not set, the
  2135. * sw_peer_id and tid_num fields must be ignored.
  2136. */
  2137. mcast: 1,
  2138. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2139. * contains valid data.
  2140. */
  2141. reserved0: 8;
  2142. A_UINT32
  2143. reserved1: 32;
  2144. } POSTPACK;
  2145. /* DWORD 4 */
  2146. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2147. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2148. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2149. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2150. /* DWORD 5 */
  2151. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2152. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2153. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2154. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2155. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2156. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2157. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2158. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2159. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2160. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2161. /* DWORD 4 */
  2162. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2163. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2164. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2165. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2169. } while (0)
  2170. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2171. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2172. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2173. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2177. } while (0)
  2178. /* DWORD 5 */
  2179. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2180. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2181. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2182. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2186. } while (0)
  2187. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2188. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2189. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2190. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2191. do { \
  2192. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2193. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2194. } while (0)
  2195. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2196. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2197. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2198. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2199. do { \
  2200. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2201. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2202. } while (0)
  2203. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2204. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2205. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2206. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2207. do { \
  2208. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2209. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2210. } while (0)
  2211. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2212. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2213. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2214. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2215. do { \
  2216. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2217. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2218. } while (0)
  2219. /**
  2220. * @brief HTT TX WBM reinject status from firmware to host
  2221. * @details
  2222. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2223. * (WBM) offload HW.
  2224. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2225. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2226. */
  2227. PREPACK struct htt_tx_wbm_reinject_status {
  2228. A_UINT32
  2229. reserved0: 32;
  2230. A_UINT32
  2231. reserved1: 32;
  2232. A_UINT32
  2233. reserved2: 32;
  2234. } POSTPACK;
  2235. /**
  2236. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2237. * @details
  2238. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2239. * (WBM) offload HW.
  2240. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2241. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2242. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2243. * STA side.
  2244. */
  2245. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2246. A_UINT32
  2247. mec_sa_addr_31_0;
  2248. A_UINT32
  2249. mec_sa_addr_47_32: 16,
  2250. sa_ast_index: 16;
  2251. A_UINT32
  2252. vdev_id: 8,
  2253. reserved0: 24;
  2254. } POSTPACK;
  2255. /* DWORD 4 - mec_sa_addr_31_0 */
  2256. /* DWORD 5 */
  2257. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2258. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2259. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2260. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2261. /* DWORD 6 */
  2262. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2263. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2264. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2265. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2266. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2267. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2268. do { \
  2269. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2270. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2271. } while (0)
  2272. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2273. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2274. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2275. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2276. do { \
  2277. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2278. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2279. } while (0)
  2280. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2281. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2282. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2283. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2284. do { \
  2285. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2286. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2287. } while (0)
  2288. typedef enum {
  2289. TX_FLOW_PRIORITY_BE,
  2290. TX_FLOW_PRIORITY_HIGH,
  2291. TX_FLOW_PRIORITY_LOW,
  2292. } htt_tx_flow_priority_t;
  2293. typedef enum {
  2294. TX_FLOW_LATENCY_SENSITIVE,
  2295. TX_FLOW_LATENCY_INSENSITIVE,
  2296. } htt_tx_flow_latency_t;
  2297. typedef enum {
  2298. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2299. TX_FLOW_INTERACTIVE_TRAFFIC,
  2300. TX_FLOW_PERIODIC_TRAFFIC,
  2301. TX_FLOW_BURSTY_TRAFFIC,
  2302. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2303. } htt_tx_flow_traffic_pattern_t;
  2304. /**
  2305. * @brief HTT TX Flow search metadata format
  2306. * @details
  2307. * Host will set this metadata in flow table's flow search entry along with
  2308. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2309. * firmware and TQM ring if the flow search entry wins.
  2310. * This metadata is available to firmware in that first MSDU's
  2311. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2312. * to one of the available flows for specific tid and returns the tqm flow
  2313. * pointer as part of htt_tx_map_flow_info message.
  2314. */
  2315. PREPACK struct htt_tx_flow_metadata {
  2316. A_UINT32
  2317. rsvd0_1_0: 2,
  2318. tid: 4,
  2319. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2320. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2321. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2322. * Else choose final tid based on latency, priority.
  2323. */
  2324. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2325. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2326. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2327. } POSTPACK;
  2328. /* DWORD 0 */
  2329. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2330. #define HTT_TX_FLOW_METADATA_TID_S 2
  2331. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2332. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2333. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2334. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2335. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2336. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2337. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2338. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2339. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2340. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2341. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2342. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2343. /* DWORD 0 */
  2344. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2345. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2346. HTT_TX_FLOW_METADATA_TID_S)
  2347. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2351. } while (0)
  2352. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2353. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2354. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2355. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2359. } while (0)
  2360. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2361. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2362. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2363. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2367. } while (0)
  2368. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2369. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2370. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2371. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2372. do { \
  2373. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2374. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2375. } while (0)
  2376. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2377. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2378. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2379. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2380. do { \
  2381. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2382. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2383. } while (0)
  2384. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2385. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2386. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2387. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2388. do { \
  2389. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2390. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2391. } while (0)
  2392. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2393. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2394. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2395. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2396. do { \
  2397. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2398. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2399. } while (0)
  2400. /**
  2401. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2402. *
  2403. * @details
  2404. * HTT wds entry from source port learning
  2405. * Host will learn wds entries from rx and send this message to firmware
  2406. * to enable firmware to configure/delete AST entries for wds clients.
  2407. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2408. * and when SA's entry is deleted, firmware removes this AST entry
  2409. *
  2410. * The message would appear as follows:
  2411. *
  2412. * |31 30|29 |17 16|15 8|7 0|
  2413. * |----------------+----------------+----------------+----------------|
  2414. * | rsvd0 |PDVID| vdev_id | msg_type |
  2415. * |-------------------------------------------------------------------|
  2416. * | sa_addr_31_0 |
  2417. * |-------------------------------------------------------------------|
  2418. * | | ta_peer_id | sa_addr_47_32 |
  2419. * |-------------------------------------------------------------------|
  2420. * Where PDVID = pdev_id
  2421. *
  2422. * The message is interpreted as follows:
  2423. *
  2424. * dword0 - b'0:7 - msg_type: This will be set to
  2425. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2426. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2427. *
  2428. * dword0 - b'8:15 - vdev_id
  2429. *
  2430. * dword0 - b'16:17 - pdev_id
  2431. *
  2432. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2433. *
  2434. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2435. *
  2436. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2437. *
  2438. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2439. */
  2440. PREPACK struct htt_wds_entry {
  2441. A_UINT32
  2442. msg_type: 8,
  2443. vdev_id: 8,
  2444. pdev_id: 2,
  2445. rsvd0: 14;
  2446. A_UINT32 sa_addr_31_0;
  2447. A_UINT32
  2448. sa_addr_47_32: 16,
  2449. ta_peer_id: 14,
  2450. rsvd2: 2;
  2451. } POSTPACK;
  2452. /* DWORD 0 */
  2453. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2454. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2455. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2456. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2457. /* DWORD 2 */
  2458. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2459. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2460. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2461. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2462. /* DWORD 0 */
  2463. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2464. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2465. HTT_WDS_ENTRY_VDEV_ID_S)
  2466. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2467. do { \
  2468. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2469. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2470. } while (0)
  2471. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2472. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2473. HTT_WDS_ENTRY_PDEV_ID_S)
  2474. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2475. do { \
  2476. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2477. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2478. } while (0)
  2479. /* DWORD 2 */
  2480. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2481. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2482. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2483. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2486. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2487. } while (0)
  2488. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2489. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2490. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2491. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2492. do { \
  2493. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2494. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2495. } while (0)
  2496. /**
  2497. * @brief MAC DMA rx ring setup specification
  2498. * @details
  2499. * To allow for dynamic rx ring reconfiguration and to avoid race
  2500. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2501. * it uses. Instead, it sends this message to the target, indicating how
  2502. * the rx ring used by the host should be set up and maintained.
  2503. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2504. * specifications.
  2505. *
  2506. * |31 16|15 8|7 0|
  2507. * |---------------------------------------------------------------|
  2508. * header: | reserved | num rings | msg type |
  2509. * |---------------------------------------------------------------|
  2510. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2511. #if HTT_PADDR64
  2512. * | FW_IDX shadow register physical address (bits 63:32) |
  2513. #endif
  2514. * |---------------------------------------------------------------|
  2515. * | rx ring base physical address (bits 31:0) |
  2516. #if HTT_PADDR64
  2517. * | rx ring base physical address (bits 63:32) |
  2518. #endif
  2519. * |---------------------------------------------------------------|
  2520. * | rx ring buffer size | rx ring length |
  2521. * |---------------------------------------------------------------|
  2522. * | FW_IDX initial value | enabled flags |
  2523. * |---------------------------------------------------------------|
  2524. * | MSDU payload offset | 802.11 header offset |
  2525. * |---------------------------------------------------------------|
  2526. * | PPDU end offset | PPDU start offset |
  2527. * |---------------------------------------------------------------|
  2528. * | MPDU end offset | MPDU start offset |
  2529. * |---------------------------------------------------------------|
  2530. * | MSDU end offset | MSDU start offset |
  2531. * |---------------------------------------------------------------|
  2532. * | frag info offset | rx attention offset |
  2533. * |---------------------------------------------------------------|
  2534. * payload 2, if present, has the same format as payload 1
  2535. * Header fields:
  2536. * - MSG_TYPE
  2537. * Bits 7:0
  2538. * Purpose: identifies this as an rx ring configuration message
  2539. * Value: 0x2
  2540. * - NUM_RINGS
  2541. * Bits 15:8
  2542. * Purpose: indicates whether the host is setting up one rx ring or two
  2543. * Value: 1 or 2
  2544. * Payload:
  2545. * for systems using 64-bit format for bus addresses:
  2546. * - IDX_SHADOW_REG_PADDR_LO
  2547. * Bits 31:0
  2548. * Value: lower 4 bytes of physical address of the host's
  2549. * FW_IDX shadow register
  2550. * - IDX_SHADOW_REG_PADDR_HI
  2551. * Bits 31:0
  2552. * Value: upper 4 bytes of physical address of the host's
  2553. * FW_IDX shadow register
  2554. * - RING_BASE_PADDR_LO
  2555. * Bits 31:0
  2556. * Value: lower 4 bytes of physical address of the host's rx ring
  2557. * - RING_BASE_PADDR_HI
  2558. * Bits 31:0
  2559. * Value: uppper 4 bytes of physical address of the host's rx ring
  2560. * for systems using 32-bit format for bus addresses:
  2561. * - IDX_SHADOW_REG_PADDR
  2562. * Bits 31:0
  2563. * Value: physical address of the host's FW_IDX shadow register
  2564. * - RING_BASE_PADDR
  2565. * Bits 31:0
  2566. * Value: physical address of the host's rx ring
  2567. * - RING_LEN
  2568. * Bits 15:0
  2569. * Value: number of elements in the rx ring
  2570. * - RING_BUF_SZ
  2571. * Bits 31:16
  2572. * Value: size of the buffers referenced by the rx ring, in byte units
  2573. * - ENABLED_FLAGS
  2574. * Bits 15:0
  2575. * Value: 1-bit flags to show whether different rx fields are enabled
  2576. * bit 0: 802.11 header enabled (1) or disabled (0)
  2577. * bit 1: MSDU payload enabled (1) or disabled (0)
  2578. * bit 2: PPDU start enabled (1) or disabled (0)
  2579. * bit 3: PPDU end enabled (1) or disabled (0)
  2580. * bit 4: MPDU start enabled (1) or disabled (0)
  2581. * bit 5: MPDU end enabled (1) or disabled (0)
  2582. * bit 6: MSDU start enabled (1) or disabled (0)
  2583. * bit 7: MSDU end enabled (1) or disabled (0)
  2584. * bit 8: rx attention enabled (1) or disabled (0)
  2585. * bit 9: frag info enabled (1) or disabled (0)
  2586. * bit 10: unicast rx enabled (1) or disabled (0)
  2587. * bit 11: multicast rx enabled (1) or disabled (0)
  2588. * bit 12: ctrl rx enabled (1) or disabled (0)
  2589. * bit 13: mgmt rx enabled (1) or disabled (0)
  2590. * bit 14: null rx enabled (1) or disabled (0)
  2591. * bit 15: phy data rx enabled (1) or disabled (0)
  2592. * - IDX_INIT_VAL
  2593. * Bits 31:16
  2594. * Purpose: Specify the initial value for the FW_IDX.
  2595. * Value: the number of buffers initially present in the host's rx ring
  2596. * - OFFSET_802_11_HDR
  2597. * Bits 15:0
  2598. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2599. * - OFFSET_MSDU_PAYLOAD
  2600. * Bits 31:16
  2601. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2602. * - OFFSET_PPDU_START
  2603. * Bits 15:0
  2604. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2605. * - OFFSET_PPDU_END
  2606. * Bits 31:16
  2607. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2608. * - OFFSET_MPDU_START
  2609. * Bits 15:0
  2610. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2611. * - OFFSET_MPDU_END
  2612. * Bits 31:16
  2613. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2614. * - OFFSET_MSDU_START
  2615. * Bits 15:0
  2616. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2617. * - OFFSET_MSDU_END
  2618. * Bits 31:16
  2619. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2620. * - OFFSET_RX_ATTN
  2621. * Bits 15:0
  2622. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2623. * - OFFSET_FRAG_INFO
  2624. * Bits 31:16
  2625. * Value: offset in QUAD-bytes of frag info table
  2626. */
  2627. /* header fields */
  2628. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2629. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2630. /* payload fields */
  2631. /* for systems using a 64-bit format for bus addresses */
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2633. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2635. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2636. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2637. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2638. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2639. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2640. /* for systems using a 32-bit format for bus addresses */
  2641. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2642. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2645. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2646. #define HTT_RX_RING_CFG_LEN_S 0
  2647. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2648. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2649. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2650. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2651. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2652. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2653. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2654. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2655. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2656. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2657. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2658. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2659. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2660. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2661. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2662. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2663. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2664. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2665. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2666. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2667. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2668. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2669. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2670. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2671. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2672. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2673. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2674. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2675. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2676. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2677. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2678. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2679. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2680. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2681. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2682. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2683. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2684. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2685. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2686. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2687. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2688. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2689. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2690. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2691. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2692. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2693. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2694. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2695. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2696. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2697. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2698. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2699. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2700. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2701. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2702. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2703. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2704. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2705. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2706. #if HTT_PADDR64
  2707. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2708. #else
  2709. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2710. #endif
  2711. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2712. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2713. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2714. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2715. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2716. do { \
  2717. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2718. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2719. } while (0)
  2720. /* degenerate case for 32-bit fields */
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2723. ((_var) = (_val))
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2726. ((_var) = (_val))
  2727. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2728. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2729. ((_var) = (_val))
  2730. /* degenerate case for 32-bit fields */
  2731. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2733. ((_var) = (_val))
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2736. ((_var) = (_val))
  2737. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2738. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2739. ((_var) = (_val))
  2740. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2741. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2742. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2745. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2746. } while (0)
  2747. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2748. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2749. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2752. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2753. } while (0)
  2754. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2755. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2756. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2757. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2760. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2761. } while (0)
  2762. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2763. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2764. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2765. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2768. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2769. } while (0)
  2770. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2771. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2772. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2773. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2774. do { \
  2775. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2776. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2777. } while (0)
  2778. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2779. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2780. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2781. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2784. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2785. } while (0)
  2786. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2787. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2788. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2789. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2792. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2793. } while (0)
  2794. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2795. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2796. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2797. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2798. do { \
  2799. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2800. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2801. } while (0)
  2802. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2803. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2804. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2805. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2808. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2809. } while (0)
  2810. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2811. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2812. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2813. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2814. do { \
  2815. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2816. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2817. } while (0)
  2818. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2819. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2820. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2821. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2822. do { \
  2823. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2824. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2825. } while (0)
  2826. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2827. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2828. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2829. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2832. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2833. } while (0)
  2834. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2835. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2836. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2837. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2840. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2841. } while (0)
  2842. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2843. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2844. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2845. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2846. do { \
  2847. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2848. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2849. } while (0)
  2850. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2851. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2852. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2853. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2854. do { \
  2855. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2856. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2857. } while (0)
  2858. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2859. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2860. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2861. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2862. do { \
  2863. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2864. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2865. } while (0)
  2866. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2867. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2868. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2869. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2872. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2873. } while (0)
  2874. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2875. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2876. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2877. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2880. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2881. } while (0)
  2882. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2883. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2884. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2885. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2886. do { \
  2887. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2888. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2889. } while (0)
  2890. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2891. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2892. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2893. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2894. do { \
  2895. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2896. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2897. } while (0)
  2898. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2899. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2900. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2901. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2902. do { \
  2903. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2904. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2905. } while (0)
  2906. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2907. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2908. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2909. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2910. do { \
  2911. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2912. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2913. } while (0)
  2914. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2915. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2916. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2917. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2918. do { \
  2919. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2920. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2921. } while (0)
  2922. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2923. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2924. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2925. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2926. do { \
  2927. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2928. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2929. } while (0)
  2930. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2931. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2932. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2933. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2936. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2937. } while (0)
  2938. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2939. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2940. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2941. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2944. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2945. } while (0)
  2946. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2947. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2948. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2949. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2952. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2953. } while (0)
  2954. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2955. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2956. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2957. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2960. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2961. } while (0)
  2962. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2963. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2964. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2965. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2968. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2969. } while (0)
  2970. /**
  2971. * @brief host -> target FW statistics retrieve
  2972. *
  2973. * @details
  2974. * The following field definitions describe the format of the HTT host
  2975. * to target FW stats retrieve message. The message specifies the type of
  2976. * stats host wants to retrieve.
  2977. *
  2978. * |31 24|23 16|15 8|7 0|
  2979. * |-----------------------------------------------------------|
  2980. * | stats types request bitmask | msg type |
  2981. * |-----------------------------------------------------------|
  2982. * | stats types reset bitmask | reserved |
  2983. * |-----------------------------------------------------------|
  2984. * | stats type | config value |
  2985. * |-----------------------------------------------------------|
  2986. * | cookie LSBs |
  2987. * |-----------------------------------------------------------|
  2988. * | cookie MSBs |
  2989. * |-----------------------------------------------------------|
  2990. * Header fields:
  2991. * - MSG_TYPE
  2992. * Bits 7:0
  2993. * Purpose: identifies this is a stats upload request message
  2994. * Value: 0x3
  2995. * - UPLOAD_TYPES
  2996. * Bits 31:8
  2997. * Purpose: identifies which types of FW statistics to upload
  2998. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2999. * - RESET_TYPES
  3000. * Bits 31:8
  3001. * Purpose: identifies which types of FW statistics to reset
  3002. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3003. * - CFG_VAL
  3004. * Bits 23:0
  3005. * Purpose: give an opaque configuration value to the specified stats type
  3006. * Value: stats-type specific configuration value
  3007. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3008. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3009. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3010. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3011. * - CFG_STAT_TYPE
  3012. * Bits 31:24
  3013. * Purpose: specify which stats type (if any) the config value applies to
  3014. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3015. * a valid configuration specification
  3016. * - COOKIE_LSBS
  3017. * Bits 31:0
  3018. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3019. * message with its preceding host->target stats request message.
  3020. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3021. * - COOKIE_MSBS
  3022. * Bits 31:0
  3023. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3024. * message with its preceding host->target stats request message.
  3025. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3026. */
  3027. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3028. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3029. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3030. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3031. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3032. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3033. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3034. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3035. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3036. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3037. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3038. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3039. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3040. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3043. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3044. } while (0)
  3045. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3046. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3047. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3048. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3049. do { \
  3050. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3051. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3052. } while (0)
  3053. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3054. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3055. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3056. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3057. do { \
  3058. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3059. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3060. } while (0)
  3061. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3062. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3063. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3064. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3065. do { \
  3066. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3067. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3068. } while (0)
  3069. /**
  3070. * @brief host -> target HTT out-of-band sync request
  3071. *
  3072. * @details
  3073. * The HTT SYNC tells the target to suspend processing of subsequent
  3074. * HTT host-to-target messages until some other target agent locally
  3075. * informs the target HTT FW that the current sync counter is equal to
  3076. * or greater than (in a modulo sense) the sync counter specified in
  3077. * the SYNC message.
  3078. * This allows other host-target components to synchronize their operation
  3079. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3080. * security key has been downloaded to and activated by the target.
  3081. * In the absence of any explicit synchronization counter value
  3082. * specification, the target HTT FW will use zero as the default current
  3083. * sync value.
  3084. *
  3085. * |31 24|23 16|15 8|7 0|
  3086. * |-----------------------------------------------------------|
  3087. * | reserved | sync count | msg type |
  3088. * |-----------------------------------------------------------|
  3089. * Header fields:
  3090. * - MSG_TYPE
  3091. * Bits 7:0
  3092. * Purpose: identifies this as a sync message
  3093. * Value: 0x4
  3094. * - SYNC_COUNT
  3095. * Bits 15:8
  3096. * Purpose: specifies what sync value the HTT FW will wait for from
  3097. * an out-of-band specification to resume its operation
  3098. * Value: in-band sync counter value to compare against the out-of-band
  3099. * counter spec.
  3100. * The HTT target FW will suspend its host->target message processing
  3101. * as long as
  3102. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3103. */
  3104. #define HTT_H2T_SYNC_MSG_SZ 4
  3105. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3106. #define HTT_H2T_SYNC_COUNT_S 8
  3107. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3108. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3109. HTT_H2T_SYNC_COUNT_S)
  3110. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3113. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3114. } while (0)
  3115. /**
  3116. * @brief HTT aggregation configuration
  3117. */
  3118. #define HTT_AGGR_CFG_MSG_SZ 4
  3119. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3120. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3121. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3122. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3124. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3125. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3126. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3127. do { \
  3128. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3129. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3130. } while (0)
  3131. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3132. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3133. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3134. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3135. do { \
  3136. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3137. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3138. } while (0)
  3139. /**
  3140. * @brief host -> target HTT configure max amsdu info per vdev
  3141. *
  3142. * @details
  3143. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3144. *
  3145. * |31 21|20 16|15 8|7 0|
  3146. * |-----------------------------------------------------------|
  3147. * | reserved | vdev id | max amsdu | msg type |
  3148. * |-----------------------------------------------------------|
  3149. * Header fields:
  3150. * - MSG_TYPE
  3151. * Bits 7:0
  3152. * Purpose: identifies this as a aggr cfg ex message
  3153. * Value: 0xa
  3154. * - MAX_NUM_AMSDU_SUBFRM
  3155. * Bits 15:8
  3156. * Purpose: max MSDUs per A-MSDU
  3157. * - VDEV_ID
  3158. * Bits 20:16
  3159. * Purpose: ID of the vdev to which this limit is applied
  3160. */
  3161. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3162. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3163. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3164. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3165. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3166. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3167. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3168. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3169. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3170. do { \
  3171. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3172. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3173. } while (0)
  3174. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3175. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3176. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3177. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3178. do { \
  3179. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3180. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3181. } while (0)
  3182. /**
  3183. * @brief HTT WDI_IPA Config Message
  3184. *
  3185. * @details
  3186. * The HTT WDI_IPA config message is created/sent by host at driver
  3187. * init time. It contains information about data structures used on
  3188. * WDI_IPA TX and RX path.
  3189. * TX CE ring is used for pushing packet metadata from IPA uC
  3190. * to WLAN FW
  3191. * TX Completion ring is used for generating TX completions from
  3192. * WLAN FW to IPA uC
  3193. * RX Indication ring is used for indicating RX packets from FW
  3194. * to IPA uC
  3195. * RX Ring2 is used as either completion ring or as second
  3196. * indication ring. when Ring2 is used as completion ring, IPA uC
  3197. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3198. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3199. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3200. * indicated in RX Indication ring. Please see WDI_IPA specification
  3201. * for more details.
  3202. * |31 24|23 16|15 8|7 0|
  3203. * |----------------+----------------+----------------+----------------|
  3204. * | tx pkt pool size | Rsvd | msg_type |
  3205. * |-------------------------------------------------------------------|
  3206. * | tx comp ring base (bits 31:0) |
  3207. #if HTT_PADDR64
  3208. * | tx comp ring base (bits 63:32) |
  3209. #endif
  3210. * |-------------------------------------------------------------------|
  3211. * | tx comp ring size |
  3212. * |-------------------------------------------------------------------|
  3213. * | tx comp WR_IDX physical address (bits 31:0) |
  3214. #if HTT_PADDR64
  3215. * | tx comp WR_IDX physical address (bits 63:32) |
  3216. #endif
  3217. * |-------------------------------------------------------------------|
  3218. * | tx CE WR_IDX physical address (bits 31:0) |
  3219. #if HTT_PADDR64
  3220. * | tx CE WR_IDX physical address (bits 63:32) |
  3221. #endif
  3222. * |-------------------------------------------------------------------|
  3223. * | rx indication ring base (bits 31:0) |
  3224. #if HTT_PADDR64
  3225. * | rx indication ring base (bits 63:32) |
  3226. #endif
  3227. * |-------------------------------------------------------------------|
  3228. * | rx indication ring size |
  3229. * |-------------------------------------------------------------------|
  3230. * | rx ind RD_IDX physical address (bits 31:0) |
  3231. #if HTT_PADDR64
  3232. * | rx ind RD_IDX physical address (bits 63:32) |
  3233. #endif
  3234. * |-------------------------------------------------------------------|
  3235. * | rx ind WR_IDX physical address (bits 31:0) |
  3236. #if HTT_PADDR64
  3237. * | rx ind WR_IDX physical address (bits 63:32) |
  3238. #endif
  3239. * |-------------------------------------------------------------------|
  3240. * |-------------------------------------------------------------------|
  3241. * | rx ring2 base (bits 31:0) |
  3242. #if HTT_PADDR64
  3243. * | rx ring2 base (bits 63:32) |
  3244. #endif
  3245. * |-------------------------------------------------------------------|
  3246. * | rx ring2 size |
  3247. * |-------------------------------------------------------------------|
  3248. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3249. #if HTT_PADDR64
  3250. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3251. #endif
  3252. * |-------------------------------------------------------------------|
  3253. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3254. #if HTT_PADDR64
  3255. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3256. #endif
  3257. * |-------------------------------------------------------------------|
  3258. *
  3259. * Header fields:
  3260. * Header fields:
  3261. * - MSG_TYPE
  3262. * Bits 7:0
  3263. * Purpose: Identifies this as WDI_IPA config message
  3264. * value: = 0x8
  3265. * - TX_PKT_POOL_SIZE
  3266. * Bits 15:0
  3267. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3268. * WDI_IPA TX path
  3269. * For systems using 32-bit format for bus addresses:
  3270. * - TX_COMP_RING_BASE_ADDR
  3271. * Bits 31:0
  3272. * Purpose: TX Completion Ring base address in DDR
  3273. * - TX_COMP_RING_SIZE
  3274. * Bits 31:0
  3275. * Purpose: TX Completion Ring size (must be power of 2)
  3276. * - TX_COMP_WR_IDX_ADDR
  3277. * Bits 31:0
  3278. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3279. * updates the Write Index for WDI_IPA TX completion ring
  3280. * - TX_CE_WR_IDX_ADDR
  3281. * Bits 31:0
  3282. * Purpose: DDR address where IPA uC
  3283. * updates the WR Index for TX CE ring
  3284. * (needed for fusion platforms)
  3285. * - RX_IND_RING_BASE_ADDR
  3286. * Bits 31:0
  3287. * Purpose: RX Indication Ring base address in DDR
  3288. * - RX_IND_RING_SIZE
  3289. * Bits 31:0
  3290. * Purpose: RX Indication Ring size
  3291. * - RX_IND_RD_IDX_ADDR
  3292. * Bits 31:0
  3293. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3294. * RX indication ring
  3295. * - RX_IND_WR_IDX_ADDR
  3296. * Bits 31:0
  3297. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3298. * updates the Write Index for WDI_IPA RX indication ring
  3299. * - RX_RING2_BASE_ADDR
  3300. * Bits 31:0
  3301. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3302. * - RX_RING2_SIZE
  3303. * Bits 31:0
  3304. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3305. * - RX_RING2_RD_IDX_ADDR
  3306. * Bits 31:0
  3307. * Purpose: If Second RX ring is Indication ring, DDR address where
  3308. * IPA uC updates the Read Index for Ring2.
  3309. * If Second RX ring is completion ring, this is NOT used
  3310. * - RX_RING2_WR_IDX_ADDR
  3311. * Bits 31:0
  3312. * Purpose: If Second RX ring is Indication ring, DDR address where
  3313. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3314. * If second RX ring is completion ring, DDR address where
  3315. * IPA uC updates the Write Index for Ring 2.
  3316. * For systems using 64-bit format for bus addresses:
  3317. * - TX_COMP_RING_BASE_ADDR_LO
  3318. * Bits 31:0
  3319. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3320. * - TX_COMP_RING_BASE_ADDR_HI
  3321. * Bits 31:0
  3322. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3323. * - TX_COMP_RING_SIZE
  3324. * Bits 31:0
  3325. * Purpose: TX Completion Ring size (must be power of 2)
  3326. * - TX_COMP_WR_IDX_ADDR_LO
  3327. * Bits 31:0
  3328. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3329. * Lower 4 bytes of DDR address where WIFI FW
  3330. * updates the Write Index for WDI_IPA TX completion ring
  3331. * - TX_COMP_WR_IDX_ADDR_HI
  3332. * Bits 31:0
  3333. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3334. * Higher 4 bytes of DDR address where WIFI FW
  3335. * updates the Write Index for WDI_IPA TX completion ring
  3336. * - TX_CE_WR_IDX_ADDR_LO
  3337. * Bits 31:0
  3338. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3339. * updates the WR Index for TX CE ring
  3340. * (needed for fusion platforms)
  3341. * - TX_CE_WR_IDX_ADDR_HI
  3342. * Bits 31:0
  3343. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3344. * updates the WR Index for TX CE ring
  3345. * (needed for fusion platforms)
  3346. * - RX_IND_RING_BASE_ADDR_LO
  3347. * Bits 31:0
  3348. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3349. * - RX_IND_RING_BASE_ADDR_HI
  3350. * Bits 31:0
  3351. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3352. * - RX_IND_RING_SIZE
  3353. * Bits 31:0
  3354. * Purpose: RX Indication Ring size
  3355. * - RX_IND_RD_IDX_ADDR_LO
  3356. * Bits 31:0
  3357. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3358. * for WDI_IPA RX indication ring
  3359. * - RX_IND_RD_IDX_ADDR_HI
  3360. * Bits 31:0
  3361. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3362. * for WDI_IPA RX indication ring
  3363. * - RX_IND_WR_IDX_ADDR_LO
  3364. * Bits 31:0
  3365. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3366. * Lower 4 bytes of DDR address where WIFI FW
  3367. * updates the Write Index for WDI_IPA RX indication ring
  3368. * - RX_IND_WR_IDX_ADDR_HI
  3369. * Bits 31:0
  3370. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3371. * Higher 4 bytes of DDR address where WIFI FW
  3372. * updates the Write Index for WDI_IPA RX indication ring
  3373. * - RX_RING2_BASE_ADDR_LO
  3374. * Bits 31:0
  3375. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3376. * - RX_RING2_BASE_ADDR_HI
  3377. * Bits 31:0
  3378. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3379. * - RX_RING2_SIZE
  3380. * Bits 31:0
  3381. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3382. * - RX_RING2_RD_IDX_ADDR_LO
  3383. * Bits 31:0
  3384. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3385. * DDR address where IPA uC updates the Read Index for Ring2.
  3386. * If Second RX ring is completion ring, this is NOT used
  3387. * - RX_RING2_RD_IDX_ADDR_HI
  3388. * Bits 31:0
  3389. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3390. * DDR address where IPA uC updates the Read Index for Ring2.
  3391. * If Second RX ring is completion ring, this is NOT used
  3392. * - RX_RING2_WR_IDX_ADDR_LO
  3393. * Bits 31:0
  3394. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3395. * DDR address where WIFI FW updates the Write Index
  3396. * for WDI_IPA RX ring2
  3397. * If second RX ring is completion ring, lower 4 bytes of
  3398. * DDR address where IPA uC updates the Write Index for Ring 2.
  3399. * - RX_RING2_WR_IDX_ADDR_HI
  3400. * Bits 31:0
  3401. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3402. * DDR address where WIFI FW updates the Write Index
  3403. * for WDI_IPA RX ring2
  3404. * If second RX ring is completion ring, higher 4 bytes of
  3405. * DDR address where IPA uC updates the Write Index for Ring 2.
  3406. */
  3407. #if HTT_PADDR64
  3408. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3409. #else
  3410. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3411. #endif
  3412. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3413. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3434. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3474. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3475. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3476. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3479. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3480. } while (0)
  3481. /* for systems using 32-bit format for bus addr */
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3483. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3487. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3488. } while (0)
  3489. /* for systems using 64-bit format for bus addr */
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3491. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3495. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3496. } while (0)
  3497. /* for systems using 64-bit format for bus addr */
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3499. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3503. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3504. } while (0)
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3506. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3508. do { \
  3509. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3510. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3511. } while (0)
  3512. /* for systems using 32-bit format for bus addr */
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3514. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3516. do { \
  3517. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3518. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3519. } while (0)
  3520. /* for systems using 64-bit format for bus addr */
  3521. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3522. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3523. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3524. do { \
  3525. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3526. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3527. } while (0)
  3528. /* for systems using 64-bit format for bus addr */
  3529. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3530. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3531. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3532. do { \
  3533. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3534. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3535. } while (0)
  3536. /* for systems using 32-bit format for bus addr */
  3537. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3538. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3539. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3542. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3543. } while (0)
  3544. /* for systems using 64-bit format for bus addr */
  3545. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3546. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3547. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3550. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3551. } while (0)
  3552. /* for systems using 64-bit format for bus addr */
  3553. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3554. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3555. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3559. } while (0)
  3560. /* for systems using 32-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3563. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3567. } while (0)
  3568. /* for systems using 64-bit format for bus addr */
  3569. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3570. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3571. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3574. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3575. } while (0)
  3576. /* for systems using 64-bit format for bus addr */
  3577. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3578. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3579. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3582. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3583. } while (0)
  3584. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3585. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3586. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3587. do { \
  3588. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3589. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3590. } while (0)
  3591. /* for systems using 32-bit format for bus addr */
  3592. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3593. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3594. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3597. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3598. } while (0)
  3599. /* for systems using 64-bit format for bus addr */
  3600. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3601. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3602. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3603. do { \
  3604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3605. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3606. } while (0)
  3607. /* for systems using 64-bit format for bus addr */
  3608. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3609. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3610. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3611. do { \
  3612. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3613. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3614. } while (0)
  3615. /* for systems using 32-bit format for bus addr */
  3616. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3617. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3618. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3621. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3622. } while (0)
  3623. /* for systems using 64-bit format for bus addr */
  3624. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3625. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3626. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3630. } while (0)
  3631. /* for systems using 64-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3634. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3638. } while (0)
  3639. /* for systems using 32-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3642. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3646. } while (0)
  3647. /* for systems using 64-bit format for bus addr */
  3648. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3649. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3650. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3651. do { \
  3652. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3653. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3654. } while (0)
  3655. /* for systems using 64-bit format for bus addr */
  3656. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3657. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3658. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3661. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3662. } while (0)
  3663. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3664. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3665. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3668. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3669. } while (0)
  3670. /* for systems using 32-bit format for bus addr */
  3671. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3672. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3673. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3676. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3677. } while (0)
  3678. /* for systems using 64-bit format for bus addr */
  3679. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3680. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3681. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3684. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3685. } while (0)
  3686. /* for systems using 64-bit format for bus addr */
  3687. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3688. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3689. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3692. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3693. } while (0)
  3694. /* for systems using 32-bit format for bus addr */
  3695. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3696. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3697. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3700. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3701. } while (0)
  3702. /* for systems using 64-bit format for bus addr */
  3703. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3704. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3705. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3706. do { \
  3707. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3708. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3709. } while (0)
  3710. /* for systems using 64-bit format for bus addr */
  3711. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3712. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3713. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3714. do { \
  3715. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3716. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3717. } while (0)
  3718. /*
  3719. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3720. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3721. * addresses are stored in a XXX-bit field.
  3722. * This macro is used to define both htt_wdi_ipa_config32_t and
  3723. * htt_wdi_ipa_config64_t structs.
  3724. */
  3725. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3726. _paddr__tx_comp_ring_base_addr_, \
  3727. _paddr__tx_comp_wr_idx_addr_, \
  3728. _paddr__tx_ce_wr_idx_addr_, \
  3729. _paddr__rx_ind_ring_base_addr_, \
  3730. _paddr__rx_ind_rd_idx_addr_, \
  3731. _paddr__rx_ind_wr_idx_addr_, \
  3732. _paddr__rx_ring2_base_addr_,\
  3733. _paddr__rx_ring2_rd_idx_addr_,\
  3734. _paddr__rx_ring2_wr_idx_addr_) \
  3735. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3736. { \
  3737. /* DWORD 0: flags and meta-data */ \
  3738. A_UINT32 \
  3739. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3740. reserved: 8, \
  3741. tx_pkt_pool_size: 16;\
  3742. /* DWORD 1 */\
  3743. _paddr__tx_comp_ring_base_addr_;\
  3744. /* DWORD 2 (or 3)*/\
  3745. A_UINT32 tx_comp_ring_size;\
  3746. /* DWORD 3 (or 4)*/\
  3747. _paddr__tx_comp_wr_idx_addr_;\
  3748. /* DWORD 4 (or 6)*/\
  3749. _paddr__tx_ce_wr_idx_addr_;\
  3750. /* DWORD 5 (or 8)*/\
  3751. _paddr__rx_ind_ring_base_addr_;\
  3752. /* DWORD 6 (or 10)*/\
  3753. A_UINT32 rx_ind_ring_size;\
  3754. /* DWORD 7 (or 11)*/\
  3755. _paddr__rx_ind_rd_idx_addr_;\
  3756. /* DWORD 8 (or 13)*/\
  3757. _paddr__rx_ind_wr_idx_addr_;\
  3758. /* DWORD 9 (or 15)*/\
  3759. _paddr__rx_ring2_base_addr_;\
  3760. /* DWORD 10 (or 17) */\
  3761. A_UINT32 rx_ring2_size;\
  3762. /* DWORD 11 (or 18) */\
  3763. _paddr__rx_ring2_rd_idx_addr_;\
  3764. /* DWORD 12 (or 20) */\
  3765. _paddr__rx_ring2_wr_idx_addr_;\
  3766. } POSTPACK
  3767. /* define a htt_wdi_ipa_config32_t type */
  3768. 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));
  3769. /* define a htt_wdi_ipa_config64_t type */
  3770. 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));
  3771. #if HTT_PADDR64
  3772. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3773. #else
  3774. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3775. #endif
  3776. enum htt_wdi_ipa_op_code {
  3777. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3778. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3779. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3780. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3781. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3782. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3783. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3784. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3785. /* keep this last */
  3786. HTT_WDI_IPA_OPCODE_MAX
  3787. };
  3788. /**
  3789. * @brief HTT WDI_IPA Operation Request Message
  3790. *
  3791. * @details
  3792. * HTT WDI_IPA Operation Request message is sent by host
  3793. * to either suspend or resume WDI_IPA TX or RX path.
  3794. * |31 24|23 16|15 8|7 0|
  3795. * |----------------+----------------+----------------+----------------|
  3796. * | op_code | Rsvd | msg_type |
  3797. * |-------------------------------------------------------------------|
  3798. *
  3799. * Header fields:
  3800. * - MSG_TYPE
  3801. * Bits 7:0
  3802. * Purpose: Identifies this as WDI_IPA Operation Request message
  3803. * value: = 0x9
  3804. * - OP_CODE
  3805. * Bits 31:16
  3806. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3807. * value: = enum htt_wdi_ipa_op_code
  3808. */
  3809. PREPACK struct htt_wdi_ipa_op_request_t
  3810. {
  3811. /* DWORD 0: flags and meta-data */
  3812. A_UINT32
  3813. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3814. reserved: 8,
  3815. op_code: 16;
  3816. } POSTPACK;
  3817. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3818. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3819. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3820. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3821. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3822. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3823. do { \
  3824. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3825. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3826. } while (0)
  3827. /*
  3828. * @brief host -> target HTT_SRING_SETUP message
  3829. *
  3830. * @details
  3831. * After target is booted up, Host can send SRING setup message for
  3832. * each host facing LMAC SRING. Target setups up HW registers based
  3833. * on setup message and confirms back to Host if response_required is set.
  3834. * Host should wait for confirmation message before sending new SRING
  3835. * setup message
  3836. *
  3837. * The message would appear as follows:
  3838. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3839. * |--------------- +-----------------+----------------+------------------|
  3840. * | ring_type | ring_id | pdev_id | msg_type |
  3841. * |----------------------------------------------------------------------|
  3842. * | ring_base_addr_lo |
  3843. * |----------------------------------------------------------------------|
  3844. * | ring_base_addr_hi |
  3845. * |----------------------------------------------------------------------|
  3846. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3847. * |----------------------------------------------------------------------|
  3848. * | ring_head_offset32_remote_addr_lo |
  3849. * |----------------------------------------------------------------------|
  3850. * | ring_head_offset32_remote_addr_hi |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_tail_offset32_remote_addr_lo |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_tail_offset32_remote_addr_hi |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_msi_addr_lo |
  3857. * |----------------------------------------------------------------------|
  3858. * | ring_msi_addr_hi |
  3859. * |----------------------------------------------------------------------|
  3860. * | ring_msi_data |
  3861. * |----------------------------------------------------------------------|
  3862. * | intr_timer_th |IM| intr_batch_counter_th |
  3863. * |----------------------------------------------------------------------|
  3864. * | reserved |RR|PTCF| intr_low_threshold |
  3865. * |----------------------------------------------------------------------|
  3866. * Where
  3867. * IM = sw_intr_mode
  3868. * RR = response_required
  3869. * PTCF = prefetch_timer_cfg
  3870. *
  3871. * The message is interpreted as follows:
  3872. * dword0 - b'0:7 - msg_type: This will be set to
  3873. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3874. * b'8:15 - pdev_id:
  3875. * 0 (for rings at SOC/UMAC level),
  3876. * 1/2/3 mac id (for rings at LMAC level)
  3877. * b'16:23 - ring_id: identify which ring is to setup,
  3878. * more details can be got from enum htt_srng_ring_id
  3879. * b'24:31 - ring_type: identify type of host rings,
  3880. * more details can be got from enum htt_srng_ring_type
  3881. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3882. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3883. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3884. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3885. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3886. * SW_TO_HW_RING.
  3887. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3888. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3889. * Lower 32 bits of memory address of the remote variable
  3890. * storing the 4-byte word offset that identifies the head
  3891. * element within the ring.
  3892. * (The head offset variable has type A_UINT32.)
  3893. * Valid for HW_TO_SW and SW_TO_SW rings.
  3894. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3895. * Upper 32 bits of memory address of the remote variable
  3896. * storing the 4-byte word offset that identifies the head
  3897. * element within the ring.
  3898. * (The head offset variable has type A_UINT32.)
  3899. * Valid for HW_TO_SW and SW_TO_SW rings.
  3900. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3901. * Lower 32 bits of memory address of the remote variable
  3902. * storing the 4-byte word offset that identifies the tail
  3903. * element within the ring.
  3904. * (The tail offset variable has type A_UINT32.)
  3905. * Valid for HW_TO_SW and SW_TO_SW rings.
  3906. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3907. * Upper 32 bits of memory address of the remote variable
  3908. * storing the 4-byte word offset that identifies the tail
  3909. * element within the ring.
  3910. * (The tail offset variable has type A_UINT32.)
  3911. * Valid for HW_TO_SW and SW_TO_SW rings.
  3912. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3913. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3914. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3915. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3916. * dword10 - b'0:31 - ring_msi_data: MSI data
  3917. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3918. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3919. * dword11 - b'0:14 - intr_batch_counter_th:
  3920. * batch counter threshold is in units of 4-byte words.
  3921. * HW internally maintains and increments batch count.
  3922. * (see SRING spec for detail description).
  3923. * When batch count reaches threshold value, an interrupt
  3924. * is generated by HW.
  3925. * b'15 - sw_intr_mode:
  3926. * This configuration shall be static.
  3927. * Only programmed at power up.
  3928. * 0: generate pulse style sw interrupts
  3929. * 1: generate level style sw interrupts
  3930. * b'16:31 - intr_timer_th:
  3931. * The timer init value when timer is idle or is
  3932. * initialized to start downcounting.
  3933. * In 8us units (to cover a range of 0 to 524 ms)
  3934. * dword12 - b'0:15 - intr_low_threshold:
  3935. * Used only by Consumer ring to generate ring_sw_int_p.
  3936. * Ring entries low threshold water mark, that is used
  3937. * in combination with the interrupt timer as well as
  3938. * the the clearing of the level interrupt.
  3939. * b'16:18 - prefetch_timer_cfg:
  3940. * Used only by Consumer ring to set timer mode to
  3941. * support Application prefetch handling.
  3942. * The external tail offset/pointer will be updated
  3943. * at following intervals:
  3944. * 3'b000: (Prefetch feature disabled; used only for debug)
  3945. * 3'b001: 1 usec
  3946. * 3'b010: 4 usec
  3947. * 3'b011: 8 usec (default)
  3948. * 3'b100: 16 usec
  3949. * Others: Reserverd
  3950. * b'19 - response_required:
  3951. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3952. * b'20:31 - reserved: reserved for future use
  3953. */
  3954. PREPACK struct htt_sring_setup_t {
  3955. A_UINT32 msg_type: 8,
  3956. pdev_id: 8,
  3957. ring_id: 8,
  3958. ring_type: 8;
  3959. A_UINT32 ring_base_addr_lo;
  3960. A_UINT32 ring_base_addr_hi;
  3961. A_UINT32 ring_size: 16,
  3962. ring_entry_size: 8,
  3963. ring_misc_cfg_flag: 8;
  3964. A_UINT32 ring_head_offset32_remote_addr_lo;
  3965. A_UINT32 ring_head_offset32_remote_addr_hi;
  3966. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3967. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3968. A_UINT32 ring_msi_addr_lo;
  3969. A_UINT32 ring_msi_addr_hi;
  3970. A_UINT32 ring_msi_data;
  3971. A_UINT32 intr_batch_counter_th: 15,
  3972. sw_intr_mode: 1,
  3973. intr_timer_th: 16;
  3974. A_UINT32 intr_low_threshold: 16,
  3975. prefetch_timer_cfg: 3,
  3976. response_required: 1,
  3977. reserved1: 12;
  3978. } POSTPACK;
  3979. enum htt_srng_ring_type {
  3980. HTT_HW_TO_SW_RING = 0,
  3981. HTT_SW_TO_HW_RING,
  3982. HTT_SW_TO_SW_RING,
  3983. /* Insert new ring types above this line */
  3984. };
  3985. enum htt_srng_ring_id {
  3986. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3987. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3988. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3989. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3990. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3991. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3992. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3993. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3994. /* Add Other SRING which can't be directly configured by host software above this line */
  3995. };
  3996. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3997. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3998. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3999. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4000. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4001. HTT_SRING_SETUP_PDEV_ID_S)
  4002. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4003. do { \
  4004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4005. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4006. } while (0)
  4007. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4008. #define HTT_SRING_SETUP_RING_ID_S 16
  4009. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4010. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4011. HTT_SRING_SETUP_RING_ID_S)
  4012. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4013. do { \
  4014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4015. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4016. } while (0)
  4017. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4018. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4019. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4020. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4021. HTT_SRING_SETUP_RING_TYPE_S)
  4022. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4023. do { \
  4024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4025. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4026. } while (0)
  4027. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4028. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4029. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4030. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4031. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4032. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4033. do { \
  4034. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4035. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4036. } while (0)
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4038. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4039. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4040. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4041. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4042. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4043. do { \
  4044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4045. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4046. } while (0)
  4047. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4048. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4049. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4050. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4051. HTT_SRING_SETUP_RING_SIZE_S)
  4052. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4053. do { \
  4054. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4055. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4056. } while (0)
  4057. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4058. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4059. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4060. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4061. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4062. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4065. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4066. } while (0)
  4067. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4068. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4069. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4070. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4071. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4072. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4075. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4076. } while (0)
  4077. /* This control bit is applicable to only Producer, which updates Ring ID field
  4078. * of each descriptor before pushing into the ring.
  4079. * 0: updates ring_id(default)
  4080. * 1: ring_id updating disabled */
  4081. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4082. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4083. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4084. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4085. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4086. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4089. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4090. } while (0)
  4091. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4092. * of each descriptor before pushing into the ring.
  4093. * 0: updates Loopcnt(default)
  4094. * 1: Loopcnt updating disabled */
  4095. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4096. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4097. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4098. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4099. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4100. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4101. do { \
  4102. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4103. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4104. } while (0)
  4105. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4106. * into security_id port of GXI/AXI. */
  4107. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4108. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4109. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4110. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4111. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4112. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4115. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4116. } while (0)
  4117. /* During MSI write operation, SRNG drives value of this register bit into
  4118. * swap bit of GXI/AXI. */
  4119. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4120. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4121. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4122. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4123. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4127. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4128. } while (0)
  4129. /* During Pointer write operation, SRNG drives value of this register bit into
  4130. * swap bit of GXI/AXI. */
  4131. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4132. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4133. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4134. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4135. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4136. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4139. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4140. } while (0)
  4141. /* During any data or TLV write operation, SRNG drives value of this register
  4142. * bit into swap bit of GXI/AXI. */
  4143. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4145. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4146. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4147. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4148. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4151. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4152. } while (0)
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4154. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4155. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4156. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4157. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4159. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4160. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4164. } while (0)
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4166. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4167. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4169. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4170. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4174. } while (0)
  4175. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4176. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4177. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4179. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4180. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4184. } while (0)
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4186. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4187. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4188. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4189. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4190. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4193. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4194. } while (0)
  4195. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4196. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4197. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4199. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4200. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4204. } while (0)
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4206. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4207. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4208. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4209. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4210. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4211. do { \
  4212. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4213. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4214. } while (0)
  4215. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4216. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4217. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4218. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4219. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4220. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4223. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4224. } while (0)
  4225. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4226. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4227. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4228. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4229. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4230. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4233. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4234. } while (0)
  4235. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4236. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4237. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4238. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4239. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4240. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4243. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4244. } while (0)
  4245. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4246. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4247. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4248. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4249. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4250. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4253. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4254. } while (0)
  4255. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4256. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4257. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4258. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4259. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4260. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4263. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4264. } while (0)
  4265. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4266. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4267. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4268. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4269. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4270. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4273. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4274. } while (0)
  4275. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4276. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4277. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4278. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4279. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4280. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4283. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4284. } while (0)
  4285. /**
  4286. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4287. *
  4288. * @details
  4289. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4290. * configure RXDMA rings.
  4291. * The configuration is per ring based and includes both packet subtypes
  4292. * and PPDU/MPDU TLVs.
  4293. *
  4294. * The message would appear as follows:
  4295. *
  4296. * |31 26|25|24|23 16|15 8|7 0|
  4297. * |-----------------+----------------+----------------+---------------|
  4298. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4299. * |-------------------------------------------------------------------|
  4300. * | rsvd2 | ring_buffer_size |
  4301. * |-------------------------------------------------------------------|
  4302. * | packet_type_enable_flags_0 |
  4303. * |-------------------------------------------------------------------|
  4304. * | packet_type_enable_flags_1 |
  4305. * |-------------------------------------------------------------------|
  4306. * | packet_type_enable_flags_2 |
  4307. * |-------------------------------------------------------------------|
  4308. * | packet_type_enable_flags_3 |
  4309. * |-------------------------------------------------------------------|
  4310. * | tlv_filter_in_flags |
  4311. * |-------------------------------------------------------------------|
  4312. * Where:
  4313. * PS = pkt_swap
  4314. * SS = status_swap
  4315. * The message is interpreted as follows:
  4316. * dword0 - b'0:7 - msg_type: This will be set to
  4317. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4318. * b'8:15 - pdev_id:
  4319. * 0 (for rings at SOC/UMAC level),
  4320. * 1/2/3 mac id (for rings at LMAC level)
  4321. * b'16:23 - ring_id : Identify the ring to configure.
  4322. * More details can be got from enum htt_srng_ring_id
  4323. * b'24 - status_swap: 1 is to swap status TLV
  4324. * b'25 - pkt_swap: 1 is to swap packet TLV
  4325. * b'26:31 - rsvd1: reserved for future use
  4326. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4327. * in byte units.
  4328. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4329. * - b'16:31 - rsvd2: Reserved for future use
  4330. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4331. * Enable MGMT packet from 0b0000 to 0b1001
  4332. * bits from low to high: FP, MD, MO - 3 bits
  4333. * FP: Filter_Pass
  4334. * MD: Monitor_Direct
  4335. * MO: Monitor_Other
  4336. * 10 mgmt subtypes * 3 bits -> 30 bits
  4337. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4338. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4339. * Enable MGMT packet from 0b1010 to 0b1111
  4340. * bits from low to high: FP, MD, MO - 3 bits
  4341. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4342. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4343. * Enable CTRL packet from 0b0000 to 0b1001
  4344. * bits from low to high: FP, MD, MO - 3 bits
  4345. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4346. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4347. * Enable CTRL packet from 0b1010 to 0b1111,
  4348. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4349. * bits from low to high: FP, MD, MO - 3 bits
  4350. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4351. * dword6 - b'0:31 - tlv_filter_in_flags:
  4352. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4353. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4354. */
  4355. PREPACK struct htt_rx_ring_selection_cfg_t {
  4356. A_UINT32 msg_type: 8,
  4357. pdev_id: 8,
  4358. ring_id: 8,
  4359. status_swap: 1,
  4360. pkt_swap: 1,
  4361. rsvd1: 6;
  4362. A_UINT32 ring_buffer_size: 16,
  4363. rsvd2: 16;
  4364. A_UINT32 packet_type_enable_flags_0;
  4365. A_UINT32 packet_type_enable_flags_1;
  4366. A_UINT32 packet_type_enable_flags_2;
  4367. A_UINT32 packet_type_enable_flags_3;
  4368. A_UINT32 tlv_filter_in_flags;
  4369. } POSTPACK;
  4370. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4371. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4372. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4373. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4374. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4375. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4376. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4377. do { \
  4378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4380. } while (0)
  4381. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4383. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4384. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4385. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4386. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4387. do { \
  4388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4390. } while (0)
  4391. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4392. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4393. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4394. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4395. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4396. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4400. } while (0)
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4404. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4405. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4407. do { \
  4408. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4410. } while (0)
  4411. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4412. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4413. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4414. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4415. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4417. do { \
  4418. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4420. } while (0)
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4424. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4425. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4427. do { \
  4428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4430. } while (0)
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4434. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4435. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4437. do { \
  4438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4440. } while (0)
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4444. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4445. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4447. do { \
  4448. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4449. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4450. } while (0)
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4454. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4455. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4457. do { \
  4458. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4459. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4460. } while (0)
  4461. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4464. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4465. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4467. do { \
  4468. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4469. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4470. } while (0)
  4471. /*
  4472. * Subtype based MGMT frames enable bits.
  4473. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4474. */
  4475. /* association request */
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4482. /* association response */
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4489. /* Reassociation request */
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4496. /* Reassociation response */
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4503. /* Probe request */
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4510. /* Probe response */
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4517. /* Timing Advertisement */
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4524. /* Reserved */
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4531. /* Beacon */
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4538. /* ATIM */
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4545. /* Disassociation */
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4552. /* Authentication */
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4559. /* Deauthentication */
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4566. /* Action */
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4573. /* Action No Ack */
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4580. /* Reserved */
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4587. /*
  4588. * Subtype based CTRL frames enable bits.
  4589. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4590. */
  4591. /* Reserved */
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4598. /* Reserved */
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4605. /* Reserved */
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4612. /* Reserved */
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4619. /* Reserved */
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4626. /* Reserved */
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4633. /* Reserved */
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4640. /* Control Wrapper */
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4647. /* Block Ack Request */
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4654. /* Block Ack*/
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4661. /* PS-POLL */
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4668. /* RTS */
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4675. /* CTS */
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4682. /* ACK */
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4689. /* CF-END */
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4696. /* CF-END + CF-ACK */
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4703. /* Multicast data */
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4710. /* Unicast data */
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4717. /* NULL data */
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4725. do { \
  4726. HTT_CHECK_SET_VAL(httsym, value); \
  4727. (word) |= (value) << httsym##_S; \
  4728. } while (0)
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4730. (((word) & httsym##_M) >> httsym##_S)
  4731. #define htt_rx_ring_pkt_enable_subtype_set( \
  4732. word, flag, mode, type, subtype, val) \
  4733. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4734. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4735. #define htt_rx_ring_pkt_enable_subtype_get( \
  4736. word, flag, mode, type, subtype) \
  4737. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4738. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4739. /* Definition to filter in TLVs */
  4740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4763. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4764. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4765. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4766. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(httsym, enable); \
  4769. (word) |= (enable) << httsym##_S; \
  4770. } while (0)
  4771. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4772. (((word) & httsym##_M) >> httsym##_S)
  4773. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4774. HTT_RX_RING_TLV_ENABLE_SET( \
  4775. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4776. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4777. HTT_RX_RING_TLV_ENABLE_GET( \
  4778. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4779. /**
  4780. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4781. * host --> target Receive Flow Steering configuration message definition.
  4782. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4783. * The reason for this is we want RFS to be configured and ready before MAC
  4784. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4785. *
  4786. * |31 24|23 16|15 9|8|7 0|
  4787. * |----------------+----------------+----------------+----------------|
  4788. * | reserved |E| msg type |
  4789. * |-------------------------------------------------------------------|
  4790. * Where E = RFS enable flag
  4791. *
  4792. * The RFS_CONFIG message consists of a single 4-byte word.
  4793. *
  4794. * Header fields:
  4795. * - MSG_TYPE
  4796. * Bits 7:0
  4797. * Purpose: identifies this as a RFS config msg
  4798. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4799. * - RFS_CONFIG
  4800. * Bit 8
  4801. * Purpose: Tells target whether to enable (1) or disable (0)
  4802. * flow steering feature when sending rx indication messages to host
  4803. */
  4804. #define HTT_H2T_RFS_CONFIG_M 0x100
  4805. #define HTT_H2T_RFS_CONFIG_S 8
  4806. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4807. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4808. HTT_H2T_RFS_CONFIG_S)
  4809. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4810. do { \
  4811. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4812. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4813. } while (0)
  4814. #define HTT_RFS_CFG_REQ_BYTES 4
  4815. /**
  4816. * @brief host -> target FW extended statistics retrieve
  4817. *
  4818. * @details
  4819. * The following field definitions describe the format of the HTT host
  4820. * to target FW extended stats retrieve message.
  4821. * The message specifies the type of stats the host wants to retrieve.
  4822. *
  4823. * |31 24|23 16|15 8|7 0|
  4824. * |-----------------------------------------------------------|
  4825. * | reserved | stats type | pdev_mask | msg type |
  4826. * |-----------------------------------------------------------|
  4827. * | config param [0] |
  4828. * |-----------------------------------------------------------|
  4829. * | config param [1] |
  4830. * |-----------------------------------------------------------|
  4831. * | config param [2] |
  4832. * |-----------------------------------------------------------|
  4833. * | config param [3] |
  4834. * |-----------------------------------------------------------|
  4835. * | reserved |
  4836. * |-----------------------------------------------------------|
  4837. * | cookie LSBs |
  4838. * |-----------------------------------------------------------|
  4839. * | cookie MSBs |
  4840. * |-----------------------------------------------------------|
  4841. * Header fields:
  4842. * - MSG_TYPE
  4843. * Bits 7:0
  4844. * Purpose: identifies this is a extended stats upload request message
  4845. * Value: 0x10
  4846. * - PDEV_MASK
  4847. * Bits 8:15
  4848. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4849. * Value: This is a overloaded field, refer to usage and interpretation of
  4850. * PDEV in interface document.
  4851. * Bit 8 : Reserved for SOC stats
  4852. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4853. * Indicates MACID_MASK in DBS
  4854. * - STATS_TYPE
  4855. * Bits 23:16
  4856. * Purpose: identifies which FW statistics to upload
  4857. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4858. * - Reserved
  4859. * Bits 31:24
  4860. * - CONFIG_PARAM [0]
  4861. * Bits 31:0
  4862. * Purpose: give an opaque configuration value to the specified stats type
  4863. * Value: stats-type specific configuration value
  4864. * Refer to htt_stats.h for interpretation for each stats sub_type
  4865. * - CONFIG_PARAM [1]
  4866. * Bits 31:0
  4867. * Purpose: give an opaque configuration value to the specified stats type
  4868. * Value: stats-type specific configuration value
  4869. * Refer to htt_stats.h for interpretation for each stats sub_type
  4870. * - CONFIG_PARAM [2]
  4871. * Bits 31:0
  4872. * Purpose: give an opaque configuration value to the specified stats type
  4873. * Value: stats-type specific configuration value
  4874. * Refer to htt_stats.h for interpretation for each stats sub_type
  4875. * - CONFIG_PARAM [3]
  4876. * Bits 31:0
  4877. * Purpose: give an opaque configuration value to the specified stats type
  4878. * Value: stats-type specific configuration value
  4879. * Refer to htt_stats.h for interpretation for each stats sub_type
  4880. * - Reserved [31:0] for future use.
  4881. * - COOKIE_LSBS
  4882. * Bits 31:0
  4883. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4884. * message with its preceding host->target stats request message.
  4885. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4886. * - COOKIE_MSBS
  4887. * Bits 31:0
  4888. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4889. * message with its preceding host->target stats request message.
  4890. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4891. */
  4892. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4893. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4894. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4895. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4896. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4897. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4898. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4899. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4900. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4901. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4902. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4905. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4906. } while (0)
  4907. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4908. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4909. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4910. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4913. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4914. } while (0)
  4915. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4916. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4917. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4918. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4919. do { \
  4920. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4921. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4922. } while (0)
  4923. /**
  4924. * @brief host -> target FW PPDU_STATS request message
  4925. *
  4926. * @details
  4927. * The following field definitions describe the format of the HTT host
  4928. * to target FW for PPDU_STATS_CFG msg.
  4929. * The message allows the host to configure the PPDU_STATS_IND messages
  4930. * produced by the target.
  4931. *
  4932. * |31 24|23 16|15 8|7 0|
  4933. * |-----------------------------------------------------------|
  4934. * | REQ bit mask | pdev_mask | msg type |
  4935. * |-----------------------------------------------------------|
  4936. * Header fields:
  4937. * - MSG_TYPE
  4938. * Bits 7:0
  4939. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4940. * Value: 0x11
  4941. * - PDEV_MASK
  4942. * Bits 8:15
  4943. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4944. * Value: This is a overloaded field, refer to usage and interpretation of
  4945. * PDEV in interface document.
  4946. * Bit 8 : Reserved for SOC stats
  4947. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4948. * Indicates MACID_MASK in DBS
  4949. * - REQ_TLV_BIT_MASK
  4950. * Bits 16:31
  4951. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4952. * needs to be included in the target's PPDU_STATS_IND messages.
  4953. * Value: refer htt_ppdu_stats_tlv_tag_t
  4954. *
  4955. */
  4956. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4957. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4958. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4959. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4960. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4961. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4962. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4963. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4964. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4967. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4968. } while (0)
  4969. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4970. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4971. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4972. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4975. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4976. } while (0)
  4977. /*=== target -> host messages ===============================================*/
  4978. enum htt_t2h_msg_type {
  4979. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4980. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4981. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4982. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4983. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4984. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4985. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4986. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4987. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4988. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4989. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4990. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4991. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4992. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4993. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4994. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4995. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4996. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4997. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4998. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4999. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5000. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5001. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5002. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5003. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5004. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5005. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5006. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5007. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5008. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5009. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5010. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5011. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5012. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5013. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5014. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5015. HTT_T2H_MSG_TYPE_TEST,
  5016. /* keep this last */
  5017. HTT_T2H_NUM_MSGS
  5018. };
  5019. /*
  5020. * HTT target to host message type -
  5021. * stored in bits 7:0 of the first word of the message
  5022. */
  5023. #define HTT_T2H_MSG_TYPE_M 0xff
  5024. #define HTT_T2H_MSG_TYPE_S 0
  5025. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5026. do { \
  5027. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5028. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5029. } while (0)
  5030. #define HTT_T2H_MSG_TYPE_GET(word) \
  5031. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5032. /**
  5033. * @brief target -> host version number confirmation message definition
  5034. *
  5035. * |31 24|23 16|15 8|7 0|
  5036. * |----------------+----------------+----------------+----------------|
  5037. * | reserved | major number | minor number | msg type |
  5038. * |-------------------------------------------------------------------|
  5039. * : option request TLV (optional) |
  5040. * :...................................................................:
  5041. *
  5042. * The VER_CONF message may consist of a single 4-byte word, or may be
  5043. * extended with TLVs that specify HTT options selected by the target.
  5044. * The following option TLVs may be appended to the VER_CONF message:
  5045. * - LL_BUS_ADDR_SIZE
  5046. * - HL_SUPPRESS_TX_COMPL_IND
  5047. * - MAX_TX_QUEUE_GROUPS
  5048. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5049. * may be appended to the VER_CONF message (but only one TLV of each type).
  5050. *
  5051. * Header fields:
  5052. * - MSG_TYPE
  5053. * Bits 7:0
  5054. * Purpose: identifies this as a version number confirmation message
  5055. * Value: 0x0
  5056. * - VER_MINOR
  5057. * Bits 15:8
  5058. * Purpose: Specify the minor number of the HTT message library version
  5059. * in use by the target firmware.
  5060. * The minor number specifies the specific revision within a range
  5061. * of fundamentally compatible HTT message definition revisions.
  5062. * Compatible revisions involve adding new messages or perhaps
  5063. * adding new fields to existing messages, in a backwards-compatible
  5064. * manner.
  5065. * Incompatible revisions involve changing the message type values,
  5066. * or redefining existing messages.
  5067. * Value: minor number
  5068. * - VER_MAJOR
  5069. * Bits 15:8
  5070. * Purpose: Specify the major number of the HTT message library version
  5071. * in use by the target firmware.
  5072. * The major number specifies the family of minor revisions that are
  5073. * fundamentally compatible with each other, but not with prior or
  5074. * later families.
  5075. * Value: major number
  5076. */
  5077. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5078. #define HTT_VER_CONF_MINOR_S 8
  5079. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5080. #define HTT_VER_CONF_MAJOR_S 16
  5081. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5082. do { \
  5083. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5084. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5085. } while (0)
  5086. #define HTT_VER_CONF_MINOR_GET(word) \
  5087. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5088. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5089. do { \
  5090. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5091. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5092. } while (0)
  5093. #define HTT_VER_CONF_MAJOR_GET(word) \
  5094. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5095. #define HTT_VER_CONF_BYTES 4
  5096. /**
  5097. * @brief - target -> host HTT Rx In order indication message
  5098. *
  5099. * @details
  5100. *
  5101. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5102. * |----------------+-------------------+---------------------+---------------|
  5103. * | peer ID | P| F| O| ext TID | msg type |
  5104. * |--------------------------------------------------------------------------|
  5105. * | MSDU count | Reserved | vdev id |
  5106. * |--------------------------------------------------------------------------|
  5107. * | MSDU 0 bus address (bits 31:0) |
  5108. #if HTT_PADDR64
  5109. * | MSDU 0 bus address (bits 63:32) |
  5110. #endif
  5111. * |--------------------------------------------------------------------------|
  5112. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5113. * |--------------------------------------------------------------------------|
  5114. * | MSDU 1 bus address (bits 31:0) |
  5115. #if HTT_PADDR64
  5116. * | MSDU 1 bus address (bits 63:32) |
  5117. #endif
  5118. * |--------------------------------------------------------------------------|
  5119. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5120. * |--------------------------------------------------------------------------|
  5121. */
  5122. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5123. *
  5124. * @details
  5125. * bits
  5126. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5127. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5128. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5129. * | | frag | | | | fail |chksum fail|
  5130. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5131. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5132. */
  5133. struct htt_rx_in_ord_paddr_ind_hdr_t
  5134. {
  5135. A_UINT32 /* word 0 */
  5136. msg_type: 8,
  5137. ext_tid: 5,
  5138. offload: 1,
  5139. frag: 1,
  5140. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5141. peer_id: 16;
  5142. A_UINT32 /* word 1 */
  5143. vap_id: 8,
  5144. reserved_1: 8,
  5145. msdu_cnt: 16;
  5146. };
  5147. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5148. {
  5149. A_UINT32 dma_addr;
  5150. A_UINT32
  5151. length: 16,
  5152. fw_desc: 8,
  5153. msdu_info:8;
  5154. };
  5155. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5156. {
  5157. A_UINT32 dma_addr_lo;
  5158. A_UINT32 dma_addr_hi;
  5159. A_UINT32
  5160. length: 16,
  5161. fw_desc: 8,
  5162. msdu_info:8;
  5163. };
  5164. #if HTT_PADDR64
  5165. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5166. #else
  5167. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5168. #endif
  5169. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5170. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5177. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5178. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5179. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5180. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5181. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5182. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5183. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5184. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5185. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5186. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5187. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5188. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5189. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5190. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5192. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5193. /* for systems using 64-bit format for bus addresses */
  5194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5195. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5196. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5197. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5198. /* for systems using 32-bit format for bus addresses */
  5199. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5200. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5202. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5203. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5204. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5205. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5206. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5207. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5208. do { \
  5209. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5210. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5211. } while (0)
  5212. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5213. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5214. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5215. do { \
  5216. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5217. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5218. } while (0)
  5219. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5220. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5221. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5222. do { \
  5223. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5224. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5225. } while (0)
  5226. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5227. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5228. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5229. do { \
  5230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5231. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5232. } while (0)
  5233. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5234. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5235. /* for systems using 64-bit format for bus addresses */
  5236. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5237. do { \
  5238. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5239. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5240. } while (0)
  5241. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5242. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5243. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5244. do { \
  5245. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5246. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5247. } while (0)
  5248. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5249. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5250. /* for systems using 32-bit format for bus addresses */
  5251. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5252. do { \
  5253. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5254. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5255. } while (0)
  5256. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5257. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5258. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5259. do { \
  5260. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5261. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5262. } while (0)
  5263. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5264. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5265. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5266. do { \
  5267. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5268. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5269. } while (0)
  5270. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5271. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5272. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5273. do { \
  5274. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5275. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5276. } while (0)
  5277. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5278. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5279. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5280. do { \
  5281. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5282. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5283. } while (0)
  5284. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5285. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5286. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5287. do { \
  5288. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5289. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5290. } while (0)
  5291. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5292. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5293. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5294. do { \
  5295. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5296. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5297. } while (0)
  5298. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5299. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5300. /* definitions used within target -> host rx indication message */
  5301. PREPACK struct htt_rx_ind_hdr_prefix_t
  5302. {
  5303. A_UINT32 /* word 0 */
  5304. msg_type: 8,
  5305. ext_tid: 5,
  5306. release_valid: 1,
  5307. flush_valid: 1,
  5308. reserved0: 1,
  5309. peer_id: 16;
  5310. A_UINT32 /* word 1 */
  5311. flush_start_seq_num: 6,
  5312. flush_end_seq_num: 6,
  5313. release_start_seq_num: 6,
  5314. release_end_seq_num: 6,
  5315. num_mpdu_ranges: 8;
  5316. } POSTPACK;
  5317. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5318. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5319. #define HTT_TGT_RSSI_INVALID 0x80
  5320. PREPACK struct htt_rx_ppdu_desc_t
  5321. {
  5322. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5323. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5325. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5328. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5329. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5330. A_UINT32 /* word 0 */
  5331. rssi_cmb: 8,
  5332. timestamp_submicrosec: 8,
  5333. phy_err_code: 8,
  5334. phy_err: 1,
  5335. legacy_rate: 4,
  5336. legacy_rate_sel: 1,
  5337. end_valid: 1,
  5338. start_valid: 1;
  5339. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5340. union {
  5341. A_UINT32 /* word 1 */
  5342. rssi0_pri20: 8,
  5343. rssi0_ext20: 8,
  5344. rssi0_ext40: 8,
  5345. rssi0_ext80: 8;
  5346. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5347. } u0;
  5348. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5349. union {
  5350. A_UINT32 /* word 2 */
  5351. rssi1_pri20: 8,
  5352. rssi1_ext20: 8,
  5353. rssi1_ext40: 8,
  5354. rssi1_ext80: 8;
  5355. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5356. } u1;
  5357. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5358. union {
  5359. A_UINT32 /* word 3 */
  5360. rssi2_pri20: 8,
  5361. rssi2_ext20: 8,
  5362. rssi2_ext40: 8,
  5363. rssi2_ext80: 8;
  5364. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5365. } u2;
  5366. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5367. union {
  5368. A_UINT32 /* word 4 */
  5369. rssi3_pri20: 8,
  5370. rssi3_ext20: 8,
  5371. rssi3_ext40: 8,
  5372. rssi3_ext80: 8;
  5373. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5374. } u3;
  5375. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5376. A_UINT32 tsf32; /* word 5 */
  5377. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5378. A_UINT32 timestamp_microsec; /* word 6 */
  5379. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5380. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5381. A_UINT32 /* word 7 */
  5382. vht_sig_a1: 24,
  5383. preamble_type: 8;
  5384. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5385. A_UINT32 /* word 8 */
  5386. vht_sig_a2: 24,
  5387. reserved0: 8;
  5388. } POSTPACK;
  5389. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5390. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5391. PREPACK struct htt_rx_ind_hdr_suffix_t
  5392. {
  5393. A_UINT32 /* word 0 */
  5394. fw_rx_desc_bytes: 16,
  5395. reserved0: 16;
  5396. } POSTPACK;
  5397. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5398. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5399. PREPACK struct htt_rx_ind_hdr_t
  5400. {
  5401. struct htt_rx_ind_hdr_prefix_t prefix;
  5402. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5403. struct htt_rx_ind_hdr_suffix_t suffix;
  5404. } POSTPACK;
  5405. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5406. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5407. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5408. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5409. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5410. /*
  5411. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5412. * the offset into the HTT rx indication message at which the
  5413. * FW rx PPDU descriptor resides
  5414. */
  5415. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5416. /*
  5417. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5418. * the offset into the HTT rx indication message at which the
  5419. * header suffix (FW rx MSDU byte count) resides
  5420. */
  5421. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5422. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5423. /*
  5424. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5425. * the offset into the HTT rx indication message at which the per-MSDU
  5426. * information starts
  5427. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5428. * per-MSDU information portion of the message. The per-MSDU info itself
  5429. * starts at byte 12.
  5430. */
  5431. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5432. /**
  5433. * @brief target -> host rx indication message definition
  5434. *
  5435. * @details
  5436. * The following field definitions describe the format of the rx indication
  5437. * message sent from the target to the host.
  5438. * The message consists of three major sections:
  5439. * 1. a fixed-length header
  5440. * 2. a variable-length list of firmware rx MSDU descriptors
  5441. * 3. one or more 4-octet MPDU range information elements
  5442. * The fixed length header itself has two sub-sections
  5443. * 1. the message meta-information, including identification of the
  5444. * sender and type of the received data, and a 4-octet flush/release IE
  5445. * 2. the firmware rx PPDU descriptor
  5446. *
  5447. * The format of the message is depicted below.
  5448. * in this depiction, the following abbreviations are used for information
  5449. * elements within the message:
  5450. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5451. * elements associated with the PPDU start are valid.
  5452. * Specifically, the following fields are valid only if SV is set:
  5453. * RSSI (all variants), L, legacy rate, preamble type, service,
  5454. * VHT-SIG-A
  5455. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5456. * elements associated with the PPDU end are valid.
  5457. * Specifically, the following fields are valid only if EV is set:
  5458. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5459. * - L - Legacy rate selector - if legacy rates are used, this flag
  5460. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5461. * (L == 0) PHY.
  5462. * - P - PHY error flag - boolean indication of whether the rx frame had
  5463. * a PHY error
  5464. *
  5465. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5466. * |----------------+-------------------+---------------------+---------------|
  5467. * | peer ID | |RV|FV| ext TID | msg type |
  5468. * |--------------------------------------------------------------------------|
  5469. * | num | release | release | flush | flush |
  5470. * | MPDU | end | start | end | start |
  5471. * | ranges | seq num | seq num | seq num | seq num |
  5472. * |==========================================================================|
  5473. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5474. * |V|V| | rate | | | timestamp | RSSI |
  5475. * |--------------------------------------------------------------------------|
  5476. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5477. * |--------------------------------------------------------------------------|
  5478. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5479. * |--------------------------------------------------------------------------|
  5480. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5481. * |--------------------------------------------------------------------------|
  5482. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5483. * |--------------------------------------------------------------------------|
  5484. * | TSF LSBs |
  5485. * |--------------------------------------------------------------------------|
  5486. * | microsec timestamp |
  5487. * |--------------------------------------------------------------------------|
  5488. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5489. * |--------------------------------------------------------------------------|
  5490. * | service | HT-SIG / VHT-SIG-A2 |
  5491. * |==========================================================================|
  5492. * | reserved | FW rx desc bytes |
  5493. * |--------------------------------------------------------------------------|
  5494. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5495. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5496. * |--------------------------------------------------------------------------|
  5497. * : : :
  5498. * |--------------------------------------------------------------------------|
  5499. * | alignment | MSDU Rx |
  5500. * | padding | desc Bn |
  5501. * |--------------------------------------------------------------------------|
  5502. * | reserved | MPDU range status | MPDU count |
  5503. * |--------------------------------------------------------------------------|
  5504. * : reserved : MPDU range status : MPDU count :
  5505. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5506. *
  5507. * Header fields:
  5508. * - MSG_TYPE
  5509. * Bits 7:0
  5510. * Purpose: identifies this as an rx indication message
  5511. * Value: 0x1
  5512. * - EXT_TID
  5513. * Bits 12:8
  5514. * Purpose: identify the traffic ID of the rx data, including
  5515. * special "extended" TID values for multicast, broadcast, and
  5516. * non-QoS data frames
  5517. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5518. * - FLUSH_VALID (FV)
  5519. * Bit 13
  5520. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5521. * is valid
  5522. * Value:
  5523. * 1 -> flush IE is valid and needs to be processed
  5524. * 0 -> flush IE is not valid and should be ignored
  5525. * - REL_VALID (RV)
  5526. * Bit 13
  5527. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5528. * is valid
  5529. * Value:
  5530. * 1 -> release IE is valid and needs to be processed
  5531. * 0 -> release IE is not valid and should be ignored
  5532. * - PEER_ID
  5533. * Bits 31:16
  5534. * Purpose: Identify, by ID, which peer sent the rx data
  5535. * Value: ID of the peer who sent the rx data
  5536. * - FLUSH_SEQ_NUM_START
  5537. * Bits 5:0
  5538. * Purpose: Indicate the start of a series of MPDUs to flush
  5539. * Not all MPDUs within this series are necessarily valid - the host
  5540. * must check each sequence number within this range to see if the
  5541. * corresponding MPDU is actually present.
  5542. * This field is only valid if the FV bit is set.
  5543. * Value:
  5544. * The sequence number for the first MPDUs to check to flush.
  5545. * The sequence number is masked by 0x3f.
  5546. * - FLUSH_SEQ_NUM_END
  5547. * Bits 11:6
  5548. * Purpose: Indicate the end of a series of MPDUs to flush
  5549. * Value:
  5550. * The sequence number one larger than the sequence number of the
  5551. * last MPDU to check to flush.
  5552. * The sequence number is masked by 0x3f.
  5553. * Not all MPDUs within this series are necessarily valid - the host
  5554. * must check each sequence number within this range to see if the
  5555. * corresponding MPDU is actually present.
  5556. * This field is only valid if the FV bit is set.
  5557. * - REL_SEQ_NUM_START
  5558. * Bits 17:12
  5559. * Purpose: Indicate the start of a series of MPDUs to release.
  5560. * All MPDUs within this series are present and valid - the host
  5561. * need not check each sequence number within this range to see if
  5562. * the corresponding MPDU is actually present.
  5563. * This field is only valid if the RV bit is set.
  5564. * Value:
  5565. * The sequence number for the first MPDUs to check to release.
  5566. * The sequence number is masked by 0x3f.
  5567. * - REL_SEQ_NUM_END
  5568. * Bits 23:18
  5569. * Purpose: Indicate the end of a series of MPDUs to release.
  5570. * Value:
  5571. * The sequence number one larger than the sequence number of the
  5572. * last MPDU to check to release.
  5573. * The sequence number is masked by 0x3f.
  5574. * All MPDUs within this series are present and valid - the host
  5575. * need not check each sequence number within this range to see if
  5576. * the corresponding MPDU is actually present.
  5577. * This field is only valid if the RV bit is set.
  5578. * - NUM_MPDU_RANGES
  5579. * Bits 31:24
  5580. * Purpose: Indicate how many ranges of MPDUs are present.
  5581. * Each MPDU range consists of a series of contiguous MPDUs within the
  5582. * rx frame sequence which all have the same MPDU status.
  5583. * Value: 1-63 (typically a small number, like 1-3)
  5584. *
  5585. * Rx PPDU descriptor fields:
  5586. * - RSSI_CMB
  5587. * Bits 7:0
  5588. * Purpose: Combined RSSI from all active rx chains, across the active
  5589. * bandwidth.
  5590. * Value: RSSI dB units w.r.t. noise floor
  5591. * - TIMESTAMP_SUBMICROSEC
  5592. * Bits 15:8
  5593. * Purpose: high-resolution timestamp
  5594. * Value:
  5595. * Sub-microsecond time of PPDU reception.
  5596. * This timestamp ranges from [0,MAC clock MHz).
  5597. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5598. * to form a high-resolution, large range rx timestamp.
  5599. * - PHY_ERR_CODE
  5600. * Bits 23:16
  5601. * Purpose:
  5602. * If the rx frame processing resulted in a PHY error, indicate what
  5603. * type of rx PHY error occurred.
  5604. * Value:
  5605. * This field is valid if the "P" (PHY_ERR) flag is set.
  5606. * TBD: document/specify the values for this field
  5607. * - PHY_ERR
  5608. * Bit 24
  5609. * Purpose: indicate whether the rx PPDU had a PHY error
  5610. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5611. * - LEGACY_RATE
  5612. * Bits 28:25
  5613. * Purpose:
  5614. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5615. * specify which rate was used.
  5616. * Value:
  5617. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5618. * flag.
  5619. * If LEGACY_RATE_SEL is 0:
  5620. * 0x8: OFDM 48 Mbps
  5621. * 0x9: OFDM 24 Mbps
  5622. * 0xA: OFDM 12 Mbps
  5623. * 0xB: OFDM 6 Mbps
  5624. * 0xC: OFDM 54 Mbps
  5625. * 0xD: OFDM 36 Mbps
  5626. * 0xE: OFDM 18 Mbps
  5627. * 0xF: OFDM 9 Mbps
  5628. * If LEGACY_RATE_SEL is 1:
  5629. * 0x8: CCK 11 Mbps long preamble
  5630. * 0x9: CCK 5.5 Mbps long preamble
  5631. * 0xA: CCK 2 Mbps long preamble
  5632. * 0xB: CCK 1 Mbps long preamble
  5633. * 0xC: CCK 11 Mbps short preamble
  5634. * 0xD: CCK 5.5 Mbps short preamble
  5635. * 0xE: CCK 2 Mbps short preamble
  5636. * - LEGACY_RATE_SEL
  5637. * Bit 29
  5638. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5639. * Value:
  5640. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5641. * used a legacy rate.
  5642. * 0 -> OFDM, 1 -> CCK
  5643. * - END_VALID
  5644. * Bit 30
  5645. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5646. * the start of the PPDU are valid. Specifically, the following
  5647. * fields are only valid if END_VALID is set:
  5648. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5649. * TIMESTAMP_SUBMICROSEC
  5650. * Value:
  5651. * 0 -> rx PPDU desc end fields are not valid
  5652. * 1 -> rx PPDU desc end fields are valid
  5653. * - START_VALID
  5654. * Bit 31
  5655. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5656. * the end of the PPDU are valid. Specifically, the following
  5657. * fields are only valid if START_VALID is set:
  5658. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5659. * VHT-SIG-A
  5660. * Value:
  5661. * 0 -> rx PPDU desc start fields are not valid
  5662. * 1 -> rx PPDU desc start fields are valid
  5663. * - RSSI0_PRI20
  5664. * Bits 7:0
  5665. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5666. * Value: RSSI dB units w.r.t. noise floor
  5667. *
  5668. * - RSSI0_EXT20
  5669. * Bits 7:0
  5670. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5671. * (if the rx bandwidth was >= 40 MHz)
  5672. * Value: RSSI dB units w.r.t. noise floor
  5673. * - RSSI0_EXT40
  5674. * Bits 7:0
  5675. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5676. * (if the rx bandwidth was >= 80 MHz)
  5677. * Value: RSSI dB units w.r.t. noise floor
  5678. * - RSSI0_EXT80
  5679. * Bits 7:0
  5680. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5681. * (if the rx bandwidth was >= 160 MHz)
  5682. * Value: RSSI dB units w.r.t. noise floor
  5683. *
  5684. * - RSSI1_PRI20
  5685. * Bits 7:0
  5686. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5687. * Value: RSSI dB units w.r.t. noise floor
  5688. * - RSSI1_EXT20
  5689. * Bits 7:0
  5690. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5691. * (if the rx bandwidth was >= 40 MHz)
  5692. * Value: RSSI dB units w.r.t. noise floor
  5693. * - RSSI1_EXT40
  5694. * Bits 7:0
  5695. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5696. * (if the rx bandwidth was >= 80 MHz)
  5697. * Value: RSSI dB units w.r.t. noise floor
  5698. * - RSSI1_EXT80
  5699. * Bits 7:0
  5700. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5701. * (if the rx bandwidth was >= 160 MHz)
  5702. * Value: RSSI dB units w.r.t. noise floor
  5703. *
  5704. * - RSSI2_PRI20
  5705. * Bits 7:0
  5706. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5707. * Value: RSSI dB units w.r.t. noise floor
  5708. * - RSSI2_EXT20
  5709. * Bits 7:0
  5710. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5711. * (if the rx bandwidth was >= 40 MHz)
  5712. * Value: RSSI dB units w.r.t. noise floor
  5713. * - RSSI2_EXT40
  5714. * Bits 7:0
  5715. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5716. * (if the rx bandwidth was >= 80 MHz)
  5717. * Value: RSSI dB units w.r.t. noise floor
  5718. * - RSSI2_EXT80
  5719. * Bits 7:0
  5720. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5721. * (if the rx bandwidth was >= 160 MHz)
  5722. * Value: RSSI dB units w.r.t. noise floor
  5723. *
  5724. * - RSSI3_PRI20
  5725. * Bits 7:0
  5726. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5727. * Value: RSSI dB units w.r.t. noise floor
  5728. * - RSSI3_EXT20
  5729. * Bits 7:0
  5730. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5731. * (if the rx bandwidth was >= 40 MHz)
  5732. * Value: RSSI dB units w.r.t. noise floor
  5733. * - RSSI3_EXT40
  5734. * Bits 7:0
  5735. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5736. * (if the rx bandwidth was >= 80 MHz)
  5737. * Value: RSSI dB units w.r.t. noise floor
  5738. * - RSSI3_EXT80
  5739. * Bits 7:0
  5740. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5741. * (if the rx bandwidth was >= 160 MHz)
  5742. * Value: RSSI dB units w.r.t. noise floor
  5743. *
  5744. * - TSF32
  5745. * Bits 31:0
  5746. * Purpose: specify the time the rx PPDU was received, in TSF units
  5747. * Value: 32 LSBs of the TSF
  5748. * - TIMESTAMP_MICROSEC
  5749. * Bits 31:0
  5750. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5751. * Value: PPDU rx time, in microseconds
  5752. * - VHT_SIG_A1
  5753. * Bits 23:0
  5754. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5755. * from the rx PPDU
  5756. * Value:
  5757. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5758. * VHT-SIG-A1 data.
  5759. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5760. * first 24 bits of the HT-SIG data.
  5761. * Otherwise, this field is invalid.
  5762. * Refer to the the 802.11 protocol for the definition of the
  5763. * HT-SIG and VHT-SIG-A1 fields
  5764. * - VHT_SIG_A2
  5765. * Bits 23:0
  5766. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5767. * from the rx PPDU
  5768. * Value:
  5769. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5770. * VHT-SIG-A2 data.
  5771. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5772. * last 24 bits of the HT-SIG data.
  5773. * Otherwise, this field is invalid.
  5774. * Refer to the the 802.11 protocol for the definition of the
  5775. * HT-SIG and VHT-SIG-A2 fields
  5776. * - PREAMBLE_TYPE
  5777. * Bits 31:24
  5778. * Purpose: indicate the PHY format of the received burst
  5779. * Value:
  5780. * 0x4: Legacy (OFDM/CCK)
  5781. * 0x8: HT
  5782. * 0x9: HT with TxBF
  5783. * 0xC: VHT
  5784. * 0xD: VHT with TxBF
  5785. * - SERVICE
  5786. * Bits 31:24
  5787. * Purpose: TBD
  5788. * Value: TBD
  5789. *
  5790. * Rx MSDU descriptor fields:
  5791. * - FW_RX_DESC_BYTES
  5792. * Bits 15:0
  5793. * Purpose: Indicate how many bytes in the Rx indication are used for
  5794. * FW Rx descriptors
  5795. *
  5796. * Payload fields:
  5797. * - MPDU_COUNT
  5798. * Bits 7:0
  5799. * Purpose: Indicate how many sequential MPDUs share the same status.
  5800. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5801. * - MPDU_STATUS
  5802. * Bits 15:8
  5803. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5804. * received successfully.
  5805. * Value:
  5806. * 0x1: success
  5807. * 0x2: FCS error
  5808. * 0x3: duplicate error
  5809. * 0x4: replay error
  5810. * 0x5: invalid peer
  5811. */
  5812. /* header fields */
  5813. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5814. #define HTT_RX_IND_EXT_TID_S 8
  5815. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5816. #define HTT_RX_IND_FLUSH_VALID_S 13
  5817. #define HTT_RX_IND_REL_VALID_M 0x4000
  5818. #define HTT_RX_IND_REL_VALID_S 14
  5819. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5820. #define HTT_RX_IND_PEER_ID_S 16
  5821. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5822. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5823. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5824. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5825. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5826. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5827. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5828. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5829. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5830. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5831. /* rx PPDU descriptor fields */
  5832. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5833. #define HTT_RX_IND_RSSI_CMB_S 0
  5834. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5835. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5836. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5837. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5838. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5839. #define HTT_RX_IND_PHY_ERR_S 24
  5840. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5841. #define HTT_RX_IND_LEGACY_RATE_S 25
  5842. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5843. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5844. #define HTT_RX_IND_END_VALID_M 0x40000000
  5845. #define HTT_RX_IND_END_VALID_S 30
  5846. #define HTT_RX_IND_START_VALID_M 0x80000000
  5847. #define HTT_RX_IND_START_VALID_S 31
  5848. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5849. #define HTT_RX_IND_RSSI_PRI20_S 0
  5850. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5851. #define HTT_RX_IND_RSSI_EXT20_S 8
  5852. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5853. #define HTT_RX_IND_RSSI_EXT40_S 16
  5854. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5855. #define HTT_RX_IND_RSSI_EXT80_S 24
  5856. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5857. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5858. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5859. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5860. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5861. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5862. #define HTT_RX_IND_SERVICE_M 0xff000000
  5863. #define HTT_RX_IND_SERVICE_S 24
  5864. /* rx MSDU descriptor fields */
  5865. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5866. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5867. /* payload fields */
  5868. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5869. #define HTT_RX_IND_MPDU_COUNT_S 0
  5870. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5871. #define HTT_RX_IND_MPDU_STATUS_S 8
  5872. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5873. do { \
  5874. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5875. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5876. } while (0)
  5877. #define HTT_RX_IND_EXT_TID_GET(word) \
  5878. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5879. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5880. do { \
  5881. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5882. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5883. } while (0)
  5884. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5885. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5886. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5887. do { \
  5888. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5889. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5890. } while (0)
  5891. #define HTT_RX_IND_REL_VALID_GET(word) \
  5892. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5893. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5894. do { \
  5895. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5896. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5897. } while (0)
  5898. #define HTT_RX_IND_PEER_ID_GET(word) \
  5899. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5900. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5901. do { \
  5902. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5903. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5904. } while (0)
  5905. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5906. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5907. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5908. do { \
  5909. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5910. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5911. } while (0)
  5912. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5913. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5914. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5915. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5916. do { \
  5917. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5918. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5919. } while (0)
  5920. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5921. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5922. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5923. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5924. do { \
  5925. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5926. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5927. } while (0)
  5928. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5929. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5930. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5931. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5932. do { \
  5933. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5934. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5935. } while (0)
  5936. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5937. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5938. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5939. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5942. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5943. } while (0)
  5944. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5945. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5946. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5947. /* FW rx PPDU descriptor fields */
  5948. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5949. do { \
  5950. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5951. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5952. } while (0)
  5953. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5954. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5955. HTT_RX_IND_RSSI_CMB_S)
  5956. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5957. do { \
  5958. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5959. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5960. } while (0)
  5961. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5962. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5963. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5964. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5965. do { \
  5966. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5967. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5968. } while (0)
  5969. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5970. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5971. HTT_RX_IND_PHY_ERR_CODE_S)
  5972. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5973. do { \
  5974. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5975. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5976. } while (0)
  5977. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5978. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5979. HTT_RX_IND_PHY_ERR_S)
  5980. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5981. do { \
  5982. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5983. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5984. } while (0)
  5985. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5986. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5987. HTT_RX_IND_LEGACY_RATE_S)
  5988. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5989. do { \
  5990. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5991. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5992. } while (0)
  5993. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5994. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5995. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5996. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5997. do { \
  5998. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5999. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6000. } while (0)
  6001. #define HTT_RX_IND_END_VALID_GET(word) \
  6002. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6003. HTT_RX_IND_END_VALID_S)
  6004. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6005. do { \
  6006. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6007. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6008. } while (0)
  6009. #define HTT_RX_IND_START_VALID_GET(word) \
  6010. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6011. HTT_RX_IND_START_VALID_S)
  6012. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6013. do { \
  6014. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6015. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6016. } while (0)
  6017. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6018. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6019. HTT_RX_IND_RSSI_PRI20_S)
  6020. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6021. do { \
  6022. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6023. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6024. } while (0)
  6025. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6026. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6027. HTT_RX_IND_RSSI_EXT20_S)
  6028. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6029. do { \
  6030. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6031. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6032. } while (0)
  6033. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6034. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6035. HTT_RX_IND_RSSI_EXT40_S)
  6036. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6037. do { \
  6038. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6039. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6040. } while (0)
  6041. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6042. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6043. HTT_RX_IND_RSSI_EXT80_S)
  6044. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6045. do { \
  6046. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6047. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6048. } while (0)
  6049. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6050. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6051. HTT_RX_IND_VHT_SIG_A1_S)
  6052. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6055. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6056. } while (0)
  6057. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6058. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6059. HTT_RX_IND_VHT_SIG_A2_S)
  6060. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6061. do { \
  6062. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6063. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6064. } while (0)
  6065. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6066. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6067. HTT_RX_IND_PREAMBLE_TYPE_S)
  6068. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6069. do { \
  6070. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6071. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6072. } while (0)
  6073. #define HTT_RX_IND_SERVICE_GET(word) \
  6074. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6075. HTT_RX_IND_SERVICE_S)
  6076. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6077. do { \
  6078. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6079. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6080. } while (0)
  6081. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6082. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6083. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6084. do { \
  6085. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6086. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6087. } while (0)
  6088. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6089. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6090. #define HTT_RX_IND_HL_BYTES \
  6091. (HTT_RX_IND_HDR_BYTES + \
  6092. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6093. 4 /* single MPDU range information element */)
  6094. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6095. /* Could we use one macro entry? */
  6096. #define HTT_WORD_SET(word, field, value) \
  6097. do { \
  6098. HTT_CHECK_SET_VAL(field, value); \
  6099. (word) |= ((value) << field ## _S); \
  6100. } while (0)
  6101. #define HTT_WORD_GET(word, field) \
  6102. (((word) & field ## _M) >> field ## _S)
  6103. PREPACK struct hl_htt_rx_ind_base {
  6104. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6105. } POSTPACK;
  6106. /*
  6107. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6108. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6109. * HL host needed info. The field is just after the msdu fw rx desc.
  6110. */
  6111. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6112. struct htt_rx_ind_hl_rx_desc_t {
  6113. A_UINT8 ver;
  6114. A_UINT8 len;
  6115. struct {
  6116. A_UINT8
  6117. first_msdu: 1,
  6118. last_msdu: 1,
  6119. c3_failed: 1,
  6120. c4_failed: 1,
  6121. ipv6: 1,
  6122. tcp: 1,
  6123. udp: 1,
  6124. reserved: 1;
  6125. } flags;
  6126. };
  6127. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6128. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6129. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6130. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6131. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6132. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6133. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6134. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6135. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6136. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6137. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6138. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6139. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6140. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6141. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6142. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6143. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6144. /* This structure is used in HL, the basic descriptor information
  6145. * used by host. the structure is translated by FW from HW desc
  6146. * or generated by FW. But in HL monitor mode, the host would use
  6147. * the same structure with LL.
  6148. */
  6149. PREPACK struct hl_htt_rx_desc_base {
  6150. A_UINT32
  6151. seq_num:12,
  6152. encrypted:1,
  6153. chan_info_present:1,
  6154. resv0:2,
  6155. mcast_bcast:1,
  6156. fragment:1,
  6157. key_id_oct:8,
  6158. resv1:6;
  6159. A_UINT32
  6160. pn_31_0;
  6161. union {
  6162. struct {
  6163. A_UINT16 pn_47_32;
  6164. A_UINT16 pn_63_48;
  6165. } pn16;
  6166. A_UINT32 pn_63_32;
  6167. } u0;
  6168. A_UINT32
  6169. pn_95_64;
  6170. A_UINT32
  6171. pn_127_96;
  6172. } POSTPACK;
  6173. /*
  6174. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6175. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6176. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6177. * Please see htt_chan_change_t for description of the fields.
  6178. */
  6179. PREPACK struct htt_chan_info_t
  6180. {
  6181. A_UINT32 primary_chan_center_freq_mhz: 16,
  6182. contig_chan1_center_freq_mhz: 16;
  6183. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6184. phy_mode: 8,
  6185. reserved: 8;
  6186. } POSTPACK;
  6187. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6188. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6189. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6190. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6191. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6192. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6193. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6194. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6195. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6196. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6197. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6198. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6199. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6200. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6201. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6202. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6203. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6204. /* Channel information */
  6205. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6206. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6207. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6208. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6209. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6210. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6211. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6212. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6213. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6214. do { \
  6215. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6216. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6217. } while (0)
  6218. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6219. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6220. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6221. do { \
  6222. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6223. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6224. } while (0)
  6225. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6226. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6227. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6228. do { \
  6229. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6230. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6231. } while (0)
  6232. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6233. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6234. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6235. do { \
  6236. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6237. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6238. } while (0)
  6239. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6240. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6241. /*
  6242. * @brief target -> host rx reorder flush message definition
  6243. *
  6244. * @details
  6245. * The following field definitions describe the format of the rx flush
  6246. * message sent from the target to the host.
  6247. * The message consists of a 4-octet header, followed by one or more
  6248. * 4-octet payload information elements.
  6249. *
  6250. * |31 24|23 8|7 0|
  6251. * |--------------------------------------------------------------|
  6252. * | TID | peer ID | msg type |
  6253. * |--------------------------------------------------------------|
  6254. * | seq num end | seq num start | MPDU status | reserved |
  6255. * |--------------------------------------------------------------|
  6256. * First DWORD:
  6257. * - MSG_TYPE
  6258. * Bits 7:0
  6259. * Purpose: identifies this as an rx flush message
  6260. * Value: 0x2
  6261. * - PEER_ID
  6262. * Bits 23:8 (only bits 18:8 actually used)
  6263. * Purpose: identify which peer's rx data is being flushed
  6264. * Value: (rx) peer ID
  6265. * - TID
  6266. * Bits 31:24 (only bits 27:24 actually used)
  6267. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6268. * Value: traffic identifier
  6269. * Second DWORD:
  6270. * - MPDU_STATUS
  6271. * Bits 15:8
  6272. * Purpose:
  6273. * Indicate whether the flushed MPDUs should be discarded or processed.
  6274. * Value:
  6275. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6276. * stages of rx processing
  6277. * other: discard the MPDUs
  6278. * It is anticipated that flush messages will always have
  6279. * MPDU status == 1, but the status flag is included for
  6280. * flexibility.
  6281. * - SEQ_NUM_START
  6282. * Bits 23:16
  6283. * Purpose:
  6284. * Indicate the start of a series of consecutive MPDUs being flushed.
  6285. * Not all MPDUs within this range are necessarily valid - the host
  6286. * must check each sequence number within this range to see if the
  6287. * corresponding MPDU is actually present.
  6288. * Value:
  6289. * The sequence number for the first MPDU in the sequence.
  6290. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6291. * - SEQ_NUM_END
  6292. * Bits 30:24
  6293. * Purpose:
  6294. * Indicate the end of a series of consecutive MPDUs being flushed.
  6295. * Value:
  6296. * The sequence number one larger than the sequence number of the
  6297. * last MPDU being flushed.
  6298. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6299. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6300. * are to be released for further rx processing.
  6301. * Not all MPDUs within this range are necessarily valid - the host
  6302. * must check each sequence number within this range to see if the
  6303. * corresponding MPDU is actually present.
  6304. */
  6305. /* first DWORD */
  6306. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6307. #define HTT_RX_FLUSH_PEER_ID_S 8
  6308. #define HTT_RX_FLUSH_TID_M 0xff000000
  6309. #define HTT_RX_FLUSH_TID_S 24
  6310. /* second DWORD */
  6311. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6312. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6313. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6314. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6315. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6316. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6317. #define HTT_RX_FLUSH_BYTES 8
  6318. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6321. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6322. } while (0)
  6323. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6324. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6325. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6328. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6329. } while (0)
  6330. #define HTT_RX_FLUSH_TID_GET(word) \
  6331. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6332. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6333. do { \
  6334. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6335. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6336. } while (0)
  6337. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6338. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6339. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6340. do { \
  6341. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6342. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6343. } while (0)
  6344. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6345. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6346. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6347. do { \
  6348. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6349. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6350. } while (0)
  6351. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6352. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6353. /*
  6354. * @brief target -> host rx pn check indication message
  6355. *
  6356. * @details
  6357. * The following field definitions describe the format of the Rx PN check
  6358. * indication message sent from the target to the host.
  6359. * The message consists of a 4-octet header, followed by the start and
  6360. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6361. * IE is one octet containing the sequence number that failed the PN
  6362. * check.
  6363. *
  6364. * |31 24|23 8|7 0|
  6365. * |--------------------------------------------------------------|
  6366. * | TID | peer ID | msg type |
  6367. * |--------------------------------------------------------------|
  6368. * | Reserved | PN IE count | seq num end | seq num start|
  6369. * |--------------------------------------------------------------|
  6370. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6371. * |--------------------------------------------------------------|
  6372. * First DWORD:
  6373. * - MSG_TYPE
  6374. * Bits 7:0
  6375. * Purpose: Identifies this as an rx pn check indication message
  6376. * Value: 0x2
  6377. * - PEER_ID
  6378. * Bits 23:8 (only bits 18:8 actually used)
  6379. * Purpose: identify which peer
  6380. * Value: (rx) peer ID
  6381. * - TID
  6382. * Bits 31:24 (only bits 27:24 actually used)
  6383. * Purpose: identify traffic identifier
  6384. * Value: traffic identifier
  6385. * Second DWORD:
  6386. * - SEQ_NUM_START
  6387. * Bits 7:0
  6388. * Purpose:
  6389. * Indicates the starting sequence number of the MPDU in this
  6390. * series of MPDUs that went though PN check.
  6391. * Value:
  6392. * The sequence number for the first MPDU in the sequence.
  6393. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6394. * - SEQ_NUM_END
  6395. * Bits 15:8
  6396. * Purpose:
  6397. * Indicates the ending sequence number of the MPDU in this
  6398. * series of MPDUs that went though PN check.
  6399. * Value:
  6400. * The sequence number one larger then the sequence number of the last
  6401. * MPDU being flushed.
  6402. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6403. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6404. * for invalid PN numbers and are ready to be released for further processing.
  6405. * Not all MPDUs within this range are necessarily valid - the host
  6406. * must check each sequence number within this range to see if the
  6407. * corresponding MPDU is actually present.
  6408. * - PN_IE_COUNT
  6409. * Bits 23:16
  6410. * Purpose:
  6411. * Used to determine the variable number of PN information elements in this
  6412. * message
  6413. *
  6414. * PN information elements:
  6415. * - PN_IE_x-
  6416. * Purpose:
  6417. * Each PN information element contains the sequence number of the MPDU that
  6418. * has failed the target PN check.
  6419. * Value:
  6420. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6421. * that failed the PN check.
  6422. */
  6423. /* first DWORD */
  6424. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6425. #define HTT_RX_PN_IND_PEER_ID_S 8
  6426. #define HTT_RX_PN_IND_TID_M 0xff000000
  6427. #define HTT_RX_PN_IND_TID_S 24
  6428. /* second DWORD */
  6429. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6430. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6431. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6432. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6433. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6434. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6435. #define HTT_RX_PN_IND_BYTES 8
  6436. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6437. do { \
  6438. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6439. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6440. } while (0)
  6441. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6442. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6443. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6444. do { \
  6445. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6446. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6447. } while (0)
  6448. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6449. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6450. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6451. do { \
  6452. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6453. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6454. } while (0)
  6455. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6456. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6457. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6458. do { \
  6459. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6460. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6461. } while (0)
  6462. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6463. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6464. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6465. do { \
  6466. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6467. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6468. } while (0)
  6469. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6470. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6471. /*
  6472. * @brief target -> host rx offload deliver message for LL system
  6473. *
  6474. * @details
  6475. * In a low latency system this message is sent whenever the offload
  6476. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6477. * The DMA of the actual packets into host memory is done before sending out
  6478. * this message. This message indicates only how many MSDUs to reap. The
  6479. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6480. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6481. * DMA'd by the MAC directly into host memory these packets do not contain
  6482. * the MAC descriptors in the header portion of the packet. Instead they contain
  6483. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6484. * message, the packets are delivered directly to the NW stack without going
  6485. * through the regular reorder buffering and PN checking path since it has
  6486. * already been done in target.
  6487. *
  6488. * |31 24|23 16|15 8|7 0|
  6489. * |-----------------------------------------------------------------------|
  6490. * | Total MSDU count | reserved | msg type |
  6491. * |-----------------------------------------------------------------------|
  6492. *
  6493. * @brief target -> host rx offload deliver message for HL system
  6494. *
  6495. * @details
  6496. * In a high latency system this message is sent whenever the offload manager
  6497. * flushes out the packets it has coalesced in its coalescing buffer. The
  6498. * actual packets are also carried along with this message. When the host
  6499. * receives this message, it is expected to deliver these packets to the NW
  6500. * stack directly instead of routing them through the reorder buffering and
  6501. * PN checking path since it has already been done in target.
  6502. *
  6503. * |31 24|23 16|15 8|7 0|
  6504. * |-----------------------------------------------------------------------|
  6505. * | Total MSDU count | reserved | msg type |
  6506. * |-----------------------------------------------------------------------|
  6507. * | peer ID | MSDU length |
  6508. * |-----------------------------------------------------------------------|
  6509. * | MSDU payload | FW Desc | tid | vdev ID |
  6510. * |-----------------------------------------------------------------------|
  6511. * | MSDU payload contd. |
  6512. * |-----------------------------------------------------------------------|
  6513. * | peer ID | MSDU length |
  6514. * |-----------------------------------------------------------------------|
  6515. * | MSDU payload | FW Desc | tid | vdev ID |
  6516. * |-----------------------------------------------------------------------|
  6517. * | MSDU payload contd. |
  6518. * |-----------------------------------------------------------------------|
  6519. *
  6520. */
  6521. /* first DWORD */
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6523. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6537. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6539. do { \
  6540. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6541. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6542. } while (0)
  6543. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6544. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6546. do { \
  6547. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6548. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6549. } while (0)
  6550. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6551. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6553. do { \
  6554. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6555. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6556. } while (0)
  6557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6558. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6560. do { \
  6561. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6562. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6563. } while (0)
  6564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6565. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6566. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6567. do { \
  6568. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6569. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6570. } while (0)
  6571. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6572. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6573. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6574. do { \
  6575. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6576. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6577. } while (0)
  6578. /**
  6579. * @brief target -> host rx peer map/unmap message definition
  6580. *
  6581. * @details
  6582. * The following diagram shows the format of the rx peer map message sent
  6583. * from the target to the host. This layout assumes the target operates
  6584. * as little-endian.
  6585. *
  6586. * This message always contains a SW peer ID. The main purpose of the
  6587. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6588. * with, so that the host can use that peer ID to determine which peer
  6589. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6590. * other purposes, such as identifying during tx completions which peer
  6591. * the tx frames in question were transmitted to.
  6592. *
  6593. * In certain generations of chips, the peer map message also contains
  6594. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6595. * to identify which peer the frame needs to be forwarded to (i.e. the
  6596. * peer assocated with the Destination MAC Address within the packet),
  6597. * and particularly which vdev needs to transmit the frame (for cases
  6598. * of inter-vdev rx --> tx forwarding).
  6599. * This DA-based peer ID that is provided for certain rx frames
  6600. * (the rx frames that need to be re-transmitted as tx frames)
  6601. * is the ID that the HW uses for referring to the peer in question,
  6602. * rather than the peer ID that the SW+FW use to refer to the peer.
  6603. *
  6604. *
  6605. * |31 24|23 16|15 8|7 0|
  6606. * |-----------------------------------------------------------------------|
  6607. * | SW peer ID | VDEV ID | msg type |
  6608. * |-----------------------------------------------------------------------|
  6609. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6610. * |-----------------------------------------------------------------------|
  6611. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6612. * |-----------------------------------------------------------------------|
  6613. *
  6614. *
  6615. * The following diagram shows the format of the rx peer unmap message sent
  6616. * from the target to the host.
  6617. *
  6618. * |31 24|23 16|15 8|7 0|
  6619. * |-----------------------------------------------------------------------|
  6620. * | SW peer ID | VDEV ID | msg type |
  6621. * |-----------------------------------------------------------------------|
  6622. *
  6623. * The following field definitions describe the format of the rx peer map
  6624. * and peer unmap messages sent from the target to the host.
  6625. * - MSG_TYPE
  6626. * Bits 7:0
  6627. * Purpose: identifies this as an rx peer map or peer unmap message
  6628. * Value: peer map -> 0x3, peer unmap -> 0x4
  6629. * - VDEV_ID
  6630. * Bits 15:8
  6631. * Purpose: Indicates which virtual device the peer is associated
  6632. * with.
  6633. * Value: vdev ID (used in the host to look up the vdev object)
  6634. * - PEER_ID (a.k.a. SW_PEER_ID)
  6635. * Bits 31:16
  6636. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6637. * freeing (unmap)
  6638. * Value: (rx) peer ID
  6639. * - MAC_ADDR_L32 (peer map only)
  6640. * Bits 31:0
  6641. * Purpose: Identifies which peer node the peer ID is for.
  6642. * Value: lower 4 bytes of peer node's MAC address
  6643. * - MAC_ADDR_U16 (peer map only)
  6644. * Bits 15:0
  6645. * Purpose: Identifies which peer node the peer ID is for.
  6646. * Value: upper 2 bytes of peer node's MAC address
  6647. * - HW_PEER_ID
  6648. * Bits 31:16
  6649. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6650. * address, so for rx frames marked for rx --> tx forwarding, the
  6651. * host can determine from the HW peer ID provided as meta-data with
  6652. * the rx frame which peer the frame is supposed to be forwarded to.
  6653. * Value: ID used by the MAC HW to identify the peer
  6654. */
  6655. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6656. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6657. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6658. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6659. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6660. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6661. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6662. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6663. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6664. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6665. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6666. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6667. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6668. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6669. do { \
  6670. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6671. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6672. } while (0)
  6673. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6674. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6675. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6676. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6677. do { \
  6678. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6679. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6680. } while (0)
  6681. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6682. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6683. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6684. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6685. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6686. do { \
  6687. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6688. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6689. } while (0)
  6690. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6691. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6692. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6693. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6694. #define HTT_RX_PEER_MAP_BYTES 12
  6695. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6696. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6697. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6698. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6699. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6700. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6701. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6702. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6703. #define HTT_RX_PEER_UNMAP_BYTES 4
  6704. /**
  6705. * @brief target -> host rx peer map V2 message definition
  6706. *
  6707. * @details
  6708. * The following diagram shows the format of the rx peer map v2 message sent
  6709. * from the target to the host. This layout assumes the target operates
  6710. * as little-endian.
  6711. *
  6712. * This message always contains a SW peer ID. The main purpose of the
  6713. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6714. * with, so that the host can use that peer ID to determine which peer
  6715. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6716. * other purposes, such as identifying during tx completions which peer
  6717. * the tx frames in question were transmitted to.
  6718. *
  6719. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6720. * is used during rx --> tx frame forwarding to identify which peer the
  6721. * frame needs to be forwarded to (i.e. the peer assocated with the
  6722. * Destination MAC Address within the packet), and particularly which vdev
  6723. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6724. * This DA-based peer ID that is provided for certain rx frames
  6725. * (the rx frames that need to be re-transmitted as tx frames)
  6726. * is the ID that the HW uses for referring to the peer in question,
  6727. * rather than the peer ID that the SW+FW use to refer to the peer.
  6728. *
  6729. *
  6730. * |31 24|23 16|15 8|7 0|
  6731. * |-----------------------------------------------------------------------|
  6732. * | SW peer ID | VDEV ID | msg type |
  6733. * |-----------------------------------------------------------------------|
  6734. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6735. * |-----------------------------------------------------------------------|
  6736. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6737. * |-----------------------------------------------------------------------|
  6738. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6739. * |-----------------------------------------------------------------------|
  6740. * | Reserved_0 |
  6741. * |-----------------------------------------------------------------------|
  6742. * | Reserved_1 |
  6743. * |-----------------------------------------------------------------------|
  6744. * | Reserved_2 |
  6745. * |-----------------------------------------------------------------------|
  6746. * | Reserved_3 |
  6747. * |-----------------------------------------------------------------------|
  6748. *
  6749. *
  6750. * The following field definitions describe the format of the rx peer map v2
  6751. * messages sent from the target to the host.
  6752. * - MSG_TYPE
  6753. * Bits 7:0
  6754. * Purpose: identifies this as an rx peer map v2 message
  6755. * Value: peer map v2 -> 0x1e
  6756. * - VDEV_ID
  6757. * Bits 15:8
  6758. * Purpose: Indicates which virtual device the peer is associated with.
  6759. * Value: vdev ID (used in the host to look up the vdev object)
  6760. * - SW_PEER_ID
  6761. * Bits 31:16
  6762. * Purpose: The peer ID (index) that WAL is allocating
  6763. * Value: (rx) peer ID
  6764. * - MAC_ADDR_L32
  6765. * Bits 31:0
  6766. * Purpose: Identifies which peer node the peer ID is for.
  6767. * Value: lower 4 bytes of peer node's MAC address
  6768. * - MAC_ADDR_U16
  6769. * Bits 15:0
  6770. * Purpose: Identifies which peer node the peer ID is for.
  6771. * Value: upper 2 bytes of peer node's MAC address
  6772. * - HW_PEER_ID
  6773. * Bits 31:16
  6774. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6775. * address, so for rx frames marked for rx --> tx forwarding, the
  6776. * host can determine from the HW peer ID provided as meta-data with
  6777. * the rx frame which peer the frame is supposed to be forwarded to.
  6778. * Value: ID used by the MAC HW to identify the peer
  6779. * - AST_HASH_VALUE
  6780. * Bits 15:0
  6781. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6782. * override feature.
  6783. * - NEXT_HOP
  6784. * Bit 16
  6785. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6786. * (Wireless Distribution System).
  6787. */
  6788. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6789. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6790. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6791. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6792. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6793. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6794. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6795. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6796. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6797. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6798. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6799. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6800. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6801. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6802. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6803. do { \
  6804. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6805. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6806. } while (0)
  6807. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6808. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6809. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6810. do { \
  6811. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6812. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6813. } while (0)
  6814. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6815. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6816. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6817. do { \
  6818. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6819. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6820. } while (0)
  6821. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6822. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6823. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6824. do { \
  6825. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6826. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6827. } while (0)
  6828. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6829. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6830. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6833. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6834. } while (0)
  6835. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6836. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6837. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6838. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6839. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6840. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6841. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6842. /**
  6843. * @brief target -> host rx peer unmap V2 message definition
  6844. *
  6845. *
  6846. * The following diagram shows the format of the rx peer unmap message sent
  6847. * from the target to the host.
  6848. *
  6849. * |31 24|23 16|15 8|7 0|
  6850. * |-----------------------------------------------------------------------|
  6851. * | SW peer ID | VDEV ID | msg type |
  6852. * |-----------------------------------------------------------------------|
  6853. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6854. * |-----------------------------------------------------------------------|
  6855. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6856. * |-----------------------------------------------------------------------|
  6857. * | Peer Delete Duration |
  6858. * |-----------------------------------------------------------------------|
  6859. * | Reserved_0 |
  6860. * |-----------------------------------------------------------------------|
  6861. * | Reserved_1 |
  6862. * |-----------------------------------------------------------------------|
  6863. * | Reserved_2 |
  6864. * |-----------------------------------------------------------------------|
  6865. *
  6866. *
  6867. * The following field definitions describe the format of the rx peer unmap
  6868. * messages sent from the target to the host.
  6869. * - MSG_TYPE
  6870. * Bits 7:0
  6871. * Purpose: identifies this as an rx peer unmap v2 message
  6872. * Value: peer unmap v2 -> 0x1f
  6873. * - VDEV_ID
  6874. * Bits 15:8
  6875. * Purpose: Indicates which virtual device the peer is associated
  6876. * with.
  6877. * Value: vdev ID (used in the host to look up the vdev object)
  6878. * - SW_PEER_ID
  6879. * Bits 31:16
  6880. * Purpose: The peer ID (index) that WAL is freeing
  6881. * Value: (rx) peer ID
  6882. * - MAC_ADDR_L32
  6883. * Bits 31:0
  6884. * Purpose: Identifies which peer node the peer ID is for.
  6885. * Value: lower 4 bytes of peer node's MAC address
  6886. * - MAC_ADDR_U16
  6887. * Bits 15:0
  6888. * Purpose: Identifies which peer node the peer ID is for.
  6889. * Value: upper 2 bytes of peer node's MAC address
  6890. * - NEXT_HOP
  6891. * Bits 16
  6892. * Purpose: Bit indicates next_hop AST entry used for WDS
  6893. * (Wireless Distribution System).
  6894. * - PEER_DELETE_DURATION
  6895. * Bits 31:0
  6896. * Purpose: Time taken to delete peer, in msec,
  6897. * Used for monitoring / debugging PEER delete response delay
  6898. */
  6899. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6900. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6901. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6902. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6903. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6904. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6905. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6906. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6907. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6908. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6909. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6910. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6911. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6912. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6913. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6914. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6915. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6916. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6917. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6918. do { \
  6919. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6920. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6921. } while (0)
  6922. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6923. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6924. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6925. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6926. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6927. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6928. /**
  6929. * @brief target -> host message specifying security parameters
  6930. *
  6931. * @details
  6932. * The following diagram shows the format of the security specification
  6933. * message sent from the target to the host.
  6934. * This security specification message tells the host whether a PN check is
  6935. * necessary on rx data frames, and if so, how large the PN counter is.
  6936. * This message also tells the host about the security processing to apply
  6937. * to defragmented rx frames - specifically, whether a Message Integrity
  6938. * Check is required, and the Michael key to use.
  6939. *
  6940. * |31 24|23 16|15|14 8|7 0|
  6941. * |-----------------------------------------------------------------------|
  6942. * | peer ID | U| security type | msg type |
  6943. * |-----------------------------------------------------------------------|
  6944. * | Michael Key K0 |
  6945. * |-----------------------------------------------------------------------|
  6946. * | Michael Key K1 |
  6947. * |-----------------------------------------------------------------------|
  6948. * | WAPI RSC Low0 |
  6949. * |-----------------------------------------------------------------------|
  6950. * | WAPI RSC Low1 |
  6951. * |-----------------------------------------------------------------------|
  6952. * | WAPI RSC Hi0 |
  6953. * |-----------------------------------------------------------------------|
  6954. * | WAPI RSC Hi1 |
  6955. * |-----------------------------------------------------------------------|
  6956. *
  6957. * The following field definitions describe the format of the security
  6958. * indication message sent from the target to the host.
  6959. * - MSG_TYPE
  6960. * Bits 7:0
  6961. * Purpose: identifies this as a security specification message
  6962. * Value: 0xb
  6963. * - SEC_TYPE
  6964. * Bits 14:8
  6965. * Purpose: specifies which type of security applies to the peer
  6966. * Value: htt_sec_type enum value
  6967. * - UNICAST
  6968. * Bit 15
  6969. * Purpose: whether this security is applied to unicast or multicast data
  6970. * Value: 1 -> unicast, 0 -> multicast
  6971. * - PEER_ID
  6972. * Bits 31:16
  6973. * Purpose: The ID number for the peer the security specification is for
  6974. * Value: peer ID
  6975. * - MICHAEL_KEY_K0
  6976. * Bits 31:0
  6977. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6978. * Value: Michael Key K0 (if security type is TKIP)
  6979. * - MICHAEL_KEY_K1
  6980. * Bits 31:0
  6981. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6982. * Value: Michael Key K1 (if security type is TKIP)
  6983. * - WAPI_RSC_LOW0
  6984. * Bits 31:0
  6985. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6986. * Value: WAPI RSC Low0 (if security type is WAPI)
  6987. * - WAPI_RSC_LOW1
  6988. * Bits 31:0
  6989. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6990. * Value: WAPI RSC Low1 (if security type is WAPI)
  6991. * - WAPI_RSC_HI0
  6992. * Bits 31:0
  6993. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6994. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6995. * - WAPI_RSC_HI1
  6996. * Bits 31:0
  6997. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6998. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6999. */
  7000. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7001. #define HTT_SEC_IND_SEC_TYPE_S 8
  7002. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7003. #define HTT_SEC_IND_UNICAST_S 15
  7004. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7005. #define HTT_SEC_IND_PEER_ID_S 16
  7006. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7007. do { \
  7008. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7009. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7010. } while (0)
  7011. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7012. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7013. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7014. do { \
  7015. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7016. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7017. } while (0)
  7018. #define HTT_SEC_IND_UNICAST_GET(word) \
  7019. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7020. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7021. do { \
  7022. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7023. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7024. } while (0)
  7025. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7026. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7027. #define HTT_SEC_IND_BYTES 28
  7028. /**
  7029. * @brief target -> host rx ADDBA / DELBA message definitions
  7030. *
  7031. * @details
  7032. * The following diagram shows the format of the rx ADDBA message sent
  7033. * from the target to the host:
  7034. *
  7035. * |31 20|19 16|15 8|7 0|
  7036. * |---------------------------------------------------------------------|
  7037. * | peer ID | TID | window size | msg type |
  7038. * |---------------------------------------------------------------------|
  7039. *
  7040. * The following diagram shows the format of the rx DELBA message sent
  7041. * from the target to the host:
  7042. *
  7043. * |31 20|19 16|15 10|9 8|7 0|
  7044. * |---------------------------------------------------------------------|
  7045. * | peer ID | TID | reserved | IR| msg type |
  7046. * |---------------------------------------------------------------------|
  7047. *
  7048. * The following field definitions describe the format of the rx ADDBA
  7049. * and DELBA messages sent from the target to the host.
  7050. * - MSG_TYPE
  7051. * Bits 7:0
  7052. * Purpose: identifies this as an rx ADDBA or DELBA message
  7053. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7054. * - IR (initiator / recipient)
  7055. * Bits 9:8 (DELBA only)
  7056. * Purpose: specify whether the DELBA handshake was initiated by the
  7057. * local STA/AP, or by the peer STA/AP
  7058. * Value:
  7059. * 0 - unspecified
  7060. * 1 - initiator (a.k.a. originator)
  7061. * 2 - recipient (a.k.a. responder)
  7062. * 3 - unused / reserved
  7063. * - WIN_SIZE
  7064. * Bits 15:8 (ADDBA only)
  7065. * Purpose: Specifies the length of the block ack window (max = 64).
  7066. * Value:
  7067. * block ack window length specified by the received ADDBA
  7068. * management message.
  7069. * - TID
  7070. * Bits 19:16
  7071. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7072. * Value:
  7073. * TID specified by the received ADDBA or DELBA management message.
  7074. * - PEER_ID
  7075. * Bits 31:20
  7076. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7077. * Value:
  7078. * ID (hash value) used by the host for fast, direct lookup of
  7079. * host SW peer info, including rx reorder states.
  7080. */
  7081. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7082. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7083. #define HTT_RX_ADDBA_TID_M 0xf0000
  7084. #define HTT_RX_ADDBA_TID_S 16
  7085. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7086. #define HTT_RX_ADDBA_PEER_ID_S 20
  7087. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7088. do { \
  7089. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7090. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7091. } while (0)
  7092. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7093. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7094. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7095. do { \
  7096. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7097. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7098. } while (0)
  7099. #define HTT_RX_ADDBA_TID_GET(word) \
  7100. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7101. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7102. do { \
  7103. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7104. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7105. } while (0)
  7106. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7107. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7108. #define HTT_RX_ADDBA_BYTES 4
  7109. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7110. #define HTT_RX_DELBA_INITIATOR_S 8
  7111. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7112. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7113. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7114. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7115. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7116. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7117. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7118. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7119. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7120. do { \
  7121. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7122. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7123. } while (0)
  7124. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7125. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7126. #define HTT_RX_DELBA_BYTES 4
  7127. /**
  7128. * @brief tx queue group information element definition
  7129. *
  7130. * @details
  7131. * The following diagram shows the format of the tx queue group
  7132. * information element, which can be included in target --> host
  7133. * messages to specify the number of tx "credits" (tx descriptors
  7134. * for LL, or tx buffers for HL) available to a particular group
  7135. * of host-side tx queues, and which host-side tx queues belong to
  7136. * the group.
  7137. *
  7138. * |31|30 24|23 16|15|14|13 0|
  7139. * |------------------------------------------------------------------------|
  7140. * | X| reserved | tx queue grp ID | A| S| credit count |
  7141. * |------------------------------------------------------------------------|
  7142. * | vdev ID mask | AC mask |
  7143. * |------------------------------------------------------------------------|
  7144. *
  7145. * The following definitions describe the fields within the tx queue group
  7146. * information element:
  7147. * - credit_count
  7148. * Bits 13:1
  7149. * Purpose: specify how many tx credits are available to the tx queue group
  7150. * Value: An absolute or relative, positive or negative credit value
  7151. * The 'A' bit specifies whether the value is absolute or relative.
  7152. * The 'S' bit specifies whether the value is positive or negative.
  7153. * A negative value can only be relative, not absolute.
  7154. * An absolute value replaces any prior credit value the host has for
  7155. * the tx queue group in question.
  7156. * A relative value is added to the prior credit value the host has for
  7157. * the tx queue group in question.
  7158. * - sign
  7159. * Bit 14
  7160. * Purpose: specify whether the credit count is positive or negative
  7161. * Value: 0 -> positive, 1 -> negative
  7162. * - absolute
  7163. * Bit 15
  7164. * Purpose: specify whether the credit count is absolute or relative
  7165. * Value: 0 -> relative, 1 -> absolute
  7166. * - txq_group_id
  7167. * Bits 23:16
  7168. * Purpose: indicate which tx queue group's credit and/or membership are
  7169. * being specified
  7170. * Value: 0 to max_tx_queue_groups-1
  7171. * - reserved
  7172. * Bits 30:16
  7173. * Value: 0x0
  7174. * - eXtension
  7175. * Bit 31
  7176. * Purpose: specify whether another tx queue group info element follows
  7177. * Value: 0 -> no more tx queue group information elements
  7178. * 1 -> another tx queue group information element immediately follows
  7179. * - ac_mask
  7180. * Bits 15:0
  7181. * Purpose: specify which Access Categories belong to the tx queue group
  7182. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7183. * the tx queue group.
  7184. * The AC bit-mask values are obtained by left-shifting by the
  7185. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7186. * - vdev_id_mask
  7187. * Bits 31:16
  7188. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7189. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7190. * belong to the tx queue group.
  7191. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7192. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7193. */
  7194. PREPACK struct htt_txq_group {
  7195. A_UINT32
  7196. credit_count: 14,
  7197. sign: 1,
  7198. absolute: 1,
  7199. tx_queue_group_id: 8,
  7200. reserved0: 7,
  7201. extension: 1;
  7202. A_UINT32
  7203. ac_mask: 16,
  7204. vdev_id_mask: 16;
  7205. } POSTPACK;
  7206. /* first word */
  7207. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7208. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7209. #define HTT_TXQ_GROUP_SIGN_S 14
  7210. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7211. #define HTT_TXQ_GROUP_ABS_S 15
  7212. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7213. #define HTT_TXQ_GROUP_ID_S 16
  7214. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7215. #define HTT_TXQ_GROUP_EXT_S 31
  7216. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7217. /* second word */
  7218. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7219. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7220. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7221. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7222. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7223. do { \
  7224. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7225. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7226. } while (0)
  7227. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7228. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7229. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7230. do { \
  7231. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7232. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7233. } while (0)
  7234. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7235. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7236. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7239. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7240. } while (0)
  7241. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7242. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7243. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7246. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7247. } while (0)
  7248. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7249. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7250. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7251. do { \
  7252. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7253. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7254. } while (0)
  7255. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7256. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7257. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7260. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7261. } while (0)
  7262. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7263. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7264. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7265. do { \
  7266. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7267. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7268. } while (0)
  7269. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7270. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7271. /**
  7272. * @brief target -> host TX completion indication message definition
  7273. *
  7274. * @details
  7275. * The following diagram shows the format of the TX completion indication sent
  7276. * from the target to the host
  7277. *
  7278. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7279. * |-------------------------------------------------------------|
  7280. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7281. * |-------------------------------------------------------------|
  7282. * payload: | MSDU1 ID | MSDU0 ID |
  7283. * |-------------------------------------------------------------|
  7284. * : MSDU3 ID : MSDU2 ID :
  7285. * |-------------------------------------------------------------|
  7286. * | struct htt_tx_compl_ind_append_retries |
  7287. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7288. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7289. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7290. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7291. * |-------------------------------------------------------------|
  7292. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7293. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7294. * Where:
  7295. * A0 = append (a.k.a. append0)
  7296. * A1 = append1
  7297. * TP = MSDU tx power presence
  7298. * A2 = append2
  7299. *
  7300. * The following field definitions describe the format of the TX completion
  7301. * indication sent from the target to the host
  7302. * Header fields:
  7303. * - msg_type
  7304. * Bits 7:0
  7305. * Purpose: identifies this as HTT TX completion indication
  7306. * Value: 0x7
  7307. * - status
  7308. * Bits 10:8
  7309. * Purpose: the TX completion status of payload fragmentations descriptors
  7310. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7311. * - tid
  7312. * Bits 14:11
  7313. * Purpose: the tid associated with those fragmentation descriptors. It is
  7314. * valid or not, depending on the tid_invalid bit.
  7315. * Value: 0 to 15
  7316. * - tid_invalid
  7317. * Bits 15:15
  7318. * Purpose: this bit indicates whether the tid field is valid or not
  7319. * Value: 0 indicates valid; 1 indicates invalid
  7320. * - num
  7321. * Bits 23:16
  7322. * Purpose: the number of payload in this indication
  7323. * Value: 1 to 255
  7324. * - append (a.k.a. append0)
  7325. * Bits 24:24
  7326. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7327. * the number of tx retries for one MSDU at the end of this message
  7328. * Value: 0 indicates no appending; 1 indicates appending
  7329. * - append1
  7330. * Bits 25:25
  7331. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7332. * contains the timestamp info for each TX msdu id in payload.
  7333. * The order of the timestamps matches the order of the MSDU IDs.
  7334. * Note that a big-endian host needs to account for the reordering
  7335. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7336. * conversion) when determining which tx timestamp corresponds to
  7337. * which MSDU ID.
  7338. * Value: 0 indicates no appending; 1 indicates appending
  7339. * - msdu_tx_power_presence
  7340. * Bits 26:26
  7341. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7342. * for each MSDU referenced by the TX_COMPL_IND message.
  7343. * The tx power is reported in 0.5 dBm units.
  7344. * The order of the per-MSDU tx power reports matches the order
  7345. * of the MSDU IDs.
  7346. * Note that a big-endian host needs to account for the reordering
  7347. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7348. * conversion) when determining which Tx Power corresponds to
  7349. * which MSDU ID.
  7350. * Value: 0 indicates MSDU tx power reports are not appended,
  7351. * 1 indicates MSDU tx power reports are appended
  7352. * - append2
  7353. * Bits 27:27
  7354. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7355. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7356. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7357. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7358. * for each MSDU, for convenience.
  7359. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7360. * this append2 bit is set).
  7361. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7362. * dB above the noise floor.
  7363. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7364. * 1 indicates MSDU ACK RSSI values are appended.
  7365. * Payload fields:
  7366. * - hmsdu_id
  7367. * Bits 15:0
  7368. * Purpose: this ID is used to track the Tx buffer in host
  7369. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7370. */
  7371. #define HTT_TX_COMPL_IND_STATUS_S 8
  7372. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7373. #define HTT_TX_COMPL_IND_TID_S 11
  7374. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7375. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7376. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7377. #define HTT_TX_COMPL_IND_NUM_S 16
  7378. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7379. #define HTT_TX_COMPL_IND_APPEND_S 24
  7380. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7381. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7382. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7383. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7384. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7385. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7386. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7387. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7388. do { \
  7389. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7390. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7391. } while (0)
  7392. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7393. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7394. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7395. do { \
  7396. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7397. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7398. } while (0)
  7399. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7400. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7401. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7402. do { \
  7403. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7404. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7405. } while (0)
  7406. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7407. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7408. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7409. do { \
  7410. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7411. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7412. } while (0)
  7413. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7414. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7415. HTT_TX_COMPL_IND_TID_INV_S)
  7416. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7417. do { \
  7418. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7419. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7420. } while (0)
  7421. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7422. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7423. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7424. do { \
  7425. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7426. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7427. } while (0)
  7428. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7429. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7430. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7431. do { \
  7432. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7433. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7434. } while (0)
  7435. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7436. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7437. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7438. do { \
  7439. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7440. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7441. } while (0)
  7442. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7443. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7444. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7445. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7446. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7447. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7448. #define HTT_TX_COMPL_IND_STAT_OK 0
  7449. /* DISCARD:
  7450. * current meaning:
  7451. * MSDUs were queued for transmission but filtered by HW or SW
  7452. * without any over the air attempts
  7453. * legacy meaning (HL Rome):
  7454. * MSDUs were discarded by the target FW without any over the air
  7455. * attempts due to lack of space
  7456. */
  7457. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7458. /* NO_ACK:
  7459. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7460. */
  7461. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7462. /* POSTPONE:
  7463. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7464. * be downloaded again later (in the appropriate order), when they are
  7465. * deliverable.
  7466. */
  7467. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7468. /*
  7469. * The PEER_DEL tx completion status is used for HL cases
  7470. * where the peer the frame is for has been deleted.
  7471. * The host has already discarded its copy of the frame, but
  7472. * it still needs the tx completion to restore its credit.
  7473. */
  7474. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7475. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7476. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7477. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7478. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7479. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7480. PREPACK struct htt_tx_compl_ind_base {
  7481. A_UINT32 hdr;
  7482. A_UINT16 payload[1/*or more*/];
  7483. } POSTPACK;
  7484. PREPACK struct htt_tx_compl_ind_append_retries {
  7485. A_UINT16 msdu_id;
  7486. A_UINT8 tx_retries;
  7487. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7488. 0: this is the last append_retries struct */
  7489. } POSTPACK;
  7490. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7491. A_UINT32 timestamp[1/*or more*/];
  7492. } POSTPACK;
  7493. /**
  7494. * @brief target -> host rate-control update indication message
  7495. *
  7496. * @details
  7497. * The following diagram shows the format of the RC Update message
  7498. * sent from the target to the host, while processing the tx-completion
  7499. * of a transmitted PPDU.
  7500. *
  7501. * |31 24|23 16|15 8|7 0|
  7502. * |-------------------------------------------------------------|
  7503. * | peer ID | vdev ID | msg_type |
  7504. * |-------------------------------------------------------------|
  7505. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7506. * |-------------------------------------------------------------|
  7507. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7508. * |-------------------------------------------------------------|
  7509. * | : |
  7510. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7511. * | : |
  7512. * |-------------------------------------------------------------|
  7513. * | : |
  7514. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7515. * | : |
  7516. * |-------------------------------------------------------------|
  7517. * : :
  7518. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7519. *
  7520. */
  7521. typedef struct {
  7522. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7523. A_UINT32 rate_code_flags;
  7524. A_UINT32 flags; /* Encodes information such as excessive
  7525. retransmission, aggregate, some info
  7526. from .11 frame control,
  7527. STBC, LDPC, (SGI and Tx Chain Mask
  7528. are encoded in ptx_rc->flags field),
  7529. AMPDU truncation (BT/time based etc.),
  7530. RTS/CTS attempt */
  7531. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7532. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7533. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7534. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7535. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7536. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7537. } HTT_RC_TX_DONE_PARAMS;
  7538. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7539. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7540. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7541. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7542. #define HTT_RC_UPDATE_VDEVID_S 8
  7543. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7544. #define HTT_RC_UPDATE_PEERID_S 16
  7545. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7546. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7547. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7548. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7549. do { \
  7550. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7551. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7552. } while (0)
  7553. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7554. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7555. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7558. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7559. } while (0)
  7560. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7561. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7562. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7563. do { \
  7564. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7565. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7566. } while (0)
  7567. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7568. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7569. /**
  7570. * @brief target -> host rx fragment indication message definition
  7571. *
  7572. * @details
  7573. * The following field definitions describe the format of the rx fragment
  7574. * indication message sent from the target to the host.
  7575. * The rx fragment indication message shares the format of the
  7576. * rx indication message, but not all fields from the rx indication message
  7577. * are relevant to the rx fragment indication message.
  7578. *
  7579. *
  7580. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7581. * |-----------+-------------------+---------------------+-------------|
  7582. * | peer ID | |FV| ext TID | msg type |
  7583. * |-------------------------------------------------------------------|
  7584. * | | flush | flush |
  7585. * | | end | start |
  7586. * | | seq num | seq num |
  7587. * |-------------------------------------------------------------------|
  7588. * | reserved | FW rx desc bytes |
  7589. * |-------------------------------------------------------------------|
  7590. * | | FW MSDU Rx |
  7591. * | | desc B0 |
  7592. * |-------------------------------------------------------------------|
  7593. * Header fields:
  7594. * - MSG_TYPE
  7595. * Bits 7:0
  7596. * Purpose: identifies this as an rx fragment indication message
  7597. * Value: 0xa
  7598. * - EXT_TID
  7599. * Bits 12:8
  7600. * Purpose: identify the traffic ID of the rx data, including
  7601. * special "extended" TID values for multicast, broadcast, and
  7602. * non-QoS data frames
  7603. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7604. * - FLUSH_VALID (FV)
  7605. * Bit 13
  7606. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7607. * is valid
  7608. * Value:
  7609. * 1 -> flush IE is valid and needs to be processed
  7610. * 0 -> flush IE is not valid and should be ignored
  7611. * - PEER_ID
  7612. * Bits 31:16
  7613. * Purpose: Identify, by ID, which peer sent the rx data
  7614. * Value: ID of the peer who sent the rx data
  7615. * - FLUSH_SEQ_NUM_START
  7616. * Bits 5:0
  7617. * Purpose: Indicate the start of a series of MPDUs to flush
  7618. * Not all MPDUs within this series are necessarily valid - the host
  7619. * must check each sequence number within this range to see if the
  7620. * corresponding MPDU is actually present.
  7621. * This field is only valid if the FV bit is set.
  7622. * Value:
  7623. * The sequence number for the first MPDUs to check to flush.
  7624. * The sequence number is masked by 0x3f.
  7625. * - FLUSH_SEQ_NUM_END
  7626. * Bits 11:6
  7627. * Purpose: Indicate the end of a series of MPDUs to flush
  7628. * Value:
  7629. * The sequence number one larger than the sequence number of the
  7630. * last MPDU to check to flush.
  7631. * The sequence number is masked by 0x3f.
  7632. * Not all MPDUs within this series are necessarily valid - the host
  7633. * must check each sequence number within this range to see if the
  7634. * corresponding MPDU is actually present.
  7635. * This field is only valid if the FV bit is set.
  7636. * Rx descriptor fields:
  7637. * - FW_RX_DESC_BYTES
  7638. * Bits 15:0
  7639. * Purpose: Indicate how many bytes in the Rx indication are used for
  7640. * FW Rx descriptors
  7641. * Value: 1
  7642. */
  7643. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7644. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7645. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7646. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7647. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7648. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7649. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7650. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7651. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7652. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7653. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7654. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7655. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7656. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7657. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7658. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7659. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7660. #define HTT_RX_FRAG_IND_BYTES \
  7661. (4 /* msg hdr */ + \
  7662. 4 /* flush spec */ + \
  7663. 4 /* (unused) FW rx desc bytes spec */ + \
  7664. 4 /* FW rx desc */)
  7665. /**
  7666. * @brief target -> host test message definition
  7667. *
  7668. * @details
  7669. * The following field definitions describe the format of the test
  7670. * message sent from the target to the host.
  7671. * The message consists of a 4-octet header, followed by a variable
  7672. * number of 32-bit integer values, followed by a variable number
  7673. * of 8-bit character values.
  7674. *
  7675. * |31 16|15 8|7 0|
  7676. * |-----------------------------------------------------------|
  7677. * | num chars | num ints | msg type |
  7678. * |-----------------------------------------------------------|
  7679. * | int 0 |
  7680. * |-----------------------------------------------------------|
  7681. * | int 1 |
  7682. * |-----------------------------------------------------------|
  7683. * | ... |
  7684. * |-----------------------------------------------------------|
  7685. * | char 3 | char 2 | char 1 | char 0 |
  7686. * |-----------------------------------------------------------|
  7687. * | | | ... | char 4 |
  7688. * |-----------------------------------------------------------|
  7689. * - MSG_TYPE
  7690. * Bits 7:0
  7691. * Purpose: identifies this as a test message
  7692. * Value: HTT_MSG_TYPE_TEST
  7693. * - NUM_INTS
  7694. * Bits 15:8
  7695. * Purpose: indicate how many 32-bit integers follow the message header
  7696. * - NUM_CHARS
  7697. * Bits 31:16
  7698. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7699. */
  7700. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7701. #define HTT_RX_TEST_NUM_INTS_S 8
  7702. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7703. #define HTT_RX_TEST_NUM_CHARS_S 16
  7704. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7705. do { \
  7706. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7707. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7708. } while (0)
  7709. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7710. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7711. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7712. do { \
  7713. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7714. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7715. } while (0)
  7716. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7717. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7718. /**
  7719. * @brief target -> host packet log message
  7720. *
  7721. * @details
  7722. * The following field definitions describe the format of the packet log
  7723. * message sent from the target to the host.
  7724. * The message consists of a 4-octet header,followed by a variable number
  7725. * of 32-bit character values.
  7726. *
  7727. * |31 16|15 12|11 10|9 8|7 0|
  7728. * |------------------------------------------------------------------|
  7729. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7730. * |------------------------------------------------------------------|
  7731. * | payload |
  7732. * |------------------------------------------------------------------|
  7733. * - MSG_TYPE
  7734. * Bits 7:0
  7735. * Purpose: identifies this as a pktlog message
  7736. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7737. * - mac_id
  7738. * Bits 9:8
  7739. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7740. * Value: 0-3
  7741. * - pdev_id
  7742. * Bits 11:10
  7743. * Purpose: pdev_id
  7744. * Value: 0-3
  7745. * 0 (for rings at SOC level),
  7746. * 1/2/3 PDEV -> 0/1/2
  7747. * - payload_size
  7748. * Bits 31:16
  7749. * Purpose: explicitly specify the payload size
  7750. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7751. */
  7752. PREPACK struct htt_pktlog_msg {
  7753. A_UINT32 header;
  7754. A_UINT32 payload[1/* or more */];
  7755. } POSTPACK;
  7756. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7757. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7758. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7759. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7760. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7761. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7762. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7763. do { \
  7764. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7765. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7766. } while (0)
  7767. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7768. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7769. HTT_T2H_PKTLOG_MAC_ID_S)
  7770. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7771. do { \
  7772. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7773. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7774. } while (0)
  7775. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7776. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7777. HTT_T2H_PKTLOG_PDEV_ID_S)
  7778. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7779. do { \
  7780. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7781. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7782. } while (0)
  7783. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7784. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7785. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7786. /*
  7787. * Rx reorder statistics
  7788. * NB: all the fields must be defined in 4 octets size.
  7789. */
  7790. struct rx_reorder_stats {
  7791. /* Non QoS MPDUs received */
  7792. A_UINT32 deliver_non_qos;
  7793. /* MPDUs received in-order */
  7794. A_UINT32 deliver_in_order;
  7795. /* Flush due to reorder timer expired */
  7796. A_UINT32 deliver_flush_timeout;
  7797. /* Flush due to move out of window */
  7798. A_UINT32 deliver_flush_oow;
  7799. /* Flush due to DELBA */
  7800. A_UINT32 deliver_flush_delba;
  7801. /* MPDUs dropped due to FCS error */
  7802. A_UINT32 fcs_error;
  7803. /* MPDUs dropped due to monitor mode non-data packet */
  7804. A_UINT32 mgmt_ctrl;
  7805. /* Unicast-data MPDUs dropped due to invalid peer */
  7806. A_UINT32 invalid_peer;
  7807. /* MPDUs dropped due to duplication (non aggregation) */
  7808. A_UINT32 dup_non_aggr;
  7809. /* MPDUs dropped due to processed before */
  7810. A_UINT32 dup_past;
  7811. /* MPDUs dropped due to duplicate in reorder queue */
  7812. A_UINT32 dup_in_reorder;
  7813. /* Reorder timeout happened */
  7814. A_UINT32 reorder_timeout;
  7815. /* invalid bar ssn */
  7816. A_UINT32 invalid_bar_ssn;
  7817. /* reorder reset due to bar ssn */
  7818. A_UINT32 ssn_reset;
  7819. /* Flush due to delete peer */
  7820. A_UINT32 deliver_flush_delpeer;
  7821. /* Flush due to offload*/
  7822. A_UINT32 deliver_flush_offload;
  7823. /* Flush due to out of buffer*/
  7824. A_UINT32 deliver_flush_oob;
  7825. /* MPDUs dropped due to PN check fail */
  7826. A_UINT32 pn_fail;
  7827. /* MPDUs dropped due to unable to allocate memory */
  7828. A_UINT32 store_fail;
  7829. /* Number of times the tid pool alloc succeeded */
  7830. A_UINT32 tid_pool_alloc_succ;
  7831. /* Number of times the MPDU pool alloc succeeded */
  7832. A_UINT32 mpdu_pool_alloc_succ;
  7833. /* Number of times the MSDU pool alloc succeeded */
  7834. A_UINT32 msdu_pool_alloc_succ;
  7835. /* Number of times the tid pool alloc failed */
  7836. A_UINT32 tid_pool_alloc_fail;
  7837. /* Number of times the MPDU pool alloc failed */
  7838. A_UINT32 mpdu_pool_alloc_fail;
  7839. /* Number of times the MSDU pool alloc failed */
  7840. A_UINT32 msdu_pool_alloc_fail;
  7841. /* Number of times the tid pool freed */
  7842. A_UINT32 tid_pool_free;
  7843. /* Number of times the MPDU pool freed */
  7844. A_UINT32 mpdu_pool_free;
  7845. /* Number of times the MSDU pool freed */
  7846. A_UINT32 msdu_pool_free;
  7847. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7848. A_UINT32 msdu_queued;
  7849. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7850. A_UINT32 msdu_recycled;
  7851. /* Number of MPDUs with invalid peer but A2 found in AST */
  7852. A_UINT32 invalid_peer_a2_in_ast;
  7853. /* Number of MPDUs with invalid peer but A3 found in AST */
  7854. A_UINT32 invalid_peer_a3_in_ast;
  7855. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7856. A_UINT32 invalid_peer_bmc_mpdus;
  7857. /* Number of MSDUs with err attention word */
  7858. A_UINT32 rxdesc_err_att;
  7859. /* Number of MSDUs with flag of peer_idx_invalid */
  7860. A_UINT32 rxdesc_err_peer_idx_inv;
  7861. /* Number of MSDUs with flag of peer_idx_timeout */
  7862. A_UINT32 rxdesc_err_peer_idx_to;
  7863. /* Number of MSDUs with flag of overflow */
  7864. A_UINT32 rxdesc_err_ov;
  7865. /* Number of MSDUs with flag of msdu_length_err */
  7866. A_UINT32 rxdesc_err_msdu_len;
  7867. /* Number of MSDUs with flag of mpdu_length_err */
  7868. A_UINT32 rxdesc_err_mpdu_len;
  7869. /* Number of MSDUs with flag of tkip_mic_err */
  7870. A_UINT32 rxdesc_err_tkip_mic;
  7871. /* Number of MSDUs with flag of decrypt_err */
  7872. A_UINT32 rxdesc_err_decrypt;
  7873. /* Number of MSDUs with flag of fcs_err */
  7874. A_UINT32 rxdesc_err_fcs;
  7875. /* Number of Unicast (bc_mc bit is not set in attention word)
  7876. * frames with invalid peer handler
  7877. */
  7878. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7879. /* Number of unicast frame directly (direct bit is set in attention word)
  7880. * to DUT with invalid peer handler
  7881. */
  7882. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7883. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7884. * frames with invalid peer handler
  7885. */
  7886. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7887. /* Number of MSDUs dropped due to no first MSDU flag */
  7888. A_UINT32 rxdesc_no_1st_msdu;
  7889. /* Number of MSDUs droped due to ring overflow */
  7890. A_UINT32 msdu_drop_ring_ov;
  7891. /* Number of MSDUs dropped due to FC mismatch */
  7892. A_UINT32 msdu_drop_fc_mismatch;
  7893. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7894. A_UINT32 msdu_drop_mgmt_remote_ring;
  7895. /* Number of MSDUs dropped due to errors not reported in attention word */
  7896. A_UINT32 msdu_drop_misc;
  7897. /* Number of MSDUs go to offload before reorder */
  7898. A_UINT32 offload_msdu_wal;
  7899. /* Number of data frame dropped by offload after reorder */
  7900. A_UINT32 offload_msdu_reorder;
  7901. /* Number of MPDUs with sequence number in the past and within the BA window */
  7902. A_UINT32 dup_past_within_window;
  7903. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7904. A_UINT32 dup_past_outside_window;
  7905. /* Number of MSDUs with decrypt/MIC error */
  7906. A_UINT32 rxdesc_err_decrypt_mic;
  7907. /* Number of data MSDUs received on both local and remote rings */
  7908. A_UINT32 data_msdus_on_both_rings;
  7909. /* MPDUs never filled */
  7910. A_UINT32 holes_not_filled;
  7911. };
  7912. /*
  7913. * Rx Remote buffer statistics
  7914. * NB: all the fields must be defined in 4 octets size.
  7915. */
  7916. struct rx_remote_buffer_mgmt_stats {
  7917. /* Total number of MSDUs reaped for Rx processing */
  7918. A_UINT32 remote_reaped;
  7919. /* MSDUs recycled within firmware */
  7920. A_UINT32 remote_recycled;
  7921. /* MSDUs stored by Data Rx */
  7922. A_UINT32 data_rx_msdus_stored;
  7923. /* Number of HTT indications from WAL Rx MSDU */
  7924. A_UINT32 wal_rx_ind;
  7925. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7926. A_UINT32 wal_rx_ind_unconsumed;
  7927. /* Number of HTT indications from Data Rx MSDU */
  7928. A_UINT32 data_rx_ind;
  7929. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7930. A_UINT32 data_rx_ind_unconsumed;
  7931. /* Number of HTT indications from ATHBUF */
  7932. A_UINT32 athbuf_rx_ind;
  7933. /* Number of remote buffers requested for refill */
  7934. A_UINT32 refill_buf_req;
  7935. /* Number of remote buffers filled by the host */
  7936. A_UINT32 refill_buf_rsp;
  7937. /* Number of times MAC hw_index = f/w write_index */
  7938. A_INT32 mac_no_bufs;
  7939. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7940. A_INT32 fw_indices_equal;
  7941. /* Number of times f/w finds no buffers to post */
  7942. A_INT32 host_no_bufs;
  7943. };
  7944. /*
  7945. * TXBF MU/SU packets and NDPA statistics
  7946. * NB: all the fields must be defined in 4 octets size.
  7947. */
  7948. struct rx_txbf_musu_ndpa_pkts_stats {
  7949. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7950. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7951. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7952. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7953. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7954. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7955. };
  7956. /*
  7957. * htt_dbg_stats_status -
  7958. * present - The requested stats have been delivered in full.
  7959. * This indicates that either the stats information was contained
  7960. * in its entirety within this message, or else this message
  7961. * completes the delivery of the requested stats info that was
  7962. * partially delivered through earlier STATS_CONF messages.
  7963. * partial - The requested stats have been delivered in part.
  7964. * One or more subsequent STATS_CONF messages with the same
  7965. * cookie value will be sent to deliver the remainder of the
  7966. * information.
  7967. * error - The requested stats could not be delivered, for example due
  7968. * to a shortage of memory to construct a message holding the
  7969. * requested stats.
  7970. * invalid - The requested stat type is either not recognized, or the
  7971. * target is configured to not gather the stats type in question.
  7972. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7973. * series_done - This special value indicates that no further stats info
  7974. * elements are present within a series of stats info elems
  7975. * (within a stats upload confirmation message).
  7976. */
  7977. enum htt_dbg_stats_status {
  7978. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7979. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7980. HTT_DBG_STATS_STATUS_ERROR = 2,
  7981. HTT_DBG_STATS_STATUS_INVALID = 3,
  7982. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7983. };
  7984. /**
  7985. * @brief target -> host statistics upload
  7986. *
  7987. * @details
  7988. * The following field definitions describe the format of the HTT target
  7989. * to host stats upload confirmation message.
  7990. * The message contains a cookie echoed from the HTT host->target stats
  7991. * upload request, which identifies which request the confirmation is
  7992. * for, and a series of tag-length-value stats information elements.
  7993. * The tag-length header for each stats info element also includes a
  7994. * status field, to indicate whether the request for the stat type in
  7995. * question was fully met, partially met, unable to be met, or invalid
  7996. * (if the stat type in question is disabled in the target).
  7997. * A special value of all 1's in this status field is used to indicate
  7998. * the end of the series of stats info elements.
  7999. *
  8000. *
  8001. * |31 16|15 8|7 5|4 0|
  8002. * |------------------------------------------------------------|
  8003. * | reserved | msg type |
  8004. * |------------------------------------------------------------|
  8005. * | cookie LSBs |
  8006. * |------------------------------------------------------------|
  8007. * | cookie MSBs |
  8008. * |------------------------------------------------------------|
  8009. * | stats entry length | reserved | S |stat type|
  8010. * |------------------------------------------------------------|
  8011. * | |
  8012. * | type-specific stats info |
  8013. * | |
  8014. * |------------------------------------------------------------|
  8015. * | stats entry length | reserved | S |stat type|
  8016. * |------------------------------------------------------------|
  8017. * | |
  8018. * | type-specific stats info |
  8019. * | |
  8020. * |------------------------------------------------------------|
  8021. * | n/a | reserved | 111 | n/a |
  8022. * |------------------------------------------------------------|
  8023. * Header fields:
  8024. * - MSG_TYPE
  8025. * Bits 7:0
  8026. * Purpose: identifies this is a statistics upload confirmation message
  8027. * Value: 0x9
  8028. * - COOKIE_LSBS
  8029. * Bits 31:0
  8030. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8031. * message with its preceding host->target stats request message.
  8032. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8033. * - COOKIE_MSBS
  8034. * Bits 31:0
  8035. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8036. * message with its preceding host->target stats request message.
  8037. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8038. *
  8039. * Stats Information Element tag-length header fields:
  8040. * - STAT_TYPE
  8041. * Bits 4:0
  8042. * Purpose: identifies the type of statistics info held in the
  8043. * following information element
  8044. * Value: htt_dbg_stats_type
  8045. * - STATUS
  8046. * Bits 7:5
  8047. * Purpose: indicate whether the requested stats are present
  8048. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8049. * the completion of the stats entry series
  8050. * - LENGTH
  8051. * Bits 31:16
  8052. * Purpose: indicate the stats information size
  8053. * Value: This field specifies the number of bytes of stats information
  8054. * that follows the element tag-length header.
  8055. * It is expected but not required that this length is a multiple of
  8056. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8057. * subsequent stats entry header will begin on a 4-byte aligned
  8058. * boundary.
  8059. */
  8060. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8061. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8062. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8063. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8064. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8065. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8066. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8067. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8068. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8069. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8070. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8071. do { \
  8072. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8073. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8074. } while (0)
  8075. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8076. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8077. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8078. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8079. do { \
  8080. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8081. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8082. } while (0)
  8083. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8084. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8085. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8086. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8087. do { \
  8088. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8089. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8090. } while (0)
  8091. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8092. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8093. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8094. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8095. #define HTT_MAX_AGGR 64
  8096. #define HTT_HL_MAX_AGGR 18
  8097. /**
  8098. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8099. *
  8100. * @details
  8101. * The following field definitions describe the format of the HTT host
  8102. * to target frag_desc/msdu_ext bank configuration message.
  8103. * The message contains the based address and the min and max id of the
  8104. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8105. * MSDU_EXT/FRAG_DESC.
  8106. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8107. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8108. * the hardware does the mapping/translation.
  8109. *
  8110. * Total banks that can be configured is configured to 16.
  8111. *
  8112. * This should be called before any TX has be initiated by the HTT
  8113. *
  8114. * |31 16|15 8|7 5|4 0|
  8115. * |------------------------------------------------------------|
  8116. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8117. * |------------------------------------------------------------|
  8118. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8119. #if HTT_PADDR64
  8120. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8121. #endif
  8122. * |------------------------------------------------------------|
  8123. * | ... |
  8124. * |------------------------------------------------------------|
  8125. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8126. #if HTT_PADDR64
  8127. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8128. #endif
  8129. * |------------------------------------------------------------|
  8130. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8131. * |------------------------------------------------------------|
  8132. * | ... |
  8133. * |------------------------------------------------------------|
  8134. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8135. * |------------------------------------------------------------|
  8136. * Header fields:
  8137. * - MSG_TYPE
  8138. * Bits 7:0
  8139. * Value: 0x6
  8140. * for systems with 64-bit format for bus addresses:
  8141. * - BANKx_BASE_ADDRESS_LO
  8142. * Bits 31:0
  8143. * Purpose: Provide a mechanism to specify the base address of the
  8144. * MSDU_EXT bank physical/bus address.
  8145. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8146. * - BANKx_BASE_ADDRESS_HI
  8147. * Bits 31:0
  8148. * Purpose: Provide a mechanism to specify the base address of the
  8149. * MSDU_EXT bank physical/bus address.
  8150. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8151. * for systems with 32-bit format for bus addresses:
  8152. * - BANKx_BASE_ADDRESS
  8153. * Bits 31:0
  8154. * Purpose: Provide a mechanism to specify the base address of the
  8155. * MSDU_EXT bank physical/bus address.
  8156. * Value: MSDU_EXT bank physical / bus address
  8157. * - BANKx_MIN_ID
  8158. * Bits 15:0
  8159. * Purpose: Provide a mechanism to specify the min index that needs to
  8160. * mapped.
  8161. * - BANKx_MAX_ID
  8162. * Bits 31:16
  8163. * Purpose: Provide a mechanism to specify the max index that needs to
  8164. * mapped.
  8165. *
  8166. */
  8167. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8168. * safe value.
  8169. * @note MAX supported banks is 16.
  8170. */
  8171. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8172. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8173. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8174. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8175. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8176. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8177. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8178. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8179. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8180. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8181. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8182. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8183. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8184. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8187. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8188. } while (0)
  8189. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8190. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8191. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8194. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8195. } while (0)
  8196. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8197. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8198. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8199. do { \
  8200. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8201. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8202. } while (0)
  8203. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8204. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8205. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8206. do { \
  8207. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8208. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8209. } while (0)
  8210. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8211. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8212. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8213. do { \
  8214. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8215. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8216. } while (0)
  8217. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8218. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8219. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8220. do { \
  8221. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8222. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8223. } while (0)
  8224. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8225. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8226. /*
  8227. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8228. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8229. * addresses are stored in a XXX-bit field.
  8230. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8231. * htt_tx_frag_desc64_bank_cfg_t structs.
  8232. */
  8233. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8234. _paddr_bits_, \
  8235. _paddr__bank_base_address_) \
  8236. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8237. /** word 0 \
  8238. * msg_type: 8, \
  8239. * pdev_id: 2, \
  8240. * swap: 1, \
  8241. * reserved0: 5, \
  8242. * num_banks: 8, \
  8243. * desc_size: 8; \
  8244. */ \
  8245. A_UINT32 word0; \
  8246. /* \
  8247. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8248. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8249. * the second A_UINT32). \
  8250. */ \
  8251. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8252. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8253. } POSTPACK
  8254. /* define htt_tx_frag_desc32_bank_cfg_t */
  8255. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8256. /* define htt_tx_frag_desc64_bank_cfg_t */
  8257. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8258. /*
  8259. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8260. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8261. */
  8262. #if HTT_PADDR64
  8263. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8264. #else
  8265. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8266. #endif
  8267. /**
  8268. * @brief target -> host HTT TX Credit total count update message definition
  8269. *
  8270. *|31 16|15|14 9| 8 |7 0 |
  8271. *|---------------------+--+----------+-------+----------|
  8272. *|cur htt credit delta | Q| reserved | sign | msg type |
  8273. *|------------------------------------------------------|
  8274. *
  8275. * Header fields:
  8276. * - MSG_TYPE
  8277. * Bits 7:0
  8278. * Purpose: identifies this as a htt tx credit delta update message
  8279. * Value: 0xe
  8280. * - SIGN
  8281. * Bits 8
  8282. * identifies whether credit delta is positive or negative
  8283. * Value:
  8284. * - 0x0: credit delta is positive, rebalance in some buffers
  8285. * - 0x1: credit delta is negative, rebalance out some buffers
  8286. * - reserved
  8287. * Bits 14:9
  8288. * Value: 0x0
  8289. * - TXQ_GRP
  8290. * Bit 15
  8291. * Purpose: indicates whether any tx queue group information elements
  8292. * are appended to the tx credit update message
  8293. * Value: 0 -> no tx queue group information element is present
  8294. * 1 -> a tx queue group information element immediately follows
  8295. * - DELTA_COUNT
  8296. * Bits 31:16
  8297. * Purpose: Specify current htt credit delta absolute count
  8298. */
  8299. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8300. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8301. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8302. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8303. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8304. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8305. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8306. do { \
  8307. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8308. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8309. } while (0)
  8310. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8311. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8312. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8313. do { \
  8314. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8315. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8316. } while (0)
  8317. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8318. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8319. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8320. do { \
  8321. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8322. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8323. } while (0)
  8324. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8325. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8326. #define HTT_TX_CREDIT_MSG_BYTES 4
  8327. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8328. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8329. /**
  8330. * @brief HTT WDI_IPA Operation Response Message
  8331. *
  8332. * @details
  8333. * HTT WDI_IPA Operation Response message is sent by target
  8334. * to host confirming suspend or resume operation.
  8335. * |31 24|23 16|15 8|7 0|
  8336. * |----------------+----------------+----------------+----------------|
  8337. * | op_code | Rsvd | msg_type |
  8338. * |-------------------------------------------------------------------|
  8339. * | Rsvd | Response len |
  8340. * |-------------------------------------------------------------------|
  8341. * | |
  8342. * | Response-type specific info |
  8343. * | |
  8344. * | |
  8345. * |-------------------------------------------------------------------|
  8346. * Header fields:
  8347. * - MSG_TYPE
  8348. * Bits 7:0
  8349. * Purpose: Identifies this as WDI_IPA Operation Response message
  8350. * value: = 0x13
  8351. * - OP_CODE
  8352. * Bits 31:16
  8353. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8354. * value: = enum htt_wdi_ipa_op_code
  8355. * - RSP_LEN
  8356. * Bits 16:0
  8357. * Purpose: length for the response-type specific info
  8358. * value: = length in bytes for response-type specific info
  8359. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8360. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8361. */
  8362. PREPACK struct htt_wdi_ipa_op_response_t
  8363. {
  8364. /* DWORD 0: flags and meta-data */
  8365. A_UINT32
  8366. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8367. reserved1: 8,
  8368. op_code: 16;
  8369. A_UINT32
  8370. rsp_len: 16,
  8371. reserved2: 16;
  8372. } POSTPACK;
  8373. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8374. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8375. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8376. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8377. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8378. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8379. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8380. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8383. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8384. } while (0)
  8385. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8386. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8387. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8390. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8391. } while (0)
  8392. enum htt_phy_mode {
  8393. htt_phy_mode_11a = 0,
  8394. htt_phy_mode_11g = 1,
  8395. htt_phy_mode_11b = 2,
  8396. htt_phy_mode_11g_only = 3,
  8397. htt_phy_mode_11na_ht20 = 4,
  8398. htt_phy_mode_11ng_ht20 = 5,
  8399. htt_phy_mode_11na_ht40 = 6,
  8400. htt_phy_mode_11ng_ht40 = 7,
  8401. htt_phy_mode_11ac_vht20 = 8,
  8402. htt_phy_mode_11ac_vht40 = 9,
  8403. htt_phy_mode_11ac_vht80 = 10,
  8404. htt_phy_mode_11ac_vht20_2g = 11,
  8405. htt_phy_mode_11ac_vht40_2g = 12,
  8406. htt_phy_mode_11ac_vht80_2g = 13,
  8407. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8408. htt_phy_mode_11ac_vht160 = 15,
  8409. htt_phy_mode_max,
  8410. };
  8411. /**
  8412. * @brief target -> host HTT channel change indication
  8413. * @details
  8414. * Specify when a channel change occurs.
  8415. * This allows the host to precisely determine which rx frames arrived
  8416. * on the old channel and which rx frames arrived on the new channel.
  8417. *
  8418. *|31 |7 0 |
  8419. *|-------------------------------------------+----------|
  8420. *| reserved | msg type |
  8421. *|------------------------------------------------------|
  8422. *| primary_chan_center_freq_mhz |
  8423. *|------------------------------------------------------|
  8424. *| contiguous_chan1_center_freq_mhz |
  8425. *|------------------------------------------------------|
  8426. *| contiguous_chan2_center_freq_mhz |
  8427. *|------------------------------------------------------|
  8428. *| phy_mode |
  8429. *|------------------------------------------------------|
  8430. *
  8431. * Header fields:
  8432. * - MSG_TYPE
  8433. * Bits 7:0
  8434. * Purpose: identifies this as a htt channel change indication message
  8435. * Value: 0x15
  8436. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8437. * Bits 31:0
  8438. * Purpose: identify the (center of the) new 20 MHz primary channel
  8439. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8440. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8441. * Bits 31:0
  8442. * Purpose: identify the (center of the) contiguous frequency range
  8443. * comprising the new channel.
  8444. * For example, if the new channel is a 80 MHz channel extending
  8445. * 60 MHz beyond the primary channel, this field would be 30 larger
  8446. * than the primary channel center frequency field.
  8447. * Value: center frequency of the contiguous frequency range comprising
  8448. * the full channel in MHz units
  8449. * (80+80 channels also use the CONTIG_CHAN2 field)
  8450. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8451. * Bits 31:0
  8452. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8453. * within a VHT 80+80 channel.
  8454. * This field is only relevant for VHT 80+80 channels.
  8455. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8456. * channel (arbitrary value for cases besides VHT 80+80)
  8457. * - PHY_MODE
  8458. * Bits 31:0
  8459. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8460. * and band
  8461. * Value: htt_phy_mode enum value
  8462. */
  8463. PREPACK struct htt_chan_change_t
  8464. {
  8465. /* DWORD 0: flags and meta-data */
  8466. A_UINT32
  8467. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8468. reserved1: 24;
  8469. A_UINT32 primary_chan_center_freq_mhz;
  8470. A_UINT32 contig_chan1_center_freq_mhz;
  8471. A_UINT32 contig_chan2_center_freq_mhz;
  8472. A_UINT32 phy_mode;
  8473. } POSTPACK;
  8474. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8475. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8476. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8477. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8478. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8479. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8480. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8481. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8482. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8483. do { \
  8484. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8485. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8486. } while (0)
  8487. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8488. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8489. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8490. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8491. do { \
  8492. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8493. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8494. } while (0)
  8495. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8496. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8497. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8498. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8501. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8502. } while (0)
  8503. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8504. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8505. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8506. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8507. do { \
  8508. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8509. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8510. } while (0)
  8511. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8512. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8513. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8514. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8515. /**
  8516. * @brief rx offload packet error message
  8517. *
  8518. * @details
  8519. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8520. * of target payload like mic err.
  8521. *
  8522. * |31 24|23 16|15 8|7 0|
  8523. * |----------------+----------------+----------------+----------------|
  8524. * | tid | vdev_id | msg_sub_type | msg_type |
  8525. * |-------------------------------------------------------------------|
  8526. * : (sub-type dependent content) :
  8527. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8528. * Header fields:
  8529. * - msg_type
  8530. * Bits 7:0
  8531. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8532. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8533. * - msg_sub_type
  8534. * Bits 15:8
  8535. * Purpose: Identifies which type of rx error is reported by this message
  8536. * value: htt_rx_ofld_pkt_err_type
  8537. * - vdev_id
  8538. * Bits 23:16
  8539. * Purpose: Identifies which vdev received the erroneous rx frame
  8540. * value:
  8541. * - tid
  8542. * Bits 31:24
  8543. * Purpose: Identifies the traffic type of the rx frame
  8544. * value:
  8545. *
  8546. * - The payload fields used if the sub-type == MIC error are shown below.
  8547. * Note - MIC err is per MSDU, while PN is per MPDU.
  8548. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8549. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8550. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8551. * instead of sending separate HTT messages for each wrong MSDU within
  8552. * the MPDU.
  8553. *
  8554. * |31 24|23 16|15 8|7 0|
  8555. * |----------------+----------------+----------------+----------------|
  8556. * | Rsvd | key_id | peer_id |
  8557. * |-------------------------------------------------------------------|
  8558. * | receiver MAC addr 31:0 |
  8559. * |-------------------------------------------------------------------|
  8560. * | Rsvd | receiver MAC addr 47:32 |
  8561. * |-------------------------------------------------------------------|
  8562. * | transmitter MAC addr 31:0 |
  8563. * |-------------------------------------------------------------------|
  8564. * | Rsvd | transmitter MAC addr 47:32 |
  8565. * |-------------------------------------------------------------------|
  8566. * | PN 31:0 |
  8567. * |-------------------------------------------------------------------|
  8568. * | Rsvd | PN 47:32 |
  8569. * |-------------------------------------------------------------------|
  8570. * - peer_id
  8571. * Bits 15:0
  8572. * Purpose: identifies which peer is frame is from
  8573. * value:
  8574. * - key_id
  8575. * Bits 23:16
  8576. * Purpose: identifies key_id of rx frame
  8577. * value:
  8578. * - RA_31_0 (receiver MAC addr 31:0)
  8579. * Bits 31:0
  8580. * Purpose: identifies by MAC address which vdev received the frame
  8581. * value: MAC address lower 4 bytes
  8582. * - RA_47_32 (receiver MAC addr 47:32)
  8583. * Bits 15:0
  8584. * Purpose: identifies by MAC address which vdev received the frame
  8585. * value: MAC address upper 2 bytes
  8586. * - TA_31_0 (transmitter MAC addr 31:0)
  8587. * Bits 31:0
  8588. * Purpose: identifies by MAC address which peer transmitted the frame
  8589. * value: MAC address lower 4 bytes
  8590. * - TA_47_32 (transmitter MAC addr 47:32)
  8591. * Bits 15:0
  8592. * Purpose: identifies by MAC address which peer transmitted the frame
  8593. * value: MAC address upper 2 bytes
  8594. * - PN_31_0
  8595. * Bits 31:0
  8596. * Purpose: Identifies pn of rx frame
  8597. * value: PN lower 4 bytes
  8598. * - PN_47_32
  8599. * Bits 15:0
  8600. * Purpose: Identifies pn of rx frame
  8601. * value:
  8602. * TKIP or CCMP: PN upper 2 bytes
  8603. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8604. */
  8605. enum htt_rx_ofld_pkt_err_type {
  8606. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8607. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8608. };
  8609. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8610. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8611. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8612. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8613. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8614. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8615. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8616. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8617. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8618. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8619. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8620. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8621. do { \
  8622. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8623. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8624. } while (0)
  8625. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8626. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8627. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8628. do { \
  8629. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8630. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8631. } while (0)
  8632. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8633. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8634. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8637. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8638. } while (0)
  8639. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8640. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8641. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8643. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8658. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8659. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8661. do { \
  8662. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8663. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8664. } while (0)
  8665. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8666. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8667. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8669. do { \
  8670. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8671. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8672. } while (0)
  8673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8674. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8675. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8677. do { \
  8678. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8679. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8680. } while (0)
  8681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8682. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8683. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8685. do { \
  8686. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8687. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8688. } while (0)
  8689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8690. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8691. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8692. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8693. do { \
  8694. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8695. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8696. } while (0)
  8697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8698. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8699. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8701. do { \
  8702. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8703. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8704. } while (0)
  8705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8706. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8707. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8708. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8709. do { \
  8710. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8711. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8712. } while (0)
  8713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8714. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8715. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8717. do { \
  8718. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8719. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8720. } while (0)
  8721. /**
  8722. * @brief peer rate report message
  8723. *
  8724. * @details
  8725. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8726. * justified rate of all the peers.
  8727. *
  8728. * |31 24|23 16|15 8|7 0|
  8729. * |----------------+----------------+----------------+----------------|
  8730. * | peer_count | | msg_type |
  8731. * |-------------------------------------------------------------------|
  8732. * : Payload (variant number of peer rate report) :
  8733. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8734. * Header fields:
  8735. * - msg_type
  8736. * Bits 7:0
  8737. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8738. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8739. * - reserved
  8740. * Bits 15:8
  8741. * Purpose:
  8742. * value:
  8743. * - peer_count
  8744. * Bits 31:16
  8745. * Purpose: Specify how many peer rate report elements are present in the payload.
  8746. * value:
  8747. *
  8748. * Payload:
  8749. * There are variant number of peer rate report follow the first 32 bits.
  8750. * The peer rate report is defined as follows.
  8751. *
  8752. * |31 20|19 16|15 0|
  8753. * |-----------------------+---------+---------------------------------|-
  8754. * | reserved | phy | peer_id | \
  8755. * |-------------------------------------------------------------------| -> report #0
  8756. * | rate | /
  8757. * |-----------------------+---------+---------------------------------|-
  8758. * | reserved | phy | peer_id | \
  8759. * |-------------------------------------------------------------------| -> report #1
  8760. * | rate | /
  8761. * |-----------------------+---------+---------------------------------|-
  8762. * | reserved | phy | peer_id | \
  8763. * |-------------------------------------------------------------------| -> report #2
  8764. * | rate | /
  8765. * |-------------------------------------------------------------------|-
  8766. * : :
  8767. * : :
  8768. * : :
  8769. * :-------------------------------------------------------------------:
  8770. *
  8771. * - peer_id
  8772. * Bits 15:0
  8773. * Purpose: identify the peer
  8774. * value:
  8775. * - phy
  8776. * Bits 19:16
  8777. * Purpose: identify which phy is in use
  8778. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8779. * Please see enum htt_peer_report_phy_type for detail.
  8780. * - reserved
  8781. * Bits 31:20
  8782. * Purpose:
  8783. * value:
  8784. * - rate
  8785. * Bits 31:0
  8786. * Purpose: represent the justified rate of the peer specified by peer_id
  8787. * value:
  8788. */
  8789. enum htt_peer_rate_report_phy_type {
  8790. HTT_PEER_RATE_REPORT_11B = 0,
  8791. HTT_PEER_RATE_REPORT_11A_G,
  8792. HTT_PEER_RATE_REPORT_11N,
  8793. HTT_PEER_RATE_REPORT_11AC,
  8794. };
  8795. #define HTT_PEER_RATE_REPORT_SIZE 8
  8796. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8797. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8798. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8799. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8800. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8801. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8802. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8803. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8804. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8805. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8806. do { \
  8807. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8808. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8809. } while (0)
  8810. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8811. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8812. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8813. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8814. do { \
  8815. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8816. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8817. } while (0)
  8818. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8819. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8820. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8821. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8822. do { \
  8823. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8824. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8825. } while (0)
  8826. /**
  8827. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8828. *
  8829. * @details
  8830. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8831. * a flow of descriptors.
  8832. *
  8833. * This message is in TLV format and indicates the parameters to be setup a
  8834. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8835. * receive descriptors from a specified pool.
  8836. *
  8837. * The message would appear as follows:
  8838. *
  8839. * |31 24|23 16|15 8|7 0|
  8840. * |----------------+----------------+----------------+----------------|
  8841. * header | reserved | num_flows | msg_type |
  8842. * |-------------------------------------------------------------------|
  8843. * | |
  8844. * : payload :
  8845. * | |
  8846. * |-------------------------------------------------------------------|
  8847. *
  8848. * The header field is one DWORD long and is interpreted as follows:
  8849. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8850. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8851. * this message
  8852. * b'16-31 - reserved: These bits are reserved for future use
  8853. *
  8854. * Payload:
  8855. * The payload would contain multiple objects of the following structure. Each
  8856. * object represents a flow.
  8857. *
  8858. * |31 24|23 16|15 8|7 0|
  8859. * |----------------+----------------+----------------+----------------|
  8860. * header | reserved | num_flows | msg_type |
  8861. * |-------------------------------------------------------------------|
  8862. * payload0| flow_type |
  8863. * |-------------------------------------------------------------------|
  8864. * | flow_id |
  8865. * |-------------------------------------------------------------------|
  8866. * | reserved0 | flow_pool_id |
  8867. * |-------------------------------------------------------------------|
  8868. * | reserved1 | flow_pool_size |
  8869. * |-------------------------------------------------------------------|
  8870. * | reserved2 |
  8871. * |-------------------------------------------------------------------|
  8872. * payload1| flow_type |
  8873. * |-------------------------------------------------------------------|
  8874. * | flow_id |
  8875. * |-------------------------------------------------------------------|
  8876. * | reserved0 | flow_pool_id |
  8877. * |-------------------------------------------------------------------|
  8878. * | reserved1 | flow_pool_size |
  8879. * |-------------------------------------------------------------------|
  8880. * | reserved2 |
  8881. * |-------------------------------------------------------------------|
  8882. * | . |
  8883. * | . |
  8884. * | . |
  8885. * |-------------------------------------------------------------------|
  8886. *
  8887. * Each payload is 5 DWORDS long and is interpreted as follows:
  8888. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8889. * this flow is associated. It can be VDEV, peer,
  8890. * or tid (AC). Based on enum htt_flow_type.
  8891. *
  8892. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8893. * object. For flow_type vdev it is set to the
  8894. * vdevid, for peer it is peerid and for tid, it is
  8895. * tid_num.
  8896. *
  8897. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8898. * in the host for this flow
  8899. * b'16:31 - reserved0: This field in reserved for the future. In case
  8900. * we have a hierarchical implementation (HCM) of
  8901. * pools, it can be used to indicate the ID of the
  8902. * parent-pool.
  8903. *
  8904. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8905. * Descriptors for this flow will be
  8906. * allocated from this pool in the host.
  8907. * b'16:31 - reserved1: This field in reserved for the future. In case
  8908. * we have a hierarchical implementation of pools,
  8909. * it can be used to indicate the max number of
  8910. * descriptors in the pool. The b'0:15 can be used
  8911. * to indicate min number of descriptors in the
  8912. * HCM scheme.
  8913. *
  8914. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8915. * we have a hierarchical implementation of pools,
  8916. * b'0:15 can be used to indicate the
  8917. * priority-based borrowing (PBB) threshold of
  8918. * the flow's pool. The b'16:31 are still left
  8919. * reserved.
  8920. */
  8921. enum htt_flow_type {
  8922. FLOW_TYPE_VDEV = 0,
  8923. /* Insert new flow types above this line */
  8924. };
  8925. PREPACK struct htt_flow_pool_map_payload_t {
  8926. A_UINT32 flow_type;
  8927. A_UINT32 flow_id;
  8928. A_UINT32 flow_pool_id:16,
  8929. reserved0:16;
  8930. A_UINT32 flow_pool_size:16,
  8931. reserved1:16;
  8932. A_UINT32 reserved2;
  8933. } POSTPACK;
  8934. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8935. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8936. (sizeof(struct htt_flow_pool_map_payload_t))
  8937. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8938. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8939. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8940. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8941. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8942. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8943. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8944. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8945. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8946. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8947. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8948. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8949. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8950. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8951. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8952. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8953. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8954. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8955. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8956. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8957. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8958. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8959. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8960. do { \
  8961. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8962. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8963. } while (0)
  8964. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8965. do { \
  8966. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8967. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8968. } while (0)
  8969. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8970. do { \
  8971. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8972. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8973. } while (0)
  8974. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8977. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8978. } while (0)
  8979. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8982. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8983. } while (0)
  8984. /**
  8985. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8986. *
  8987. * @details
  8988. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8989. * down a flow of descriptors.
  8990. * This message indicates that for the flow (whose ID is provided) is wanting
  8991. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8992. * pool of descriptors from where descriptors are being allocated for this
  8993. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8994. * be unmapped by the host.
  8995. *
  8996. * The message would appear as follows:
  8997. *
  8998. * |31 24|23 16|15 8|7 0|
  8999. * |----------------+----------------+----------------+----------------|
  9000. * | reserved0 | msg_type |
  9001. * |-------------------------------------------------------------------|
  9002. * | flow_type |
  9003. * |-------------------------------------------------------------------|
  9004. * | flow_id |
  9005. * |-------------------------------------------------------------------|
  9006. * | reserved1 | flow_pool_id |
  9007. * |-------------------------------------------------------------------|
  9008. *
  9009. * The message is interpreted as follows:
  9010. * dword0 - b'0:7 - msg_type: This will be set to
  9011. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9012. * b'8:31 - reserved0: Reserved for future use
  9013. *
  9014. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9015. * this flow is associated. It can be VDEV, peer,
  9016. * or tid (AC). Based on enum htt_flow_type.
  9017. *
  9018. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9019. * object. For flow_type vdev it is set to the
  9020. * vdevid, for peer it is peerid and for tid, it is
  9021. * tid_num.
  9022. *
  9023. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9024. * used in the host for this flow
  9025. * b'16:31 - reserved0: This field in reserved for the future.
  9026. *
  9027. */
  9028. PREPACK struct htt_flow_pool_unmap_t {
  9029. A_UINT32 msg_type:8,
  9030. reserved0:24;
  9031. A_UINT32 flow_type;
  9032. A_UINT32 flow_id;
  9033. A_UINT32 flow_pool_id:16,
  9034. reserved1:16;
  9035. } POSTPACK;
  9036. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9037. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9038. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9039. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9040. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9041. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9042. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9043. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9044. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9045. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9046. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9047. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9048. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9049. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9050. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9051. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9052. do { \
  9053. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9054. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9055. } while (0)
  9056. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9057. do { \
  9058. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9059. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9060. } while (0)
  9061. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9062. do { \
  9063. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9064. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9065. } while (0)
  9066. /**
  9067. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9068. *
  9069. * @details
  9070. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9071. * SRNG ring setup is done
  9072. *
  9073. * This message indicates whether the last setup operation is successful.
  9074. * It will be sent to host when host set respose_required bit in
  9075. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9076. * The message would appear as follows:
  9077. *
  9078. * |31 24|23 16|15 8|7 0|
  9079. * |--------------- +----------------+----------------+----------------|
  9080. * | setup_status | ring_id | pdev_id | msg_type |
  9081. * |-------------------------------------------------------------------|
  9082. *
  9083. * The message is interpreted as follows:
  9084. * dword0 - b'0:7 - msg_type: This will be set to
  9085. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9086. * b'8:15 - pdev_id:
  9087. * 0 (for rings at SOC/UMAC level),
  9088. * 1/2/3 mac id (for rings at LMAC level)
  9089. * b'16:23 - ring_id: Identify the ring which is set up
  9090. * More details can be got from enum htt_srng_ring_id
  9091. * b'24:31 - setup_status: Indicate status of setup operation
  9092. * Refer to htt_ring_setup_status
  9093. */
  9094. PREPACK struct htt_sring_setup_done_t {
  9095. A_UINT32 msg_type: 8,
  9096. pdev_id: 8,
  9097. ring_id: 8,
  9098. setup_status: 8;
  9099. } POSTPACK;
  9100. enum htt_ring_setup_status {
  9101. htt_ring_setup_status_ok = 0,
  9102. htt_ring_setup_status_error,
  9103. };
  9104. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9105. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9106. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9107. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9108. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9109. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9110. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9111. do { \
  9112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9113. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9114. } while (0)
  9115. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9116. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9117. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9118. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9119. HTT_SRING_SETUP_DONE_RING_ID_S)
  9120. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9121. do { \
  9122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9123. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9124. } while (0)
  9125. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9126. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9127. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9128. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9129. HTT_SRING_SETUP_DONE_STATUS_S)
  9130. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9131. do { \
  9132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9133. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9134. } while (0)
  9135. /**
  9136. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9137. *
  9138. * @details
  9139. * HTT TX map flow entry with tqm flow pointer
  9140. * Sent from firmware to host to add tqm flow pointer in corresponding
  9141. * flow search entry. Flow metadata is replayed back to host as part of this
  9142. * struct to enable host to find the specific flow search entry
  9143. *
  9144. * The message would appear as follows:
  9145. *
  9146. * |31 28|27 18|17 14|13 8|7 0|
  9147. * |-------+------------------------------------------+----------------|
  9148. * | rsvd0 | fse_hsh_idx | msg_type |
  9149. * |-------------------------------------------------------------------|
  9150. * | rsvd1 | tid | peer_id |
  9151. * |-------------------------------------------------------------------|
  9152. * | tqm_flow_pntr_lo |
  9153. * |-------------------------------------------------------------------|
  9154. * | tqm_flow_pntr_hi |
  9155. * |-------------------------------------------------------------------|
  9156. * | fse_meta_data |
  9157. * |-------------------------------------------------------------------|
  9158. *
  9159. * The message is interpreted as follows:
  9160. *
  9161. * dword0 - b'0:7 - msg_type: This will be set to
  9162. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9163. *
  9164. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9165. * for this flow entry
  9166. *
  9167. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9168. *
  9169. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9170. *
  9171. * dword1 - b'14:17 - tid
  9172. *
  9173. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9174. *
  9175. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9176. *
  9177. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9178. *
  9179. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9180. * given by host
  9181. */
  9182. PREPACK struct htt_tx_map_flow_info {
  9183. A_UINT32
  9184. msg_type: 8,
  9185. fse_hsh_idx: 20,
  9186. rsvd0: 4;
  9187. A_UINT32
  9188. peer_id: 14,
  9189. tid: 4,
  9190. rsvd1: 14;
  9191. A_UINT32 tqm_flow_pntr_lo;
  9192. A_UINT32 tqm_flow_pntr_hi;
  9193. struct htt_tx_flow_metadata fse_meta_data;
  9194. } POSTPACK;
  9195. /* DWORD 0 */
  9196. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9197. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9198. /* DWORD 1 */
  9199. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9200. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9201. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9202. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9203. /* DWORD 0 */
  9204. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9205. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9206. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9207. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9210. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9211. } while (0)
  9212. /* DWORD 1 */
  9213. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9214. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9215. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9216. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9217. do { \
  9218. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9219. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9220. } while (0)
  9221. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9222. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9223. HTT_TX_MAP_FLOW_INFO_TID_S)
  9224. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9225. do { \
  9226. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9227. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9228. } while (0)
  9229. /*
  9230. * htt_dbg_ext_stats_status -
  9231. * present - The requested stats have been delivered in full.
  9232. * This indicates that either the stats information was contained
  9233. * in its entirety within this message, or else this message
  9234. * completes the delivery of the requested stats info that was
  9235. * partially delivered through earlier STATS_CONF messages.
  9236. * partial - The requested stats have been delivered in part.
  9237. * One or more subsequent STATS_CONF messages with the same
  9238. * cookie value will be sent to deliver the remainder of the
  9239. * information.
  9240. * error - The requested stats could not be delivered, for example due
  9241. * to a shortage of memory to construct a message holding the
  9242. * requested stats.
  9243. * invalid - The requested stat type is either not recognized, or the
  9244. * target is configured to not gather the stats type in question.
  9245. */
  9246. enum htt_dbg_ext_stats_status {
  9247. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9248. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9249. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9250. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9251. };
  9252. /**
  9253. * @brief target -> host ppdu stats upload
  9254. *
  9255. * @details
  9256. * The following field definitions describe the format of the HTT target
  9257. * to host ppdu stats indication message.
  9258. *
  9259. *
  9260. * |31 16|15 12|11 10|9 8|7 0 |
  9261. * |----------------------------------------------------------------------|
  9262. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9263. * |----------------------------------------------------------------------|
  9264. * | ppdu_id |
  9265. * |----------------------------------------------------------------------|
  9266. * | Timestamp in us |
  9267. * |----------------------------------------------------------------------|
  9268. * | reserved |
  9269. * |----------------------------------------------------------------------|
  9270. * | type-specific stats info |
  9271. * | (see htt_ppdu_stats.h) |
  9272. * |----------------------------------------------------------------------|
  9273. * Header fields:
  9274. * - MSG_TYPE
  9275. * Bits 7:0
  9276. * Purpose: Identifies this is a PPDU STATS indication
  9277. * message.
  9278. * Value: 0x1d
  9279. * - mac_id
  9280. * Bits 9:8
  9281. * Purpose: mac_id of this ppdu_id
  9282. * Value: 0-3
  9283. * - pdev_id
  9284. * Bits 11:10
  9285. * Purpose: pdev_id of this ppdu_id
  9286. * Value: 0-3
  9287. * 0 (for rings at SOC level),
  9288. * 1/2/3 PDEV -> 0/1/2
  9289. * - payload_size
  9290. * Bits 31:16
  9291. * Purpose: total tlv size
  9292. * Value: payload_size in bytes
  9293. */
  9294. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9295. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9296. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9297. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9298. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9299. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9300. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9301. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9302. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9303. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9304. do { \
  9305. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9306. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9307. } while (0)
  9308. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9309. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9310. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9311. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9314. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9315. } while (0)
  9316. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9317. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9318. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9319. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9322. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9323. } while (0)
  9324. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9325. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9326. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9327. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9328. do { \
  9329. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9330. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9331. } while (0)
  9332. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9333. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9334. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9335. /**
  9336. * @brief target -> host extended statistics upload
  9337. *
  9338. * @details
  9339. * The following field definitions describe the format of the HTT target
  9340. * to host stats upload confirmation message.
  9341. * The message contains a cookie echoed from the HTT host->target stats
  9342. * upload request, which identifies which request the confirmation is
  9343. * for, and a single stats can span over multiple HTT stats indication
  9344. * due to the HTT message size limitation so every HTT ext stats indication
  9345. * will have tag-length-value stats information elements.
  9346. * The tag-length header for each HTT stats IND message also includes a
  9347. * status field, to indicate whether the request for the stat type in
  9348. * question was fully met, partially met, unable to be met, or invalid
  9349. * (if the stat type in question is disabled in the target).
  9350. * A Done bit 1's indicate the end of the of stats info elements.
  9351. *
  9352. *
  9353. * |31 16|15 12|11|10 8|7 5|4 0|
  9354. * |--------------------------------------------------------------|
  9355. * | reserved | msg type |
  9356. * |--------------------------------------------------------------|
  9357. * | cookie LSBs |
  9358. * |--------------------------------------------------------------|
  9359. * | cookie MSBs |
  9360. * |--------------------------------------------------------------|
  9361. * | stats entry length | rsvd | D| S | stat type |
  9362. * |--------------------------------------------------------------|
  9363. * | type-specific stats info |
  9364. * | (see htt_stats.h) |
  9365. * |--------------------------------------------------------------|
  9366. * Header fields:
  9367. * - MSG_TYPE
  9368. * Bits 7:0
  9369. * Purpose: Identifies this is a extended statistics upload confirmation
  9370. * message.
  9371. * Value: 0x1c
  9372. * - COOKIE_LSBS
  9373. * Bits 31:0
  9374. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9375. * message with its preceding host->target stats request message.
  9376. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9377. * - COOKIE_MSBS
  9378. * Bits 31:0
  9379. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9380. * message with its preceding host->target stats request message.
  9381. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9382. *
  9383. * Stats Information Element tag-length header fields:
  9384. * - STAT_TYPE
  9385. * Bits 7:0
  9386. * Purpose: identifies the type of statistics info held in the
  9387. * following information element
  9388. * Value: htt_dbg_ext_stats_type
  9389. * - STATUS
  9390. * Bits 10:8
  9391. * Purpose: indicate whether the requested stats are present
  9392. * Value: htt_dbg_ext_stats_status
  9393. * - DONE
  9394. * Bits 11
  9395. * Purpose:
  9396. * Indicates the completion of the stats entry, this will be the last
  9397. * stats conf HTT segment for the requested stats type.
  9398. * Value:
  9399. * 0 -> the stats retrieval is ongoing
  9400. * 1 -> the stats retrieval is complete
  9401. * - LENGTH
  9402. * Bits 31:16
  9403. * Purpose: indicate the stats information size
  9404. * Value: This field specifies the number of bytes of stats information
  9405. * that follows the element tag-length header.
  9406. * It is expected but not required that this length is a multiple of
  9407. * 4 bytes.
  9408. */
  9409. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9410. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9411. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9412. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9413. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9414. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9415. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9416. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9417. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9418. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9419. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9420. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9421. do { \
  9422. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9423. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9424. } while (0)
  9425. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9426. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9427. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9428. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9429. do { \
  9430. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9431. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9432. } while (0)
  9433. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9434. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9435. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9436. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9437. do { \
  9438. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9439. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9440. } while (0)
  9441. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9442. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9443. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9444. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9445. do { \
  9446. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9447. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9448. } while (0)
  9449. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9450. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9451. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9452. typedef enum {
  9453. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9454. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9455. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9456. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9457. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9458. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9459. /* Reserved from 128 - 255 for target internal use.*/
  9460. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9461. } HTT_PEER_TYPE;
  9462. /** 2 word representation of MAC addr */
  9463. typedef struct {
  9464. /** upper 4 bytes of MAC address */
  9465. A_UINT32 mac_addr31to0;
  9466. /** lower 2 bytes of MAC address */
  9467. A_UINT32 mac_addr47to32;
  9468. } htt_mac_addr;
  9469. /** macro to convert MAC address from char array to HTT word format */
  9470. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9471. (phtt_mac_addr)->mac_addr31to0 = \
  9472. (((c_macaddr)[0] << 0) | \
  9473. ((c_macaddr)[1] << 8) | \
  9474. ((c_macaddr)[2] << 16) | \
  9475. ((c_macaddr)[3] << 24)); \
  9476. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9477. } while (0)
  9478. /**
  9479. * @brief target -> host monitor mac header indication message
  9480. *
  9481. * @details
  9482. * The following diagram shows the format of the monitor mac header message
  9483. * sent from the target to the host.
  9484. * This message is primarily sent when promiscuous rx mode is enabled.
  9485. * One message is sent per rx PPDU.
  9486. *
  9487. * |31 24|23 16|15 8|7 0|
  9488. * |-------------------------------------------------------------|
  9489. * | peer_id | reserved0 | msg_type |
  9490. * |-------------------------------------------------------------|
  9491. * | reserved1 | num_mpdu |
  9492. * |-------------------------------------------------------------|
  9493. * | struct hw_rx_desc |
  9494. * | (see wal_rx_desc.h) |
  9495. * |-------------------------------------------------------------|
  9496. * | struct ieee80211_frame_addr4 |
  9497. * | (see ieee80211_defs.h) |
  9498. * |-------------------------------------------------------------|
  9499. * | struct ieee80211_frame_addr4 |
  9500. * | (see ieee80211_defs.h) |
  9501. * |-------------------------------------------------------------|
  9502. * | ...... |
  9503. * |-------------------------------------------------------------|
  9504. *
  9505. * Header fields:
  9506. * - msg_type
  9507. * Bits 7:0
  9508. * Purpose: Identifies this is a monitor mac header indication message.
  9509. * Value: 0x20
  9510. * - peer_id
  9511. * Bits 31:16
  9512. * Purpose: Software peer id given by host during association,
  9513. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9514. * for rx PPDUs received from unassociated peers.
  9515. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9516. * - num_mpdu
  9517. * Bits 15:0
  9518. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9519. * delivered within the message.
  9520. * Value: 1 to 32
  9521. * num_mpdu is limited to a maximum value of 32, due to buffer
  9522. * size limits. For PPDUs with more than 32 MPDUs, only the
  9523. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9524. * the PPDU will be provided.
  9525. */
  9526. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9527. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9528. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9529. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9530. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9531. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9534. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9535. } while (0)
  9536. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9537. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9538. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9539. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9540. do { \
  9541. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9542. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9543. } while (0)
  9544. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9545. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9546. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9547. /**
  9548. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9549. *
  9550. * @details
  9551. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9552. * the flow pool associated with the specified ID is resized
  9553. *
  9554. * The message would appear as follows:
  9555. *
  9556. * |31 16|15 8|7 0|
  9557. * |---------------------------------+----------------+----------------|
  9558. * | reserved0 | Msg type |
  9559. * |-------------------------------------------------------------------|
  9560. * | flow pool new size | flow pool ID |
  9561. * |-------------------------------------------------------------------|
  9562. *
  9563. * The message is interpreted as follows:
  9564. * b'0:7 - msg_type: This will be set to
  9565. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9566. *
  9567. * b'0:15 - flow pool ID: Existing flow pool ID
  9568. *
  9569. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9570. *
  9571. */
  9572. PREPACK struct htt_flow_pool_resize_t {
  9573. A_UINT32 msg_type:8,
  9574. reserved0:24;
  9575. A_UINT32 flow_pool_id:16,
  9576. flow_pool_new_size:16;
  9577. } POSTPACK;
  9578. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9579. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9580. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9581. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9582. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9583. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9584. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9585. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9586. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9587. do { \
  9588. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9589. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9590. } while (0)
  9591. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9592. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9593. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9594. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9597. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9598. } while (0)
  9599. /**
  9600. * @brief host -> target channel change message
  9601. *
  9602. * @details
  9603. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9604. * to associate RX frames to correct channel they were received on.
  9605. * The following field definitions describe the format of the HTT target
  9606. * to host channel change message.
  9607. * |31 16|15 8|7 5|4 0|
  9608. * |------------------------------------------------------------|
  9609. * | reserved | MSG_TYPE |
  9610. * |------------------------------------------------------------|
  9611. * | CHAN_MHZ |
  9612. * |------------------------------------------------------------|
  9613. * | BAND_CENTER_FREQ1 |
  9614. * |------------------------------------------------------------|
  9615. * | BAND_CENTER_FREQ2 |
  9616. * |------------------------------------------------------------|
  9617. * | CHAN_PHY_MODE |
  9618. * |------------------------------------------------------------|
  9619. * Header fields:
  9620. * - MSG_TYPE
  9621. * Bits 7:0
  9622. * Value: 0xf
  9623. * - CHAN_MHZ
  9624. * Bits 31:0
  9625. * Purpose: frequency of the primary 20mhz channel.
  9626. * - BAND_CENTER_FREQ1
  9627. * Bits 31:0
  9628. * Purpose: centre frequency of the full channel.
  9629. * - BAND_CENTER_FREQ2
  9630. * Bits 31:0
  9631. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9632. * - CHAN_PHY_MODE
  9633. * Bits 31:0
  9634. * Purpose: phy mode of the channel.
  9635. */
  9636. PREPACK struct htt_chan_change_msg {
  9637. A_UINT32 chan_mhz; /* frequency in mhz */
  9638. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9639. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9640. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9641. } POSTPACK;
  9642. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9643. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9644. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9645. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9646. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9647. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9648. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9649. /*
  9650. * The read and write indices point to the data within the host buffer.
  9651. * Because the first 4 bytes of the host buffer is used for the read index and
  9652. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9653. * The read index and write index are the byte offsets from the base of the
  9654. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9655. * Refer the ASCII text picture below.
  9656. */
  9657. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9658. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9659. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9660. /*
  9661. ***************************************************************************
  9662. *
  9663. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9664. *
  9665. ***************************************************************************
  9666. *
  9667. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9668. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9669. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9670. * written into the Host memory region mentioned below.
  9671. *
  9672. * Read index is updated by the Host. At any point of time, the read index will
  9673. * indicate the index that will next be read by the Host. The read index is
  9674. * in units of bytes offset from the base of the meta-data buffer.
  9675. *
  9676. * Write index is updated by the FW. At any point of time, the write index will
  9677. * indicate from where the FW can start writing any new data. The write index is
  9678. * in units of bytes offset from the base of the meta-data buffer.
  9679. *
  9680. * If the Host is not fast enough in reading the CFR data, any new capture data
  9681. * would be dropped if there is no space left to write the new captures.
  9682. *
  9683. * The last 4 bytes of the memory region will have the magic pattern
  9684. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9685. * not overrun the host buffer.
  9686. *
  9687. * ,--------------------. read and write indices store the
  9688. * | | byte offset from the base of the
  9689. * | ,--------+--------. meta-data buffer to the next
  9690. * | | | | location within the data buffer
  9691. * | | v v that will be read / written
  9692. * ************************************************************************
  9693. * * Read * Write * * Magic *
  9694. * * index * index * CFR data1 ...... CFR data N * pattern *
  9695. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9696. * ************************************************************************
  9697. * |<---------- data buffer ---------->|
  9698. *
  9699. * |<----------------- meta-data buffer allocated in Host ----------------|
  9700. *
  9701. * Note:
  9702. * - Considering the 4 bytes needed to store the Read index (R) and the
  9703. * Write index (W), the initial value is as follows:
  9704. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9705. * - Buffer empty condition:
  9706. * R = W
  9707. *
  9708. * Regarding CFR data format:
  9709. * --------------------------
  9710. *
  9711. * Each CFR tone is stored in HW as 16-bits with the following format:
  9712. * {bits[15:12], bits[11:6], bits[5:0]} =
  9713. * {unsigned exponent (4 bits),
  9714. * signed mantissa_real (6 bits),
  9715. * signed mantissa_imag (6 bits)}
  9716. *
  9717. * CFR_real = mantissa_real * 2^(exponent-5)
  9718. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9719. *
  9720. *
  9721. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9722. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9723. *
  9724. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9725. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9726. * .
  9727. * .
  9728. * .
  9729. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9730. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9731. */
  9732. /* Bandwidth of peer CFR captures */
  9733. typedef enum {
  9734. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9735. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9736. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9737. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9738. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9739. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9740. } HTT_PEER_CFR_CAPTURE_BW;
  9741. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9742. * was captured
  9743. */
  9744. typedef enum {
  9745. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9746. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9747. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9748. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9749. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9750. } HTT_PEER_CFR_CAPTURE_MODE;
  9751. typedef enum {
  9752. /* This message type is currently used for the below purpose:
  9753. *
  9754. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9755. * wmi_peer_cfr_capture_cmd.
  9756. * If payload_present bit is set to 0 then the associated memory region
  9757. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9758. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9759. * message; the CFR dump will be present at the end of the message,
  9760. * after the chan_phy_mode.
  9761. */
  9762. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9763. /* Always keep this last */
  9764. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9765. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9766. /**
  9767. * @brief target -> host CFR dump completion indication message definition
  9768. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9769. *
  9770. * @details
  9771. * The following diagram shows the format of the Channel Frequency Response
  9772. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9773. * the channel capture of a peer is copied by Firmware into the Host memory
  9774. *
  9775. * **************************************************************************
  9776. *
  9777. * Message format when the CFR capture message type is
  9778. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9779. *
  9780. * **************************************************************************
  9781. *
  9782. * |31 16|15 |8|7 0|
  9783. * |----------------------------------------------------------------|
  9784. * header: | reserved |P| msg_type |
  9785. * word 0 | | | |
  9786. * |----------------------------------------------------------------|
  9787. * payload: | cfr_capture_msg_type |
  9788. * word 1 | |
  9789. * |----------------------------------------------------------------|
  9790. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9791. * word 2 | | | | | | | | |
  9792. * |----------------------------------------------------------------|
  9793. * | mac_addr31to0 |
  9794. * word 3 | |
  9795. * |----------------------------------------------------------------|
  9796. * | unused / reserved | mac_addr47to32 |
  9797. * word 4 | | |
  9798. * |----------------------------------------------------------------|
  9799. * | index |
  9800. * word 5 | |
  9801. * |----------------------------------------------------------------|
  9802. * | length |
  9803. * word 6 | |
  9804. * |----------------------------------------------------------------|
  9805. * | timestamp |
  9806. * word 7 | |
  9807. * |----------------------------------------------------------------|
  9808. * | counter |
  9809. * word 8 | |
  9810. * |----------------------------------------------------------------|
  9811. * | chan_mhz |
  9812. * word 9 | |
  9813. * |----------------------------------------------------------------|
  9814. * | band_center_freq1 |
  9815. * word 10 | |
  9816. * |----------------------------------------------------------------|
  9817. * | band_center_freq2 |
  9818. * word 11 | |
  9819. * |----------------------------------------------------------------|
  9820. * | chan_phy_mode |
  9821. * word 12 | |
  9822. * |----------------------------------------------------------------|
  9823. * where,
  9824. * P - payload present bit (payload_present explained below)
  9825. * req_id - memory request id (mem_req_id explained below)
  9826. * S - status field (status explained below)
  9827. * capbw - capture bandwidth (capture_bw explained below)
  9828. * mode - mode of capture (mode explained below)
  9829. * sts - space time streams (sts_count explained below)
  9830. * chbw - channel bandwidth (channel_bw explained below)
  9831. * captype - capture type (cap_type explained below)
  9832. *
  9833. * The following field definitions describe the format of the CFR dump
  9834. * completion indication sent from the target to the host
  9835. *
  9836. * Header fields:
  9837. *
  9838. * Word 0
  9839. * - msg_type
  9840. * Bits 7:0
  9841. * Purpose: Identifies this as CFR TX completion indication
  9842. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  9843. * - payload_present
  9844. * Bit 8
  9845. * Purpose: Identifies how CFR data is sent to host
  9846. * Value: 0 - If CFR Payload is written to host memory
  9847. * 1 - If CFR Payload is sent as part of HTT message
  9848. * (This is the requirement for SDIO/USB where it is
  9849. * not possible to write CFR data to host memory)
  9850. * - reserved
  9851. * Bits 31:9
  9852. * Purpose: Reserved
  9853. * Value: 0
  9854. *
  9855. * Payload fields:
  9856. *
  9857. * Word 1
  9858. * - cfr_capture_msg_type
  9859. * Bits 31:0
  9860. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  9861. * to specify the format used for the remainder of the message
  9862. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9863. * (currently only MSG_TYPE_1 is defined)
  9864. *
  9865. * Word 2
  9866. * - mem_req_id
  9867. * Bits 6:0
  9868. * Purpose: Contain the mem request id of the region where the CFR capture
  9869. * has been stored - of type WMI_HOST_MEM_REQ_ID
  9870. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  9871. this value is invalid)
  9872. * - status
  9873. * Bit 7
  9874. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  9875. * Value: 1 (True) - Successful; 0 (False) - Not successful
  9876. * - capture_bw
  9877. * Bits 10:8
  9878. * Purpose: Carry the bandwidth of the CFR capture
  9879. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  9880. * - mode
  9881. * Bits 13:11
  9882. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  9883. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  9884. * - sts_count
  9885. * Bits 16:14
  9886. * Purpose: Carry the number of space time streams
  9887. * Value: Number of space time streams
  9888. * - channel_bw
  9889. * Bits 19:17
  9890. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  9891. * measurement
  9892. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  9893. * - cap_type
  9894. * Bits 23:20
  9895. * Purpose: Carry the type of the capture
  9896. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  9897. * - vdev_id
  9898. * Bits 31:24
  9899. * Purpose: Carry the virtual device id
  9900. * Value: vdev ID
  9901. *
  9902. * Word 3
  9903. * - mac_addr31to0
  9904. * Bits 31:0
  9905. * Purpose: Contain the bits 31:0 of the peer MAC address
  9906. * Value: Bits 31:0 of the peer MAC address
  9907. *
  9908. * Word 4
  9909. * - mac_addr47to32
  9910. * Bits 15:0
  9911. * Purpose: Contain the bits 47:32 of the peer MAC address
  9912. * Value: Bits 47:32 of the peer MAC address
  9913. *
  9914. * Word 5
  9915. * - index
  9916. * Bits 31:0
  9917. * Purpose: Contain the index at which this CFR dump was written in the Host
  9918. * allocated memory. This index is the number of bytes from the base address.
  9919. * Value: Index position
  9920. *
  9921. * Word 6
  9922. * - length
  9923. * Bits 31:0
  9924. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  9925. * Value: Length of the CFR capture of the peer
  9926. *
  9927. * Word 7
  9928. * - timestamp
  9929. * Bits 31:0
  9930. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  9931. * clock used for this timestamp is private to the target and not visible to
  9932. * the host i.e., Host can interpret only the relative timestamp deltas from
  9933. * one message to the next, but can't interpret the absolute timestamp from a
  9934. * single message.
  9935. * Value: Timestamp in microseconds
  9936. *
  9937. * Word 8
  9938. * - counter
  9939. * Bits 31:0
  9940. * Purpose: Carry the count of the current CFR capture from FW. This is
  9941. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  9942. * in host memory)
  9943. * Value: Count of the current CFR capture
  9944. *
  9945. * Word 9
  9946. * - chan_mhz
  9947. * Bits 31:0
  9948. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  9949. * Value: Primary 20 channel frequency
  9950. *
  9951. * Word 10
  9952. * - band_center_freq1
  9953. * Bits 31:0
  9954. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  9955. * Value: Center frequency 1 in MHz
  9956. *
  9957. * Word 11
  9958. * - band_center_freq2
  9959. * Bits 31:0
  9960. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  9961. * the VDEV
  9962. * 80plus80 mode
  9963. * Value: Center frequency 2 in MHz
  9964. *
  9965. * Word 12
  9966. * - chan_phy_mode
  9967. * Bits 31:0
  9968. * Purpose: Carry the phy mode of the channel, of the VDEV
  9969. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  9970. */
  9971. PREPACK struct htt_cfr_dump_ind_type_1 {
  9972. A_UINT32 mem_req_id:7,
  9973. status:1,
  9974. capture_bw:3,
  9975. mode:3,
  9976. sts_count:3,
  9977. channel_bw:3,
  9978. cap_type:4,
  9979. vdev_id:8;
  9980. htt_mac_addr addr;
  9981. A_UINT32 index;
  9982. A_UINT32 length;
  9983. A_UINT32 timestamp;
  9984. A_UINT32 counter;
  9985. struct htt_chan_change_msg chan;
  9986. } POSTPACK;
  9987. PREPACK struct htt_cfr_dump_compl_ind {
  9988. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  9989. union {
  9990. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  9991. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  9992. /* If there is a need to change the memory layout and its associated
  9993. * HTT indication format, a new CFR capture message type can be
  9994. * introduced and added into this union.
  9995. */
  9996. };
  9997. } POSTPACK;
  9998. /*
  9999. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10000. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10001. */
  10002. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10003. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10004. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10007. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10008. } while(0)
  10009. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10010. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10011. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10012. /*
  10013. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10014. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10015. */
  10016. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10017. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10018. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10019. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10020. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10021. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10022. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10023. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10024. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10025. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10026. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10027. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10028. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10029. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10030. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10031. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10032. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10035. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10036. } while (0)
  10037. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10038. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10039. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10040. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10041. do { \
  10042. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10043. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10044. } while (0)
  10045. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10046. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10047. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10048. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10049. do { \
  10050. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10051. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10052. } while (0)
  10053. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10054. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10055. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10056. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10059. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10060. } while (0)
  10061. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10062. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10063. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10064. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10068. } while (0)
  10069. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10071. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10072. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10073. do { \
  10074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10076. } while (0)
  10077. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10079. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10080. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10081. do { \
  10082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10084. } while (0)
  10085. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10087. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10088. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10091. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10092. } while (0)
  10093. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10094. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10095. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10096. #endif