htt.h 528 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. */
  177. #define HTT_CURRENT_VERSION_MAJOR 3
  178. #define HTT_CURRENT_VERSION_MINOR 64
  179. #define HTT_NUM_TX_FRAG_DESC 1024
  180. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  181. #define HTT_CHECK_SET_VAL(field, val) \
  182. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  183. /* macros to assist in sign-extending fields from HTT messages */
  184. #define HTT_SIGN_BIT_MASK(field) \
  185. ((field ## _M + (1 << field ## _S)) >> 1)
  186. #define HTT_SIGN_BIT(_val, field) \
  187. (_val & HTT_SIGN_BIT_MASK(field))
  188. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  189. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  190. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  191. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  192. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  193. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  194. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  195. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  196. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  197. /*
  198. * TEMPORARY:
  199. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  200. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  201. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  202. * updated.
  203. */
  204. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  205. /*
  206. * TEMPORARY:
  207. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  208. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  209. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  210. * updated.
  211. */
  212. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  213. /* HTT Access Category values */
  214. enum HTT_AC_WMM {
  215. /* WMM Access Categories */
  216. HTT_AC_WMM_BE = 0x0,
  217. HTT_AC_WMM_BK = 0x1,
  218. HTT_AC_WMM_VI = 0x2,
  219. HTT_AC_WMM_VO = 0x3,
  220. /* extension Access Categories */
  221. HTT_AC_EXT_NON_QOS = 0x4,
  222. HTT_AC_EXT_UCAST_MGMT = 0x5,
  223. HTT_AC_EXT_MCAST_DATA = 0x6,
  224. HTT_AC_EXT_MCAST_MGMT = 0x7,
  225. };
  226. enum HTT_AC_WMM_MASK {
  227. /* WMM Access Categories */
  228. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  229. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  230. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  231. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  232. /* extension Access Categories */
  233. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  234. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  235. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  236. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  237. };
  238. #define HTT_AC_MASK_WMM \
  239. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  240. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  241. #define HTT_AC_MASK_EXT \
  242. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  243. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  244. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  245. /*
  246. * htt_dbg_stats_type -
  247. * bit positions for each stats type within a stats type bitmask
  248. * The bitmask contains 24 bits.
  249. */
  250. enum htt_dbg_stats_type {
  251. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  252. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  253. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  254. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  255. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  256. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  257. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  258. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  259. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  260. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  261. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  262. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  263. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  264. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  265. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  266. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  267. /* bits 16-23 currently reserved */
  268. /* keep this last */
  269. HTT_DBG_NUM_STATS
  270. };
  271. /*=== HTT option selection TLVs ===
  272. * Certain HTT messages have alternatives or options.
  273. * For such cases, the host and target need to agree on which option to use.
  274. * Option specification TLVs can be appended to the VERSION_REQ and
  275. * VERSION_CONF messages to select options other than the default.
  276. * These TLVs are entirely optional - if they are not provided, there is a
  277. * well-defined default for each option. If they are provided, they can be
  278. * provided in any order. Each TLV can be present or absent independent of
  279. * the presence / absence of other TLVs.
  280. *
  281. * The HTT option selection TLVs use the following format:
  282. * |31 16|15 8|7 0|
  283. * |---------------------------------+----------------+----------------|
  284. * | value (payload) | length | tag |
  285. * |-------------------------------------------------------------------|
  286. * The value portion need not be only 2 bytes; it can be extended by any
  287. * integer number of 4-byte units. The total length of the TLV, including
  288. * the tag and length fields, must be a multiple of 4 bytes. The length
  289. * field specifies the total TLV size in 4-byte units. Thus, the typical
  290. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  291. * field, would store 0x1 in its length field, to show that the TLV occupies
  292. * a single 4-byte unit.
  293. */
  294. /*--- TLV header format - applies to all HTT option TLVs ---*/
  295. enum HTT_OPTION_TLV_TAGS {
  296. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  297. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  298. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  299. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  300. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  301. };
  302. PREPACK struct htt_option_tlv_header_t {
  303. A_UINT8 tag;
  304. A_UINT8 length;
  305. } POSTPACK;
  306. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  307. #define HTT_OPTION_TLV_TAG_S 0
  308. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  309. #define HTT_OPTION_TLV_LENGTH_S 8
  310. /*
  311. * value0 - 16 bit value field stored in word0
  312. * The TLV's value field may be longer than 2 bytes, in which case
  313. * the remainder of the value is stored in word1, word2, etc.
  314. */
  315. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  316. #define HTT_OPTION_TLV_VALUE0_S 16
  317. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  318. do { \
  319. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  320. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  321. } while (0)
  322. #define HTT_OPTION_TLV_TAG_GET(word) \
  323. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  324. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  325. do { \
  326. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  327. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  328. } while (0)
  329. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  330. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  331. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  332. do { \
  333. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  334. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  335. } while (0)
  336. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  337. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  338. /*--- format of specific HTT option TLVs ---*/
  339. /*
  340. * HTT option TLV for specifying LL bus address size
  341. * Some chips require bus addresses used by the target to access buffers
  342. * within the host's memory to be 32 bits; others require bus addresses
  343. * used by the target to access buffers within the host's memory to be
  344. * 64 bits.
  345. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  346. * a suffix to the VERSION_CONF message to specify which bus address format
  347. * the target requires.
  348. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  349. * default to providing bus addresses to the target in 32-bit format.
  350. */
  351. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  352. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  353. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  354. };
  355. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  356. struct htt_option_tlv_header_t hdr;
  357. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  358. } POSTPACK;
  359. /*
  360. * HTT option TLV for specifying whether HL systems should indicate
  361. * over-the-air tx completion for individual frames, or should instead
  362. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  363. * requests an OTA tx completion for a particular tx frame.
  364. * This option does not apply to LL systems, where the TX_COMPL_IND
  365. * is mandatory.
  366. * This option is primarily intended for HL systems in which the tx frame
  367. * downloads over the host --> target bus are as slow as or slower than
  368. * the transmissions over the WLAN PHY. For cases where the bus is faster
  369. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  370. * and consquently will send one TX_COMPL_IND message that covers several
  371. * tx frames. For cases where the WLAN PHY is faster than the bus,
  372. * the target will end up transmitting very short A-MPDUs, and consequently
  373. * sending many TX_COMPL_IND messages, which each cover a very small number
  374. * of tx frames.
  375. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  376. * a suffix to the VERSION_REQ message to request whether the host desires to
  377. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  378. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  379. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  380. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  381. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  382. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  383. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  384. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  385. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  386. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  387. * TLV.
  388. */
  389. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  390. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  391. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  392. };
  393. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  394. struct htt_option_tlv_header_t hdr;
  395. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  396. } POSTPACK;
  397. /*
  398. * HTT option TLV for specifying how many tx queue groups the target
  399. * may establish.
  400. * This TLV specifies the maximum value the target may send in the
  401. * txq_group_id field of any TXQ_GROUP information elements sent by
  402. * the target to the host. This allows the host to pre-allocate an
  403. * appropriate number of tx queue group structs.
  404. *
  405. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  406. * a suffix to the VERSION_REQ message to specify whether the host supports
  407. * tx queue groups at all, and if so if there is any limit on the number of
  408. * tx queue groups that the host supports.
  409. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  410. * a suffix to the VERSION_CONF message. If the host has specified in the
  411. * VER_REQ message a limit on the number of tx queue groups the host can
  412. * supprt, the target shall limit its specification of the maximum tx groups
  413. * to be no larger than this host-specified limit.
  414. *
  415. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  416. * shall preallocate 4 tx queue group structs, and the target shall not
  417. * specify a txq_group_id larger than 3.
  418. */
  419. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  420. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  421. /*
  422. * values 1 through N specify the max number of tx queue groups
  423. * the sender supports
  424. */
  425. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  426. };
  427. /* TEMPORARY backwards-compatibility alias for a typo fix -
  428. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  429. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  430. * to support the old name (with the typo) until all references to the
  431. * old name are replaced with the new name.
  432. */
  433. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  434. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  435. struct htt_option_tlv_header_t hdr;
  436. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  437. } POSTPACK;
  438. /*
  439. * HTT option TLV for specifying whether the target supports an extended
  440. * version of the HTT tx descriptor. If the target provides this TLV
  441. * and specifies in the TLV that the target supports an extended version
  442. * of the HTT tx descriptor, the target must check the "extension" bit in
  443. * the HTT tx descriptor, and if the extension bit is set, to expect a
  444. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  445. * descriptor. Furthermore, the target must provide room for the HTT
  446. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  447. * This option is intended for systems where the host needs to explicitly
  448. * control the transmission parameters such as tx power for individual
  449. * tx frames.
  450. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  451. * as a suffix to the VERSION_CONF message to explicitly specify whether
  452. * the target supports the HTT tx MSDU extension descriptor.
  453. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  454. * by the host as lack of target support for the HTT tx MSDU extension
  455. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  456. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  457. * the HTT tx MSDU extension descriptor.
  458. * The host is not required to provide the HTT tx MSDU extension descriptor
  459. * just because the target supports it; the target must check the
  460. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  461. * extension descriptor is present.
  462. */
  463. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  464. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  465. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  466. };
  467. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  468. struct htt_option_tlv_header_t hdr;
  469. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  470. } POSTPACK;
  471. /*=== host -> target messages ===============================================*/
  472. enum htt_h2t_msg_type {
  473. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  474. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  475. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  476. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  477. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  478. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  479. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  480. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  481. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  482. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  483. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  484. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  485. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  486. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  487. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  488. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  489. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  490. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  491. /* keep this last */
  492. HTT_H2T_NUM_MSGS
  493. };
  494. /*
  495. * HTT host to target message type -
  496. * stored in bits 7:0 of the first word of the message
  497. */
  498. #define HTT_H2T_MSG_TYPE_M 0xff
  499. #define HTT_H2T_MSG_TYPE_S 0
  500. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  501. do { \
  502. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  503. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  504. } while (0)
  505. #define HTT_H2T_MSG_TYPE_GET(word) \
  506. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  507. /**
  508. * @brief host -> target version number request message definition
  509. *
  510. * |31 24|23 16|15 8|7 0|
  511. * |----------------+----------------+----------------+----------------|
  512. * | reserved | msg type |
  513. * |-------------------------------------------------------------------|
  514. * : option request TLV (optional) |
  515. * :...................................................................:
  516. *
  517. * The VER_REQ message may consist of a single 4-byte word, or may be
  518. * extended with TLVs that specify which HTT options the host is requesting
  519. * from the target.
  520. * The following option TLVs may be appended to the VER_REQ message:
  521. * - HL_SUPPRESS_TX_COMPL_IND
  522. * - HL_MAX_TX_QUEUE_GROUPS
  523. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  524. * may be appended to the VER_REQ message (but only one TLV of each type).
  525. *
  526. * Header fields:
  527. * - MSG_TYPE
  528. * Bits 7:0
  529. * Purpose: identifies this as a version number request message
  530. * Value: 0x0
  531. */
  532. #define HTT_VER_REQ_BYTES 4
  533. /* TBDXXX: figure out a reasonable number */
  534. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  535. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  536. /**
  537. * @brief HTT tx MSDU descriptor
  538. *
  539. * @details
  540. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  541. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  542. * the target firmware needs for the FW's tx processing, particularly
  543. * for creating the HW msdu descriptor.
  544. * The same HTT tx descriptor is used for HL and LL systems, though
  545. * a few fields within the tx descriptor are used only by LL or
  546. * only by HL.
  547. * The HTT tx descriptor is defined in two manners: by a struct with
  548. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  549. * definitions.
  550. * The target should use the struct def, for simplicitly and clarity,
  551. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  552. * neutral. Specifically, the host shall use the get/set macros built
  553. * around the mask + shift defs.
  554. */
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  557. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  563. #define HTT_TX_VDEV_ID_WORD 0
  564. #define HTT_TX_VDEV_ID_MASK 0x3f
  565. #define HTT_TX_VDEV_ID_SHIFT 16
  566. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  567. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  568. #define HTT_TX_MSDU_LEN_DWORD 1
  569. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  570. /*
  571. * HTT_VAR_PADDR macros
  572. * Allow physical / bus addresses to be either a single 32-bit value,
  573. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  574. */
  575. #define HTT_VAR_PADDR32(var_name) \
  576. A_UINT32 var_name
  577. #define HTT_VAR_PADDR64_LE(var_name) \
  578. struct { \
  579. /* little-endian: lo precedes hi */ \
  580. A_UINT32 lo; \
  581. A_UINT32 hi; \
  582. } var_name
  583. /*
  584. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  585. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  586. * addresses are stored in a XXX-bit field.
  587. * This macro is used to define both htt_tx_msdu_desc32_t and
  588. * htt_tx_msdu_desc64_t structs.
  589. */
  590. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  591. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  592. { \
  593. /* DWORD 0: flags and meta-data */ \
  594. A_UINT32 \
  595. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  596. \
  597. /* pkt_subtype - \
  598. * Detailed specification of the tx frame contents, extending the \
  599. * general specification provided by pkt_type. \
  600. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  601. * pkt_type | pkt_subtype \
  602. * ============================================================== \
  603. * 802.3 | bit 0:3 - Reserved \
  604. * | bit 4: 0x0 - Copy-Engine Classification Results \
  605. * | not appended to the HTT message \
  606. * | 0x1 - Copy-Engine Classification Results \
  607. * | appended to the HTT message in the \
  608. * | format: \
  609. * | [HTT tx desc, frame header, \
  610. * | CE classification results] \
  611. * | The CE classification results begin \
  612. * | at the next 4-byte boundary after \
  613. * | the frame header. \
  614. * ------------+------------------------------------------------- \
  615. * Eth2 | bit 0:3 - Reserved \
  616. * | bit 4: 0x0 - Copy-Engine Classification Results \
  617. * | not appended to the HTT message \
  618. * | 0x1 - Copy-Engine Classification Results \
  619. * | appended to the HTT message. \
  620. * | See the above specification of the \
  621. * | CE classification results location. \
  622. * ------------+------------------------------------------------- \
  623. * native WiFi | bit 0:3 - Reserved \
  624. * | bit 4: 0x0 - Copy-Engine Classification Results \
  625. * | not appended to the HTT message \
  626. * | 0x1 - Copy-Engine Classification Results \
  627. * | appended to the HTT message. \
  628. * | See the above specification of the \
  629. * | CE classification results location. \
  630. * ------------+------------------------------------------------- \
  631. * mgmt | 0x0 - 802.11 MAC header absent \
  632. * | 0x1 - 802.11 MAC header present \
  633. * ------------+------------------------------------------------- \
  634. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  635. * | 0x1 - 802.11 MAC header present \
  636. * | bit 1: 0x0 - allow aggregation \
  637. * | 0x1 - don't allow aggregation \
  638. * | bit 2: 0x0 - perform encryption \
  639. * | 0x1 - don't perform encryption \
  640. * | bit 3: 0x0 - perform tx classification / queuing \
  641. * | 0x1 - don't perform tx classification; \
  642. * | insert the frame into the "misc" \
  643. * | tx queue \
  644. * | bit 4: 0x0 - Copy-Engine Classification Results \
  645. * | not appended to the HTT message \
  646. * | 0x1 - Copy-Engine Classification Results \
  647. * | appended to the HTT message. \
  648. * | See the above specification of the \
  649. * | CE classification results location. \
  650. */ \
  651. pkt_subtype: 5, \
  652. \
  653. /* pkt_type - \
  654. * General specification of the tx frame contents. \
  655. * The htt_pkt_type enum should be used to specify and check the \
  656. * value of this field. \
  657. */ \
  658. pkt_type: 3, \
  659. \
  660. /* vdev_id - \
  661. * ID for the vdev that is sending this tx frame. \
  662. * For certain non-standard packet types, e.g. pkt_type == raw \
  663. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  664. * This field is used primarily for determining where to queue \
  665. * broadcast and multicast frames. \
  666. */ \
  667. vdev_id: 6, \
  668. /* ext_tid - \
  669. * The extended traffic ID. \
  670. * If the TID is unknown, the extended TID is set to \
  671. * HTT_TX_EXT_TID_INVALID. \
  672. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  673. * value of the QoS TID. \
  674. * If the tx frame is non-QoS data, then the extended TID is set to \
  675. * HTT_TX_EXT_TID_NON_QOS. \
  676. * If the tx frame is multicast or broadcast, then the extended TID \
  677. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  678. */ \
  679. ext_tid: 5, \
  680. \
  681. /* postponed - \
  682. * This flag indicates whether the tx frame has been downloaded to \
  683. * the target before but discarded by the target, and now is being \
  684. * downloaded again; or if this is a new frame that is being \
  685. * downloaded for the first time. \
  686. * This flag allows the target to determine the correct order for \
  687. * transmitting new vs. old frames. \
  688. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  689. * This flag only applies to HL systems, since in LL systems, \
  690. * the tx flow control is handled entirely within the target. \
  691. */ \
  692. postponed: 1, \
  693. \
  694. /* extension - \
  695. * This flag indicates whether a HTT tx MSDU extension descriptor \
  696. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  697. * \
  698. * 0x0 - no extension MSDU descriptor is present \
  699. * 0x1 - an extension MSDU descriptor immediately follows the \
  700. * regular MSDU descriptor \
  701. */ \
  702. extension: 1, \
  703. \
  704. /* cksum_offload - \
  705. * This flag indicates whether checksum offload is enabled or not \
  706. * for this frame. Target FW use this flag to turn on HW checksumming \
  707. * 0x0 - No checksum offload \
  708. * 0x1 - L3 header checksum only \
  709. * 0x2 - L4 checksum only \
  710. * 0x3 - L3 header checksum + L4 checksum \
  711. */ \
  712. cksum_offload: 2, \
  713. \
  714. /* tx_comp_req - \
  715. * This flag indicates whether Tx Completion \
  716. * from fw is required or not. \
  717. * This flag is only relevant if tx completion is not \
  718. * universally enabled. \
  719. * For all LL systems, tx completion is mandatory, \
  720. * so this flag will be irrelevant. \
  721. * For HL systems tx completion is optional, but HL systems in which \
  722. * the bus throughput exceeds the WLAN throughput will \
  723. * probably want to always use tx completion, and thus \
  724. * would not check this flag. \
  725. * This flag is required when tx completions are not used universally, \
  726. * but are still required for certain tx frames for which \
  727. * an OTA delivery acknowledgment is needed by the host. \
  728. * In practice, this would be for HL systems in which the \
  729. * bus throughput is less than the WLAN throughput. \
  730. * \
  731. * 0x0 - Tx Completion Indication from Fw not required \
  732. * 0x1 - Tx Completion Indication from Fw is required \
  733. */ \
  734. tx_compl_req: 1; \
  735. \
  736. \
  737. /* DWORD 1: MSDU length and ID */ \
  738. A_UINT32 \
  739. len: 16, /* MSDU length, in bytes */ \
  740. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  741. * and this id is used to calculate fragmentation \
  742. * descriptor pointer inside the target based on \
  743. * the base address, configured inside the target. \
  744. */ \
  745. \
  746. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  747. /* frags_desc_ptr - \
  748. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  749. * where the tx frame's fragments reside in memory. \
  750. * This field only applies to LL systems, since in HL systems the \
  751. * (degenerate single-fragment) fragmentation descriptor is created \
  752. * within the target. \
  753. */ \
  754. _paddr__frags_desc_ptr_; \
  755. \
  756. /* DWORD 3 (or 4): peerid, chanfreq */ \
  757. /* \
  758. * Peer ID : Target can use this value to know which peer-id packet \
  759. * destined to. \
  760. * It's intended to be specified by host in case of NAWDS. \
  761. */ \
  762. A_UINT16 peerid; \
  763. \
  764. /* \
  765. * Channel frequency: This identifies the desired channel \
  766. * frequency (in mhz) for tx frames. This is used by FW to help \
  767. * determine when it is safe to transmit or drop frames for \
  768. * off-channel operation. \
  769. * The default value of zero indicates to FW that the corresponding \
  770. * VDEV's home channel (if there is one) is the desired channel \
  771. * frequency. \
  772. */ \
  773. A_UINT16 chanfreq; \
  774. \
  775. /* Reason reserved is commented is increasing the htt structure size \
  776. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  777. * A_UINT32 reserved_dword3_bits0_31; \
  778. */ \
  779. } POSTPACK
  780. /* define a htt_tx_msdu_desc32_t type */
  781. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  782. /* define a htt_tx_msdu_desc64_t type */
  783. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  784. /*
  785. * Make htt_tx_msdu_desc_t be an alias for either
  786. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  787. */
  788. #if HTT_PADDR64
  789. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  790. #else
  791. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  792. #endif
  793. /* decriptor information for Management frame*/
  794. /*
  795. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  796. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  797. */
  798. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  799. extern A_UINT32 mgmt_hdr_len;
  800. PREPACK struct htt_mgmt_tx_desc_t {
  801. A_UINT32 msg_type;
  802. #if HTT_PADDR64
  803. A_UINT64 frag_paddr; /* DMAble address of the data */
  804. #else
  805. A_UINT32 frag_paddr; /* DMAble address of the data */
  806. #endif
  807. A_UINT32 desc_id; /* returned to host during completion
  808. * to free the meory*/
  809. A_UINT32 len; /* Fragment length */
  810. A_UINT32 vdev_id; /* virtual device ID*/
  811. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  812. } POSTPACK;
  813. PREPACK struct htt_mgmt_tx_compl_ind {
  814. A_UINT32 desc_id;
  815. A_UINT32 status;
  816. } POSTPACK;
  817. /*
  818. * This SDU header size comes from the summation of the following:
  819. * 1. Max of:
  820. * a. Native WiFi header, for native WiFi frames: 24 bytes
  821. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  822. * b. 802.11 header, for raw frames: 36 bytes
  823. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  824. * QoS header, HT header)
  825. * c. 802.3 header, for ethernet frames: 14 bytes
  826. * (destination address, source address, ethertype / length)
  827. * 2. Max of:
  828. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  829. * b. IPv6 header, up through the Traffic Class: 2 bytes
  830. * 3. 802.1Q VLAN header: 4 bytes
  831. * 4. LLC/SNAP header: 8 bytes
  832. */
  833. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  834. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  835. #define HTT_TX_HDR_SIZE_ETHERNET 14
  836. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  837. A_COMPILE_TIME_ASSERT(
  838. htt_encap_hdr_size_max_check_nwifi,
  839. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  840. A_COMPILE_TIME_ASSERT(
  841. htt_encap_hdr_size_max_check_enet,
  842. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  843. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  844. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  845. #define HTT_TX_HDR_SIZE_802_1Q 4
  846. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  847. #define HTT_COMMON_TX_FRM_HDR_LEN \
  848. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  849. HTT_TX_HDR_SIZE_802_1Q + \
  850. HTT_TX_HDR_SIZE_LLC_SNAP)
  851. #define HTT_HL_TX_FRM_HDR_LEN \
  852. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  853. #define HTT_LL_TX_FRM_HDR_LEN \
  854. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  855. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  856. /* dword 0 */
  857. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  858. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  859. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  860. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  861. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  862. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  863. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  864. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  865. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  866. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  868. #define HTT_TX_DESC_PKT_TYPE_S 13
  869. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  870. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  872. #define HTT_TX_DESC_VDEV_ID_S 16
  873. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  876. #define HTT_TX_DESC_EXT_TID_S 22
  877. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  880. #define HTT_TX_DESC_POSTPONED_S 27
  881. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  882. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  884. #define HTT_TX_DESC_EXTENSION_S 28
  885. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  886. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  887. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  888. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  889. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  890. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  892. #define HTT_TX_DESC_TX_COMP_S 31
  893. /* dword 1 */
  894. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  895. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  896. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  897. #define HTT_TX_DESC_FRM_LEN_S 0
  898. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  899. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  900. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  901. #define HTT_TX_DESC_FRM_ID_S 16
  902. /* dword 2 */
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  905. /* for systems using 64-bit format for bus addresses */
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  907. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  908. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  910. /* for systems using 32-bit format for bus addresses */
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  913. /* dword 3 */
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  917. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  919. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  920. #if HTT_PADDR64
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  923. #else
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  925. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  926. #endif
  927. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  928. #define HTT_TX_DESC_PEER_ID_S 0
  929. /*
  930. * TEMPORARY:
  931. * The original definitions for the PEER_ID fields contained typos
  932. * (with _DESC_PADDR appended to this PEER_ID field name).
  933. * Retain deprecated original names for PEER_ID fields until all code that
  934. * refers to them has been updated.
  935. */
  936. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  937. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  938. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  939. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  940. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  941. HTT_TX_DESC_PEER_ID_M
  942. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  943. HTT_TX_DESC_PEER_ID_S
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  947. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  949. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  950. #if HTT_PADDR64
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  953. #else
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  955. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  956. #endif
  957. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  958. #define HTT_TX_DESC_CHAN_FREQ_S 16
  959. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  960. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  961. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  962. do { \
  963. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  964. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  965. } while (0)
  966. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  967. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  968. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  969. do { \
  970. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  971. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  972. } while (0)
  973. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  974. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  975. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  976. do { \
  977. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  978. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  979. } while (0)
  980. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  981. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  982. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  983. do { \
  984. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  985. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  986. } while (0)
  987. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  988. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  989. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  990. do { \
  991. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  992. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  993. } while (0)
  994. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  995. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  996. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  997. do { \
  998. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  999. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1000. } while (0)
  1001. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1002. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1003. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1004. do { \
  1005. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1006. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1007. } while (0)
  1008. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1009. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1010. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1011. do { \
  1012. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1013. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1014. } while (0)
  1015. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1016. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1017. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1018. do { \
  1019. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1020. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1021. } while (0)
  1022. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1023. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1024. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1025. do { \
  1026. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1027. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1028. } while (0)
  1029. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1030. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1031. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1032. do { \
  1033. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1034. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1035. } while (0)
  1036. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1037. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1038. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1039. do { \
  1040. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1041. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1042. } while (0)
  1043. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1044. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1045. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1046. do { \
  1047. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1048. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1049. } while (0)
  1050. /* enums used in the HTT tx MSDU extension descriptor */
  1051. enum {
  1052. htt_tx_guard_interval_regular = 0,
  1053. htt_tx_guard_interval_short = 1,
  1054. };
  1055. enum {
  1056. htt_tx_preamble_type_ofdm = 0,
  1057. htt_tx_preamble_type_cck = 1,
  1058. htt_tx_preamble_type_ht = 2,
  1059. htt_tx_preamble_type_vht = 3,
  1060. };
  1061. enum {
  1062. htt_tx_bandwidth_5MHz = 0,
  1063. htt_tx_bandwidth_10MHz = 1,
  1064. htt_tx_bandwidth_20MHz = 2,
  1065. htt_tx_bandwidth_40MHz = 3,
  1066. htt_tx_bandwidth_80MHz = 4,
  1067. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1068. };
  1069. /**
  1070. * @brief HTT tx MSDU extension descriptor
  1071. * @details
  1072. * If the target supports HTT tx MSDU extension descriptors, the host has
  1073. * the option of appending the following struct following the regular
  1074. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1075. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1076. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1077. * tx specs for each frame.
  1078. */
  1079. PREPACK struct htt_tx_msdu_desc_ext_t {
  1080. /* DWORD 0: flags */
  1081. A_UINT32
  1082. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1083. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1084. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1085. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1086. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1087. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1088. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1089. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1090. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1091. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1092. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1093. /* DWORD 1: tx power, tx rate, tx BW */
  1094. A_UINT32
  1095. /* pwr -
  1096. * Specify what power the tx frame needs to be transmitted at.
  1097. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1098. * The value needs to be appropriately sign-extended when extracting
  1099. * the value from the message and storing it in a variable that is
  1100. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1101. * automatically handles this sign-extension.)
  1102. * If the transmission uses multiple tx chains, this power spec is
  1103. * the total transmit power, assuming incoherent combination of
  1104. * per-chain power to produce the total power.
  1105. */
  1106. pwr: 8,
  1107. /* mcs_mask -
  1108. * Specify the allowable values for MCS index (modulation and coding)
  1109. * to use for transmitting the frame.
  1110. *
  1111. * For HT / VHT preamble types, this mask directly corresponds to
  1112. * the HT or VHT MCS indices that are allowed. For each bit N set
  1113. * within the mask, MCS index N is allowed for transmitting the frame.
  1114. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1115. * rates versus OFDM rates, so the host has the option of specifying
  1116. * that the target must transmit the frame with CCK or OFDM rates
  1117. * (not HT or VHT), but leaving the decision to the target whether
  1118. * to use CCK or OFDM.
  1119. *
  1120. * For CCK and OFDM, the bits within this mask are interpreted as
  1121. * follows:
  1122. * bit 0 -> CCK 1 Mbps rate is allowed
  1123. * bit 1 -> CCK 2 Mbps rate is allowed
  1124. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1125. * bit 3 -> CCK 11 Mbps rate is allowed
  1126. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1127. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1128. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1129. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1130. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1131. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1132. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1133. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1134. *
  1135. * The MCS index specification needs to be compatible with the
  1136. * bandwidth mask specification. For example, a MCS index == 9
  1137. * specification is inconsistent with a preamble type == VHT,
  1138. * Nss == 1, and channel bandwidth == 20 MHz.
  1139. *
  1140. * Furthermore, the host has only a limited ability to specify to
  1141. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1142. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1143. */
  1144. mcs_mask: 12,
  1145. /* nss_mask -
  1146. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1147. * Each bit in this mask corresponds to a Nss value:
  1148. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1149. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1150. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1151. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1152. * The values in the Nss mask must be suitable for the recipient, e.g.
  1153. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1154. * recipient which only supports 2x2 MIMO.
  1155. */
  1156. nss_mask: 4,
  1157. /* guard_interval -
  1158. * Specify a htt_tx_guard_interval enum value to indicate whether
  1159. * the transmission should use a regular guard interval or a
  1160. * short guard interval.
  1161. */
  1162. guard_interval: 1,
  1163. /* preamble_type_mask -
  1164. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1165. * may choose from for transmitting this frame.
  1166. * The bits in this mask correspond to the values in the
  1167. * htt_tx_preamble_type enum. For example, to allow the target
  1168. * to transmit the frame as either CCK or OFDM, this field would
  1169. * be set to
  1170. * (1 << htt_tx_preamble_type_ofdm) |
  1171. * (1 << htt_tx_preamble_type_cck)
  1172. */
  1173. preamble_type_mask: 4,
  1174. reserved1_31_29: 3; /* unused, set to 0x0 */
  1175. /* DWORD 2: tx chain mask, tx retries */
  1176. A_UINT32
  1177. /* chain_mask - specify which chains to transmit from */
  1178. chain_mask: 4,
  1179. /* retry_limit -
  1180. * Specify the maximum number of transmissions, including the
  1181. * initial transmission, to attempt before giving up if no ack
  1182. * is received.
  1183. * If the tx rate is specified, then all retries shall use the
  1184. * same rate as the initial transmission.
  1185. * If no tx rate is specified, the target can choose whether to
  1186. * retain the original rate during the retransmissions, or to
  1187. * fall back to a more robust rate.
  1188. */
  1189. retry_limit: 4,
  1190. /* bandwidth_mask -
  1191. * Specify what channel widths may be used for the transmission.
  1192. * A value of zero indicates "don't care" - the target may choose
  1193. * the transmission bandwidth.
  1194. * The bits within this mask correspond to the htt_tx_bandwidth
  1195. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1196. * The bandwidth_mask must be consistent with the preamble_type_mask
  1197. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1198. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1199. */
  1200. bandwidth_mask: 6,
  1201. reserved2_31_14: 18; /* unused, set to 0x0 */
  1202. /* DWORD 3: tx expiry time (TSF) LSBs */
  1203. A_UINT32 expire_tsf_lo;
  1204. /* DWORD 4: tx expiry time (TSF) MSBs */
  1205. A_UINT32 expire_tsf_hi;
  1206. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1207. } POSTPACK;
  1208. /* DWORD 0 */
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1229. /* DWORD 1 */
  1230. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1231. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1232. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1233. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1234. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1235. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1236. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1237. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1238. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1239. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1240. /* DWORD 2 */
  1241. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1242. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1243. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1244. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1245. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1246. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1247. /* DWORD 0 */
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1249. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1250. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1255. } while (0)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1257. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1258. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1260. do { \
  1261. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1262. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL( \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1271. ((_var) |= ((_val) \
  1272. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1273. } while (0)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1275. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1276. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL( \
  1280. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1281. ((_var) |= ((_val) \
  1282. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1283. } while (0)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1285. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1290. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1291. } while (0)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1293. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1294. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1299. } while (0)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1301. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1307. } while (0)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1309. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1310. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1315. } while (0)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1317. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1318. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1323. } while (0)
  1324. /* DWORD 1 */
  1325. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1329. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1330. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1331. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1332. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1333. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1334. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1335. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1336. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1337. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1341. } while (0)
  1342. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1343. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1344. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1345. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1349. } while (0)
  1350. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1357. } while (0)
  1358. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1365. } while (0)
  1366. /* DWORD 2 */
  1367. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1374. } while (0)
  1375. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1382. } while (0)
  1383. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1384. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1385. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1386. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1390. } while (0)
  1391. typedef enum {
  1392. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1393. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1394. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1395. } htt_11ax_ltf_subtype_t;
  1396. typedef enum {
  1397. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1398. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1399. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1400. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1401. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1402. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1403. } htt_tx_ext2_preamble_type_t;
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1416. /**
  1417. * @brief HTT tx MSDU extension descriptor v2
  1418. * @details
  1419. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1420. * is received as tcl_exit_base->host_meta_info in firmware.
  1421. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1422. * are already part of tcl_exit_base.
  1423. */
  1424. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1425. /* DWORD 0: flags */
  1426. A_UINT32
  1427. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1428. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1429. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1430. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1431. valid_retries : 1, /* if set, tx retries spec is valid */
  1432. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1433. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1434. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1435. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1436. valid_key_flags : 1, /* if set, key flags is valid */
  1437. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1438. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1439. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1440. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1441. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1442. 1 = ENCRYPT,
  1443. 2 ~ 3 - Reserved */
  1444. /* retry_limit -
  1445. * Specify the maximum number of transmissions, including the
  1446. * initial transmission, to attempt before giving up if no ack
  1447. * is received.
  1448. * If the tx rate is specified, then all retries shall use the
  1449. * same rate as the initial transmission.
  1450. * If no tx rate is specified, the target can choose whether to
  1451. * retain the original rate during the retransmissions, or to
  1452. * fall back to a more robust rate.
  1453. */
  1454. retry_limit : 4,
  1455. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1456. * Valid only for 11ax preamble types HE_SU
  1457. * and HE_EXT_SU
  1458. */
  1459. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1460. * Valid only for 11ax preamble types HE_SU
  1461. * and HE_EXT_SU
  1462. */
  1463. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1464. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1465. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1466. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1467. */
  1468. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1469. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1470. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1471. * Use cases:
  1472. * Any time firmware uses TQM-BYPASS for Data
  1473. * TID, firmware expect host to set this bit.
  1474. */
  1475. /* DWORD 1: tx power, tx rate */
  1476. A_UINT32
  1477. power : 8, /* unit of the power field is 0.5 dbm
  1478. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1479. * signed value ranging from -64dbm to 63.5 dbm
  1480. */
  1481. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1482. * Setting more than one MCS 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 MCS values.
  1487. */
  1488. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1489. * Setting more than one Nss isn't currently
  1490. * supported by the target (but is supported
  1491. * in the interface in case in the future
  1492. * the target supports specifications of
  1493. * a limited set of Nss values.
  1494. */
  1495. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1496. update_peer_cache : 1; /* When set these custom values will be
  1497. * used for all packets, until the next
  1498. * update via this ext header.
  1499. * This is to make sure not all packets
  1500. * need to include this header.
  1501. */
  1502. /* DWORD 2: tx chain mask, tx retries */
  1503. A_UINT32
  1504. /* chain_mask - specify which chains to transmit from */
  1505. chain_mask : 8,
  1506. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1507. * TODO: Update Enum values for key_flags
  1508. */
  1509. /*
  1510. * Channel frequency: This identifies the desired channel
  1511. * frequency (in MHz) for tx frames. This is used by FW to help
  1512. * determine when it is safe to transmit or drop frames for
  1513. * off-channel operation.
  1514. * The default value of zero indicates to FW that the corresponding
  1515. * VDEV's home channel (if there is one) is the desired channel
  1516. * frequency.
  1517. */
  1518. chanfreq : 16;
  1519. /* DWORD 3: tx expiry time (TSF) LSBs */
  1520. A_UINT32 expire_tsf_lo;
  1521. /* DWORD 4: tx expiry time (TSF) MSBs */
  1522. A_UINT32 expire_tsf_hi;
  1523. /* DWORD 5: reserved
  1524. * This structure can be expanded further up to 60 bytes
  1525. * by adding further DWORDs as needed.
  1526. */
  1527. A_UINT32
  1528. /* learning_frame
  1529. * When this flag is set, this frame will be dropped by FW
  1530. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1531. */
  1532. learning_frame : 1,
  1533. rsvd0 : 31;
  1534. } POSTPACK;
  1535. /* DWORD 0 */
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1562. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1563. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1564. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1565. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1566. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1567. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1568. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1569. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1570. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1571. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1572. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1573. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1574. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1575. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1576. /* DWORD 1 */
  1577. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1578. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1579. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1580. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1581. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1582. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1583. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1584. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1585. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1586. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1587. /* DWORD 2 */
  1588. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1589. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1590. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1591. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1592. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1593. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1594. /* DWORD 5 */
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1597. /* DWORD 0 */
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1600. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1604. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1608. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1616. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1620. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1624. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL( \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1629. ((_var) |= ((_val) \
  1630. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1634. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL( \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1655. ((_var) |= ((_val) \
  1656. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1657. } while (0)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1659. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1660. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1668. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1676. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1689. } while (0)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1691. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1692. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1694. do { \
  1695. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1696. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1697. } while (0)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1699. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1700. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1702. do { \
  1703. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1704. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1705. } while (0)
  1706. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1707. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1708. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1709. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1710. do { \
  1711. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1712. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1713. } while (0)
  1714. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1715. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1716. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1717. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1718. do { \
  1719. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1720. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1721. } while (0)
  1722. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1723. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1724. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1725. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1726. do { \
  1727. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1728. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1729. } while (0)
  1730. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1731. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1732. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1733. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1734. do { \
  1735. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1736. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1737. } while (0)
  1738. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1739. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1740. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1741. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1742. do { \
  1743. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1744. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1745. } while (0)
  1746. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1747. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1748. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1749. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1750. do { \
  1751. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1752. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1753. } while (0)
  1754. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1755. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1756. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1757. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1758. do { \
  1759. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1760. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1761. } while (0)
  1762. /* DWORD 1 */
  1763. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1767. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1768. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1769. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1770. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1771. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1772. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1773. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1774. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1775. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1776. do { \
  1777. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1778. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1779. } while (0)
  1780. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1781. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1782. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1783. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1784. do { \
  1785. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1786. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1787. } while (0)
  1788. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1794. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1795. } while (0)
  1796. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1797. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1798. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1799. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1800. do { \
  1801. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1802. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1803. } while (0)
  1804. /* DWORD 2 */
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1809. do { \
  1810. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1811. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1812. } while (0)
  1813. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1814. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1815. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1816. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1817. do { \
  1818. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1819. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1820. } while (0)
  1821. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1823. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1824. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1828. } while (0)
  1829. /* DWORD 5 */
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1837. } while (0)
  1838. typedef enum {
  1839. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1840. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1841. } htt_tcl_metadata_type;
  1842. /**
  1843. * @brief HTT TCL command number format
  1844. * @details
  1845. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1846. * available to firmware as tcl_exit_base->tcl_status_number.
  1847. * For regular / multicast packets host will send vdev and mac id and for
  1848. * NAWDS packets, host will send peer id.
  1849. * A_UINT32 is used to avoid endianness conversion problems.
  1850. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1851. */
  1852. typedef struct {
  1853. A_UINT32
  1854. type: 1, /* vdev_id based or peer_id based */
  1855. rsvd: 31;
  1856. } htt_tx_tcl_vdev_or_peer_t;
  1857. typedef struct {
  1858. A_UINT32
  1859. type: 1, /* vdev_id based or peer_id based */
  1860. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1861. vdev_id: 8,
  1862. pdev_id: 2,
  1863. host_inspected:1,
  1864. rsvd: 19;
  1865. } htt_tx_tcl_vdev_metadata;
  1866. typedef struct {
  1867. A_UINT32
  1868. type: 1, /* vdev_id based or peer_id based */
  1869. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1870. peer_id: 14,
  1871. rsvd: 16;
  1872. } htt_tx_tcl_peer_metadata;
  1873. PREPACK struct htt_tx_tcl_metadata {
  1874. union {
  1875. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1876. htt_tx_tcl_vdev_metadata vdev_meta;
  1877. htt_tx_tcl_peer_metadata peer_meta;
  1878. };
  1879. } POSTPACK;
  1880. /* DWORD 0 */
  1881. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1882. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1883. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1884. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1885. /* VDEV metadata */
  1886. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1887. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1888. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1889. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1890. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1891. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1892. /* PEER metadata */
  1893. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1894. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1895. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1896. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1897. HTT_TX_TCL_METADATA_TYPE_S)
  1898. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1899. do { \
  1900. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1901. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1902. } while (0)
  1903. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1904. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1905. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1906. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1907. do { \
  1908. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1909. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1910. } while (0)
  1911. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1912. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1913. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1914. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1918. } while (0)
  1919. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1920. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1921. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1922. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1926. } while (0)
  1927. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1928. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1929. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1930. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1934. } while (0)
  1935. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1936. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1937. HTT_TX_TCL_METADATA_PEER_ID_S)
  1938. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1942. } while (0)
  1943. typedef enum {
  1944. HTT_TX_FW2WBM_TX_STATUS_OK,
  1945. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1946. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1947. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1948. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1949. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1950. HTT_TX_FW2WBM_TX_STATUS_MAX
  1951. } htt_tx_fw2wbm_tx_status_t;
  1952. typedef enum {
  1953. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1954. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1955. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1956. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1957. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1958. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1959. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1960. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1961. } htt_tx_fw2wbm_reinject_reason_t;
  1962. /**
  1963. * @brief HTT TX WBM Completion from firmware to host
  1964. * @details
  1965. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1966. * DWORD 3 and 4 for software based completions (Exception frames and
  1967. * TQM bypass frames)
  1968. * For software based completions, wbm_release_ring->release_source_module will
  1969. * be set to release_source_fw
  1970. */
  1971. PREPACK struct htt_tx_wbm_completion {
  1972. A_UINT32
  1973. sch_cmd_id: 24,
  1974. exception_frame: 1, /* If set, this packet was queued via exception path */
  1975. rsvd0_31_25: 7;
  1976. A_UINT32
  1977. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1978. * reception of an ACK or BA, this field indicates
  1979. * the RSSI of the received ACK or BA frame.
  1980. * When the frame is removed as result of a direct
  1981. * remove command from the SW, this field is set
  1982. * to 0x0 (which is never a valid value when real
  1983. * RSSI is available).
  1984. * Units: dB w.r.t noise floor
  1985. */
  1986. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1987. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1988. rsvd1_31_16: 16;
  1989. } POSTPACK;
  1990. /* DWORD 0 */
  1991. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1992. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1993. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1994. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1995. /* DWORD 1 */
  1996. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1997. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1998. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1999. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2000. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2001. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2002. /* DWORD 0 */
  2003. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2004. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2005. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2006. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2010. } while (0)
  2011. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2012. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2013. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2014. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2018. } while (0)
  2019. /* DWORD 1 */
  2020. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2021. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2022. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2023. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2027. } while (0)
  2028. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2029. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2030. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2031. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2035. } while (0)
  2036. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2037. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2038. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2039. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2043. } while (0)
  2044. /**
  2045. * @brief HTT TX WBM Completion from firmware to host
  2046. * @details
  2047. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2048. * (WBM) offload HW.
  2049. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2050. * For software based completions, release_source_module will
  2051. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2052. * struct wbm_release_ring and then switch to this after looking at
  2053. * release_source_module.
  2054. */
  2055. PREPACK struct htt_tx_wbm_completion_v2 {
  2056. A_UINT32
  2057. used_by_hw0; /* Refer to struct wbm_release_ring */
  2058. A_UINT32
  2059. used_by_hw1; /* Refer to struct wbm_release_ring */
  2060. A_UINT32
  2061. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2062. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2063. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2064. exception_frame: 1,
  2065. rsvd0: 12, /* For future use */
  2066. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2067. rsvd1: 1; /* For future use */
  2068. A_UINT32
  2069. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2070. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2071. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2072. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2073. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2074. */
  2075. A_UINT32
  2076. data1: 32;
  2077. A_UINT32
  2078. data2: 32;
  2079. A_UINT32
  2080. used_by_hw3; /* Refer to struct wbm_release_ring */
  2081. } POSTPACK;
  2082. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2083. /* DWORD 3 */
  2084. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2085. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2086. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2087. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2088. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2089. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2090. /* DWORD 3 */
  2091. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2093. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2094. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2098. } while (0)
  2099. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2100. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2101. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2102. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2106. } while (0)
  2107. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2108. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2109. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2110. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2114. } while (0)
  2115. /**
  2116. * @brief HTT TX WBM transmit status from firmware to host
  2117. * @details
  2118. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2119. * (WBM) offload HW.
  2120. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2121. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2122. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2123. */
  2124. PREPACK struct htt_tx_wbm_transmit_status {
  2125. A_UINT32
  2126. sch_cmd_id: 24,
  2127. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2128. * reception of an ACK or BA, this field indicates
  2129. * the RSSI of the received ACK or BA frame.
  2130. * When the frame is removed as result of a direct
  2131. * remove command from the SW, this field is set
  2132. * to 0x0 (which is never a valid value when real
  2133. * RSSI is available).
  2134. * Units: dB w.r.t noise floor
  2135. */
  2136. A_UINT32
  2137. sw_peer_id: 16,
  2138. tid_num: 5,
  2139. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2140. * and tid_num fields contain valid data.
  2141. * If this "valid" flag is not set, the
  2142. * sw_peer_id and tid_num fields must be ignored.
  2143. */
  2144. mcast: 1,
  2145. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2146. * contains valid data.
  2147. */
  2148. reserved0: 8;
  2149. A_UINT32
  2150. reserved1: 32;
  2151. } POSTPACK;
  2152. /* DWORD 4 */
  2153. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2154. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2155. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2156. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2157. /* DWORD 5 */
  2158. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2159. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2160. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2161. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2162. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2163. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2164. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2165. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2166. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2167. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2168. /* DWORD 4 */
  2169. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2170. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2171. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2172. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2173. do { \
  2174. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2175. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2176. } while (0)
  2177. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2178. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2179. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2180. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2184. } while (0)
  2185. /* DWORD 5 */
  2186. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2187. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2188. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2189. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2190. do { \
  2191. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2192. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2193. } while (0)
  2194. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2195. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2196. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2197. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2198. do { \
  2199. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2200. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2201. } while (0)
  2202. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2203. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2204. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2205. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2206. do { \
  2207. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2208. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2209. } while (0)
  2210. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2211. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2212. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2213. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2214. do { \
  2215. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2216. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2217. } while (0)
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2219. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2220. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2221. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2222. do { \
  2223. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2224. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2225. } while (0)
  2226. /**
  2227. * @brief HTT TX WBM reinject status from firmware to host
  2228. * @details
  2229. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2230. * (WBM) offload HW.
  2231. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2232. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2233. */
  2234. PREPACK struct htt_tx_wbm_reinject_status {
  2235. A_UINT32
  2236. reserved0: 32;
  2237. A_UINT32
  2238. reserved1: 32;
  2239. A_UINT32
  2240. reserved2: 32;
  2241. } POSTPACK;
  2242. /**
  2243. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2244. * @details
  2245. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2246. * (WBM) offload HW.
  2247. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2248. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2249. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2250. * STA side.
  2251. */
  2252. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2253. A_UINT32
  2254. mec_sa_addr_31_0;
  2255. A_UINT32
  2256. mec_sa_addr_47_32: 16,
  2257. sa_ast_index: 16;
  2258. A_UINT32
  2259. vdev_id: 8,
  2260. reserved0: 24;
  2261. } POSTPACK;
  2262. /* DWORD 4 - mec_sa_addr_31_0 */
  2263. /* DWORD 5 */
  2264. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2265. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2266. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2267. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2268. /* DWORD 6 */
  2269. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2270. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2271. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2278. } while (0)
  2279. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2280. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2281. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2282. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2286. } while (0)
  2287. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2288. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2289. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2290. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2293. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2294. } while (0)
  2295. typedef enum {
  2296. TX_FLOW_PRIORITY_BE,
  2297. TX_FLOW_PRIORITY_HIGH,
  2298. TX_FLOW_PRIORITY_LOW,
  2299. } htt_tx_flow_priority_t;
  2300. typedef enum {
  2301. TX_FLOW_LATENCY_SENSITIVE,
  2302. TX_FLOW_LATENCY_INSENSITIVE,
  2303. } htt_tx_flow_latency_t;
  2304. typedef enum {
  2305. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2306. TX_FLOW_INTERACTIVE_TRAFFIC,
  2307. TX_FLOW_PERIODIC_TRAFFIC,
  2308. TX_FLOW_BURSTY_TRAFFIC,
  2309. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2310. } htt_tx_flow_traffic_pattern_t;
  2311. /**
  2312. * @brief HTT TX Flow search metadata format
  2313. * @details
  2314. * Host will set this metadata in flow table's flow search entry along with
  2315. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2316. * firmware and TQM ring if the flow search entry wins.
  2317. * This metadata is available to firmware in that first MSDU's
  2318. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2319. * to one of the available flows for specific tid and returns the tqm flow
  2320. * pointer as part of htt_tx_map_flow_info message.
  2321. */
  2322. PREPACK struct htt_tx_flow_metadata {
  2323. A_UINT32
  2324. rsvd0_1_0: 2,
  2325. tid: 4,
  2326. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2327. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2328. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2329. * Else choose final tid based on latency, priority.
  2330. */
  2331. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2332. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2333. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2334. } POSTPACK;
  2335. /* DWORD 0 */
  2336. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2337. #define HTT_TX_FLOW_METADATA_TID_S 2
  2338. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2339. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2340. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2341. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2342. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2343. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2344. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2345. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2346. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2347. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2348. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2349. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2350. /* DWORD 0 */
  2351. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2352. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2353. HTT_TX_FLOW_METADATA_TID_S)
  2354. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2357. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2358. } while (0)
  2359. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2360. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2361. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2362. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2363. do { \
  2364. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2365. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2366. } while (0)
  2367. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2368. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2369. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2370. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2371. do { \
  2372. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2373. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2374. } while (0)
  2375. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2376. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2377. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2378. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2379. do { \
  2380. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2381. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2382. } while (0)
  2383. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2384. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2385. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2386. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2390. } while (0)
  2391. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2392. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2393. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2394. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2395. do { \
  2396. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2397. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2398. } while (0)
  2399. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2400. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2401. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2402. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2403. do { \
  2404. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2405. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2406. } while (0)
  2407. /**
  2408. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2409. *
  2410. * @details
  2411. * HTT wds entry from source port learning
  2412. * Host will learn wds entries from rx and send this message to firmware
  2413. * to enable firmware to configure/delete AST entries for wds clients.
  2414. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2415. * and when SA's entry is deleted, firmware removes this AST entry
  2416. *
  2417. * The message would appear as follows:
  2418. *
  2419. * |31 30|29 |17 16|15 8|7 0|
  2420. * |----------------+----------------+----------------+----------------|
  2421. * | rsvd0 |PDVID| vdev_id | msg_type |
  2422. * |-------------------------------------------------------------------|
  2423. * | sa_addr_31_0 |
  2424. * |-------------------------------------------------------------------|
  2425. * | | ta_peer_id | sa_addr_47_32 |
  2426. * |-------------------------------------------------------------------|
  2427. * Where PDVID = pdev_id
  2428. *
  2429. * The message is interpreted as follows:
  2430. *
  2431. * dword0 - b'0:7 - msg_type: This will be set to
  2432. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2433. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2434. *
  2435. * dword0 - b'8:15 - vdev_id
  2436. *
  2437. * dword0 - b'16:17 - pdev_id
  2438. *
  2439. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2440. *
  2441. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2442. *
  2443. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2444. *
  2445. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2446. */
  2447. PREPACK struct htt_wds_entry {
  2448. A_UINT32
  2449. msg_type: 8,
  2450. vdev_id: 8,
  2451. pdev_id: 2,
  2452. rsvd0: 14;
  2453. A_UINT32 sa_addr_31_0;
  2454. A_UINT32
  2455. sa_addr_47_32: 16,
  2456. ta_peer_id: 14,
  2457. rsvd2: 2;
  2458. } POSTPACK;
  2459. /* DWORD 0 */
  2460. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2461. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2462. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2463. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2464. /* DWORD 2 */
  2465. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2466. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2467. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2468. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2469. /* DWORD 0 */
  2470. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2471. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2472. HTT_WDS_ENTRY_VDEV_ID_S)
  2473. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2474. do { \
  2475. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2476. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2477. } while (0)
  2478. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2479. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2480. HTT_WDS_ENTRY_PDEV_ID_S)
  2481. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2484. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2485. } while (0)
  2486. /* DWORD 2 */
  2487. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2488. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2489. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2490. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2491. do { \
  2492. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2493. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2494. } while (0)
  2495. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2496. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2497. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2498. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2499. do { \
  2500. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2501. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2502. } while (0)
  2503. /**
  2504. * @brief MAC DMA rx ring setup specification
  2505. * @details
  2506. * To allow for dynamic rx ring reconfiguration and to avoid race
  2507. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2508. * it uses. Instead, it sends this message to the target, indicating how
  2509. * the rx ring used by the host should be set up and maintained.
  2510. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2511. * specifications.
  2512. *
  2513. * |31 16|15 8|7 0|
  2514. * |---------------------------------------------------------------|
  2515. * header: | reserved | num rings | msg type |
  2516. * |---------------------------------------------------------------|
  2517. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2518. #if HTT_PADDR64
  2519. * | FW_IDX shadow register physical address (bits 63:32) |
  2520. #endif
  2521. * |---------------------------------------------------------------|
  2522. * | rx ring base physical address (bits 31:0) |
  2523. #if HTT_PADDR64
  2524. * | rx ring base physical address (bits 63:32) |
  2525. #endif
  2526. * |---------------------------------------------------------------|
  2527. * | rx ring buffer size | rx ring length |
  2528. * |---------------------------------------------------------------|
  2529. * | FW_IDX initial value | enabled flags |
  2530. * |---------------------------------------------------------------|
  2531. * | MSDU payload offset | 802.11 header offset |
  2532. * |---------------------------------------------------------------|
  2533. * | PPDU end offset | PPDU start offset |
  2534. * |---------------------------------------------------------------|
  2535. * | MPDU end offset | MPDU start offset |
  2536. * |---------------------------------------------------------------|
  2537. * | MSDU end offset | MSDU start offset |
  2538. * |---------------------------------------------------------------|
  2539. * | frag info offset | rx attention offset |
  2540. * |---------------------------------------------------------------|
  2541. * payload 2, if present, has the same format as payload 1
  2542. * Header fields:
  2543. * - MSG_TYPE
  2544. * Bits 7:0
  2545. * Purpose: identifies this as an rx ring configuration message
  2546. * Value: 0x2
  2547. * - NUM_RINGS
  2548. * Bits 15:8
  2549. * Purpose: indicates whether the host is setting up one rx ring or two
  2550. * Value: 1 or 2
  2551. * Payload:
  2552. * for systems using 64-bit format for bus addresses:
  2553. * - IDX_SHADOW_REG_PADDR_LO
  2554. * Bits 31:0
  2555. * Value: lower 4 bytes of physical address of the host's
  2556. * FW_IDX shadow register
  2557. * - IDX_SHADOW_REG_PADDR_HI
  2558. * Bits 31:0
  2559. * Value: upper 4 bytes of physical address of the host's
  2560. * FW_IDX shadow register
  2561. * - RING_BASE_PADDR_LO
  2562. * Bits 31:0
  2563. * Value: lower 4 bytes of physical address of the host's rx ring
  2564. * - RING_BASE_PADDR_HI
  2565. * Bits 31:0
  2566. * Value: uppper 4 bytes of physical address of the host's rx ring
  2567. * for systems using 32-bit format for bus addresses:
  2568. * - IDX_SHADOW_REG_PADDR
  2569. * Bits 31:0
  2570. * Value: physical address of the host's FW_IDX shadow register
  2571. * - RING_BASE_PADDR
  2572. * Bits 31:0
  2573. * Value: physical address of the host's rx ring
  2574. * - RING_LEN
  2575. * Bits 15:0
  2576. * Value: number of elements in the rx ring
  2577. * - RING_BUF_SZ
  2578. * Bits 31:16
  2579. * Value: size of the buffers referenced by the rx ring, in byte units
  2580. * - ENABLED_FLAGS
  2581. * Bits 15:0
  2582. * Value: 1-bit flags to show whether different rx fields are enabled
  2583. * bit 0: 802.11 header enabled (1) or disabled (0)
  2584. * bit 1: MSDU payload enabled (1) or disabled (0)
  2585. * bit 2: PPDU start enabled (1) or disabled (0)
  2586. * bit 3: PPDU end enabled (1) or disabled (0)
  2587. * bit 4: MPDU start enabled (1) or disabled (0)
  2588. * bit 5: MPDU end enabled (1) or disabled (0)
  2589. * bit 6: MSDU start enabled (1) or disabled (0)
  2590. * bit 7: MSDU end enabled (1) or disabled (0)
  2591. * bit 8: rx attention enabled (1) or disabled (0)
  2592. * bit 9: frag info enabled (1) or disabled (0)
  2593. * bit 10: unicast rx enabled (1) or disabled (0)
  2594. * bit 11: multicast rx enabled (1) or disabled (0)
  2595. * bit 12: ctrl rx enabled (1) or disabled (0)
  2596. * bit 13: mgmt rx enabled (1) or disabled (0)
  2597. * bit 14: null rx enabled (1) or disabled (0)
  2598. * bit 15: phy data rx enabled (1) or disabled (0)
  2599. * - IDX_INIT_VAL
  2600. * Bits 31:16
  2601. * Purpose: Specify the initial value for the FW_IDX.
  2602. * Value: the number of buffers initially present in the host's rx ring
  2603. * - OFFSET_802_11_HDR
  2604. * Bits 15:0
  2605. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2606. * - OFFSET_MSDU_PAYLOAD
  2607. * Bits 31:16
  2608. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2609. * - OFFSET_PPDU_START
  2610. * Bits 15:0
  2611. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2612. * - OFFSET_PPDU_END
  2613. * Bits 31:16
  2614. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2615. * - OFFSET_MPDU_START
  2616. * Bits 15:0
  2617. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2618. * - OFFSET_MPDU_END
  2619. * Bits 31:16
  2620. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2621. * - OFFSET_MSDU_START
  2622. * Bits 15:0
  2623. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2624. * - OFFSET_MSDU_END
  2625. * Bits 31:16
  2626. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2627. * - OFFSET_RX_ATTN
  2628. * Bits 15:0
  2629. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2630. * - OFFSET_FRAG_INFO
  2631. * Bits 31:16
  2632. * Value: offset in QUAD-bytes of frag info table
  2633. */
  2634. /* header fields */
  2635. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2636. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2637. /* payload fields */
  2638. /* for systems using a 64-bit format for bus addresses */
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2640. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2641. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2642. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2645. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2646. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2647. /* for systems using a 32-bit format for bus addresses */
  2648. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2649. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2650. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2651. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2652. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2653. #define HTT_RX_RING_CFG_LEN_S 0
  2654. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2655. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2656. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2657. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2658. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2659. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2660. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2661. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2662. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2663. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2664. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2665. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2666. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2667. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2668. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2669. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2670. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2671. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2672. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2673. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2674. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2675. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2676. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2677. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2678. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2679. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2680. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2681. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2682. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2683. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2684. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2685. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2686. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2687. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2688. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2689. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2690. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2691. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2692. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2693. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2694. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2695. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2696. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2697. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2698. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2699. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2700. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2701. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2702. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2703. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2704. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2705. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2706. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2707. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2708. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2709. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2710. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2711. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2712. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2713. #if HTT_PADDR64
  2714. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2715. #else
  2716. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2717. #endif
  2718. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2719. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2720. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2721. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2722. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2723. do { \
  2724. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2725. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2726. } while (0)
  2727. /* degenerate case for 32-bit fields */
  2728. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2730. ((_var) = (_val))
  2731. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2732. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2733. ((_var) = (_val))
  2734. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2735. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2736. ((_var) = (_val))
  2737. /* degenerate case for 32-bit fields */
  2738. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2740. ((_var) = (_val))
  2741. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2742. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2743. ((_var) = (_val))
  2744. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2745. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2746. ((_var) = (_val))
  2747. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2748. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2749. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2752. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2753. } while (0)
  2754. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2755. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2756. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2757. do { \
  2758. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2759. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2760. } while (0)
  2761. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2762. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2763. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2764. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2767. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2768. } while (0)
  2769. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2770. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2771. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2772. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2775. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2776. } while (0)
  2777. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2778. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2779. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2780. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2783. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2784. } while (0)
  2785. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2786. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2787. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2788. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2791. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2792. } while (0)
  2793. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2794. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2795. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2796. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2799. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2800. } while (0)
  2801. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2802. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2803. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2804. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2807. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2808. } while (0)
  2809. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2810. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2811. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2812. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2815. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2816. } while (0)
  2817. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2818. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2819. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2820. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2827. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2828. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2831. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2832. } while (0)
  2833. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2834. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2835. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2836. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2839. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2840. } while (0)
  2841. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2842. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2843. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2844. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2847. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2848. } while (0)
  2849. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2850. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2851. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2852. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2853. do { \
  2854. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2855. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2856. } while (0)
  2857. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2858. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2859. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2860. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2861. do { \
  2862. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2863. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2864. } while (0)
  2865. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2866. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2867. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2868. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2871. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2872. } while (0)
  2873. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2874. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2875. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2876. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2877. do { \
  2878. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2879. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2880. } while (0)
  2881. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2882. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2883. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2884. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2885. do { \
  2886. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2887. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2888. } while (0)
  2889. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2890. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2891. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2892. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2893. do { \
  2894. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2895. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2896. } while (0)
  2897. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2898. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2899. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2900. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2901. do { \
  2902. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2903. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2904. } while (0)
  2905. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2906. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2907. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2908. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2909. do { \
  2910. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2911. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2912. } while (0)
  2913. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2914. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2915. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2916. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2917. do { \
  2918. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2919. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2920. } while (0)
  2921. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2922. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2923. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2924. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2925. do { \
  2926. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2927. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2928. } while (0)
  2929. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2930. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2931. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2932. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2933. do { \
  2934. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2935. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2936. } while (0)
  2937. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2938. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2939. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2940. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2941. do { \
  2942. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2943. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2944. } while (0)
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2946. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2947. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2948. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2951. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2952. } while (0)
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2954. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2955. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2956. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2959. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2960. } while (0)
  2961. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2962. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2963. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2964. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2965. do { \
  2966. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2967. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2968. } while (0)
  2969. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2970. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2971. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2972. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2975. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2976. } while (0)
  2977. /**
  2978. * @brief host -> target FW statistics retrieve
  2979. *
  2980. * @details
  2981. * The following field definitions describe the format of the HTT host
  2982. * to target FW stats retrieve message. The message specifies the type of
  2983. * stats host wants to retrieve.
  2984. *
  2985. * |31 24|23 16|15 8|7 0|
  2986. * |-----------------------------------------------------------|
  2987. * | stats types request bitmask | msg type |
  2988. * |-----------------------------------------------------------|
  2989. * | stats types reset bitmask | reserved |
  2990. * |-----------------------------------------------------------|
  2991. * | stats type | config value |
  2992. * |-----------------------------------------------------------|
  2993. * | cookie LSBs |
  2994. * |-----------------------------------------------------------|
  2995. * | cookie MSBs |
  2996. * |-----------------------------------------------------------|
  2997. * Header fields:
  2998. * - MSG_TYPE
  2999. * Bits 7:0
  3000. * Purpose: identifies this is a stats upload request message
  3001. * Value: 0x3
  3002. * - UPLOAD_TYPES
  3003. * Bits 31:8
  3004. * Purpose: identifies which types of FW statistics to upload
  3005. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3006. * - RESET_TYPES
  3007. * Bits 31:8
  3008. * Purpose: identifies which types of FW statistics to reset
  3009. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3010. * - CFG_VAL
  3011. * Bits 23:0
  3012. * Purpose: give an opaque configuration value to the specified stats type
  3013. * Value: stats-type specific configuration value
  3014. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3015. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3016. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3017. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3018. * - CFG_STAT_TYPE
  3019. * Bits 31:24
  3020. * Purpose: specify which stats type (if any) the config value applies to
  3021. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3022. * a valid configuration specification
  3023. * - COOKIE_LSBS
  3024. * Bits 31:0
  3025. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3026. * message with its preceding host->target stats request message.
  3027. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3028. * - COOKIE_MSBS
  3029. * Bits 31:0
  3030. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3031. * message with its preceding host->target stats request message.
  3032. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3033. */
  3034. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3035. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3036. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3037. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3038. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3039. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3040. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3041. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3042. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3043. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3044. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3045. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3046. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3047. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3050. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3051. } while (0)
  3052. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3053. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3054. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3055. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3056. do { \
  3057. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3058. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3059. } while (0)
  3060. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3061. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3062. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3063. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3064. do { \
  3065. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3066. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3067. } while (0)
  3068. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3069. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3070. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3071. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3072. do { \
  3073. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3074. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3075. } while (0)
  3076. /**
  3077. * @brief host -> target HTT out-of-band sync request
  3078. *
  3079. * @details
  3080. * The HTT SYNC tells the target to suspend processing of subsequent
  3081. * HTT host-to-target messages until some other target agent locally
  3082. * informs the target HTT FW that the current sync counter is equal to
  3083. * or greater than (in a modulo sense) the sync counter specified in
  3084. * the SYNC message.
  3085. * This allows other host-target components to synchronize their operation
  3086. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3087. * security key has been downloaded to and activated by the target.
  3088. * In the absence of any explicit synchronization counter value
  3089. * specification, the target HTT FW will use zero as the default current
  3090. * sync value.
  3091. *
  3092. * |31 24|23 16|15 8|7 0|
  3093. * |-----------------------------------------------------------|
  3094. * | reserved | sync count | msg type |
  3095. * |-----------------------------------------------------------|
  3096. * Header fields:
  3097. * - MSG_TYPE
  3098. * Bits 7:0
  3099. * Purpose: identifies this as a sync message
  3100. * Value: 0x4
  3101. * - SYNC_COUNT
  3102. * Bits 15:8
  3103. * Purpose: specifies what sync value the HTT FW will wait for from
  3104. * an out-of-band specification to resume its operation
  3105. * Value: in-band sync counter value to compare against the out-of-band
  3106. * counter spec.
  3107. * The HTT target FW will suspend its host->target message processing
  3108. * as long as
  3109. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3110. */
  3111. #define HTT_H2T_SYNC_MSG_SZ 4
  3112. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3113. #define HTT_H2T_SYNC_COUNT_S 8
  3114. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3115. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3116. HTT_H2T_SYNC_COUNT_S)
  3117. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3118. do { \
  3119. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3120. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3121. } while (0)
  3122. /**
  3123. * @brief HTT aggregation configuration
  3124. */
  3125. #define HTT_AGGR_CFG_MSG_SZ 4
  3126. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3128. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3129. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3130. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3131. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3132. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3133. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3134. do { \
  3135. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3136. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3137. } while (0)
  3138. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3139. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3140. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3141. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3142. do { \
  3143. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3144. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3145. } while (0)
  3146. /**
  3147. * @brief host -> target HTT configure max amsdu info per vdev
  3148. *
  3149. * @details
  3150. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3151. *
  3152. * |31 21|20 16|15 8|7 0|
  3153. * |-----------------------------------------------------------|
  3154. * | reserved | vdev id | max amsdu | msg type |
  3155. * |-----------------------------------------------------------|
  3156. * Header fields:
  3157. * - MSG_TYPE
  3158. * Bits 7:0
  3159. * Purpose: identifies this as a aggr cfg ex message
  3160. * Value: 0xa
  3161. * - MAX_NUM_AMSDU_SUBFRM
  3162. * Bits 15:8
  3163. * Purpose: max MSDUs per A-MSDU
  3164. * - VDEV_ID
  3165. * Bits 20:16
  3166. * Purpose: ID of the vdev to which this limit is applied
  3167. */
  3168. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3169. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3170. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3171. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3172. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3173. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3174. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3175. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3176. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3177. do { \
  3178. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3179. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3180. } while (0)
  3181. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3182. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3183. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3184. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3185. do { \
  3186. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3187. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3188. } while (0)
  3189. /**
  3190. * @brief HTT WDI_IPA Config Message
  3191. *
  3192. * @details
  3193. * The HTT WDI_IPA config message is created/sent by host at driver
  3194. * init time. It contains information about data structures used on
  3195. * WDI_IPA TX and RX path.
  3196. * TX CE ring is used for pushing packet metadata from IPA uC
  3197. * to WLAN FW
  3198. * TX Completion ring is used for generating TX completions from
  3199. * WLAN FW to IPA uC
  3200. * RX Indication ring is used for indicating RX packets from FW
  3201. * to IPA uC
  3202. * RX Ring2 is used as either completion ring or as second
  3203. * indication ring. when Ring2 is used as completion ring, IPA uC
  3204. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3205. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3206. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3207. * indicated in RX Indication ring. Please see WDI_IPA specification
  3208. * for more details.
  3209. * |31 24|23 16|15 8|7 0|
  3210. * |----------------+----------------+----------------+----------------|
  3211. * | tx pkt pool size | Rsvd | msg_type |
  3212. * |-------------------------------------------------------------------|
  3213. * | tx comp ring base (bits 31:0) |
  3214. #if HTT_PADDR64
  3215. * | tx comp ring base (bits 63:32) |
  3216. #endif
  3217. * |-------------------------------------------------------------------|
  3218. * | tx comp ring size |
  3219. * |-------------------------------------------------------------------|
  3220. * | tx comp WR_IDX physical address (bits 31:0) |
  3221. #if HTT_PADDR64
  3222. * | tx comp WR_IDX physical address (bits 63:32) |
  3223. #endif
  3224. * |-------------------------------------------------------------------|
  3225. * | tx CE WR_IDX physical address (bits 31:0) |
  3226. #if HTT_PADDR64
  3227. * | tx CE WR_IDX physical address (bits 63:32) |
  3228. #endif
  3229. * |-------------------------------------------------------------------|
  3230. * | rx indication ring base (bits 31:0) |
  3231. #if HTT_PADDR64
  3232. * | rx indication ring base (bits 63:32) |
  3233. #endif
  3234. * |-------------------------------------------------------------------|
  3235. * | rx indication ring size |
  3236. * |-------------------------------------------------------------------|
  3237. * | rx ind RD_IDX physical address (bits 31:0) |
  3238. #if HTT_PADDR64
  3239. * | rx ind RD_IDX physical address (bits 63:32) |
  3240. #endif
  3241. * |-------------------------------------------------------------------|
  3242. * | rx ind WR_IDX physical address (bits 31:0) |
  3243. #if HTT_PADDR64
  3244. * | rx ind WR_IDX physical address (bits 63:32) |
  3245. #endif
  3246. * |-------------------------------------------------------------------|
  3247. * |-------------------------------------------------------------------|
  3248. * | rx ring2 base (bits 31:0) |
  3249. #if HTT_PADDR64
  3250. * | rx ring2 base (bits 63:32) |
  3251. #endif
  3252. * |-------------------------------------------------------------------|
  3253. * | rx ring2 size |
  3254. * |-------------------------------------------------------------------|
  3255. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3256. #if HTT_PADDR64
  3257. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3258. #endif
  3259. * |-------------------------------------------------------------------|
  3260. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3261. #if HTT_PADDR64
  3262. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3263. #endif
  3264. * |-------------------------------------------------------------------|
  3265. *
  3266. * Header fields:
  3267. * Header fields:
  3268. * - MSG_TYPE
  3269. * Bits 7:0
  3270. * Purpose: Identifies this as WDI_IPA config message
  3271. * value: = 0x8
  3272. * - TX_PKT_POOL_SIZE
  3273. * Bits 15:0
  3274. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3275. * WDI_IPA TX path
  3276. * For systems using 32-bit format for bus addresses:
  3277. * - TX_COMP_RING_BASE_ADDR
  3278. * Bits 31:0
  3279. * Purpose: TX Completion Ring base address in DDR
  3280. * - TX_COMP_RING_SIZE
  3281. * Bits 31:0
  3282. * Purpose: TX Completion Ring size (must be power of 2)
  3283. * - TX_COMP_WR_IDX_ADDR
  3284. * Bits 31:0
  3285. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3286. * updates the Write Index for WDI_IPA TX completion ring
  3287. * - TX_CE_WR_IDX_ADDR
  3288. * Bits 31:0
  3289. * Purpose: DDR address where IPA uC
  3290. * updates the WR Index for TX CE ring
  3291. * (needed for fusion platforms)
  3292. * - RX_IND_RING_BASE_ADDR
  3293. * Bits 31:0
  3294. * Purpose: RX Indication Ring base address in DDR
  3295. * - RX_IND_RING_SIZE
  3296. * Bits 31:0
  3297. * Purpose: RX Indication Ring size
  3298. * - RX_IND_RD_IDX_ADDR
  3299. * Bits 31:0
  3300. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3301. * RX indication ring
  3302. * - RX_IND_WR_IDX_ADDR
  3303. * Bits 31:0
  3304. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3305. * updates the Write Index for WDI_IPA RX indication ring
  3306. * - RX_RING2_BASE_ADDR
  3307. * Bits 31:0
  3308. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3309. * - RX_RING2_SIZE
  3310. * Bits 31:0
  3311. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3312. * - RX_RING2_RD_IDX_ADDR
  3313. * Bits 31:0
  3314. * Purpose: If Second RX ring is Indication ring, DDR address where
  3315. * IPA uC updates the Read Index for Ring2.
  3316. * If Second RX ring is completion ring, this is NOT used
  3317. * - RX_RING2_WR_IDX_ADDR
  3318. * Bits 31:0
  3319. * Purpose: If Second RX ring is Indication ring, DDR address where
  3320. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3321. * If second RX ring is completion ring, DDR address where
  3322. * IPA uC updates the Write Index for Ring 2.
  3323. * For systems using 64-bit format for bus addresses:
  3324. * - TX_COMP_RING_BASE_ADDR_LO
  3325. * Bits 31:0
  3326. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3327. * - TX_COMP_RING_BASE_ADDR_HI
  3328. * Bits 31:0
  3329. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3330. * - TX_COMP_RING_SIZE
  3331. * Bits 31:0
  3332. * Purpose: TX Completion Ring size (must be power of 2)
  3333. * - TX_COMP_WR_IDX_ADDR_LO
  3334. * Bits 31:0
  3335. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3336. * Lower 4 bytes of DDR address where WIFI FW
  3337. * updates the Write Index for WDI_IPA TX completion ring
  3338. * - TX_COMP_WR_IDX_ADDR_HI
  3339. * Bits 31:0
  3340. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3341. * Higher 4 bytes of DDR address where WIFI FW
  3342. * updates the Write Index for WDI_IPA TX completion ring
  3343. * - TX_CE_WR_IDX_ADDR_LO
  3344. * Bits 31:0
  3345. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3346. * updates the WR Index for TX CE ring
  3347. * (needed for fusion platforms)
  3348. * - TX_CE_WR_IDX_ADDR_HI
  3349. * Bits 31:0
  3350. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3351. * updates the WR Index for TX CE ring
  3352. * (needed for fusion platforms)
  3353. * - RX_IND_RING_BASE_ADDR_LO
  3354. * Bits 31:0
  3355. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3356. * - RX_IND_RING_BASE_ADDR_HI
  3357. * Bits 31:0
  3358. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3359. * - RX_IND_RING_SIZE
  3360. * Bits 31:0
  3361. * Purpose: RX Indication Ring size
  3362. * - RX_IND_RD_IDX_ADDR_LO
  3363. * Bits 31:0
  3364. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3365. * for WDI_IPA RX indication ring
  3366. * - RX_IND_RD_IDX_ADDR_HI
  3367. * Bits 31:0
  3368. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3369. * for WDI_IPA RX indication ring
  3370. * - RX_IND_WR_IDX_ADDR_LO
  3371. * Bits 31:0
  3372. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3373. * Lower 4 bytes of DDR address where WIFI FW
  3374. * updates the Write Index for WDI_IPA RX indication ring
  3375. * - RX_IND_WR_IDX_ADDR_HI
  3376. * Bits 31:0
  3377. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3378. * Higher 4 bytes of DDR address where WIFI FW
  3379. * updates the Write Index for WDI_IPA RX indication ring
  3380. * - RX_RING2_BASE_ADDR_LO
  3381. * Bits 31:0
  3382. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3383. * - RX_RING2_BASE_ADDR_HI
  3384. * Bits 31:0
  3385. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3386. * - RX_RING2_SIZE
  3387. * Bits 31:0
  3388. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3389. * - RX_RING2_RD_IDX_ADDR_LO
  3390. * Bits 31:0
  3391. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3392. * DDR address where IPA uC updates the Read Index for Ring2.
  3393. * If Second RX ring is completion ring, this is NOT used
  3394. * - RX_RING2_RD_IDX_ADDR_HI
  3395. * Bits 31:0
  3396. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3397. * DDR address where IPA uC updates the Read Index for Ring2.
  3398. * If Second RX ring is completion ring, this is NOT used
  3399. * - RX_RING2_WR_IDX_ADDR_LO
  3400. * Bits 31:0
  3401. * Purpose: If Second RX ring is Indication ring, lower 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, lower 4 bytes of
  3405. * DDR address where IPA uC updates the Write Index for Ring 2.
  3406. * - RX_RING2_WR_IDX_ADDR_HI
  3407. * Bits 31:0
  3408. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3409. * DDR address where WIFI FW updates the Write Index
  3410. * for WDI_IPA RX ring2
  3411. * If second RX ring is completion ring, higher 4 bytes of
  3412. * DDR address where IPA uC updates the Write Index for Ring 2.
  3413. */
  3414. #if HTT_PADDR64
  3415. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3416. #else
  3417. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3418. #endif
  3419. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3420. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3431. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3433. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3435. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3437. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3439. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3449. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3450. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3451. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3452. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3453. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3454. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3455. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3456. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3457. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3458. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3459. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3460. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3476. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3477. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3479. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3480. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3481. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3482. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3483. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3486. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3487. } while (0)
  3488. /* for systems using 32-bit format for bus addr */
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3490. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3492. do { \
  3493. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3494. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3495. } while (0)
  3496. /* for systems using 64-bit format for bus addr */
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3498. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3500. do { \
  3501. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3502. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3503. } while (0)
  3504. /* for systems using 64-bit format for bus addr */
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3506. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3508. do { \
  3509. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3510. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3511. } while (0)
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3513. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3515. do { \
  3516. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3517. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3518. } while (0)
  3519. /* for systems using 32-bit format for bus addr */
  3520. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3521. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3522. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3523. do { \
  3524. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3525. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3526. } while (0)
  3527. /* for systems using 64-bit format for bus addr */
  3528. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3529. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3530. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3531. do { \
  3532. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3533. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3534. } while (0)
  3535. /* for systems using 64-bit format for bus addr */
  3536. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3537. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3538. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3541. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3542. } while (0)
  3543. /* for systems using 32-bit format for bus addr */
  3544. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3545. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3546. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3549. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3550. } while (0)
  3551. /* for systems using 64-bit format for bus addr */
  3552. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3553. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3554. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3557. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3558. } while (0)
  3559. /* for systems using 64-bit format for bus addr */
  3560. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3561. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3562. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3565. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3566. } while (0)
  3567. /* for systems using 32-bit format for bus addr */
  3568. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3569. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3570. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3573. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3574. } while (0)
  3575. /* for systems using 64-bit format for bus addr */
  3576. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3577. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3578. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3581. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3582. } while (0)
  3583. /* for systems using 64-bit format for bus addr */
  3584. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3585. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3586. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3587. do { \
  3588. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3589. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3590. } while (0)
  3591. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3592. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3593. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3594. do { \
  3595. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3596. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3597. } while (0)
  3598. /* for systems using 32-bit format for bus addr */
  3599. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3600. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3601. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3602. do { \
  3603. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3604. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3605. } while (0)
  3606. /* for systems using 64-bit format for bus addr */
  3607. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3608. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3609. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3610. do { \
  3611. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3612. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3613. } while (0)
  3614. /* for systems using 64-bit format for bus addr */
  3615. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3616. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3617. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3618. do { \
  3619. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3620. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3621. } while (0)
  3622. /* for systems using 32-bit format for bus addr */
  3623. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3624. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3625. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3626. do { \
  3627. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3628. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3629. } while (0)
  3630. /* for systems using 64-bit format for bus addr */
  3631. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3632. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3633. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3634. do { \
  3635. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3636. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3637. } while (0)
  3638. /* for systems using 64-bit format for bus addr */
  3639. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3640. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3641. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3644. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3645. } while (0)
  3646. /* for systems using 32-bit format for bus addr */
  3647. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3648. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3649. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3652. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3653. } while (0)
  3654. /* for systems using 64-bit format for bus addr */
  3655. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3656. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3657. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3660. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3661. } while (0)
  3662. /* for systems using 64-bit format for bus addr */
  3663. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3664. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3665. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3668. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3669. } while (0)
  3670. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3671. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3672. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3675. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3676. } while (0)
  3677. /* for systems using 32-bit format for bus addr */
  3678. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3679. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3680. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3683. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3684. } while (0)
  3685. /* for systems using 64-bit format for bus addr */
  3686. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3687. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3688. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3691. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3692. } while (0)
  3693. /* for systems using 64-bit format for bus addr */
  3694. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3695. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3696. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3699. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3700. } while (0)
  3701. /* for systems using 32-bit format for bus addr */
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3703. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3704. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3707. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3708. } while (0)
  3709. /* for systems using 64-bit format for bus addr */
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3711. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3712. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3713. do { \
  3714. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3715. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3716. } while (0)
  3717. /* for systems using 64-bit format for bus addr */
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3719. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3721. do { \
  3722. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3723. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3724. } while (0)
  3725. /*
  3726. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3727. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3728. * addresses are stored in a XXX-bit field.
  3729. * This macro is used to define both htt_wdi_ipa_config32_t and
  3730. * htt_wdi_ipa_config64_t structs.
  3731. */
  3732. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3733. _paddr__tx_comp_ring_base_addr_, \
  3734. _paddr__tx_comp_wr_idx_addr_, \
  3735. _paddr__tx_ce_wr_idx_addr_, \
  3736. _paddr__rx_ind_ring_base_addr_, \
  3737. _paddr__rx_ind_rd_idx_addr_, \
  3738. _paddr__rx_ind_wr_idx_addr_, \
  3739. _paddr__rx_ring2_base_addr_,\
  3740. _paddr__rx_ring2_rd_idx_addr_,\
  3741. _paddr__rx_ring2_wr_idx_addr_) \
  3742. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3743. { \
  3744. /* DWORD 0: flags and meta-data */ \
  3745. A_UINT32 \
  3746. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3747. reserved: 8, \
  3748. tx_pkt_pool_size: 16;\
  3749. /* DWORD 1 */\
  3750. _paddr__tx_comp_ring_base_addr_;\
  3751. /* DWORD 2 (or 3)*/\
  3752. A_UINT32 tx_comp_ring_size;\
  3753. /* DWORD 3 (or 4)*/\
  3754. _paddr__tx_comp_wr_idx_addr_;\
  3755. /* DWORD 4 (or 6)*/\
  3756. _paddr__tx_ce_wr_idx_addr_;\
  3757. /* DWORD 5 (or 8)*/\
  3758. _paddr__rx_ind_ring_base_addr_;\
  3759. /* DWORD 6 (or 10)*/\
  3760. A_UINT32 rx_ind_ring_size;\
  3761. /* DWORD 7 (or 11)*/\
  3762. _paddr__rx_ind_rd_idx_addr_;\
  3763. /* DWORD 8 (or 13)*/\
  3764. _paddr__rx_ind_wr_idx_addr_;\
  3765. /* DWORD 9 (or 15)*/\
  3766. _paddr__rx_ring2_base_addr_;\
  3767. /* DWORD 10 (or 17) */\
  3768. A_UINT32 rx_ring2_size;\
  3769. /* DWORD 11 (or 18) */\
  3770. _paddr__rx_ring2_rd_idx_addr_;\
  3771. /* DWORD 12 (or 20) */\
  3772. _paddr__rx_ring2_wr_idx_addr_;\
  3773. } POSTPACK
  3774. /* define a htt_wdi_ipa_config32_t type */
  3775. 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));
  3776. /* define a htt_wdi_ipa_config64_t type */
  3777. 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));
  3778. #if HTT_PADDR64
  3779. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3780. #else
  3781. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3782. #endif
  3783. enum htt_wdi_ipa_op_code {
  3784. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3785. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3786. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3787. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3788. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3789. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3790. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3791. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3792. /* keep this last */
  3793. HTT_WDI_IPA_OPCODE_MAX
  3794. };
  3795. /**
  3796. * @brief HTT WDI_IPA Operation Request Message
  3797. *
  3798. * @details
  3799. * HTT WDI_IPA Operation Request message is sent by host
  3800. * to either suspend or resume WDI_IPA TX or RX path.
  3801. * |31 24|23 16|15 8|7 0|
  3802. * |----------------+----------------+----------------+----------------|
  3803. * | op_code | Rsvd | msg_type |
  3804. * |-------------------------------------------------------------------|
  3805. *
  3806. * Header fields:
  3807. * - MSG_TYPE
  3808. * Bits 7:0
  3809. * Purpose: Identifies this as WDI_IPA Operation Request message
  3810. * value: = 0x9
  3811. * - OP_CODE
  3812. * Bits 31:16
  3813. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3814. * value: = enum htt_wdi_ipa_op_code
  3815. */
  3816. PREPACK struct htt_wdi_ipa_op_request_t
  3817. {
  3818. /* DWORD 0: flags and meta-data */
  3819. A_UINT32
  3820. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3821. reserved: 8,
  3822. op_code: 16;
  3823. } POSTPACK;
  3824. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3825. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3826. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3827. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3828. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3829. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3830. do { \
  3831. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3832. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3833. } while (0)
  3834. /*
  3835. * @brief host -> target HTT_SRING_SETUP message
  3836. *
  3837. * @details
  3838. * After target is booted up, Host can send SRING setup message for
  3839. * each host facing LMAC SRING. Target setups up HW registers based
  3840. * on setup message and confirms back to Host if response_required is set.
  3841. * Host should wait for confirmation message before sending new SRING
  3842. * setup message
  3843. *
  3844. * The message would appear as follows:
  3845. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3846. * |--------------- +-----------------+----------------+------------------|
  3847. * | ring_type | ring_id | pdev_id | msg_type |
  3848. * |----------------------------------------------------------------------|
  3849. * | ring_base_addr_lo |
  3850. * |----------------------------------------------------------------------|
  3851. * | ring_base_addr_hi |
  3852. * |----------------------------------------------------------------------|
  3853. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3854. * |----------------------------------------------------------------------|
  3855. * | ring_head_offset32_remote_addr_lo |
  3856. * |----------------------------------------------------------------------|
  3857. * | ring_head_offset32_remote_addr_hi |
  3858. * |----------------------------------------------------------------------|
  3859. * | ring_tail_offset32_remote_addr_lo |
  3860. * |----------------------------------------------------------------------|
  3861. * | ring_tail_offset32_remote_addr_hi |
  3862. * |----------------------------------------------------------------------|
  3863. * | ring_msi_addr_lo |
  3864. * |----------------------------------------------------------------------|
  3865. * | ring_msi_addr_hi |
  3866. * |----------------------------------------------------------------------|
  3867. * | ring_msi_data |
  3868. * |----------------------------------------------------------------------|
  3869. * | intr_timer_th |IM| intr_batch_counter_th |
  3870. * |----------------------------------------------------------------------|
  3871. * | reserved |RR|PTCF| intr_low_threshold |
  3872. * |----------------------------------------------------------------------|
  3873. * Where
  3874. * IM = sw_intr_mode
  3875. * RR = response_required
  3876. * PTCF = prefetch_timer_cfg
  3877. *
  3878. * The message is interpreted as follows:
  3879. * dword0 - b'0:7 - msg_type: This will be set to
  3880. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3881. * b'8:15 - pdev_id:
  3882. * 0 (for rings at SOC/UMAC level),
  3883. * 1/2/3 mac id (for rings at LMAC level)
  3884. * b'16:23 - ring_id: identify which ring is to setup,
  3885. * more details can be got from enum htt_srng_ring_id
  3886. * b'24:31 - ring_type: identify type of host rings,
  3887. * more details can be got from enum htt_srng_ring_type
  3888. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3889. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3890. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3891. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3892. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3893. * SW_TO_HW_RING.
  3894. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3895. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3896. * Lower 32 bits of memory address of the remote variable
  3897. * storing the 4-byte word offset that identifies the head
  3898. * element within the ring.
  3899. * (The head offset variable has type A_UINT32.)
  3900. * Valid for HW_TO_SW and SW_TO_SW rings.
  3901. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3902. * Upper 32 bits of memory address of the remote variable
  3903. * storing the 4-byte word offset that identifies the head
  3904. * element within the ring.
  3905. * (The head offset variable has type A_UINT32.)
  3906. * Valid for HW_TO_SW and SW_TO_SW rings.
  3907. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3908. * Lower 32 bits of memory address of the remote variable
  3909. * storing the 4-byte word offset that identifies the tail
  3910. * element within the ring.
  3911. * (The tail offset variable has type A_UINT32.)
  3912. * Valid for HW_TO_SW and SW_TO_SW rings.
  3913. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3914. * Upper 32 bits of memory address of the remote variable
  3915. * storing the 4-byte word offset that identifies the tail
  3916. * element within the ring.
  3917. * (The tail offset variable has type A_UINT32.)
  3918. * Valid for HW_TO_SW and SW_TO_SW rings.
  3919. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3920. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3921. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3922. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3923. * dword10 - b'0:31 - ring_msi_data: MSI data
  3924. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3925. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3926. * dword11 - b'0:14 - intr_batch_counter_th:
  3927. * batch counter threshold is in units of 4-byte words.
  3928. * HW internally maintains and increments batch count.
  3929. * (see SRING spec for detail description).
  3930. * When batch count reaches threshold value, an interrupt
  3931. * is generated by HW.
  3932. * b'15 - sw_intr_mode:
  3933. * This configuration shall be static.
  3934. * Only programmed at power up.
  3935. * 0: generate pulse style sw interrupts
  3936. * 1: generate level style sw interrupts
  3937. * b'16:31 - intr_timer_th:
  3938. * The timer init value when timer is idle or is
  3939. * initialized to start downcounting.
  3940. * In 8us units (to cover a range of 0 to 524 ms)
  3941. * dword12 - b'0:15 - intr_low_threshold:
  3942. * Used only by Consumer ring to generate ring_sw_int_p.
  3943. * Ring entries low threshold water mark, that is used
  3944. * in combination with the interrupt timer as well as
  3945. * the the clearing of the level interrupt.
  3946. * b'16:18 - prefetch_timer_cfg:
  3947. * Used only by Consumer ring to set timer mode to
  3948. * support Application prefetch handling.
  3949. * The external tail offset/pointer will be updated
  3950. * at following intervals:
  3951. * 3'b000: (Prefetch feature disabled; used only for debug)
  3952. * 3'b001: 1 usec
  3953. * 3'b010: 4 usec
  3954. * 3'b011: 8 usec (default)
  3955. * 3'b100: 16 usec
  3956. * Others: Reserverd
  3957. * b'19 - response_required:
  3958. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3959. * b'20:31 - reserved: reserved for future use
  3960. */
  3961. PREPACK struct htt_sring_setup_t {
  3962. A_UINT32 msg_type: 8,
  3963. pdev_id: 8,
  3964. ring_id: 8,
  3965. ring_type: 8;
  3966. A_UINT32 ring_base_addr_lo;
  3967. A_UINT32 ring_base_addr_hi;
  3968. A_UINT32 ring_size: 16,
  3969. ring_entry_size: 8,
  3970. ring_misc_cfg_flag: 8;
  3971. A_UINT32 ring_head_offset32_remote_addr_lo;
  3972. A_UINT32 ring_head_offset32_remote_addr_hi;
  3973. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3974. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3975. A_UINT32 ring_msi_addr_lo;
  3976. A_UINT32 ring_msi_addr_hi;
  3977. A_UINT32 ring_msi_data;
  3978. A_UINT32 intr_batch_counter_th: 15,
  3979. sw_intr_mode: 1,
  3980. intr_timer_th: 16;
  3981. A_UINT32 intr_low_threshold: 16,
  3982. prefetch_timer_cfg: 3,
  3983. response_required: 1,
  3984. reserved1: 12;
  3985. } POSTPACK;
  3986. enum htt_srng_ring_type {
  3987. HTT_HW_TO_SW_RING = 0,
  3988. HTT_SW_TO_HW_RING,
  3989. HTT_SW_TO_SW_RING,
  3990. /* Insert new ring types above this line */
  3991. };
  3992. enum htt_srng_ring_id {
  3993. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3994. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3995. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3996. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3997. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3998. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3999. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4000. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4001. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4002. /* Add Other SRING which can't be directly configured by host software above this line */
  4003. };
  4004. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4005. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4006. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4007. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4008. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4009. HTT_SRING_SETUP_PDEV_ID_S)
  4010. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4011. do { \
  4012. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4013. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4014. } while (0)
  4015. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4016. #define HTT_SRING_SETUP_RING_ID_S 16
  4017. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4018. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4019. HTT_SRING_SETUP_RING_ID_S)
  4020. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4021. do { \
  4022. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4023. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4024. } while (0)
  4025. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4026. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4027. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4028. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4029. HTT_SRING_SETUP_RING_TYPE_S)
  4030. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4031. do { \
  4032. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4033. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4034. } while (0)
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4036. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4038. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4039. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4040. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4041. do { \
  4042. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4043. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4044. } while (0)
  4045. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4046. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4047. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4048. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4049. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4050. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4051. do { \
  4052. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4053. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4054. } while (0)
  4055. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4056. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4057. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4058. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4059. HTT_SRING_SETUP_RING_SIZE_S)
  4060. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4061. do { \
  4062. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4063. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4064. } while (0)
  4065. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4066. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4067. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4069. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4070. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4073. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4074. } while (0)
  4075. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4076. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4077. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4078. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4079. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4080. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4083. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4084. } while (0)
  4085. /* This control bit is applicable to only Producer, which updates Ring ID field
  4086. * of each descriptor before pushing into the ring.
  4087. * 0: updates ring_id(default)
  4088. * 1: ring_id updating disabled */
  4089. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4090. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4092. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4093. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4094. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4097. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4098. } while (0)
  4099. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4100. * of each descriptor before pushing into the ring.
  4101. * 0: updates Loopcnt(default)
  4102. * 1: Loopcnt updating disabled */
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4104. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4106. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4107. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4108. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4111. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4112. } while (0)
  4113. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4114. * into security_id port of GXI/AXI. */
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4116. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4119. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4120. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4124. } while (0)
  4125. /* During MSI write operation, SRNG drives value of this register bit into
  4126. * swap bit of GXI/AXI. */
  4127. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4128. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4130. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4131. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4132. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4135. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4136. } while (0)
  4137. /* During Pointer write operation, SRNG drives value of this register bit into
  4138. * swap bit of GXI/AXI. */
  4139. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4140. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4142. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4143. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4147. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4148. } while (0)
  4149. /* During any data or TLV write operation, SRNG drives value of this register
  4150. * bit into swap bit of GXI/AXI. */
  4151. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4152. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4154. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4155. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4159. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4160. } while (0)
  4161. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4162. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4164. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4166. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4167. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4168. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4171. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4172. } while (0)
  4173. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4174. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4175. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4176. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4177. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4178. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4179. do { \
  4180. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4181. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4182. } while (0)
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4184. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4187. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4188. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4192. } while (0)
  4193. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4194. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4195. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4196. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4197. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4198. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4201. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4202. } while (0)
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4204. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4206. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4207. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4208. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4211. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4212. } while (0)
  4213. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4214. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4215. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4216. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4217. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4218. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4221. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4222. } while (0)
  4223. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4224. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4225. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4226. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4227. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4228. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4231. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4232. } while (0)
  4233. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4234. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4235. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4236. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4237. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4238. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4241. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4242. } while (0)
  4243. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4244. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4245. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4246. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4247. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4248. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4251. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4252. } while (0)
  4253. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4254. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4255. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4256. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4257. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4258. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4261. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4262. } while (0)
  4263. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4264. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4265. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4266. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4267. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4268. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4271. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4272. } while (0)
  4273. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4274. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4275. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4276. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4277. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4278. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4281. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4282. } while (0)
  4283. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4284. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4285. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4286. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4287. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4288. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4291. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4292. } while (0)
  4293. /**
  4294. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4295. *
  4296. * @details
  4297. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4298. * configure RXDMA rings.
  4299. * The configuration is per ring based and includes both packet subtypes
  4300. * and PPDU/MPDU TLVs.
  4301. *
  4302. * The message would appear as follows:
  4303. *
  4304. * |31 27|26|25|24|23 16|15 8|7 0|
  4305. * |-----------------+----------------+----------------+---------------|
  4306. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4307. * |-------------------------------------------------------------------|
  4308. * | rsvd2 | ring_buffer_size |
  4309. * |-------------------------------------------------------------------|
  4310. * | packet_type_enable_flags_0 |
  4311. * |-------------------------------------------------------------------|
  4312. * | packet_type_enable_flags_1 |
  4313. * |-------------------------------------------------------------------|
  4314. * | packet_type_enable_flags_2 |
  4315. * |-------------------------------------------------------------------|
  4316. * | packet_type_enable_flags_3 |
  4317. * |-------------------------------------------------------------------|
  4318. * | tlv_filter_in_flags |
  4319. * |-------------------------------------------------------------------|
  4320. * | rx_header_offset | rx_packet_offset |
  4321. * |-------------------------------------------------------------------|
  4322. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4323. * |-------------------------------------------------------------------|
  4324. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4325. * |-------------------------------------------------------------------|
  4326. * | rsvd3 | rx_attention_offset |
  4327. * |-------------------------------------------------------------------|
  4328. * Where:
  4329. * PS = pkt_swap
  4330. * SS = status_swap
  4331. * OV = rx_offsets_valid
  4332. * The message is interpreted as follows:
  4333. * dword0 - b'0:7 - msg_type: This will be set to
  4334. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4335. * b'8:15 - pdev_id:
  4336. * 0 (for rings at SOC/UMAC level),
  4337. * 1/2/3 mac id (for rings at LMAC level)
  4338. * b'16:23 - ring_id : Identify the ring to configure.
  4339. * More details can be got from enum htt_srng_ring_id
  4340. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4341. * BUF_RING_CFG_0 defs within HW .h files,
  4342. * e.g. wmac_top_reg_seq_hwioreg.h
  4343. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4344. * BUF_RING_CFG_0 defs within HW .h files,
  4345. * e.g. wmac_top_reg_seq_hwioreg.h
  4346. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4347. * configuration fields are valid
  4348. * b'27:31 - rsvd1: reserved for future use
  4349. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4350. * in byte units.
  4351. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4352. * - b'16:31 - rsvd2: Reserved for future use
  4353. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4354. * Enable MGMT packet from 0b0000 to 0b1001
  4355. * bits from low to high: FP, MD, MO - 3 bits
  4356. * FP: Filter_Pass
  4357. * MD: Monitor_Direct
  4358. * MO: Monitor_Other
  4359. * 10 mgmt subtypes * 3 bits -> 30 bits
  4360. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4361. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4362. * Enable MGMT packet from 0b1010 to 0b1111
  4363. * bits from low to high: FP, MD, MO - 3 bits
  4364. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4365. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4366. * Enable CTRL packet from 0b0000 to 0b1001
  4367. * bits from low to high: FP, MD, MO - 3 bits
  4368. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4369. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4370. * Enable CTRL packet from 0b1010 to 0b1111,
  4371. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4372. * bits from low to high: FP, MD, MO - 3 bits
  4373. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4374. * dword6 - b'0:31 - tlv_filter_in_flags:
  4375. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4376. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4377. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4378. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4379. * A value of 0 will be considered as ignore this config.
  4380. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4381. * e.g. wmac_top_reg_seq_hwioreg.h
  4382. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4383. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4384. * A value of 0 will be considered as ignore this config.
  4385. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4386. * e.g. wmac_top_reg_seq_hwioreg.h
  4387. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4388. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4389. * A value of 0 will be considered as ignore this config.
  4390. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4391. * e.g. wmac_top_reg_seq_hwioreg.h
  4392. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4393. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4394. * A value of 0 will be considered as ignore this config.
  4395. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4396. * e.g. wmac_top_reg_seq_hwioreg.h
  4397. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4398. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4399. * A value of 0 will be considered as ignore this config.
  4400. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4401. * e.g. wmac_top_reg_seq_hwioreg.h
  4402. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4403. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4404. * A value of 0 will be considered as ignore this config.
  4405. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4406. * e.g. wmac_top_reg_seq_hwioreg.h
  4407. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4408. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4409. * A value of 0 will be considered as ignore this config.
  4410. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4411. * e.g. wmac_top_reg_seq_hwioreg.h
  4412. * - b'16-31 - rsvd3 for future use
  4413. */
  4414. PREPACK struct htt_rx_ring_selection_cfg_t {
  4415. A_UINT32 msg_type: 8,
  4416. pdev_id: 8,
  4417. ring_id: 8,
  4418. status_swap: 1,
  4419. pkt_swap: 1,
  4420. rx_offsets_valid: 1,
  4421. rsvd1: 5;
  4422. A_UINT32 ring_buffer_size: 16,
  4423. rsvd2: 16;
  4424. A_UINT32 packet_type_enable_flags_0;
  4425. A_UINT32 packet_type_enable_flags_1;
  4426. A_UINT32 packet_type_enable_flags_2;
  4427. A_UINT32 packet_type_enable_flags_3;
  4428. A_UINT32 tlv_filter_in_flags;
  4429. A_UINT32 rx_packet_offset: 16,
  4430. rx_header_offset: 16;
  4431. A_UINT32 rx_mpdu_end_offset: 16,
  4432. rx_mpdu_start_offset: 16;
  4433. A_UINT32 rx_msdu_end_offset: 16,
  4434. rx_msdu_start_offset: 16;
  4435. A_UINT32 rx_attn_offset: 16,
  4436. rsvd3: 16;
  4437. } POSTPACK;
  4438. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4439. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4440. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4441. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4442. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4443. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4444. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4447. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4448. } while (0)
  4449. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4450. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4451. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4452. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4453. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4454. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4455. do { \
  4456. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4457. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4458. } while (0)
  4459. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4460. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4461. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4462. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4463. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4464. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4465. do { \
  4466. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4467. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4468. } while (0)
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4472. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4473. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4475. do { \
  4476. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4477. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4478. } while (0)
  4479. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4480. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4481. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4482. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4483. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4484. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4485. do { \
  4486. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4487. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4488. } while (0)
  4489. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4490. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4491. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4492. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4493. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4494. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4495. do { \
  4496. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4497. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4498. } while (0)
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4502. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4503. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4505. do { \
  4506. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4507. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4508. } while (0)
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4512. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4513. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4515. do { \
  4516. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4517. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4518. } while (0)
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4522. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4523. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4528. } while (0)
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4532. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4533. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4538. } while (0)
  4539. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4540. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4541. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4542. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4543. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4544. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4548. } while (0)
  4549. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4550. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4551. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4552. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4553. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4554. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4558. } while (0)
  4559. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4560. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4561. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4562. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4563. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4564. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4568. } while (0)
  4569. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4570. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4571. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4572. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4573. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4574. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4578. } while (0)
  4579. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4580. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4581. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4582. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4583. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4584. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4585. do { \
  4586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4588. } while (0)
  4589. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4590. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4591. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4592. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4593. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4594. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4595. do { \
  4596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4598. } while (0)
  4599. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4600. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4602. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4603. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4604. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4605. do { \
  4606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4608. } while (0)
  4609. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4610. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4611. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4612. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4613. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4614. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4615. do { \
  4616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4618. } while (0)
  4619. /*
  4620. * Subtype based MGMT frames enable bits.
  4621. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4622. */
  4623. /* association request */
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4630. /* association response */
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4637. /* Reassociation request */
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4644. /* Reassociation response */
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4651. /* Probe request */
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4658. /* Probe response */
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4665. /* Timing Advertisement */
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4672. /* Reserved */
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4679. /* Beacon */
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4686. /* ATIM */
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4693. /* Disassociation */
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4700. /* Authentication */
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4707. /* Deauthentication */
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4714. /* Action */
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4721. /* Action No Ack */
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4728. /* Reserved */
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4735. /*
  4736. * Subtype based CTRL frames enable bits.
  4737. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4738. */
  4739. /* Reserved */
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4746. /* Reserved */
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4753. /* Reserved */
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4760. /* Reserved */
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4767. /* Reserved */
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4774. /* Reserved */
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4781. /* Reserved */
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4788. /* Control Wrapper */
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4795. /* Block Ack Request */
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4802. /* Block Ack*/
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4809. /* PS-POLL */
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4816. /* RTS */
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4823. /* CTS */
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4830. /* ACK */
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4837. /* CF-END */
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4844. /* CF-END + CF-ACK */
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4851. /* Multicast data */
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4858. /* Unicast data */
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4865. /* NULL data */
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(httsym, value); \
  4875. (word) |= (value) << httsym##_S; \
  4876. } while (0)
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4878. (((word) & httsym##_M) >> httsym##_S)
  4879. #define htt_rx_ring_pkt_enable_subtype_set( \
  4880. word, flag, mode, type, subtype, val) \
  4881. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4882. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4883. #define htt_rx_ring_pkt_enable_subtype_get( \
  4884. word, flag, mode, type, subtype) \
  4885. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4886. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4887. /* Definition to filter in TLVs */
  4888. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4889. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4890. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4891. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4892. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4893. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4894. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4895. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4896. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4897. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4898. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4899. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4900. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4901. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4902. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4903. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4904. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4905. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4906. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4907. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4908. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4909. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4910. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4911. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4912. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4913. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4914. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(httsym, enable); \
  4917. (word) |= (enable) << httsym##_S; \
  4918. } while (0)
  4919. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4920. (((word) & httsym##_M) >> httsym##_S)
  4921. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4922. HTT_RX_RING_TLV_ENABLE_SET( \
  4923. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4924. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4925. HTT_RX_RING_TLV_ENABLE_GET( \
  4926. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4927. /**
  4928. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4929. * host --> target Receive Flow Steering configuration message definition.
  4930. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4931. * The reason for this is we want RFS to be configured and ready before MAC
  4932. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4933. *
  4934. * |31 24|23 16|15 9|8|7 0|
  4935. * |----------------+----------------+----------------+----------------|
  4936. * | reserved |E| msg type |
  4937. * |-------------------------------------------------------------------|
  4938. * Where E = RFS enable flag
  4939. *
  4940. * The RFS_CONFIG message consists of a single 4-byte word.
  4941. *
  4942. * Header fields:
  4943. * - MSG_TYPE
  4944. * Bits 7:0
  4945. * Purpose: identifies this as a RFS config msg
  4946. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4947. * - RFS_CONFIG
  4948. * Bit 8
  4949. * Purpose: Tells target whether to enable (1) or disable (0)
  4950. * flow steering feature when sending rx indication messages to host
  4951. */
  4952. #define HTT_H2T_RFS_CONFIG_M 0x100
  4953. #define HTT_H2T_RFS_CONFIG_S 8
  4954. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4955. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4956. HTT_H2T_RFS_CONFIG_S)
  4957. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4958. do { \
  4959. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4960. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4961. } while (0)
  4962. #define HTT_RFS_CFG_REQ_BYTES 4
  4963. /**
  4964. * @brief host -> target FW extended statistics retrieve
  4965. *
  4966. * @details
  4967. * The following field definitions describe the format of the HTT host
  4968. * to target FW extended stats retrieve message.
  4969. * The message specifies the type of stats the host wants to retrieve.
  4970. *
  4971. * |31 24|23 16|15 8|7 0|
  4972. * |-----------------------------------------------------------|
  4973. * | reserved | stats type | pdev_mask | msg type |
  4974. * |-----------------------------------------------------------|
  4975. * | config param [0] |
  4976. * |-----------------------------------------------------------|
  4977. * | config param [1] |
  4978. * |-----------------------------------------------------------|
  4979. * | config param [2] |
  4980. * |-----------------------------------------------------------|
  4981. * | config param [3] |
  4982. * |-----------------------------------------------------------|
  4983. * | reserved |
  4984. * |-----------------------------------------------------------|
  4985. * | cookie LSBs |
  4986. * |-----------------------------------------------------------|
  4987. * | cookie MSBs |
  4988. * |-----------------------------------------------------------|
  4989. * Header fields:
  4990. * - MSG_TYPE
  4991. * Bits 7:0
  4992. * Purpose: identifies this is a extended stats upload request message
  4993. * Value: 0x10
  4994. * - PDEV_MASK
  4995. * Bits 8:15
  4996. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4997. * Value: This is a overloaded field, refer to usage and interpretation of
  4998. * PDEV in interface document.
  4999. * Bit 8 : Reserved for SOC stats
  5000. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5001. * Indicates MACID_MASK in DBS
  5002. * - STATS_TYPE
  5003. * Bits 23:16
  5004. * Purpose: identifies which FW statistics to upload
  5005. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5006. * - Reserved
  5007. * Bits 31:24
  5008. * - CONFIG_PARAM [0]
  5009. * Bits 31:0
  5010. * Purpose: give an opaque configuration value to the specified stats type
  5011. * Value: stats-type specific configuration value
  5012. * Refer to htt_stats.h for interpretation for each stats sub_type
  5013. * - CONFIG_PARAM [1]
  5014. * Bits 31:0
  5015. * Purpose: give an opaque configuration value to the specified stats type
  5016. * Value: stats-type specific configuration value
  5017. * Refer to htt_stats.h for interpretation for each stats sub_type
  5018. * - CONFIG_PARAM [2]
  5019. * Bits 31:0
  5020. * Purpose: give an opaque configuration value to the specified stats type
  5021. * Value: stats-type specific configuration value
  5022. * Refer to htt_stats.h for interpretation for each stats sub_type
  5023. * - CONFIG_PARAM [3]
  5024. * Bits 31:0
  5025. * Purpose: give an opaque configuration value to the specified stats type
  5026. * Value: stats-type specific configuration value
  5027. * Refer to htt_stats.h for interpretation for each stats sub_type
  5028. * - Reserved [31:0] for future use.
  5029. * - COOKIE_LSBS
  5030. * Bits 31:0
  5031. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5032. * message with its preceding host->target stats request message.
  5033. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5034. * - COOKIE_MSBS
  5035. * Bits 31:0
  5036. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5037. * message with its preceding host->target stats request message.
  5038. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5039. */
  5040. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5041. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5042. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5043. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5044. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5045. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5046. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5047. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5048. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5049. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5050. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5051. do { \
  5052. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5053. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5054. } while (0)
  5055. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5056. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5057. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5058. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5059. do { \
  5060. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5061. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5062. } while (0)
  5063. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5064. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5065. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5066. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5067. do { \
  5068. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5069. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5070. } while (0)
  5071. /**
  5072. * @brief host -> target FW PPDU_STATS request message
  5073. *
  5074. * @details
  5075. * The following field definitions describe the format of the HTT host
  5076. * to target FW for PPDU_STATS_CFG msg.
  5077. * The message allows the host to configure the PPDU_STATS_IND messages
  5078. * produced by the target.
  5079. *
  5080. * |31 24|23 16|15 8|7 0|
  5081. * |-----------------------------------------------------------|
  5082. * | REQ bit mask | pdev_mask | msg type |
  5083. * |-----------------------------------------------------------|
  5084. * Header fields:
  5085. * - MSG_TYPE
  5086. * Bits 7:0
  5087. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5088. * Value: 0x11
  5089. * - PDEV_MASK
  5090. * Bits 8:15
  5091. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5092. * Value: This is a overloaded field, refer to usage and interpretation of
  5093. * PDEV in interface document.
  5094. * Bit 8 : Reserved for SOC stats
  5095. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5096. * Indicates MACID_MASK in DBS
  5097. * - REQ_TLV_BIT_MASK
  5098. * Bits 16:31
  5099. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5100. * needs to be included in the target's PPDU_STATS_IND messages.
  5101. * Value: refer htt_ppdu_stats_tlv_tag_t
  5102. *
  5103. */
  5104. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5105. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5106. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5107. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5108. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5109. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5110. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5111. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5112. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5113. do { \
  5114. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5115. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5116. } while (0)
  5117. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5118. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5119. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5120. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5121. do { \
  5122. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5123. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5124. } while (0)
  5125. /*=== target -> host messages ===============================================*/
  5126. enum htt_t2h_msg_type {
  5127. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5128. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5129. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5130. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5131. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5132. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5133. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5134. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5135. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5136. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5137. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5138. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5139. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5140. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5141. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5142. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5143. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5144. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5145. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5146. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5147. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5148. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5149. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5150. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5151. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5152. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5153. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5154. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5155. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5156. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5157. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5158. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5159. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5160. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5161. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5162. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5163. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5164. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5165. HTT_T2H_MSG_TYPE_TEST,
  5166. /* keep this last */
  5167. HTT_T2H_NUM_MSGS
  5168. };
  5169. /*
  5170. * HTT target to host message type -
  5171. * stored in bits 7:0 of the first word of the message
  5172. */
  5173. #define HTT_T2H_MSG_TYPE_M 0xff
  5174. #define HTT_T2H_MSG_TYPE_S 0
  5175. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5176. do { \
  5177. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5178. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5179. } while (0)
  5180. #define HTT_T2H_MSG_TYPE_GET(word) \
  5181. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5182. /**
  5183. * @brief target -> host version number confirmation message definition
  5184. *
  5185. * |31 24|23 16|15 8|7 0|
  5186. * |----------------+----------------+----------------+----------------|
  5187. * | reserved | major number | minor number | msg type |
  5188. * |-------------------------------------------------------------------|
  5189. * : option request TLV (optional) |
  5190. * :...................................................................:
  5191. *
  5192. * The VER_CONF message may consist of a single 4-byte word, or may be
  5193. * extended with TLVs that specify HTT options selected by the target.
  5194. * The following option TLVs may be appended to the VER_CONF message:
  5195. * - LL_BUS_ADDR_SIZE
  5196. * - HL_SUPPRESS_TX_COMPL_IND
  5197. * - MAX_TX_QUEUE_GROUPS
  5198. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5199. * may be appended to the VER_CONF message (but only one TLV of each type).
  5200. *
  5201. * Header fields:
  5202. * - MSG_TYPE
  5203. * Bits 7:0
  5204. * Purpose: identifies this as a version number confirmation message
  5205. * Value: 0x0
  5206. * - VER_MINOR
  5207. * Bits 15:8
  5208. * Purpose: Specify the minor number of the HTT message library version
  5209. * in use by the target firmware.
  5210. * The minor number specifies the specific revision within a range
  5211. * of fundamentally compatible HTT message definition revisions.
  5212. * Compatible revisions involve adding new messages or perhaps
  5213. * adding new fields to existing messages, in a backwards-compatible
  5214. * manner.
  5215. * Incompatible revisions involve changing the message type values,
  5216. * or redefining existing messages.
  5217. * Value: minor number
  5218. * - VER_MAJOR
  5219. * Bits 15:8
  5220. * Purpose: Specify the major number of the HTT message library version
  5221. * in use by the target firmware.
  5222. * The major number specifies the family of minor revisions that are
  5223. * fundamentally compatible with each other, but not with prior or
  5224. * later families.
  5225. * Value: major number
  5226. */
  5227. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5228. #define HTT_VER_CONF_MINOR_S 8
  5229. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5230. #define HTT_VER_CONF_MAJOR_S 16
  5231. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5232. do { \
  5233. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5234. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5235. } while (0)
  5236. #define HTT_VER_CONF_MINOR_GET(word) \
  5237. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5238. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5239. do { \
  5240. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5241. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5242. } while (0)
  5243. #define HTT_VER_CONF_MAJOR_GET(word) \
  5244. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5245. #define HTT_VER_CONF_BYTES 4
  5246. /**
  5247. * @brief - target -> host HTT Rx In order indication message
  5248. *
  5249. * @details
  5250. *
  5251. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5252. * |----------------+-------------------+---------------------+---------------|
  5253. * | peer ID | P| F| O| ext TID | msg type |
  5254. * |--------------------------------------------------------------------------|
  5255. * | MSDU count | Reserved | vdev id |
  5256. * |--------------------------------------------------------------------------|
  5257. * | MSDU 0 bus address (bits 31:0) |
  5258. #if HTT_PADDR64
  5259. * | MSDU 0 bus address (bits 63:32) |
  5260. #endif
  5261. * |--------------------------------------------------------------------------|
  5262. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5263. * |--------------------------------------------------------------------------|
  5264. * | MSDU 1 bus address (bits 31:0) |
  5265. #if HTT_PADDR64
  5266. * | MSDU 1 bus address (bits 63:32) |
  5267. #endif
  5268. * |--------------------------------------------------------------------------|
  5269. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5270. * |--------------------------------------------------------------------------|
  5271. */
  5272. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5273. *
  5274. * @details
  5275. * bits
  5276. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5277. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5278. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5279. * | | frag | | | | fail |chksum fail|
  5280. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5281. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5282. */
  5283. struct htt_rx_in_ord_paddr_ind_hdr_t
  5284. {
  5285. A_UINT32 /* word 0 */
  5286. msg_type: 8,
  5287. ext_tid: 5,
  5288. offload: 1,
  5289. frag: 1,
  5290. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5291. peer_id: 16;
  5292. A_UINT32 /* word 1 */
  5293. vap_id: 8,
  5294. reserved_1: 8,
  5295. msdu_cnt: 16;
  5296. };
  5297. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5298. {
  5299. A_UINT32 dma_addr;
  5300. A_UINT32
  5301. length: 16,
  5302. fw_desc: 8,
  5303. msdu_info:8;
  5304. };
  5305. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5306. {
  5307. A_UINT32 dma_addr_lo;
  5308. A_UINT32 dma_addr_hi;
  5309. A_UINT32
  5310. length: 16,
  5311. fw_desc: 8,
  5312. msdu_info:8;
  5313. };
  5314. #if HTT_PADDR64
  5315. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5316. #else
  5317. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5318. #endif
  5319. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5320. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5321. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5322. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5323. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5324. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5325. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5326. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5327. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5328. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5329. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5330. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5331. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5332. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5333. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5334. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5335. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5336. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5337. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5338. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5339. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5340. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5341. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5342. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5343. /* for systems using 64-bit format for bus addresses */
  5344. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5345. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5346. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5347. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5348. /* for systems using 32-bit format for bus addresses */
  5349. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5350. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5351. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5352. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5353. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5354. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5355. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5356. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5357. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5358. do { \
  5359. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5360. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5361. } while (0)
  5362. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5363. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5364. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5365. do { \
  5366. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5367. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5368. } while (0)
  5369. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5370. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5371. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5374. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5375. } while (0)
  5376. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5377. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5378. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5381. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5382. } while (0)
  5383. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5384. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5385. /* for systems using 64-bit format for bus addresses */
  5386. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5389. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5390. } while (0)
  5391. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5392. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5393. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5396. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5397. } while (0)
  5398. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5399. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5400. /* for systems using 32-bit format for bus addresses */
  5401. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5404. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5405. } while (0)
  5406. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5407. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5408. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5411. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5412. } while (0)
  5413. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5414. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5415. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5416. do { \
  5417. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5418. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5419. } while (0)
  5420. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5421. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5422. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5423. do { \
  5424. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5425. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5426. } while (0)
  5427. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5428. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5429. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5432. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5433. } while (0)
  5434. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5435. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5436. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5439. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5440. } while (0)
  5441. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5442. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5443. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5446. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5447. } while (0)
  5448. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5449. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5450. /* definitions used within target -> host rx indication message */
  5451. PREPACK struct htt_rx_ind_hdr_prefix_t
  5452. {
  5453. A_UINT32 /* word 0 */
  5454. msg_type: 8,
  5455. ext_tid: 5,
  5456. release_valid: 1,
  5457. flush_valid: 1,
  5458. reserved0: 1,
  5459. peer_id: 16;
  5460. A_UINT32 /* word 1 */
  5461. flush_start_seq_num: 6,
  5462. flush_end_seq_num: 6,
  5463. release_start_seq_num: 6,
  5464. release_end_seq_num: 6,
  5465. num_mpdu_ranges: 8;
  5466. } POSTPACK;
  5467. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5468. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5469. #define HTT_TGT_RSSI_INVALID 0x80
  5470. PREPACK struct htt_rx_ppdu_desc_t
  5471. {
  5472. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5473. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5474. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5475. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5476. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5477. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5478. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5479. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5480. A_UINT32 /* word 0 */
  5481. rssi_cmb: 8,
  5482. timestamp_submicrosec: 8,
  5483. phy_err_code: 8,
  5484. phy_err: 1,
  5485. legacy_rate: 4,
  5486. legacy_rate_sel: 1,
  5487. end_valid: 1,
  5488. start_valid: 1;
  5489. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5490. union {
  5491. A_UINT32 /* word 1 */
  5492. rssi0_pri20: 8,
  5493. rssi0_ext20: 8,
  5494. rssi0_ext40: 8,
  5495. rssi0_ext80: 8;
  5496. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5497. } u0;
  5498. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5499. union {
  5500. A_UINT32 /* word 2 */
  5501. rssi1_pri20: 8,
  5502. rssi1_ext20: 8,
  5503. rssi1_ext40: 8,
  5504. rssi1_ext80: 8;
  5505. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5506. } u1;
  5507. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5508. union {
  5509. A_UINT32 /* word 3 */
  5510. rssi2_pri20: 8,
  5511. rssi2_ext20: 8,
  5512. rssi2_ext40: 8,
  5513. rssi2_ext80: 8;
  5514. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5515. } u2;
  5516. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5517. union {
  5518. A_UINT32 /* word 4 */
  5519. rssi3_pri20: 8,
  5520. rssi3_ext20: 8,
  5521. rssi3_ext40: 8,
  5522. rssi3_ext80: 8;
  5523. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5524. } u3;
  5525. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5526. A_UINT32 tsf32; /* word 5 */
  5527. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5528. A_UINT32 timestamp_microsec; /* word 6 */
  5529. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5530. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5531. A_UINT32 /* word 7 */
  5532. vht_sig_a1: 24,
  5533. preamble_type: 8;
  5534. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5535. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5536. A_UINT32 /* word 8 */
  5537. vht_sig_a2: 24,
  5538. /* sa_ant_matrix
  5539. * For cases where a single rx chain has options to be connected to
  5540. * different rx antennas, show which rx antennas were in use during
  5541. * receipt of a given PPDU.
  5542. * This sa_ant_matrix provides a bitmask of the antennas used while
  5543. * receiving this frame.
  5544. */
  5545. sa_ant_matrix: 8;
  5546. } POSTPACK;
  5547. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5548. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5549. PREPACK struct htt_rx_ind_hdr_suffix_t
  5550. {
  5551. A_UINT32 /* word 0 */
  5552. fw_rx_desc_bytes: 16,
  5553. reserved0: 16;
  5554. } POSTPACK;
  5555. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5556. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5557. PREPACK struct htt_rx_ind_hdr_t
  5558. {
  5559. struct htt_rx_ind_hdr_prefix_t prefix;
  5560. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5561. struct htt_rx_ind_hdr_suffix_t suffix;
  5562. } POSTPACK;
  5563. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5564. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5565. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5566. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5567. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5568. /*
  5569. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5570. * the offset into the HTT rx indication message at which the
  5571. * FW rx PPDU descriptor resides
  5572. */
  5573. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5574. /*
  5575. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5576. * the offset into the HTT rx indication message at which the
  5577. * header suffix (FW rx MSDU byte count) resides
  5578. */
  5579. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5580. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5581. /*
  5582. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5583. * the offset into the HTT rx indication message at which the per-MSDU
  5584. * information starts
  5585. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5586. * per-MSDU information portion of the message. The per-MSDU info itself
  5587. * starts at byte 12.
  5588. */
  5589. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5590. /**
  5591. * @brief target -> host rx indication message definition
  5592. *
  5593. * @details
  5594. * The following field definitions describe the format of the rx indication
  5595. * message sent from the target to the host.
  5596. * The message consists of three major sections:
  5597. * 1. a fixed-length header
  5598. * 2. a variable-length list of firmware rx MSDU descriptors
  5599. * 3. one or more 4-octet MPDU range information elements
  5600. * The fixed length header itself has two sub-sections
  5601. * 1. the message meta-information, including identification of the
  5602. * sender and type of the received data, and a 4-octet flush/release IE
  5603. * 2. the firmware rx PPDU descriptor
  5604. *
  5605. * The format of the message is depicted below.
  5606. * in this depiction, the following abbreviations are used for information
  5607. * elements within the message:
  5608. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5609. * elements associated with the PPDU start are valid.
  5610. * Specifically, the following fields are valid only if SV is set:
  5611. * RSSI (all variants), L, legacy rate, preamble type, service,
  5612. * VHT-SIG-A
  5613. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5614. * elements associated with the PPDU end are valid.
  5615. * Specifically, the following fields are valid only if EV is set:
  5616. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5617. * - L - Legacy rate selector - if legacy rates are used, this flag
  5618. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5619. * (L == 0) PHY.
  5620. * - P - PHY error flag - boolean indication of whether the rx frame had
  5621. * a PHY error
  5622. *
  5623. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5624. * |----------------+-------------------+---------------------+---------------|
  5625. * | peer ID | |RV|FV| ext TID | msg type |
  5626. * |--------------------------------------------------------------------------|
  5627. * | num | release | release | flush | flush |
  5628. * | MPDU | end | start | end | start |
  5629. * | ranges | seq num | seq num | seq num | seq num |
  5630. * |==========================================================================|
  5631. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5632. * |V|V| | rate | | | timestamp | RSSI |
  5633. * |--------------------------------------------------------------------------|
  5634. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5635. * |--------------------------------------------------------------------------|
  5636. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5637. * |--------------------------------------------------------------------------|
  5638. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5639. * |--------------------------------------------------------------------------|
  5640. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5641. * |--------------------------------------------------------------------------|
  5642. * | TSF LSBs |
  5643. * |--------------------------------------------------------------------------|
  5644. * | microsec timestamp |
  5645. * |--------------------------------------------------------------------------|
  5646. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5647. * |--------------------------------------------------------------------------|
  5648. * | service | HT-SIG / VHT-SIG-A2 |
  5649. * |==========================================================================|
  5650. * | reserved | FW rx desc bytes |
  5651. * |--------------------------------------------------------------------------|
  5652. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5653. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5654. * |--------------------------------------------------------------------------|
  5655. * : : :
  5656. * |--------------------------------------------------------------------------|
  5657. * | alignment | MSDU Rx |
  5658. * | padding | desc Bn |
  5659. * |--------------------------------------------------------------------------|
  5660. * | reserved | MPDU range status | MPDU count |
  5661. * |--------------------------------------------------------------------------|
  5662. * : reserved : MPDU range status : MPDU count :
  5663. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5664. *
  5665. * Header fields:
  5666. * - MSG_TYPE
  5667. * Bits 7:0
  5668. * Purpose: identifies this as an rx indication message
  5669. * Value: 0x1
  5670. * - EXT_TID
  5671. * Bits 12:8
  5672. * Purpose: identify the traffic ID of the rx data, including
  5673. * special "extended" TID values for multicast, broadcast, and
  5674. * non-QoS data frames
  5675. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5676. * - FLUSH_VALID (FV)
  5677. * Bit 13
  5678. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5679. * is valid
  5680. * Value:
  5681. * 1 -> flush IE is valid and needs to be processed
  5682. * 0 -> flush IE is not valid and should be ignored
  5683. * - REL_VALID (RV)
  5684. * Bit 13
  5685. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5686. * is valid
  5687. * Value:
  5688. * 1 -> release IE is valid and needs to be processed
  5689. * 0 -> release IE is not valid and should be ignored
  5690. * - PEER_ID
  5691. * Bits 31:16
  5692. * Purpose: Identify, by ID, which peer sent the rx data
  5693. * Value: ID of the peer who sent the rx data
  5694. * - FLUSH_SEQ_NUM_START
  5695. * Bits 5:0
  5696. * Purpose: Indicate the start of a series of MPDUs to flush
  5697. * Not all MPDUs within this series are necessarily valid - the host
  5698. * must check each sequence number within this range to see if the
  5699. * corresponding MPDU is actually present.
  5700. * This field is only valid if the FV bit is set.
  5701. * Value:
  5702. * The sequence number for the first MPDUs to check to flush.
  5703. * The sequence number is masked by 0x3f.
  5704. * - FLUSH_SEQ_NUM_END
  5705. * Bits 11:6
  5706. * Purpose: Indicate the end of a series of MPDUs to flush
  5707. * Value:
  5708. * The sequence number one larger than the sequence number of the
  5709. * last MPDU to check to flush.
  5710. * The sequence number is masked by 0x3f.
  5711. * Not all MPDUs within this series are necessarily valid - the host
  5712. * must check each sequence number within this range to see if the
  5713. * corresponding MPDU is actually present.
  5714. * This field is only valid if the FV bit is set.
  5715. * - REL_SEQ_NUM_START
  5716. * Bits 17:12
  5717. * Purpose: Indicate the start of a series of MPDUs to release.
  5718. * All MPDUs within this series are present and valid - the host
  5719. * need not check each sequence number within this range to see if
  5720. * the corresponding MPDU is actually present.
  5721. * This field is only valid if the RV bit is set.
  5722. * Value:
  5723. * The sequence number for the first MPDUs to check to release.
  5724. * The sequence number is masked by 0x3f.
  5725. * - REL_SEQ_NUM_END
  5726. * Bits 23:18
  5727. * Purpose: Indicate the end of a series of MPDUs to release.
  5728. * Value:
  5729. * The sequence number one larger than the sequence number of the
  5730. * last MPDU to check to release.
  5731. * The sequence number is masked by 0x3f.
  5732. * All MPDUs within this series are present and valid - the host
  5733. * need not check each sequence number within this range to see if
  5734. * the corresponding MPDU is actually present.
  5735. * This field is only valid if the RV bit is set.
  5736. * - NUM_MPDU_RANGES
  5737. * Bits 31:24
  5738. * Purpose: Indicate how many ranges of MPDUs are present.
  5739. * Each MPDU range consists of a series of contiguous MPDUs within the
  5740. * rx frame sequence which all have the same MPDU status.
  5741. * Value: 1-63 (typically a small number, like 1-3)
  5742. *
  5743. * Rx PPDU descriptor fields:
  5744. * - RSSI_CMB
  5745. * Bits 7:0
  5746. * Purpose: Combined RSSI from all active rx chains, across the active
  5747. * bandwidth.
  5748. * Value: RSSI dB units w.r.t. noise floor
  5749. * - TIMESTAMP_SUBMICROSEC
  5750. * Bits 15:8
  5751. * Purpose: high-resolution timestamp
  5752. * Value:
  5753. * Sub-microsecond time of PPDU reception.
  5754. * This timestamp ranges from [0,MAC clock MHz).
  5755. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5756. * to form a high-resolution, large range rx timestamp.
  5757. * - PHY_ERR_CODE
  5758. * Bits 23:16
  5759. * Purpose:
  5760. * If the rx frame processing resulted in a PHY error, indicate what
  5761. * type of rx PHY error occurred.
  5762. * Value:
  5763. * This field is valid if the "P" (PHY_ERR) flag is set.
  5764. * TBD: document/specify the values for this field
  5765. * - PHY_ERR
  5766. * Bit 24
  5767. * Purpose: indicate whether the rx PPDU had a PHY error
  5768. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5769. * - LEGACY_RATE
  5770. * Bits 28:25
  5771. * Purpose:
  5772. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5773. * specify which rate was used.
  5774. * Value:
  5775. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5776. * flag.
  5777. * If LEGACY_RATE_SEL is 0:
  5778. * 0x8: OFDM 48 Mbps
  5779. * 0x9: OFDM 24 Mbps
  5780. * 0xA: OFDM 12 Mbps
  5781. * 0xB: OFDM 6 Mbps
  5782. * 0xC: OFDM 54 Mbps
  5783. * 0xD: OFDM 36 Mbps
  5784. * 0xE: OFDM 18 Mbps
  5785. * 0xF: OFDM 9 Mbps
  5786. * If LEGACY_RATE_SEL is 1:
  5787. * 0x8: CCK 11 Mbps long preamble
  5788. * 0x9: CCK 5.5 Mbps long preamble
  5789. * 0xA: CCK 2 Mbps long preamble
  5790. * 0xB: CCK 1 Mbps long preamble
  5791. * 0xC: CCK 11 Mbps short preamble
  5792. * 0xD: CCK 5.5 Mbps short preamble
  5793. * 0xE: CCK 2 Mbps short preamble
  5794. * - LEGACY_RATE_SEL
  5795. * Bit 29
  5796. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5797. * Value:
  5798. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5799. * used a legacy rate.
  5800. * 0 -> OFDM, 1 -> CCK
  5801. * - END_VALID
  5802. * Bit 30
  5803. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5804. * the start of the PPDU are valid. Specifically, the following
  5805. * fields are only valid if END_VALID is set:
  5806. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5807. * TIMESTAMP_SUBMICROSEC
  5808. * Value:
  5809. * 0 -> rx PPDU desc end fields are not valid
  5810. * 1 -> rx PPDU desc end fields are valid
  5811. * - START_VALID
  5812. * Bit 31
  5813. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5814. * the end of the PPDU are valid. Specifically, the following
  5815. * fields are only valid if START_VALID is set:
  5816. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5817. * VHT-SIG-A
  5818. * Value:
  5819. * 0 -> rx PPDU desc start fields are not valid
  5820. * 1 -> rx PPDU desc start fields are valid
  5821. * - RSSI0_PRI20
  5822. * Bits 7:0
  5823. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5824. * Value: RSSI dB units w.r.t. noise floor
  5825. *
  5826. * - RSSI0_EXT20
  5827. * Bits 7:0
  5828. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5829. * (if the rx bandwidth was >= 40 MHz)
  5830. * Value: RSSI dB units w.r.t. noise floor
  5831. * - RSSI0_EXT40
  5832. * Bits 7:0
  5833. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5834. * (if the rx bandwidth was >= 80 MHz)
  5835. * Value: RSSI dB units w.r.t. noise floor
  5836. * - RSSI0_EXT80
  5837. * Bits 7:0
  5838. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5839. * (if the rx bandwidth was >= 160 MHz)
  5840. * Value: RSSI dB units w.r.t. noise floor
  5841. *
  5842. * - RSSI1_PRI20
  5843. * Bits 7:0
  5844. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5845. * Value: RSSI dB units w.r.t. noise floor
  5846. * - RSSI1_EXT20
  5847. * Bits 7:0
  5848. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5849. * (if the rx bandwidth was >= 40 MHz)
  5850. * Value: RSSI dB units w.r.t. noise floor
  5851. * - RSSI1_EXT40
  5852. * Bits 7:0
  5853. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5854. * (if the rx bandwidth was >= 80 MHz)
  5855. * Value: RSSI dB units w.r.t. noise floor
  5856. * - RSSI1_EXT80
  5857. * Bits 7:0
  5858. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5859. * (if the rx bandwidth was >= 160 MHz)
  5860. * Value: RSSI dB units w.r.t. noise floor
  5861. *
  5862. * - RSSI2_PRI20
  5863. * Bits 7:0
  5864. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5865. * Value: RSSI dB units w.r.t. noise floor
  5866. * - RSSI2_EXT20
  5867. * Bits 7:0
  5868. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5869. * (if the rx bandwidth was >= 40 MHz)
  5870. * Value: RSSI dB units w.r.t. noise floor
  5871. * - RSSI2_EXT40
  5872. * Bits 7:0
  5873. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5874. * (if the rx bandwidth was >= 80 MHz)
  5875. * Value: RSSI dB units w.r.t. noise floor
  5876. * - RSSI2_EXT80
  5877. * Bits 7:0
  5878. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5879. * (if the rx bandwidth was >= 160 MHz)
  5880. * Value: RSSI dB units w.r.t. noise floor
  5881. *
  5882. * - RSSI3_PRI20
  5883. * Bits 7:0
  5884. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5885. * Value: RSSI dB units w.r.t. noise floor
  5886. * - RSSI3_EXT20
  5887. * Bits 7:0
  5888. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5889. * (if the rx bandwidth was >= 40 MHz)
  5890. * Value: RSSI dB units w.r.t. noise floor
  5891. * - RSSI3_EXT40
  5892. * Bits 7:0
  5893. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5894. * (if the rx bandwidth was >= 80 MHz)
  5895. * Value: RSSI dB units w.r.t. noise floor
  5896. * - RSSI3_EXT80
  5897. * Bits 7:0
  5898. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5899. * (if the rx bandwidth was >= 160 MHz)
  5900. * Value: RSSI dB units w.r.t. noise floor
  5901. *
  5902. * - TSF32
  5903. * Bits 31:0
  5904. * Purpose: specify the time the rx PPDU was received, in TSF units
  5905. * Value: 32 LSBs of the TSF
  5906. * - TIMESTAMP_MICROSEC
  5907. * Bits 31:0
  5908. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5909. * Value: PPDU rx time, in microseconds
  5910. * - VHT_SIG_A1
  5911. * Bits 23:0
  5912. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5913. * from the rx PPDU
  5914. * Value:
  5915. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5916. * VHT-SIG-A1 data.
  5917. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5918. * first 24 bits of the HT-SIG data.
  5919. * Otherwise, this field is invalid.
  5920. * Refer to the the 802.11 protocol for the definition of the
  5921. * HT-SIG and VHT-SIG-A1 fields
  5922. * - VHT_SIG_A2
  5923. * Bits 23:0
  5924. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5925. * from the rx PPDU
  5926. * Value:
  5927. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5928. * VHT-SIG-A2 data.
  5929. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5930. * last 24 bits of the HT-SIG data.
  5931. * Otherwise, this field is invalid.
  5932. * Refer to the the 802.11 protocol for the definition of the
  5933. * HT-SIG and VHT-SIG-A2 fields
  5934. * - PREAMBLE_TYPE
  5935. * Bits 31:24
  5936. * Purpose: indicate the PHY format of the received burst
  5937. * Value:
  5938. * 0x4: Legacy (OFDM/CCK)
  5939. * 0x8: HT
  5940. * 0x9: HT with TxBF
  5941. * 0xC: VHT
  5942. * 0xD: VHT with TxBF
  5943. * - SERVICE
  5944. * Bits 31:24
  5945. * Purpose: TBD
  5946. * Value: TBD
  5947. *
  5948. * Rx MSDU descriptor fields:
  5949. * - FW_RX_DESC_BYTES
  5950. * Bits 15:0
  5951. * Purpose: Indicate how many bytes in the Rx indication are used for
  5952. * FW Rx descriptors
  5953. *
  5954. * Payload fields:
  5955. * - MPDU_COUNT
  5956. * Bits 7:0
  5957. * Purpose: Indicate how many sequential MPDUs share the same status.
  5958. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5959. * - MPDU_STATUS
  5960. * Bits 15:8
  5961. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5962. * received successfully.
  5963. * Value:
  5964. * 0x1: success
  5965. * 0x2: FCS error
  5966. * 0x3: duplicate error
  5967. * 0x4: replay error
  5968. * 0x5: invalid peer
  5969. */
  5970. /* header fields */
  5971. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5972. #define HTT_RX_IND_EXT_TID_S 8
  5973. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5974. #define HTT_RX_IND_FLUSH_VALID_S 13
  5975. #define HTT_RX_IND_REL_VALID_M 0x4000
  5976. #define HTT_RX_IND_REL_VALID_S 14
  5977. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5978. #define HTT_RX_IND_PEER_ID_S 16
  5979. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5980. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5981. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5982. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5983. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5984. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5985. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5986. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5987. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5988. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5989. /* rx PPDU descriptor fields */
  5990. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5991. #define HTT_RX_IND_RSSI_CMB_S 0
  5992. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5993. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5994. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5995. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5996. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5997. #define HTT_RX_IND_PHY_ERR_S 24
  5998. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5999. #define HTT_RX_IND_LEGACY_RATE_S 25
  6000. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6001. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6002. #define HTT_RX_IND_END_VALID_M 0x40000000
  6003. #define HTT_RX_IND_END_VALID_S 30
  6004. #define HTT_RX_IND_START_VALID_M 0x80000000
  6005. #define HTT_RX_IND_START_VALID_S 31
  6006. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6007. #define HTT_RX_IND_RSSI_PRI20_S 0
  6008. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6009. #define HTT_RX_IND_RSSI_EXT20_S 8
  6010. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6011. #define HTT_RX_IND_RSSI_EXT40_S 16
  6012. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6013. #define HTT_RX_IND_RSSI_EXT80_S 24
  6014. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6015. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6016. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6017. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6018. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6019. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6020. #define HTT_RX_IND_SERVICE_M 0xff000000
  6021. #define HTT_RX_IND_SERVICE_S 24
  6022. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6023. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6024. /* rx MSDU descriptor fields */
  6025. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6026. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6027. /* payload fields */
  6028. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6029. #define HTT_RX_IND_MPDU_COUNT_S 0
  6030. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6031. #define HTT_RX_IND_MPDU_STATUS_S 8
  6032. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6035. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6036. } while (0)
  6037. #define HTT_RX_IND_EXT_TID_GET(word) \
  6038. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6039. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6040. do { \
  6041. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6042. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6043. } while (0)
  6044. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6045. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6046. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6049. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6050. } while (0)
  6051. #define HTT_RX_IND_REL_VALID_GET(word) \
  6052. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6053. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6054. do { \
  6055. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6056. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6057. } while (0)
  6058. #define HTT_RX_IND_PEER_ID_GET(word) \
  6059. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6060. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6061. do { \
  6062. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6063. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6064. } while (0)
  6065. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6066. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6067. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6068. do { \
  6069. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6070. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6071. } while (0)
  6072. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6073. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6074. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6075. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6076. do { \
  6077. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6078. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6079. } while (0)
  6080. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6081. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6082. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6083. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6084. do { \
  6085. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6086. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6087. } while (0)
  6088. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6089. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6090. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6091. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6092. do { \
  6093. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6094. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6095. } while (0)
  6096. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6097. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6098. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6099. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6100. do { \
  6101. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6102. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6103. } while (0)
  6104. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6105. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6106. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6107. /* FW rx PPDU descriptor fields */
  6108. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6109. do { \
  6110. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6111. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6112. } while (0)
  6113. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6114. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6115. HTT_RX_IND_RSSI_CMB_S)
  6116. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6117. do { \
  6118. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6119. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6120. } while (0)
  6121. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6122. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6123. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6124. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6127. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6128. } while (0)
  6129. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6130. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6131. HTT_RX_IND_PHY_ERR_CODE_S)
  6132. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6133. do { \
  6134. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6135. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6136. } while (0)
  6137. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6138. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6139. HTT_RX_IND_PHY_ERR_S)
  6140. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6141. do { \
  6142. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6143. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6144. } while (0)
  6145. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6146. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6147. HTT_RX_IND_LEGACY_RATE_S)
  6148. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6149. do { \
  6150. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6151. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6152. } while (0)
  6153. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6154. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6155. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6156. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6157. do { \
  6158. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6159. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6160. } while (0)
  6161. #define HTT_RX_IND_END_VALID_GET(word) \
  6162. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6163. HTT_RX_IND_END_VALID_S)
  6164. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6165. do { \
  6166. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6167. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6168. } while (0)
  6169. #define HTT_RX_IND_START_VALID_GET(word) \
  6170. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6171. HTT_RX_IND_START_VALID_S)
  6172. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6173. do { \
  6174. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6175. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6176. } while (0)
  6177. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6178. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6179. HTT_RX_IND_RSSI_PRI20_S)
  6180. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6181. do { \
  6182. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6183. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6184. } while (0)
  6185. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6186. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6187. HTT_RX_IND_RSSI_EXT20_S)
  6188. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6189. do { \
  6190. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6191. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6192. } while (0)
  6193. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6194. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6195. HTT_RX_IND_RSSI_EXT40_S)
  6196. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6197. do { \
  6198. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6199. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6200. } while (0)
  6201. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6202. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6203. HTT_RX_IND_RSSI_EXT80_S)
  6204. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6205. do { \
  6206. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6207. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6208. } while (0)
  6209. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6210. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6211. HTT_RX_IND_VHT_SIG_A1_S)
  6212. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6213. do { \
  6214. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6215. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6216. } while (0)
  6217. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6218. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6219. HTT_RX_IND_VHT_SIG_A2_S)
  6220. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6221. do { \
  6222. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6223. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6224. } while (0)
  6225. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6226. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6227. HTT_RX_IND_PREAMBLE_TYPE_S)
  6228. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6229. do { \
  6230. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6231. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6232. } while (0)
  6233. #define HTT_RX_IND_SERVICE_GET(word) \
  6234. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6235. HTT_RX_IND_SERVICE_S)
  6236. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6237. do { \
  6238. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6239. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6240. } while (0)
  6241. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6242. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6243. HTT_RX_IND_SA_ANT_MATRIX_S)
  6244. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6245. do { \
  6246. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6247. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6248. } while (0)
  6249. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6250. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6251. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6252. do { \
  6253. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6254. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6255. } while (0)
  6256. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6257. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6258. #define HTT_RX_IND_HL_BYTES \
  6259. (HTT_RX_IND_HDR_BYTES + \
  6260. 4 /* single FW rx MSDU descriptor */ + \
  6261. 4 /* single MPDU range information element */)
  6262. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6263. /* Could we use one macro entry? */
  6264. #define HTT_WORD_SET(word, field, value) \
  6265. do { \
  6266. HTT_CHECK_SET_VAL(field, value); \
  6267. (word) |= ((value) << field ## _S); \
  6268. } while (0)
  6269. #define HTT_WORD_GET(word, field) \
  6270. (((word) & field ## _M) >> field ## _S)
  6271. PREPACK struct hl_htt_rx_ind_base {
  6272. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6273. } POSTPACK;
  6274. /*
  6275. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6276. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6277. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6278. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6279. * htt_rx_ind_hl_rx_desc_t.
  6280. */
  6281. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6282. struct htt_rx_ind_hl_rx_desc_t {
  6283. A_UINT8 ver;
  6284. A_UINT8 len;
  6285. struct {
  6286. A_UINT8
  6287. first_msdu: 1,
  6288. last_msdu: 1,
  6289. c3_failed: 1,
  6290. c4_failed: 1,
  6291. ipv6: 1,
  6292. tcp: 1,
  6293. udp: 1,
  6294. reserved: 1;
  6295. } flags;
  6296. /* NOTE: no reserved space - don't append any new fields here */
  6297. };
  6298. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6299. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6300. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6301. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6302. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6303. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6304. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6305. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6306. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6307. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6308. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6309. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6310. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6311. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6312. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6313. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6314. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6315. /* This structure is used in HL, the basic descriptor information
  6316. * used by host. the structure is translated by FW from HW desc
  6317. * or generated by FW. But in HL monitor mode, the host would use
  6318. * the same structure with LL.
  6319. */
  6320. PREPACK struct hl_htt_rx_desc_base {
  6321. A_UINT32
  6322. seq_num:12,
  6323. encrypted:1,
  6324. chan_info_present:1,
  6325. resv0:2,
  6326. mcast_bcast:1,
  6327. fragment:1,
  6328. key_id_oct:8,
  6329. resv1:6;
  6330. A_UINT32
  6331. pn_31_0;
  6332. union {
  6333. struct {
  6334. A_UINT16 pn_47_32;
  6335. A_UINT16 pn_63_48;
  6336. } pn16;
  6337. A_UINT32 pn_63_32;
  6338. } u0;
  6339. A_UINT32
  6340. pn_95_64;
  6341. A_UINT32
  6342. pn_127_96;
  6343. } POSTPACK;
  6344. /*
  6345. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6346. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6347. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6348. * Please see htt_chan_change_t for description of the fields.
  6349. */
  6350. PREPACK struct htt_chan_info_t
  6351. {
  6352. A_UINT32 primary_chan_center_freq_mhz: 16,
  6353. contig_chan1_center_freq_mhz: 16;
  6354. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6355. phy_mode: 8,
  6356. reserved: 8;
  6357. } POSTPACK;
  6358. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6359. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6360. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6361. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6362. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6363. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6364. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6365. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6366. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6367. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6368. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6369. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6370. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6371. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6372. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6373. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6374. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6375. /* Channel information */
  6376. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6377. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6378. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6379. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6380. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6381. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6382. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6383. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6384. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6385. do { \
  6386. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6387. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6388. } while (0)
  6389. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6390. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6391. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6394. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6395. } while (0)
  6396. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6397. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6398. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6399. do { \
  6400. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6401. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6402. } while (0)
  6403. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6404. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6405. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6406. do { \
  6407. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6408. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6409. } while (0)
  6410. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6411. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6412. /*
  6413. * @brief target -> host rx reorder flush message definition
  6414. *
  6415. * @details
  6416. * The following field definitions describe the format of the rx flush
  6417. * message sent from the target to the host.
  6418. * The message consists of a 4-octet header, followed by one or more
  6419. * 4-octet payload information elements.
  6420. *
  6421. * |31 24|23 8|7 0|
  6422. * |--------------------------------------------------------------|
  6423. * | TID | peer ID | msg type |
  6424. * |--------------------------------------------------------------|
  6425. * | seq num end | seq num start | MPDU status | reserved |
  6426. * |--------------------------------------------------------------|
  6427. * First DWORD:
  6428. * - MSG_TYPE
  6429. * Bits 7:0
  6430. * Purpose: identifies this as an rx flush message
  6431. * Value: 0x2
  6432. * - PEER_ID
  6433. * Bits 23:8 (only bits 18:8 actually used)
  6434. * Purpose: identify which peer's rx data is being flushed
  6435. * Value: (rx) peer ID
  6436. * - TID
  6437. * Bits 31:24 (only bits 27:24 actually used)
  6438. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6439. * Value: traffic identifier
  6440. * Second DWORD:
  6441. * - MPDU_STATUS
  6442. * Bits 15:8
  6443. * Purpose:
  6444. * Indicate whether the flushed MPDUs should be discarded or processed.
  6445. * Value:
  6446. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6447. * stages of rx processing
  6448. * other: discard the MPDUs
  6449. * It is anticipated that flush messages will always have
  6450. * MPDU status == 1, but the status flag is included for
  6451. * flexibility.
  6452. * - SEQ_NUM_START
  6453. * Bits 23:16
  6454. * Purpose:
  6455. * Indicate the start of a series of consecutive MPDUs being flushed.
  6456. * Not all MPDUs within this range are necessarily valid - the host
  6457. * must check each sequence number within this range to see if the
  6458. * corresponding MPDU is actually present.
  6459. * Value:
  6460. * The sequence number for the first MPDU in the sequence.
  6461. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6462. * - SEQ_NUM_END
  6463. * Bits 30:24
  6464. * Purpose:
  6465. * Indicate the end of a series of consecutive MPDUs being flushed.
  6466. * Value:
  6467. * The sequence number one larger than the sequence number of the
  6468. * last MPDU being flushed.
  6469. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6470. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6471. * are to be released for further rx processing.
  6472. * Not all MPDUs within this range are necessarily valid - the host
  6473. * must check each sequence number within this range to see if the
  6474. * corresponding MPDU is actually present.
  6475. */
  6476. /* first DWORD */
  6477. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6478. #define HTT_RX_FLUSH_PEER_ID_S 8
  6479. #define HTT_RX_FLUSH_TID_M 0xff000000
  6480. #define HTT_RX_FLUSH_TID_S 24
  6481. /* second DWORD */
  6482. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6483. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6484. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6485. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6486. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6487. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6488. #define HTT_RX_FLUSH_BYTES 8
  6489. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6490. do { \
  6491. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6492. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6493. } while (0)
  6494. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6495. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6496. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6497. do { \
  6498. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6499. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6500. } while (0)
  6501. #define HTT_RX_FLUSH_TID_GET(word) \
  6502. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6503. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6504. do { \
  6505. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6506. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6507. } while (0)
  6508. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6509. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6510. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6513. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6514. } while (0)
  6515. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6516. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6517. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6518. do { \
  6519. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6520. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6521. } while (0)
  6522. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6523. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6524. /*
  6525. * @brief target -> host rx pn check indication message
  6526. *
  6527. * @details
  6528. * The following field definitions describe the format of the Rx PN check
  6529. * indication message sent from the target to the host.
  6530. * The message consists of a 4-octet header, followed by the start and
  6531. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6532. * IE is one octet containing the sequence number that failed the PN
  6533. * check.
  6534. *
  6535. * |31 24|23 8|7 0|
  6536. * |--------------------------------------------------------------|
  6537. * | TID | peer ID | msg type |
  6538. * |--------------------------------------------------------------|
  6539. * | Reserved | PN IE count | seq num end | seq num start|
  6540. * |--------------------------------------------------------------|
  6541. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6542. * |--------------------------------------------------------------|
  6543. * First DWORD:
  6544. * - MSG_TYPE
  6545. * Bits 7:0
  6546. * Purpose: Identifies this as an rx pn check indication message
  6547. * Value: 0x2
  6548. * - PEER_ID
  6549. * Bits 23:8 (only bits 18:8 actually used)
  6550. * Purpose: identify which peer
  6551. * Value: (rx) peer ID
  6552. * - TID
  6553. * Bits 31:24 (only bits 27:24 actually used)
  6554. * Purpose: identify traffic identifier
  6555. * Value: traffic identifier
  6556. * Second DWORD:
  6557. * - SEQ_NUM_START
  6558. * Bits 7:0
  6559. * Purpose:
  6560. * Indicates the starting sequence number of the MPDU in this
  6561. * series of MPDUs that went though PN check.
  6562. * Value:
  6563. * The sequence number for the first MPDU in the sequence.
  6564. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6565. * - SEQ_NUM_END
  6566. * Bits 15:8
  6567. * Purpose:
  6568. * Indicates the ending sequence number of the MPDU in this
  6569. * series of MPDUs that went though PN check.
  6570. * Value:
  6571. * The sequence number one larger then the sequence number of the last
  6572. * MPDU being flushed.
  6573. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6574. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6575. * for invalid PN numbers and are ready to be released for further processing.
  6576. * Not all MPDUs within this range are necessarily valid - the host
  6577. * must check each sequence number within this range to see if the
  6578. * corresponding MPDU is actually present.
  6579. * - PN_IE_COUNT
  6580. * Bits 23:16
  6581. * Purpose:
  6582. * Used to determine the variable number of PN information elements in this
  6583. * message
  6584. *
  6585. * PN information elements:
  6586. * - PN_IE_x-
  6587. * Purpose:
  6588. * Each PN information element contains the sequence number of the MPDU that
  6589. * has failed the target PN check.
  6590. * Value:
  6591. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6592. * that failed the PN check.
  6593. */
  6594. /* first DWORD */
  6595. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6596. #define HTT_RX_PN_IND_PEER_ID_S 8
  6597. #define HTT_RX_PN_IND_TID_M 0xff000000
  6598. #define HTT_RX_PN_IND_TID_S 24
  6599. /* second DWORD */
  6600. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6601. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6602. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6603. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6604. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6605. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6606. #define HTT_RX_PN_IND_BYTES 8
  6607. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6608. do { \
  6609. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6610. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6611. } while (0)
  6612. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6613. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6614. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6615. do { \
  6616. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6617. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6618. } while (0)
  6619. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6620. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6621. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6622. do { \
  6623. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6624. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6625. } while (0)
  6626. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6627. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6628. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6629. do { \
  6630. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6631. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6632. } while (0)
  6633. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6634. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6635. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6636. do { \
  6637. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6638. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6639. } while (0)
  6640. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6641. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6642. /*
  6643. * @brief target -> host rx offload deliver message for LL system
  6644. *
  6645. * @details
  6646. * In a low latency system this message is sent whenever the offload
  6647. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6648. * The DMA of the actual packets into host memory is done before sending out
  6649. * this message. This message indicates only how many MSDUs to reap. The
  6650. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6651. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6652. * DMA'd by the MAC directly into host memory these packets do not contain
  6653. * the MAC descriptors in the header portion of the packet. Instead they contain
  6654. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6655. * message, the packets are delivered directly to the NW stack without going
  6656. * through the regular reorder buffering and PN checking path since it has
  6657. * already been done in target.
  6658. *
  6659. * |31 24|23 16|15 8|7 0|
  6660. * |-----------------------------------------------------------------------|
  6661. * | Total MSDU count | reserved | msg type |
  6662. * |-----------------------------------------------------------------------|
  6663. *
  6664. * @brief target -> host rx offload deliver message for HL system
  6665. *
  6666. * @details
  6667. * In a high latency system this message is sent whenever the offload manager
  6668. * flushes out the packets it has coalesced in its coalescing buffer. The
  6669. * actual packets are also carried along with this message. When the host
  6670. * receives this message, it is expected to deliver these packets to the NW
  6671. * stack directly instead of routing them through the reorder buffering and
  6672. * PN checking path since it has already been done in target.
  6673. *
  6674. * |31 24|23 16|15 8|7 0|
  6675. * |-----------------------------------------------------------------------|
  6676. * | Total MSDU count | reserved | msg type |
  6677. * |-----------------------------------------------------------------------|
  6678. * | peer ID | MSDU length |
  6679. * |-----------------------------------------------------------------------|
  6680. * | MSDU payload | FW Desc | tid | vdev ID |
  6681. * |-----------------------------------------------------------------------|
  6682. * | MSDU payload contd. |
  6683. * |-----------------------------------------------------------------------|
  6684. * | peer ID | MSDU length |
  6685. * |-----------------------------------------------------------------------|
  6686. * | MSDU payload | FW Desc | tid | vdev ID |
  6687. * |-----------------------------------------------------------------------|
  6688. * | MSDU payload contd. |
  6689. * |-----------------------------------------------------------------------|
  6690. *
  6691. */
  6692. /* first DWORD */
  6693. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6694. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6695. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6696. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6697. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6698. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6699. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6700. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6701. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6702. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6703. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6704. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6705. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6706. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6707. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6708. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6709. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6710. do { \
  6711. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6712. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6713. } while (0)
  6714. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6715. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6716. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6717. do { \
  6718. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6719. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6720. } while (0)
  6721. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6722. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6723. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6724. do { \
  6725. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6726. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6727. } while (0)
  6728. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6729. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6730. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6731. do { \
  6732. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6733. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6734. } while (0)
  6735. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6736. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6737. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6738. do { \
  6739. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6740. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6741. } while (0)
  6742. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6743. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6744. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6745. do { \
  6746. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6747. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6748. } while (0)
  6749. /**
  6750. * @brief target -> host rx peer map/unmap message definition
  6751. *
  6752. * @details
  6753. * The following diagram shows the format of the rx peer map message sent
  6754. * from the target to the host. This layout assumes the target operates
  6755. * as little-endian.
  6756. *
  6757. * This message always contains a SW peer ID. The main purpose of the
  6758. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6759. * with, so that the host can use that peer ID to determine which peer
  6760. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6761. * other purposes, such as identifying during tx completions which peer
  6762. * the tx frames in question were transmitted to.
  6763. *
  6764. * In certain generations of chips, the peer map message also contains
  6765. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6766. * to identify which peer the frame needs to be forwarded to (i.e. the
  6767. * peer assocated with the Destination MAC Address within the packet),
  6768. * and particularly which vdev needs to transmit the frame (for cases
  6769. * of inter-vdev rx --> tx forwarding).
  6770. * This DA-based peer ID that is provided for certain rx frames
  6771. * (the rx frames that need to be re-transmitted as tx frames)
  6772. * is the ID that the HW uses for referring to the peer in question,
  6773. * rather than the peer ID that the SW+FW use to refer to the peer.
  6774. *
  6775. *
  6776. * |31 24|23 16|15 8|7 0|
  6777. * |-----------------------------------------------------------------------|
  6778. * | SW peer ID | VDEV ID | msg type |
  6779. * |-----------------------------------------------------------------------|
  6780. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6781. * |-----------------------------------------------------------------------|
  6782. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6783. * |-----------------------------------------------------------------------|
  6784. *
  6785. *
  6786. * The following diagram shows the format of the rx peer unmap message sent
  6787. * from the target to the host.
  6788. *
  6789. * |31 24|23 16|15 8|7 0|
  6790. * |-----------------------------------------------------------------------|
  6791. * | SW peer ID | VDEV ID | msg type |
  6792. * |-----------------------------------------------------------------------|
  6793. *
  6794. * The following field definitions describe the format of the rx peer map
  6795. * and peer unmap messages sent from the target to the host.
  6796. * - MSG_TYPE
  6797. * Bits 7:0
  6798. * Purpose: identifies this as an rx peer map or peer unmap message
  6799. * Value: peer map -> 0x3, peer unmap -> 0x4
  6800. * - VDEV_ID
  6801. * Bits 15:8
  6802. * Purpose: Indicates which virtual device the peer is associated
  6803. * with.
  6804. * Value: vdev ID (used in the host to look up the vdev object)
  6805. * - PEER_ID (a.k.a. SW_PEER_ID)
  6806. * Bits 31:16
  6807. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6808. * freeing (unmap)
  6809. * Value: (rx) peer ID
  6810. * - MAC_ADDR_L32 (peer map only)
  6811. * Bits 31:0
  6812. * Purpose: Identifies which peer node the peer ID is for.
  6813. * Value: lower 4 bytes of peer node's MAC address
  6814. * - MAC_ADDR_U16 (peer map only)
  6815. * Bits 15:0
  6816. * Purpose: Identifies which peer node the peer ID is for.
  6817. * Value: upper 2 bytes of peer node's MAC address
  6818. * - HW_PEER_ID
  6819. * Bits 31:16
  6820. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6821. * address, so for rx frames marked for rx --> tx forwarding, the
  6822. * host can determine from the HW peer ID provided as meta-data with
  6823. * the rx frame which peer the frame is supposed to be forwarded to.
  6824. * Value: ID used by the MAC HW to identify the peer
  6825. */
  6826. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6827. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6828. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6829. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6830. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6831. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6832. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6833. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6834. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6835. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6836. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6837. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6838. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6839. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6840. do { \
  6841. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6842. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6843. } while (0)
  6844. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6845. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6846. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6847. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6848. do { \
  6849. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6850. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6851. } while (0)
  6852. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6853. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6854. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6855. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6856. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6857. do { \
  6858. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6859. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6860. } while (0)
  6861. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6862. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6863. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6864. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6865. #define HTT_RX_PEER_MAP_BYTES 12
  6866. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6867. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6868. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6869. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6870. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6871. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6872. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6873. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6874. #define HTT_RX_PEER_UNMAP_BYTES 4
  6875. /**
  6876. * @brief target -> host rx peer map V2 message definition
  6877. *
  6878. * @details
  6879. * The following diagram shows the format of the rx peer map v2 message sent
  6880. * from the target to the host. This layout assumes the target operates
  6881. * as little-endian.
  6882. *
  6883. * This message always contains a SW peer ID. The main purpose of the
  6884. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6885. * with, so that the host can use that peer ID to determine which peer
  6886. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6887. * other purposes, such as identifying during tx completions which peer
  6888. * the tx frames in question were transmitted to.
  6889. *
  6890. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6891. * is used during rx --> tx frame forwarding to identify which peer the
  6892. * frame needs to be forwarded to (i.e. the peer assocated with the
  6893. * Destination MAC Address within the packet), and particularly which vdev
  6894. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6895. * This DA-based peer ID that is provided for certain rx frames
  6896. * (the rx frames that need to be re-transmitted as tx frames)
  6897. * is the ID that the HW uses for referring to the peer in question,
  6898. * rather than the peer ID that the SW+FW use to refer to the peer.
  6899. *
  6900. *
  6901. * |31 24|23 16|15 8|7 0|
  6902. * |-----------------------------------------------------------------------|
  6903. * | SW peer ID | VDEV ID | msg type |
  6904. * |-----------------------------------------------------------------------|
  6905. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6906. * |-----------------------------------------------------------------------|
  6907. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6908. * |-----------------------------------------------------------------------|
  6909. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6910. * |-----------------------------------------------------------------------|
  6911. * | Reserved_0 |
  6912. * |-----------------------------------------------------------------------|
  6913. * | Reserved_1 |
  6914. * |-----------------------------------------------------------------------|
  6915. * | Reserved_2 |
  6916. * |-----------------------------------------------------------------------|
  6917. * | Reserved_3 |
  6918. * |-----------------------------------------------------------------------|
  6919. *
  6920. *
  6921. * The following field definitions describe the format of the rx peer map v2
  6922. * messages sent from the target to the host.
  6923. * - MSG_TYPE
  6924. * Bits 7:0
  6925. * Purpose: identifies this as an rx peer map v2 message
  6926. * Value: peer map v2 -> 0x1e
  6927. * - VDEV_ID
  6928. * Bits 15:8
  6929. * Purpose: Indicates which virtual device the peer is associated with.
  6930. * Value: vdev ID (used in the host to look up the vdev object)
  6931. * - SW_PEER_ID
  6932. * Bits 31:16
  6933. * Purpose: The peer ID (index) that WAL is allocating
  6934. * Value: (rx) peer ID
  6935. * - MAC_ADDR_L32
  6936. * Bits 31:0
  6937. * Purpose: Identifies which peer node the peer ID is for.
  6938. * Value: lower 4 bytes of peer node's MAC address
  6939. * - MAC_ADDR_U16
  6940. * Bits 15:0
  6941. * Purpose: Identifies which peer node the peer ID is for.
  6942. * Value: upper 2 bytes of peer node's MAC address
  6943. * - HW_PEER_ID
  6944. * Bits 31:16
  6945. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6946. * address, so for rx frames marked for rx --> tx forwarding, the
  6947. * host can determine from the HW peer ID provided as meta-data with
  6948. * the rx frame which peer the frame is supposed to be forwarded to.
  6949. * Value: ID used by the MAC HW to identify the peer
  6950. * - AST_HASH_VALUE
  6951. * Bits 15:0
  6952. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6953. * override feature.
  6954. * - NEXT_HOP
  6955. * Bit 16
  6956. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6957. * (Wireless Distribution System).
  6958. */
  6959. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6960. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6961. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6962. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6963. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6964. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6965. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6966. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6967. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6968. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6969. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6970. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6971. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6972. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6973. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6974. do { \
  6975. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6976. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6977. } while (0)
  6978. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6979. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6980. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6981. do { \
  6982. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6983. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6984. } while (0)
  6985. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6986. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6987. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6988. do { \
  6989. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6990. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6991. } while (0)
  6992. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6993. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6994. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6995. do { \
  6996. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6997. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6998. } while (0)
  6999. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7000. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7001. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7002. do { \
  7003. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7004. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7005. } while (0)
  7006. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7007. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7008. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7009. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7010. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7011. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7012. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7013. /**
  7014. * @brief target -> host rx peer unmap V2 message definition
  7015. *
  7016. *
  7017. * The following diagram shows the format of the rx peer unmap message sent
  7018. * from the target to the host.
  7019. *
  7020. * |31 24|23 16|15 8|7 0|
  7021. * |-----------------------------------------------------------------------|
  7022. * | SW peer ID | VDEV ID | msg type |
  7023. * |-----------------------------------------------------------------------|
  7024. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7025. * |-----------------------------------------------------------------------|
  7026. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7027. * |-----------------------------------------------------------------------|
  7028. * | Peer Delete Duration |
  7029. * |-----------------------------------------------------------------------|
  7030. * | Reserved_0 |
  7031. * |-----------------------------------------------------------------------|
  7032. * | Reserved_1 |
  7033. * |-----------------------------------------------------------------------|
  7034. * | Reserved_2 |
  7035. * |-----------------------------------------------------------------------|
  7036. *
  7037. *
  7038. * The following field definitions describe the format of the rx peer unmap
  7039. * messages sent from the target to the host.
  7040. * - MSG_TYPE
  7041. * Bits 7:0
  7042. * Purpose: identifies this as an rx peer unmap v2 message
  7043. * Value: peer unmap v2 -> 0x1f
  7044. * - VDEV_ID
  7045. * Bits 15:8
  7046. * Purpose: Indicates which virtual device the peer is associated
  7047. * with.
  7048. * Value: vdev ID (used in the host to look up the vdev object)
  7049. * - SW_PEER_ID
  7050. * Bits 31:16
  7051. * Purpose: The peer ID (index) that WAL is freeing
  7052. * Value: (rx) peer ID
  7053. * - MAC_ADDR_L32
  7054. * Bits 31:0
  7055. * Purpose: Identifies which peer node the peer ID is for.
  7056. * Value: lower 4 bytes of peer node's MAC address
  7057. * - MAC_ADDR_U16
  7058. * Bits 15:0
  7059. * Purpose: Identifies which peer node the peer ID is for.
  7060. * Value: upper 2 bytes of peer node's MAC address
  7061. * - NEXT_HOP
  7062. * Bits 16
  7063. * Purpose: Bit indicates next_hop AST entry used for WDS
  7064. * (Wireless Distribution System).
  7065. * - PEER_DELETE_DURATION
  7066. * Bits 31:0
  7067. * Purpose: Time taken to delete peer, in msec,
  7068. * Used for monitoring / debugging PEER delete response delay
  7069. */
  7070. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7071. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7072. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7073. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7074. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7075. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7076. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7077. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7078. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7079. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7080. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7081. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7082. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7083. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7084. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7085. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7086. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7087. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7088. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7091. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7092. } while (0)
  7093. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7094. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7095. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7096. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7097. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7098. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7099. /**
  7100. * @brief target -> host message specifying security parameters
  7101. *
  7102. * @details
  7103. * The following diagram shows the format of the security specification
  7104. * message sent from the target to the host.
  7105. * This security specification message tells the host whether a PN check is
  7106. * necessary on rx data frames, and if so, how large the PN counter is.
  7107. * This message also tells the host about the security processing to apply
  7108. * to defragmented rx frames - specifically, whether a Message Integrity
  7109. * Check is required, and the Michael key to use.
  7110. *
  7111. * |31 24|23 16|15|14 8|7 0|
  7112. * |-----------------------------------------------------------------------|
  7113. * | peer ID | U| security type | msg type |
  7114. * |-----------------------------------------------------------------------|
  7115. * | Michael Key K0 |
  7116. * |-----------------------------------------------------------------------|
  7117. * | Michael Key K1 |
  7118. * |-----------------------------------------------------------------------|
  7119. * | WAPI RSC Low0 |
  7120. * |-----------------------------------------------------------------------|
  7121. * | WAPI RSC Low1 |
  7122. * |-----------------------------------------------------------------------|
  7123. * | WAPI RSC Hi0 |
  7124. * |-----------------------------------------------------------------------|
  7125. * | WAPI RSC Hi1 |
  7126. * |-----------------------------------------------------------------------|
  7127. *
  7128. * The following field definitions describe the format of the security
  7129. * indication message sent from the target to the host.
  7130. * - MSG_TYPE
  7131. * Bits 7:0
  7132. * Purpose: identifies this as a security specification message
  7133. * Value: 0xb
  7134. * - SEC_TYPE
  7135. * Bits 14:8
  7136. * Purpose: specifies which type of security applies to the peer
  7137. * Value: htt_sec_type enum value
  7138. * - UNICAST
  7139. * Bit 15
  7140. * Purpose: whether this security is applied to unicast or multicast data
  7141. * Value: 1 -> unicast, 0 -> multicast
  7142. * - PEER_ID
  7143. * Bits 31:16
  7144. * Purpose: The ID number for the peer the security specification is for
  7145. * Value: peer ID
  7146. * - MICHAEL_KEY_K0
  7147. * Bits 31:0
  7148. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7149. * Value: Michael Key K0 (if security type is TKIP)
  7150. * - MICHAEL_KEY_K1
  7151. * Bits 31:0
  7152. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7153. * Value: Michael Key K1 (if security type is TKIP)
  7154. * - WAPI_RSC_LOW0
  7155. * Bits 31:0
  7156. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7157. * Value: WAPI RSC Low0 (if security type is WAPI)
  7158. * - WAPI_RSC_LOW1
  7159. * Bits 31:0
  7160. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7161. * Value: WAPI RSC Low1 (if security type is WAPI)
  7162. * - WAPI_RSC_HI0
  7163. * Bits 31:0
  7164. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7165. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7166. * - WAPI_RSC_HI1
  7167. * Bits 31:0
  7168. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7169. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7170. */
  7171. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7172. #define HTT_SEC_IND_SEC_TYPE_S 8
  7173. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7174. #define HTT_SEC_IND_UNICAST_S 15
  7175. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7176. #define HTT_SEC_IND_PEER_ID_S 16
  7177. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7178. do { \
  7179. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7180. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7181. } while (0)
  7182. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7183. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7184. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7185. do { \
  7186. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7187. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7188. } while (0)
  7189. #define HTT_SEC_IND_UNICAST_GET(word) \
  7190. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7191. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7192. do { \
  7193. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7194. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7195. } while (0)
  7196. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7197. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7198. #define HTT_SEC_IND_BYTES 28
  7199. /**
  7200. * @brief target -> host rx ADDBA / DELBA message definitions
  7201. *
  7202. * @details
  7203. * The following diagram shows the format of the rx ADDBA message sent
  7204. * from the target to the host:
  7205. *
  7206. * |31 20|19 16|15 8|7 0|
  7207. * |---------------------------------------------------------------------|
  7208. * | peer ID | TID | window size | msg type |
  7209. * |---------------------------------------------------------------------|
  7210. *
  7211. * The following diagram shows the format of the rx DELBA message sent
  7212. * from the target to the host:
  7213. *
  7214. * |31 20|19 16|15 10|9 8|7 0|
  7215. * |---------------------------------------------------------------------|
  7216. * | peer ID | TID | reserved | IR| msg type |
  7217. * |---------------------------------------------------------------------|
  7218. *
  7219. * The following field definitions describe the format of the rx ADDBA
  7220. * and DELBA messages sent from the target to the host.
  7221. * - MSG_TYPE
  7222. * Bits 7:0
  7223. * Purpose: identifies this as an rx ADDBA or DELBA message
  7224. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7225. * - IR (initiator / recipient)
  7226. * Bits 9:8 (DELBA only)
  7227. * Purpose: specify whether the DELBA handshake was initiated by the
  7228. * local STA/AP, or by the peer STA/AP
  7229. * Value:
  7230. * 0 - unspecified
  7231. * 1 - initiator (a.k.a. originator)
  7232. * 2 - recipient (a.k.a. responder)
  7233. * 3 - unused / reserved
  7234. * - WIN_SIZE
  7235. * Bits 15:8 (ADDBA only)
  7236. * Purpose: Specifies the length of the block ack window (max = 64).
  7237. * Value:
  7238. * block ack window length specified by the received ADDBA
  7239. * management message.
  7240. * - TID
  7241. * Bits 19:16
  7242. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7243. * Value:
  7244. * TID specified by the received ADDBA or DELBA management message.
  7245. * - PEER_ID
  7246. * Bits 31:20
  7247. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7248. * Value:
  7249. * ID (hash value) used by the host for fast, direct lookup of
  7250. * host SW peer info, including rx reorder states.
  7251. */
  7252. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7253. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7254. #define HTT_RX_ADDBA_TID_M 0xf0000
  7255. #define HTT_RX_ADDBA_TID_S 16
  7256. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7257. #define HTT_RX_ADDBA_PEER_ID_S 20
  7258. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7259. do { \
  7260. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7261. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7262. } while (0)
  7263. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7264. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7265. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7266. do { \
  7267. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7268. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7269. } while (0)
  7270. #define HTT_RX_ADDBA_TID_GET(word) \
  7271. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7272. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7275. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7276. } while (0)
  7277. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7278. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7279. #define HTT_RX_ADDBA_BYTES 4
  7280. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7281. #define HTT_RX_DELBA_INITIATOR_S 8
  7282. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7283. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7284. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7285. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7286. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7287. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7288. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7289. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7290. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7293. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7294. } while (0)
  7295. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7296. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7297. #define HTT_RX_DELBA_BYTES 4
  7298. /**
  7299. * @brief tx queue group information element definition
  7300. *
  7301. * @details
  7302. * The following diagram shows the format of the tx queue group
  7303. * information element, which can be included in target --> host
  7304. * messages to specify the number of tx "credits" (tx descriptors
  7305. * for LL, or tx buffers for HL) available to a particular group
  7306. * of host-side tx queues, and which host-side tx queues belong to
  7307. * the group.
  7308. *
  7309. * |31|30 24|23 16|15|14|13 0|
  7310. * |------------------------------------------------------------------------|
  7311. * | X| reserved | tx queue grp ID | A| S| credit count |
  7312. * |------------------------------------------------------------------------|
  7313. * | vdev ID mask | AC mask |
  7314. * |------------------------------------------------------------------------|
  7315. *
  7316. * The following definitions describe the fields within the tx queue group
  7317. * information element:
  7318. * - credit_count
  7319. * Bits 13:1
  7320. * Purpose: specify how many tx credits are available to the tx queue group
  7321. * Value: An absolute or relative, positive or negative credit value
  7322. * The 'A' bit specifies whether the value is absolute or relative.
  7323. * The 'S' bit specifies whether the value is positive or negative.
  7324. * A negative value can only be relative, not absolute.
  7325. * An absolute value replaces any prior credit value the host has for
  7326. * the tx queue group in question.
  7327. * A relative value is added to the prior credit value the host has for
  7328. * the tx queue group in question.
  7329. * - sign
  7330. * Bit 14
  7331. * Purpose: specify whether the credit count is positive or negative
  7332. * Value: 0 -> positive, 1 -> negative
  7333. * - absolute
  7334. * Bit 15
  7335. * Purpose: specify whether the credit count is absolute or relative
  7336. * Value: 0 -> relative, 1 -> absolute
  7337. * - txq_group_id
  7338. * Bits 23:16
  7339. * Purpose: indicate which tx queue group's credit and/or membership are
  7340. * being specified
  7341. * Value: 0 to max_tx_queue_groups-1
  7342. * - reserved
  7343. * Bits 30:16
  7344. * Value: 0x0
  7345. * - eXtension
  7346. * Bit 31
  7347. * Purpose: specify whether another tx queue group info element follows
  7348. * Value: 0 -> no more tx queue group information elements
  7349. * 1 -> another tx queue group information element immediately follows
  7350. * - ac_mask
  7351. * Bits 15:0
  7352. * Purpose: specify which Access Categories belong to the tx queue group
  7353. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7354. * the tx queue group.
  7355. * The AC bit-mask values are obtained by left-shifting by the
  7356. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7357. * - vdev_id_mask
  7358. * Bits 31:16
  7359. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7360. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7361. * belong to the tx queue group.
  7362. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7363. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7364. */
  7365. PREPACK struct htt_txq_group {
  7366. A_UINT32
  7367. credit_count: 14,
  7368. sign: 1,
  7369. absolute: 1,
  7370. tx_queue_group_id: 8,
  7371. reserved0: 7,
  7372. extension: 1;
  7373. A_UINT32
  7374. ac_mask: 16,
  7375. vdev_id_mask: 16;
  7376. } POSTPACK;
  7377. /* first word */
  7378. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7379. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7380. #define HTT_TXQ_GROUP_SIGN_S 14
  7381. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7382. #define HTT_TXQ_GROUP_ABS_S 15
  7383. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7384. #define HTT_TXQ_GROUP_ID_S 16
  7385. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7386. #define HTT_TXQ_GROUP_EXT_S 31
  7387. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7388. /* second word */
  7389. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7390. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7391. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7392. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7393. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7394. do { \
  7395. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7396. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7397. } while (0)
  7398. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7399. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7400. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7401. do { \
  7402. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7403. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7404. } while (0)
  7405. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7406. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7407. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7408. do { \
  7409. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7410. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7411. } while (0)
  7412. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7413. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7414. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7415. do { \
  7416. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7417. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7418. } while (0)
  7419. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7420. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7421. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7422. do { \
  7423. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7424. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7425. } while (0)
  7426. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7427. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7428. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7429. do { \
  7430. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7431. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7432. } while (0)
  7433. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7434. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7435. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7436. do { \
  7437. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7438. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7439. } while (0)
  7440. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7441. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7442. /**
  7443. * @brief target -> host TX completion indication message definition
  7444. *
  7445. * @details
  7446. * The following diagram shows the format of the TX completion indication sent
  7447. * from the target to the host
  7448. *
  7449. * |31 29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7450. * |----------------------------------------------------------------|
  7451. * header: |rsvd |A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7452. * |----------------------------------------------------------------|
  7453. * payload: | MSDU1 ID | MSDU0 ID |
  7454. * |----------------------------------------------------------------|
  7455. * : MSDU3 ID | MSDU2 ID :
  7456. * |----------------------------------------------------------------|
  7457. * | struct htt_tx_compl_ind_append_retries |
  7458. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7459. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7460. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7461. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7462. * |----------------------------------------------------------------|
  7463. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  7464. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7465. * | MSDU0 tx_tsf64_low |
  7466. * |----------------------------------------------------------------|
  7467. * | MSDU0 tx_tsf64_high |
  7468. * |----------------------------------------------------------------|
  7469. * | MSDU1 tx_tsf64_low |
  7470. * |----------------------------------------------------------------|
  7471. * | MSDU1 tx_tsf64_high |
  7472. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7473. * Where:
  7474. * A0 = append (a.k.a. append0)
  7475. * A1 = append1
  7476. * TP = MSDU tx power presence
  7477. * A2 = append2
  7478. * A3 = append3
  7479. *
  7480. * The following field definitions describe the format of the TX completion
  7481. * indication sent from the target to the host
  7482. * Header fields:
  7483. * - msg_type
  7484. * Bits 7:0
  7485. * Purpose: identifies this as HTT TX completion indication
  7486. * Value: 0x7
  7487. * - status
  7488. * Bits 10:8
  7489. * Purpose: the TX completion status of payload fragmentations descriptors
  7490. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7491. * - tid
  7492. * Bits 14:11
  7493. * Purpose: the tid associated with those fragmentation descriptors. It is
  7494. * valid or not, depending on the tid_invalid bit.
  7495. * Value: 0 to 15
  7496. * - tid_invalid
  7497. * Bits 15:15
  7498. * Purpose: this bit indicates whether the tid field is valid or not
  7499. * Value: 0 indicates valid; 1 indicates invalid
  7500. * - num
  7501. * Bits 23:16
  7502. * Purpose: the number of payload in this indication
  7503. * Value: 1 to 255
  7504. * - append (a.k.a. append0)
  7505. * Bits 24:24
  7506. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7507. * the number of tx retries for one MSDU at the end of this message
  7508. * Value: 0 indicates no appending; 1 indicates appending
  7509. * - append1
  7510. * Bits 25:25
  7511. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7512. * contains the timestamp info for each TX msdu id in payload.
  7513. * The order of the timestamps matches the order of the MSDU IDs.
  7514. * Note that a big-endian host needs to account for the reordering
  7515. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7516. * conversion) when determining which tx timestamp corresponds to
  7517. * which MSDU ID.
  7518. * Value: 0 indicates no appending; 1 indicates appending
  7519. * - msdu_tx_power_presence
  7520. * Bits 26:26
  7521. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7522. * for each MSDU referenced by the TX_COMPL_IND message.
  7523. * The tx power is reported in 0.5 dBm units.
  7524. * The order of the per-MSDU tx power reports matches the order
  7525. * of the MSDU IDs.
  7526. * Note that a big-endian host needs to account for the reordering
  7527. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7528. * conversion) when determining which Tx Power corresponds to
  7529. * which MSDU ID.
  7530. * Value: 0 indicates MSDU tx power reports are not appended,
  7531. * 1 indicates MSDU tx power reports are appended
  7532. * - append2
  7533. * Bits 27:27
  7534. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7535. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7536. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7537. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7538. * for each MSDU, for convenience.
  7539. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7540. * this append2 bit is set).
  7541. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7542. * dB above the noise floor.
  7543. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7544. * 1 indicates MSDU ACK RSSI values are appended.
  7545. * - append3
  7546. * Bits 28:28
  7547. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  7548. * contains the tx tsf info based on wlan global TSF for
  7549. * each TX msdu id in payload.
  7550. * The order of the tx tsf matches the order of the MSDU IDs.
  7551. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  7552. * values to indicate the the lower 32 bits and higher 32 bits of
  7553. * the tx tsf.
  7554. * The tx_tsf64 here represents the time MSDU was acked and the
  7555. * tx_tsf64 has microseconds units.
  7556. * Value: 0 indicates no appending; 1 indicates appending
  7557. * Payload fields:
  7558. * - hmsdu_id
  7559. * Bits 15:0
  7560. * Purpose: this ID is used to track the Tx buffer in host
  7561. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7562. */
  7563. #define HTT_TX_COMPL_IND_STATUS_S 8
  7564. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7565. #define HTT_TX_COMPL_IND_TID_S 11
  7566. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7567. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7568. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7569. #define HTT_TX_COMPL_IND_NUM_S 16
  7570. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7571. #define HTT_TX_COMPL_IND_APPEND_S 24
  7572. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7573. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7574. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7575. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7576. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7577. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7578. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7579. #define HTT_TX_COMPL_IND_APPEND3_S 28
  7580. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  7581. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7582. do { \
  7583. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7584. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7585. } while (0)
  7586. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7587. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7588. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7591. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7592. } while (0)
  7593. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7594. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7595. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7598. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7599. } while (0)
  7600. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7601. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7602. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7603. do { \
  7604. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7605. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7606. } while (0)
  7607. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7608. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7609. HTT_TX_COMPL_IND_TID_INV_S)
  7610. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7613. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7614. } while (0)
  7615. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7616. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7617. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7618. do { \
  7619. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7620. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7621. } while (0)
  7622. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7623. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7624. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7625. do { \
  7626. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7627. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7628. } while (0)
  7629. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7630. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7631. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7632. do { \
  7633. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7634. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7635. } while (0)
  7636. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7637. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7638. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  7639. do { \
  7640. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  7641. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  7642. } while (0)
  7643. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  7644. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  7645. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7646. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7647. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7648. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7649. #define HTT_TX_COMPL_IND_STAT_OK 0
  7650. /* DISCARD:
  7651. * current meaning:
  7652. * MSDUs were queued for transmission but filtered by HW or SW
  7653. * without any over the air attempts
  7654. * legacy meaning (HL Rome):
  7655. * MSDUs were discarded by the target FW without any over the air
  7656. * attempts due to lack of space
  7657. */
  7658. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7659. /* NO_ACK:
  7660. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7661. */
  7662. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7663. /* POSTPONE:
  7664. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7665. * be downloaded again later (in the appropriate order), when they are
  7666. * deliverable.
  7667. */
  7668. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7669. /*
  7670. * The PEER_DEL tx completion status is used for HL cases
  7671. * where the peer the frame is for has been deleted.
  7672. * The host has already discarded its copy of the frame, but
  7673. * it still needs the tx completion to restore its credit.
  7674. */
  7675. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7676. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7677. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7678. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7679. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7680. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7681. PREPACK struct htt_tx_compl_ind_base {
  7682. A_UINT32 hdr;
  7683. A_UINT16 payload[1/*or more*/];
  7684. } POSTPACK;
  7685. PREPACK struct htt_tx_compl_ind_append_retries {
  7686. A_UINT16 msdu_id;
  7687. A_UINT8 tx_retries;
  7688. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7689. 0: this is the last append_retries struct */
  7690. } POSTPACK;
  7691. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7692. A_UINT32 timestamp[1/*or more*/];
  7693. } POSTPACK;
  7694. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  7695. A_UINT32 tx_tsf64_low;
  7696. A_UINT32 tx_tsf64_high;
  7697. } POSTPACK;
  7698. /**
  7699. * @brief target -> host rate-control update indication message
  7700. *
  7701. * @details
  7702. * The following diagram shows the format of the RC Update message
  7703. * sent from the target to the host, while processing the tx-completion
  7704. * of a transmitted PPDU.
  7705. *
  7706. * |31 24|23 16|15 8|7 0|
  7707. * |-------------------------------------------------------------|
  7708. * | peer ID | vdev ID | msg_type |
  7709. * |-------------------------------------------------------------|
  7710. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7711. * |-------------------------------------------------------------|
  7712. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7713. * |-------------------------------------------------------------|
  7714. * | : |
  7715. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7716. * | : |
  7717. * |-------------------------------------------------------------|
  7718. * | : |
  7719. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7720. * | : |
  7721. * |-------------------------------------------------------------|
  7722. * : :
  7723. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7724. *
  7725. */
  7726. typedef struct {
  7727. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7728. A_UINT32 rate_code_flags;
  7729. A_UINT32 flags; /* Encodes information such as excessive
  7730. retransmission, aggregate, some info
  7731. from .11 frame control,
  7732. STBC, LDPC, (SGI and Tx Chain Mask
  7733. are encoded in ptx_rc->flags field),
  7734. AMPDU truncation (BT/time based etc.),
  7735. RTS/CTS attempt */
  7736. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7737. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7738. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7739. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7740. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7741. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7742. } HTT_RC_TX_DONE_PARAMS;
  7743. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7744. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7745. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7746. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7747. #define HTT_RC_UPDATE_VDEVID_S 8
  7748. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7749. #define HTT_RC_UPDATE_PEERID_S 16
  7750. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7751. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7752. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7753. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7754. do { \
  7755. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7756. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7757. } while (0)
  7758. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7759. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7760. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7761. do { \
  7762. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7763. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7764. } while (0)
  7765. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7766. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7767. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7770. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7771. } while (0)
  7772. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7773. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7774. /**
  7775. * @brief target -> host rx fragment indication message definition
  7776. *
  7777. * @details
  7778. * The following field definitions describe the format of the rx fragment
  7779. * indication message sent from the target to the host.
  7780. * The rx fragment indication message shares the format of the
  7781. * rx indication message, but not all fields from the rx indication message
  7782. * are relevant to the rx fragment indication message.
  7783. *
  7784. *
  7785. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7786. * |-----------+-------------------+---------------------+-------------|
  7787. * | peer ID | |FV| ext TID | msg type |
  7788. * |-------------------------------------------------------------------|
  7789. * | | flush | flush |
  7790. * | | end | start |
  7791. * | | seq num | seq num |
  7792. * |-------------------------------------------------------------------|
  7793. * | reserved | FW rx desc bytes |
  7794. * |-------------------------------------------------------------------|
  7795. * | | FW MSDU Rx |
  7796. * | | desc B0 |
  7797. * |-------------------------------------------------------------------|
  7798. * Header fields:
  7799. * - MSG_TYPE
  7800. * Bits 7:0
  7801. * Purpose: identifies this as an rx fragment indication message
  7802. * Value: 0xa
  7803. * - EXT_TID
  7804. * Bits 12:8
  7805. * Purpose: identify the traffic ID of the rx data, including
  7806. * special "extended" TID values for multicast, broadcast, and
  7807. * non-QoS data frames
  7808. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7809. * - FLUSH_VALID (FV)
  7810. * Bit 13
  7811. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7812. * is valid
  7813. * Value:
  7814. * 1 -> flush IE is valid and needs to be processed
  7815. * 0 -> flush IE is not valid and should be ignored
  7816. * - PEER_ID
  7817. * Bits 31:16
  7818. * Purpose: Identify, by ID, which peer sent the rx data
  7819. * Value: ID of the peer who sent the rx data
  7820. * - FLUSH_SEQ_NUM_START
  7821. * Bits 5:0
  7822. * Purpose: Indicate the start of a series of MPDUs to flush
  7823. * Not all MPDUs within this series are necessarily valid - the host
  7824. * must check each sequence number within this range to see if the
  7825. * corresponding MPDU is actually present.
  7826. * This field is only valid if the FV bit is set.
  7827. * Value:
  7828. * The sequence number for the first MPDUs to check to flush.
  7829. * The sequence number is masked by 0x3f.
  7830. * - FLUSH_SEQ_NUM_END
  7831. * Bits 11:6
  7832. * Purpose: Indicate the end of a series of MPDUs to flush
  7833. * Value:
  7834. * The sequence number one larger than the sequence number of the
  7835. * last MPDU to check to flush.
  7836. * The sequence number is masked by 0x3f.
  7837. * Not all MPDUs within this series are necessarily valid - the host
  7838. * must check each sequence number within this range to see if the
  7839. * corresponding MPDU is actually present.
  7840. * This field is only valid if the FV bit is set.
  7841. * Rx descriptor fields:
  7842. * - FW_RX_DESC_BYTES
  7843. * Bits 15:0
  7844. * Purpose: Indicate how many bytes in the Rx indication are used for
  7845. * FW Rx descriptors
  7846. * Value: 1
  7847. */
  7848. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7849. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7850. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7851. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7852. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7853. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7854. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7855. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7856. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7857. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7858. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7859. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7860. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7861. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7862. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7863. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7864. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7865. #define HTT_RX_FRAG_IND_BYTES \
  7866. (4 /* msg hdr */ + \
  7867. 4 /* flush spec */ + \
  7868. 4 /* (unused) FW rx desc bytes spec */ + \
  7869. 4 /* FW rx desc */)
  7870. /**
  7871. * @brief target -> host test message definition
  7872. *
  7873. * @details
  7874. * The following field definitions describe the format of the test
  7875. * message sent from the target to the host.
  7876. * The message consists of a 4-octet header, followed by a variable
  7877. * number of 32-bit integer values, followed by a variable number
  7878. * of 8-bit character values.
  7879. *
  7880. * |31 16|15 8|7 0|
  7881. * |-----------------------------------------------------------|
  7882. * | num chars | num ints | msg type |
  7883. * |-----------------------------------------------------------|
  7884. * | int 0 |
  7885. * |-----------------------------------------------------------|
  7886. * | int 1 |
  7887. * |-----------------------------------------------------------|
  7888. * | ... |
  7889. * |-----------------------------------------------------------|
  7890. * | char 3 | char 2 | char 1 | char 0 |
  7891. * |-----------------------------------------------------------|
  7892. * | | | ... | char 4 |
  7893. * |-----------------------------------------------------------|
  7894. * - MSG_TYPE
  7895. * Bits 7:0
  7896. * Purpose: identifies this as a test message
  7897. * Value: HTT_MSG_TYPE_TEST
  7898. * - NUM_INTS
  7899. * Bits 15:8
  7900. * Purpose: indicate how many 32-bit integers follow the message header
  7901. * - NUM_CHARS
  7902. * Bits 31:16
  7903. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7904. */
  7905. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7906. #define HTT_RX_TEST_NUM_INTS_S 8
  7907. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7908. #define HTT_RX_TEST_NUM_CHARS_S 16
  7909. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7910. do { \
  7911. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7912. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7913. } while (0)
  7914. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7915. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7916. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7917. do { \
  7918. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7919. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7920. } while (0)
  7921. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7922. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7923. /**
  7924. * @brief target -> host packet log message
  7925. *
  7926. * @details
  7927. * The following field definitions describe the format of the packet log
  7928. * message sent from the target to the host.
  7929. * The message consists of a 4-octet header,followed by a variable number
  7930. * of 32-bit character values.
  7931. *
  7932. * |31 16|15 12|11 10|9 8|7 0|
  7933. * |------------------------------------------------------------------|
  7934. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7935. * |------------------------------------------------------------------|
  7936. * | payload |
  7937. * |------------------------------------------------------------------|
  7938. * - MSG_TYPE
  7939. * Bits 7:0
  7940. * Purpose: identifies this as a pktlog message
  7941. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7942. * - mac_id
  7943. * Bits 9:8
  7944. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7945. * Value: 0-3
  7946. * - pdev_id
  7947. * Bits 11:10
  7948. * Purpose: pdev_id
  7949. * Value: 0-3
  7950. * 0 (for rings at SOC level),
  7951. * 1/2/3 PDEV -> 0/1/2
  7952. * - payload_size
  7953. * Bits 31:16
  7954. * Purpose: explicitly specify the payload size
  7955. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7956. */
  7957. PREPACK struct htt_pktlog_msg {
  7958. A_UINT32 header;
  7959. A_UINT32 payload[1/* or more */];
  7960. } POSTPACK;
  7961. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7962. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7963. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7964. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7965. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7966. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7967. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7970. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7971. } while (0)
  7972. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7973. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7974. HTT_T2H_PKTLOG_MAC_ID_S)
  7975. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7976. do { \
  7977. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7978. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7979. } while (0)
  7980. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7981. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7982. HTT_T2H_PKTLOG_PDEV_ID_S)
  7983. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7984. do { \
  7985. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7986. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7987. } while (0)
  7988. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7989. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7990. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7991. /*
  7992. * Rx reorder statistics
  7993. * NB: all the fields must be defined in 4 octets size.
  7994. */
  7995. struct rx_reorder_stats {
  7996. /* Non QoS MPDUs received */
  7997. A_UINT32 deliver_non_qos;
  7998. /* MPDUs received in-order */
  7999. A_UINT32 deliver_in_order;
  8000. /* Flush due to reorder timer expired */
  8001. A_UINT32 deliver_flush_timeout;
  8002. /* Flush due to move out of window */
  8003. A_UINT32 deliver_flush_oow;
  8004. /* Flush due to DELBA */
  8005. A_UINT32 deliver_flush_delba;
  8006. /* MPDUs dropped due to FCS error */
  8007. A_UINT32 fcs_error;
  8008. /* MPDUs dropped due to monitor mode non-data packet */
  8009. A_UINT32 mgmt_ctrl;
  8010. /* Unicast-data MPDUs dropped due to invalid peer */
  8011. A_UINT32 invalid_peer;
  8012. /* MPDUs dropped due to duplication (non aggregation) */
  8013. A_UINT32 dup_non_aggr;
  8014. /* MPDUs dropped due to processed before */
  8015. A_UINT32 dup_past;
  8016. /* MPDUs dropped due to duplicate in reorder queue */
  8017. A_UINT32 dup_in_reorder;
  8018. /* Reorder timeout happened */
  8019. A_UINT32 reorder_timeout;
  8020. /* invalid bar ssn */
  8021. A_UINT32 invalid_bar_ssn;
  8022. /* reorder reset due to bar ssn */
  8023. A_UINT32 ssn_reset;
  8024. /* Flush due to delete peer */
  8025. A_UINT32 deliver_flush_delpeer;
  8026. /* Flush due to offload*/
  8027. A_UINT32 deliver_flush_offload;
  8028. /* Flush due to out of buffer*/
  8029. A_UINT32 deliver_flush_oob;
  8030. /* MPDUs dropped due to PN check fail */
  8031. A_UINT32 pn_fail;
  8032. /* MPDUs dropped due to unable to allocate memory */
  8033. A_UINT32 store_fail;
  8034. /* Number of times the tid pool alloc succeeded */
  8035. A_UINT32 tid_pool_alloc_succ;
  8036. /* Number of times the MPDU pool alloc succeeded */
  8037. A_UINT32 mpdu_pool_alloc_succ;
  8038. /* Number of times the MSDU pool alloc succeeded */
  8039. A_UINT32 msdu_pool_alloc_succ;
  8040. /* Number of times the tid pool alloc failed */
  8041. A_UINT32 tid_pool_alloc_fail;
  8042. /* Number of times the MPDU pool alloc failed */
  8043. A_UINT32 mpdu_pool_alloc_fail;
  8044. /* Number of times the MSDU pool alloc failed */
  8045. A_UINT32 msdu_pool_alloc_fail;
  8046. /* Number of times the tid pool freed */
  8047. A_UINT32 tid_pool_free;
  8048. /* Number of times the MPDU pool freed */
  8049. A_UINT32 mpdu_pool_free;
  8050. /* Number of times the MSDU pool freed */
  8051. A_UINT32 msdu_pool_free;
  8052. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8053. A_UINT32 msdu_queued;
  8054. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8055. A_UINT32 msdu_recycled;
  8056. /* Number of MPDUs with invalid peer but A2 found in AST */
  8057. A_UINT32 invalid_peer_a2_in_ast;
  8058. /* Number of MPDUs with invalid peer but A3 found in AST */
  8059. A_UINT32 invalid_peer_a3_in_ast;
  8060. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8061. A_UINT32 invalid_peer_bmc_mpdus;
  8062. /* Number of MSDUs with err attention word */
  8063. A_UINT32 rxdesc_err_att;
  8064. /* Number of MSDUs with flag of peer_idx_invalid */
  8065. A_UINT32 rxdesc_err_peer_idx_inv;
  8066. /* Number of MSDUs with flag of peer_idx_timeout */
  8067. A_UINT32 rxdesc_err_peer_idx_to;
  8068. /* Number of MSDUs with flag of overflow */
  8069. A_UINT32 rxdesc_err_ov;
  8070. /* Number of MSDUs with flag of msdu_length_err */
  8071. A_UINT32 rxdesc_err_msdu_len;
  8072. /* Number of MSDUs with flag of mpdu_length_err */
  8073. A_UINT32 rxdesc_err_mpdu_len;
  8074. /* Number of MSDUs with flag of tkip_mic_err */
  8075. A_UINT32 rxdesc_err_tkip_mic;
  8076. /* Number of MSDUs with flag of decrypt_err */
  8077. A_UINT32 rxdesc_err_decrypt;
  8078. /* Number of MSDUs with flag of fcs_err */
  8079. A_UINT32 rxdesc_err_fcs;
  8080. /* Number of Unicast (bc_mc bit is not set in attention word)
  8081. * frames with invalid peer handler
  8082. */
  8083. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8084. /* Number of unicast frame directly (direct bit is set in attention word)
  8085. * to DUT with invalid peer handler
  8086. */
  8087. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8088. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8089. * frames with invalid peer handler
  8090. */
  8091. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8092. /* Number of MSDUs dropped due to no first MSDU flag */
  8093. A_UINT32 rxdesc_no_1st_msdu;
  8094. /* Number of MSDUs droped due to ring overflow */
  8095. A_UINT32 msdu_drop_ring_ov;
  8096. /* Number of MSDUs dropped due to FC mismatch */
  8097. A_UINT32 msdu_drop_fc_mismatch;
  8098. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8099. A_UINT32 msdu_drop_mgmt_remote_ring;
  8100. /* Number of MSDUs dropped due to errors not reported in attention word */
  8101. A_UINT32 msdu_drop_misc;
  8102. /* Number of MSDUs go to offload before reorder */
  8103. A_UINT32 offload_msdu_wal;
  8104. /* Number of data frame dropped by offload after reorder */
  8105. A_UINT32 offload_msdu_reorder;
  8106. /* Number of MPDUs with sequence number in the past and within the BA window */
  8107. A_UINT32 dup_past_within_window;
  8108. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8109. A_UINT32 dup_past_outside_window;
  8110. /* Number of MSDUs with decrypt/MIC error */
  8111. A_UINT32 rxdesc_err_decrypt_mic;
  8112. /* Number of data MSDUs received on both local and remote rings */
  8113. A_UINT32 data_msdus_on_both_rings;
  8114. /* MPDUs never filled */
  8115. A_UINT32 holes_not_filled;
  8116. };
  8117. /*
  8118. * Rx Remote buffer statistics
  8119. * NB: all the fields must be defined in 4 octets size.
  8120. */
  8121. struct rx_remote_buffer_mgmt_stats {
  8122. /* Total number of MSDUs reaped for Rx processing */
  8123. A_UINT32 remote_reaped;
  8124. /* MSDUs recycled within firmware */
  8125. A_UINT32 remote_recycled;
  8126. /* MSDUs stored by Data Rx */
  8127. A_UINT32 data_rx_msdus_stored;
  8128. /* Number of HTT indications from WAL Rx MSDU */
  8129. A_UINT32 wal_rx_ind;
  8130. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8131. A_UINT32 wal_rx_ind_unconsumed;
  8132. /* Number of HTT indications from Data Rx MSDU */
  8133. A_UINT32 data_rx_ind;
  8134. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8135. A_UINT32 data_rx_ind_unconsumed;
  8136. /* Number of HTT indications from ATHBUF */
  8137. A_UINT32 athbuf_rx_ind;
  8138. /* Number of remote buffers requested for refill */
  8139. A_UINT32 refill_buf_req;
  8140. /* Number of remote buffers filled by the host */
  8141. A_UINT32 refill_buf_rsp;
  8142. /* Number of times MAC hw_index = f/w write_index */
  8143. A_INT32 mac_no_bufs;
  8144. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8145. A_INT32 fw_indices_equal;
  8146. /* Number of times f/w finds no buffers to post */
  8147. A_INT32 host_no_bufs;
  8148. };
  8149. /*
  8150. * TXBF MU/SU packets and NDPA statistics
  8151. * NB: all the fields must be defined in 4 octets size.
  8152. */
  8153. struct rx_txbf_musu_ndpa_pkts_stats {
  8154. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8155. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8156. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8157. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8158. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8159. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8160. };
  8161. /*
  8162. * htt_dbg_stats_status -
  8163. * present - The requested stats have been delivered in full.
  8164. * This indicates that either the stats information was contained
  8165. * in its entirety within this message, or else this message
  8166. * completes the delivery of the requested stats info that was
  8167. * partially delivered through earlier STATS_CONF messages.
  8168. * partial - The requested stats have been delivered in part.
  8169. * One or more subsequent STATS_CONF messages with the same
  8170. * cookie value will be sent to deliver the remainder of the
  8171. * information.
  8172. * error - The requested stats could not be delivered, for example due
  8173. * to a shortage of memory to construct a message holding the
  8174. * requested stats.
  8175. * invalid - The requested stat type is either not recognized, or the
  8176. * target is configured to not gather the stats type in question.
  8177. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8178. * series_done - This special value indicates that no further stats info
  8179. * elements are present within a series of stats info elems
  8180. * (within a stats upload confirmation message).
  8181. */
  8182. enum htt_dbg_stats_status {
  8183. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8184. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8185. HTT_DBG_STATS_STATUS_ERROR = 2,
  8186. HTT_DBG_STATS_STATUS_INVALID = 3,
  8187. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8188. };
  8189. /**
  8190. * @brief target -> host statistics upload
  8191. *
  8192. * @details
  8193. * The following field definitions describe the format of the HTT target
  8194. * to host stats upload confirmation message.
  8195. * The message contains a cookie echoed from the HTT host->target stats
  8196. * upload request, which identifies which request the confirmation is
  8197. * for, and a series of tag-length-value stats information elements.
  8198. * The tag-length header for each stats info element also includes a
  8199. * status field, to indicate whether the request for the stat type in
  8200. * question was fully met, partially met, unable to be met, or invalid
  8201. * (if the stat type in question is disabled in the target).
  8202. * A special value of all 1's in this status field is used to indicate
  8203. * the end of the series of stats info elements.
  8204. *
  8205. *
  8206. * |31 16|15 8|7 5|4 0|
  8207. * |------------------------------------------------------------|
  8208. * | reserved | msg type |
  8209. * |------------------------------------------------------------|
  8210. * | cookie LSBs |
  8211. * |------------------------------------------------------------|
  8212. * | cookie MSBs |
  8213. * |------------------------------------------------------------|
  8214. * | stats entry length | reserved | S |stat type|
  8215. * |------------------------------------------------------------|
  8216. * | |
  8217. * | type-specific stats info |
  8218. * | |
  8219. * |------------------------------------------------------------|
  8220. * | stats entry length | reserved | S |stat type|
  8221. * |------------------------------------------------------------|
  8222. * | |
  8223. * | type-specific stats info |
  8224. * | |
  8225. * |------------------------------------------------------------|
  8226. * | n/a | reserved | 111 | n/a |
  8227. * |------------------------------------------------------------|
  8228. * Header fields:
  8229. * - MSG_TYPE
  8230. * Bits 7:0
  8231. * Purpose: identifies this is a statistics upload confirmation message
  8232. * Value: 0x9
  8233. * - COOKIE_LSBS
  8234. * Bits 31:0
  8235. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8236. * message with its preceding host->target stats request message.
  8237. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8238. * - COOKIE_MSBS
  8239. * Bits 31:0
  8240. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8241. * message with its preceding host->target stats request message.
  8242. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8243. *
  8244. * Stats Information Element tag-length header fields:
  8245. * - STAT_TYPE
  8246. * Bits 4:0
  8247. * Purpose: identifies the type of statistics info held in the
  8248. * following information element
  8249. * Value: htt_dbg_stats_type
  8250. * - STATUS
  8251. * Bits 7:5
  8252. * Purpose: indicate whether the requested stats are present
  8253. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8254. * the completion of the stats entry series
  8255. * - LENGTH
  8256. * Bits 31:16
  8257. * Purpose: indicate the stats information size
  8258. * Value: This field specifies the number of bytes of stats information
  8259. * that follows the element tag-length header.
  8260. * It is expected but not required that this length is a multiple of
  8261. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8262. * subsequent stats entry header will begin on a 4-byte aligned
  8263. * boundary.
  8264. */
  8265. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8266. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8267. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8268. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8269. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8270. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8271. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8272. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8273. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8274. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8275. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8276. do { \
  8277. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8278. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8279. } while (0)
  8280. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8281. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8282. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8283. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8286. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8287. } while (0)
  8288. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8289. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8290. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8291. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8292. do { \
  8293. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8294. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8295. } while (0)
  8296. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8297. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8298. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8299. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8300. #define HTT_MAX_AGGR 64
  8301. #define HTT_HL_MAX_AGGR 18
  8302. /**
  8303. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8304. *
  8305. * @details
  8306. * The following field definitions describe the format of the HTT host
  8307. * to target frag_desc/msdu_ext bank configuration message.
  8308. * The message contains the based address and the min and max id of the
  8309. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8310. * MSDU_EXT/FRAG_DESC.
  8311. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8312. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8313. * the hardware does the mapping/translation.
  8314. *
  8315. * Total banks that can be configured is configured to 16.
  8316. *
  8317. * This should be called before any TX has be initiated by the HTT
  8318. *
  8319. * |31 16|15 8|7 5|4 0|
  8320. * |------------------------------------------------------------|
  8321. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8322. * |------------------------------------------------------------|
  8323. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8324. #if HTT_PADDR64
  8325. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8326. #endif
  8327. * |------------------------------------------------------------|
  8328. * | ... |
  8329. * |------------------------------------------------------------|
  8330. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8331. #if HTT_PADDR64
  8332. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8333. #endif
  8334. * |------------------------------------------------------------|
  8335. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8336. * |------------------------------------------------------------|
  8337. * | ... |
  8338. * |------------------------------------------------------------|
  8339. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8340. * |------------------------------------------------------------|
  8341. * Header fields:
  8342. * - MSG_TYPE
  8343. * Bits 7:0
  8344. * Value: 0x6
  8345. * for systems with 64-bit format for bus addresses:
  8346. * - BANKx_BASE_ADDRESS_LO
  8347. * Bits 31:0
  8348. * Purpose: Provide a mechanism to specify the base address of the
  8349. * MSDU_EXT bank physical/bus address.
  8350. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8351. * - BANKx_BASE_ADDRESS_HI
  8352. * Bits 31:0
  8353. * Purpose: Provide a mechanism to specify the base address of the
  8354. * MSDU_EXT bank physical/bus address.
  8355. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8356. * for systems with 32-bit format for bus addresses:
  8357. * - BANKx_BASE_ADDRESS
  8358. * Bits 31:0
  8359. * Purpose: Provide a mechanism to specify the base address of the
  8360. * MSDU_EXT bank physical/bus address.
  8361. * Value: MSDU_EXT bank physical / bus address
  8362. * - BANKx_MIN_ID
  8363. * Bits 15:0
  8364. * Purpose: Provide a mechanism to specify the min index that needs to
  8365. * mapped.
  8366. * - BANKx_MAX_ID
  8367. * Bits 31:16
  8368. * Purpose: Provide a mechanism to specify the max index that needs to
  8369. * mapped.
  8370. *
  8371. */
  8372. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8373. * safe value.
  8374. * @note MAX supported banks is 16.
  8375. */
  8376. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8377. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8378. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8379. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8380. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8381. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8382. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8383. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8384. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8385. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8386. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8387. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8388. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8389. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8390. do { \
  8391. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8392. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8393. } while (0)
  8394. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8395. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8396. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8397. do { \
  8398. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8399. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8400. } while (0)
  8401. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8402. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8403. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8404. do { \
  8405. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8406. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8407. } while (0)
  8408. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8409. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8410. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8413. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8414. } while (0)
  8415. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8416. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8417. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8418. do { \
  8419. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8420. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8421. } while (0)
  8422. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8423. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8424. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8425. do { \
  8426. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8427. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8428. } while (0)
  8429. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8430. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8431. /*
  8432. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8433. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8434. * addresses are stored in a XXX-bit field.
  8435. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8436. * htt_tx_frag_desc64_bank_cfg_t structs.
  8437. */
  8438. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8439. _paddr_bits_, \
  8440. _paddr__bank_base_address_) \
  8441. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8442. /** word 0 \
  8443. * msg_type: 8, \
  8444. * pdev_id: 2, \
  8445. * swap: 1, \
  8446. * reserved0: 5, \
  8447. * num_banks: 8, \
  8448. * desc_size: 8; \
  8449. */ \
  8450. A_UINT32 word0; \
  8451. /* \
  8452. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8453. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8454. * the second A_UINT32). \
  8455. */ \
  8456. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8457. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8458. } POSTPACK
  8459. /* define htt_tx_frag_desc32_bank_cfg_t */
  8460. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8461. /* define htt_tx_frag_desc64_bank_cfg_t */
  8462. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8463. /*
  8464. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8465. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8466. */
  8467. #if HTT_PADDR64
  8468. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8469. #else
  8470. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8471. #endif
  8472. /**
  8473. * @brief target -> host HTT TX Credit total count update message definition
  8474. *
  8475. *|31 16|15|14 9| 8 |7 0 |
  8476. *|---------------------+--+----------+-------+----------|
  8477. *|cur htt credit delta | Q| reserved | sign | msg type |
  8478. *|------------------------------------------------------|
  8479. *
  8480. * Header fields:
  8481. * - MSG_TYPE
  8482. * Bits 7:0
  8483. * Purpose: identifies this as a htt tx credit delta update message
  8484. * Value: 0xe
  8485. * - SIGN
  8486. * Bits 8
  8487. * identifies whether credit delta is positive or negative
  8488. * Value:
  8489. * - 0x0: credit delta is positive, rebalance in some buffers
  8490. * - 0x1: credit delta is negative, rebalance out some buffers
  8491. * - reserved
  8492. * Bits 14:9
  8493. * Value: 0x0
  8494. * - TXQ_GRP
  8495. * Bit 15
  8496. * Purpose: indicates whether any tx queue group information elements
  8497. * are appended to the tx credit update message
  8498. * Value: 0 -> no tx queue group information element is present
  8499. * 1 -> a tx queue group information element immediately follows
  8500. * - DELTA_COUNT
  8501. * Bits 31:16
  8502. * Purpose: Specify current htt credit delta absolute count
  8503. */
  8504. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8505. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8506. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8507. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8508. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8509. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8510. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8511. do { \
  8512. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8513. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8514. } while (0)
  8515. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8516. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8517. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8518. do { \
  8519. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8520. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8521. } while (0)
  8522. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8523. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8524. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8525. do { \
  8526. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8527. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8528. } while (0)
  8529. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8530. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8531. #define HTT_TX_CREDIT_MSG_BYTES 4
  8532. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8533. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8534. /**
  8535. * @brief HTT WDI_IPA Operation Response Message
  8536. *
  8537. * @details
  8538. * HTT WDI_IPA Operation Response message is sent by target
  8539. * to host confirming suspend or resume operation.
  8540. * |31 24|23 16|15 8|7 0|
  8541. * |----------------+----------------+----------------+----------------|
  8542. * | op_code | Rsvd | msg_type |
  8543. * |-------------------------------------------------------------------|
  8544. * | Rsvd | Response len |
  8545. * |-------------------------------------------------------------------|
  8546. * | |
  8547. * | Response-type specific info |
  8548. * | |
  8549. * | |
  8550. * |-------------------------------------------------------------------|
  8551. * Header fields:
  8552. * - MSG_TYPE
  8553. * Bits 7:0
  8554. * Purpose: Identifies this as WDI_IPA Operation Response message
  8555. * value: = 0x13
  8556. * - OP_CODE
  8557. * Bits 31:16
  8558. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8559. * value: = enum htt_wdi_ipa_op_code
  8560. * - RSP_LEN
  8561. * Bits 16:0
  8562. * Purpose: length for the response-type specific info
  8563. * value: = length in bytes for response-type specific info
  8564. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8565. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8566. */
  8567. PREPACK struct htt_wdi_ipa_op_response_t
  8568. {
  8569. /* DWORD 0: flags and meta-data */
  8570. A_UINT32
  8571. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8572. reserved1: 8,
  8573. op_code: 16;
  8574. A_UINT32
  8575. rsp_len: 16,
  8576. reserved2: 16;
  8577. } POSTPACK;
  8578. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8579. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8580. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8581. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8582. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8583. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8584. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8585. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8586. do { \
  8587. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8588. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8589. } while (0)
  8590. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8591. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8592. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8593. do { \
  8594. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8595. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8596. } while (0)
  8597. enum htt_phy_mode {
  8598. htt_phy_mode_11a = 0,
  8599. htt_phy_mode_11g = 1,
  8600. htt_phy_mode_11b = 2,
  8601. htt_phy_mode_11g_only = 3,
  8602. htt_phy_mode_11na_ht20 = 4,
  8603. htt_phy_mode_11ng_ht20 = 5,
  8604. htt_phy_mode_11na_ht40 = 6,
  8605. htt_phy_mode_11ng_ht40 = 7,
  8606. htt_phy_mode_11ac_vht20 = 8,
  8607. htt_phy_mode_11ac_vht40 = 9,
  8608. htt_phy_mode_11ac_vht80 = 10,
  8609. htt_phy_mode_11ac_vht20_2g = 11,
  8610. htt_phy_mode_11ac_vht40_2g = 12,
  8611. htt_phy_mode_11ac_vht80_2g = 13,
  8612. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8613. htt_phy_mode_11ac_vht160 = 15,
  8614. htt_phy_mode_max,
  8615. };
  8616. /**
  8617. * @brief target -> host HTT channel change indication
  8618. * @details
  8619. * Specify when a channel change occurs.
  8620. * This allows the host to precisely determine which rx frames arrived
  8621. * on the old channel and which rx frames arrived on the new channel.
  8622. *
  8623. *|31 |7 0 |
  8624. *|-------------------------------------------+----------|
  8625. *| reserved | msg type |
  8626. *|------------------------------------------------------|
  8627. *| primary_chan_center_freq_mhz |
  8628. *|------------------------------------------------------|
  8629. *| contiguous_chan1_center_freq_mhz |
  8630. *|------------------------------------------------------|
  8631. *| contiguous_chan2_center_freq_mhz |
  8632. *|------------------------------------------------------|
  8633. *| phy_mode |
  8634. *|------------------------------------------------------|
  8635. *
  8636. * Header fields:
  8637. * - MSG_TYPE
  8638. * Bits 7:0
  8639. * Purpose: identifies this as a htt channel change indication message
  8640. * Value: 0x15
  8641. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8642. * Bits 31:0
  8643. * Purpose: identify the (center of the) new 20 MHz primary channel
  8644. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8645. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8646. * Bits 31:0
  8647. * Purpose: identify the (center of the) contiguous frequency range
  8648. * comprising the new channel.
  8649. * For example, if the new channel is a 80 MHz channel extending
  8650. * 60 MHz beyond the primary channel, this field would be 30 larger
  8651. * than the primary channel center frequency field.
  8652. * Value: center frequency of the contiguous frequency range comprising
  8653. * the full channel in MHz units
  8654. * (80+80 channels also use the CONTIG_CHAN2 field)
  8655. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8656. * Bits 31:0
  8657. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8658. * within a VHT 80+80 channel.
  8659. * This field is only relevant for VHT 80+80 channels.
  8660. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8661. * channel (arbitrary value for cases besides VHT 80+80)
  8662. * - PHY_MODE
  8663. * Bits 31:0
  8664. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8665. * and band
  8666. * Value: htt_phy_mode enum value
  8667. */
  8668. PREPACK struct htt_chan_change_t
  8669. {
  8670. /* DWORD 0: flags and meta-data */
  8671. A_UINT32
  8672. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8673. reserved1: 24;
  8674. A_UINT32 primary_chan_center_freq_mhz;
  8675. A_UINT32 contig_chan1_center_freq_mhz;
  8676. A_UINT32 contig_chan2_center_freq_mhz;
  8677. A_UINT32 phy_mode;
  8678. } POSTPACK;
  8679. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8680. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8681. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8682. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8683. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8684. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8685. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8686. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8687. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8690. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8691. } while (0)
  8692. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8693. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8694. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8695. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8698. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8699. } while (0)
  8700. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8701. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8702. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8703. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8706. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8707. } while (0)
  8708. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8709. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8710. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8711. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8714. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8715. } while (0)
  8716. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8717. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8718. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8719. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8720. /**
  8721. * @brief rx offload packet error message
  8722. *
  8723. * @details
  8724. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8725. * of target payload like mic err.
  8726. *
  8727. * |31 24|23 16|15 8|7 0|
  8728. * |----------------+----------------+----------------+----------------|
  8729. * | tid | vdev_id | msg_sub_type | msg_type |
  8730. * |-------------------------------------------------------------------|
  8731. * : (sub-type dependent content) :
  8732. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8733. * Header fields:
  8734. * - msg_type
  8735. * Bits 7:0
  8736. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8737. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8738. * - msg_sub_type
  8739. * Bits 15:8
  8740. * Purpose: Identifies which type of rx error is reported by this message
  8741. * value: htt_rx_ofld_pkt_err_type
  8742. * - vdev_id
  8743. * Bits 23:16
  8744. * Purpose: Identifies which vdev received the erroneous rx frame
  8745. * value:
  8746. * - tid
  8747. * Bits 31:24
  8748. * Purpose: Identifies the traffic type of the rx frame
  8749. * value:
  8750. *
  8751. * - The payload fields used if the sub-type == MIC error are shown below.
  8752. * Note - MIC err is per MSDU, while PN is per MPDU.
  8753. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8754. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8755. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8756. * instead of sending separate HTT messages for each wrong MSDU within
  8757. * the MPDU.
  8758. *
  8759. * |31 24|23 16|15 8|7 0|
  8760. * |----------------+----------------+----------------+----------------|
  8761. * | Rsvd | key_id | peer_id |
  8762. * |-------------------------------------------------------------------|
  8763. * | receiver MAC addr 31:0 |
  8764. * |-------------------------------------------------------------------|
  8765. * | Rsvd | receiver MAC addr 47:32 |
  8766. * |-------------------------------------------------------------------|
  8767. * | transmitter MAC addr 31:0 |
  8768. * |-------------------------------------------------------------------|
  8769. * | Rsvd | transmitter MAC addr 47:32 |
  8770. * |-------------------------------------------------------------------|
  8771. * | PN 31:0 |
  8772. * |-------------------------------------------------------------------|
  8773. * | Rsvd | PN 47:32 |
  8774. * |-------------------------------------------------------------------|
  8775. * - peer_id
  8776. * Bits 15:0
  8777. * Purpose: identifies which peer is frame is from
  8778. * value:
  8779. * - key_id
  8780. * Bits 23:16
  8781. * Purpose: identifies key_id of rx frame
  8782. * value:
  8783. * - RA_31_0 (receiver MAC addr 31:0)
  8784. * Bits 31:0
  8785. * Purpose: identifies by MAC address which vdev received the frame
  8786. * value: MAC address lower 4 bytes
  8787. * - RA_47_32 (receiver MAC addr 47:32)
  8788. * Bits 15:0
  8789. * Purpose: identifies by MAC address which vdev received the frame
  8790. * value: MAC address upper 2 bytes
  8791. * - TA_31_0 (transmitter MAC addr 31:0)
  8792. * Bits 31:0
  8793. * Purpose: identifies by MAC address which peer transmitted the frame
  8794. * value: MAC address lower 4 bytes
  8795. * - TA_47_32 (transmitter MAC addr 47:32)
  8796. * Bits 15:0
  8797. * Purpose: identifies by MAC address which peer transmitted the frame
  8798. * value: MAC address upper 2 bytes
  8799. * - PN_31_0
  8800. * Bits 31:0
  8801. * Purpose: Identifies pn of rx frame
  8802. * value: PN lower 4 bytes
  8803. * - PN_47_32
  8804. * Bits 15:0
  8805. * Purpose: Identifies pn of rx frame
  8806. * value:
  8807. * TKIP or CCMP: PN upper 2 bytes
  8808. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8809. */
  8810. enum htt_rx_ofld_pkt_err_type {
  8811. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8812. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8813. };
  8814. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8815. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8816. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8817. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8818. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8819. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8820. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8821. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8822. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8823. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8824. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8825. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8826. do { \
  8827. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8828. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8829. } while (0)
  8830. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8831. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8832. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8833. do { \
  8834. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8835. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8836. } while (0)
  8837. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8838. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8839. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8840. do { \
  8841. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8842. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8843. } while (0)
  8844. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8845. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8846. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8847. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8848. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8849. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8850. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8851. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8852. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8853. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8854. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8855. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8856. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8857. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8858. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8859. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8860. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8861. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8862. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8863. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8864. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8865. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8866. do { \
  8867. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8868. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8869. } while (0)
  8870. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8871. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8872. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8873. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8874. do { \
  8875. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8876. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8877. } while (0)
  8878. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8879. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8880. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8881. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8882. do { \
  8883. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8884. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8885. } while (0)
  8886. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8887. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8888. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8889. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8892. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8893. } while (0)
  8894. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8895. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8896. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8897. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8898. do { \
  8899. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8900. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8901. } while (0)
  8902. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8903. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8904. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8905. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8906. do { \
  8907. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8908. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8909. } while (0)
  8910. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8911. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8912. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8913. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8914. do { \
  8915. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8916. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8917. } while (0)
  8918. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8919. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8920. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8921. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8922. do { \
  8923. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8924. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8925. } while (0)
  8926. /**
  8927. * @brief peer rate report message
  8928. *
  8929. * @details
  8930. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8931. * justified rate of all the peers.
  8932. *
  8933. * |31 24|23 16|15 8|7 0|
  8934. * |----------------+----------------+----------------+----------------|
  8935. * | peer_count | | msg_type |
  8936. * |-------------------------------------------------------------------|
  8937. * : Payload (variant number of peer rate report) :
  8938. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8939. * Header fields:
  8940. * - msg_type
  8941. * Bits 7:0
  8942. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8943. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8944. * - reserved
  8945. * Bits 15:8
  8946. * Purpose:
  8947. * value:
  8948. * - peer_count
  8949. * Bits 31:16
  8950. * Purpose: Specify how many peer rate report elements are present in the payload.
  8951. * value:
  8952. *
  8953. * Payload:
  8954. * There are variant number of peer rate report follow the first 32 bits.
  8955. * The peer rate report is defined as follows.
  8956. *
  8957. * |31 20|19 16|15 0|
  8958. * |-----------------------+---------+---------------------------------|-
  8959. * | reserved | phy | peer_id | \
  8960. * |-------------------------------------------------------------------| -> report #0
  8961. * | rate | /
  8962. * |-----------------------+---------+---------------------------------|-
  8963. * | reserved | phy | peer_id | \
  8964. * |-------------------------------------------------------------------| -> report #1
  8965. * | rate | /
  8966. * |-----------------------+---------+---------------------------------|-
  8967. * | reserved | phy | peer_id | \
  8968. * |-------------------------------------------------------------------| -> report #2
  8969. * | rate | /
  8970. * |-------------------------------------------------------------------|-
  8971. * : :
  8972. * : :
  8973. * : :
  8974. * :-------------------------------------------------------------------:
  8975. *
  8976. * - peer_id
  8977. * Bits 15:0
  8978. * Purpose: identify the peer
  8979. * value:
  8980. * - phy
  8981. * Bits 19:16
  8982. * Purpose: identify which phy is in use
  8983. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8984. * Please see enum htt_peer_report_phy_type for detail.
  8985. * - reserved
  8986. * Bits 31:20
  8987. * Purpose:
  8988. * value:
  8989. * - rate
  8990. * Bits 31:0
  8991. * Purpose: represent the justified rate of the peer specified by peer_id
  8992. * value:
  8993. */
  8994. enum htt_peer_rate_report_phy_type {
  8995. HTT_PEER_RATE_REPORT_11B = 0,
  8996. HTT_PEER_RATE_REPORT_11A_G,
  8997. HTT_PEER_RATE_REPORT_11N,
  8998. HTT_PEER_RATE_REPORT_11AC,
  8999. };
  9000. #define HTT_PEER_RATE_REPORT_SIZE 8
  9001. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9002. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9003. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9004. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9005. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9006. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9007. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9008. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9009. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9010. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9011. do { \
  9012. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9013. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9014. } while (0)
  9015. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9016. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9017. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9018. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9019. do { \
  9020. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9021. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9022. } while (0)
  9023. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9024. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9025. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9026. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9029. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9030. } while (0)
  9031. /**
  9032. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9033. *
  9034. * @details
  9035. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9036. * a flow of descriptors.
  9037. *
  9038. * This message is in TLV format and indicates the parameters to be setup a
  9039. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9040. * receive descriptors from a specified pool.
  9041. *
  9042. * The message would appear as follows:
  9043. *
  9044. * |31 24|23 16|15 8|7 0|
  9045. * |----------------+----------------+----------------+----------------|
  9046. * header | reserved | num_flows | msg_type |
  9047. * |-------------------------------------------------------------------|
  9048. * | |
  9049. * : payload :
  9050. * | |
  9051. * |-------------------------------------------------------------------|
  9052. *
  9053. * The header field is one DWORD long and is interpreted as follows:
  9054. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9055. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9056. * this message
  9057. * b'16-31 - reserved: These bits are reserved for future use
  9058. *
  9059. * Payload:
  9060. * The payload would contain multiple objects of the following structure. Each
  9061. * object represents a flow.
  9062. *
  9063. * |31 24|23 16|15 8|7 0|
  9064. * |----------------+----------------+----------------+----------------|
  9065. * header | reserved | num_flows | msg_type |
  9066. * |-------------------------------------------------------------------|
  9067. * payload0| flow_type |
  9068. * |-------------------------------------------------------------------|
  9069. * | flow_id |
  9070. * |-------------------------------------------------------------------|
  9071. * | reserved0 | flow_pool_id |
  9072. * |-------------------------------------------------------------------|
  9073. * | reserved1 | flow_pool_size |
  9074. * |-------------------------------------------------------------------|
  9075. * | reserved2 |
  9076. * |-------------------------------------------------------------------|
  9077. * payload1| flow_type |
  9078. * |-------------------------------------------------------------------|
  9079. * | flow_id |
  9080. * |-------------------------------------------------------------------|
  9081. * | reserved0 | flow_pool_id |
  9082. * |-------------------------------------------------------------------|
  9083. * | reserved1 | flow_pool_size |
  9084. * |-------------------------------------------------------------------|
  9085. * | reserved2 |
  9086. * |-------------------------------------------------------------------|
  9087. * | . |
  9088. * | . |
  9089. * | . |
  9090. * |-------------------------------------------------------------------|
  9091. *
  9092. * Each payload is 5 DWORDS long and is interpreted as follows:
  9093. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9094. * this flow is associated. It can be VDEV, peer,
  9095. * or tid (AC). Based on enum htt_flow_type.
  9096. *
  9097. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9098. * object. For flow_type vdev it is set to the
  9099. * vdevid, for peer it is peerid and for tid, it is
  9100. * tid_num.
  9101. *
  9102. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9103. * in the host for this flow
  9104. * b'16:31 - reserved0: This field in reserved for the future. In case
  9105. * we have a hierarchical implementation (HCM) of
  9106. * pools, it can be used to indicate the ID of the
  9107. * parent-pool.
  9108. *
  9109. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9110. * Descriptors for this flow will be
  9111. * allocated from this pool in the host.
  9112. * b'16:31 - reserved1: This field in reserved for the future. In case
  9113. * we have a hierarchical implementation of pools,
  9114. * it can be used to indicate the max number of
  9115. * descriptors in the pool. The b'0:15 can be used
  9116. * to indicate min number of descriptors in the
  9117. * HCM scheme.
  9118. *
  9119. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9120. * we have a hierarchical implementation of pools,
  9121. * b'0:15 can be used to indicate the
  9122. * priority-based borrowing (PBB) threshold of
  9123. * the flow's pool. The b'16:31 are still left
  9124. * reserved.
  9125. */
  9126. enum htt_flow_type {
  9127. FLOW_TYPE_VDEV = 0,
  9128. /* Insert new flow types above this line */
  9129. };
  9130. PREPACK struct htt_flow_pool_map_payload_t {
  9131. A_UINT32 flow_type;
  9132. A_UINT32 flow_id;
  9133. A_UINT32 flow_pool_id:16,
  9134. reserved0:16;
  9135. A_UINT32 flow_pool_size:16,
  9136. reserved1:16;
  9137. A_UINT32 reserved2;
  9138. } POSTPACK;
  9139. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9140. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9141. (sizeof(struct htt_flow_pool_map_payload_t))
  9142. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9143. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9144. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9145. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9146. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9147. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9148. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9149. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9150. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9151. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9152. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9153. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9154. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9155. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9156. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9157. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9158. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9159. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9160. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9161. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9162. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9163. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9164. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9167. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9168. } while (0)
  9169. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9170. do { \
  9171. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9172. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9173. } while (0)
  9174. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9175. do { \
  9176. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9177. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9178. } while (0)
  9179. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9180. do { \
  9181. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9182. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9183. } while (0)
  9184. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9185. do { \
  9186. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9187. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9188. } while (0)
  9189. /**
  9190. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9191. *
  9192. * @details
  9193. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9194. * down a flow of descriptors.
  9195. * This message indicates that for the flow (whose ID is provided) is wanting
  9196. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9197. * pool of descriptors from where descriptors are being allocated for this
  9198. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9199. * be unmapped by the host.
  9200. *
  9201. * The message would appear as follows:
  9202. *
  9203. * |31 24|23 16|15 8|7 0|
  9204. * |----------------+----------------+----------------+----------------|
  9205. * | reserved0 | msg_type |
  9206. * |-------------------------------------------------------------------|
  9207. * | flow_type |
  9208. * |-------------------------------------------------------------------|
  9209. * | flow_id |
  9210. * |-------------------------------------------------------------------|
  9211. * | reserved1 | flow_pool_id |
  9212. * |-------------------------------------------------------------------|
  9213. *
  9214. * The message is interpreted as follows:
  9215. * dword0 - b'0:7 - msg_type: This will be set to
  9216. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9217. * b'8:31 - reserved0: Reserved for future use
  9218. *
  9219. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9220. * this flow is associated. It can be VDEV, peer,
  9221. * or tid (AC). Based on enum htt_flow_type.
  9222. *
  9223. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9224. * object. For flow_type vdev it is set to the
  9225. * vdevid, for peer it is peerid and for tid, it is
  9226. * tid_num.
  9227. *
  9228. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9229. * used in the host for this flow
  9230. * b'16:31 - reserved0: This field in reserved for the future.
  9231. *
  9232. */
  9233. PREPACK struct htt_flow_pool_unmap_t {
  9234. A_UINT32 msg_type:8,
  9235. reserved0:24;
  9236. A_UINT32 flow_type;
  9237. A_UINT32 flow_id;
  9238. A_UINT32 flow_pool_id:16,
  9239. reserved1:16;
  9240. } POSTPACK;
  9241. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9242. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9243. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9244. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9245. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9246. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9247. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9248. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9249. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9250. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9251. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9252. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9253. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9254. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9255. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9256. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9257. do { \
  9258. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9259. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9260. } while (0)
  9261. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9262. do { \
  9263. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9264. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9265. } while (0)
  9266. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9267. do { \
  9268. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9269. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9270. } while (0)
  9271. /**
  9272. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9273. *
  9274. * @details
  9275. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9276. * SRNG ring setup is done
  9277. *
  9278. * This message indicates whether the last setup operation is successful.
  9279. * It will be sent to host when host set respose_required bit in
  9280. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9281. * The message would appear as follows:
  9282. *
  9283. * |31 24|23 16|15 8|7 0|
  9284. * |--------------- +----------------+----------------+----------------|
  9285. * | setup_status | ring_id | pdev_id | msg_type |
  9286. * |-------------------------------------------------------------------|
  9287. *
  9288. * The message is interpreted as follows:
  9289. * dword0 - b'0:7 - msg_type: This will be set to
  9290. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9291. * b'8:15 - pdev_id:
  9292. * 0 (for rings at SOC/UMAC level),
  9293. * 1/2/3 mac id (for rings at LMAC level)
  9294. * b'16:23 - ring_id: Identify the ring which is set up
  9295. * More details can be got from enum htt_srng_ring_id
  9296. * b'24:31 - setup_status: Indicate status of setup operation
  9297. * Refer to htt_ring_setup_status
  9298. */
  9299. PREPACK struct htt_sring_setup_done_t {
  9300. A_UINT32 msg_type: 8,
  9301. pdev_id: 8,
  9302. ring_id: 8,
  9303. setup_status: 8;
  9304. } POSTPACK;
  9305. enum htt_ring_setup_status {
  9306. htt_ring_setup_status_ok = 0,
  9307. htt_ring_setup_status_error,
  9308. };
  9309. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9310. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9311. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9312. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9313. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9314. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9315. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9316. do { \
  9317. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9318. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9319. } while (0)
  9320. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9321. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9322. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9323. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9324. HTT_SRING_SETUP_DONE_RING_ID_S)
  9325. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9326. do { \
  9327. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9328. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9329. } while (0)
  9330. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9331. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9332. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9333. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9334. HTT_SRING_SETUP_DONE_STATUS_S)
  9335. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9336. do { \
  9337. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9338. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9339. } while (0)
  9340. /**
  9341. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9342. *
  9343. * @details
  9344. * HTT TX map flow entry with tqm flow pointer
  9345. * Sent from firmware to host to add tqm flow pointer in corresponding
  9346. * flow search entry. Flow metadata is replayed back to host as part of this
  9347. * struct to enable host to find the specific flow search entry
  9348. *
  9349. * The message would appear as follows:
  9350. *
  9351. * |31 28|27 18|17 14|13 8|7 0|
  9352. * |-------+------------------------------------------+----------------|
  9353. * | rsvd0 | fse_hsh_idx | msg_type |
  9354. * |-------------------------------------------------------------------|
  9355. * | rsvd1 | tid | peer_id |
  9356. * |-------------------------------------------------------------------|
  9357. * | tqm_flow_pntr_lo |
  9358. * |-------------------------------------------------------------------|
  9359. * | tqm_flow_pntr_hi |
  9360. * |-------------------------------------------------------------------|
  9361. * | fse_meta_data |
  9362. * |-------------------------------------------------------------------|
  9363. *
  9364. * The message is interpreted as follows:
  9365. *
  9366. * dword0 - b'0:7 - msg_type: This will be set to
  9367. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9368. *
  9369. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9370. * for this flow entry
  9371. *
  9372. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9373. *
  9374. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9375. *
  9376. * dword1 - b'14:17 - tid
  9377. *
  9378. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9379. *
  9380. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9381. *
  9382. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9383. *
  9384. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9385. * given by host
  9386. */
  9387. PREPACK struct htt_tx_map_flow_info {
  9388. A_UINT32
  9389. msg_type: 8,
  9390. fse_hsh_idx: 20,
  9391. rsvd0: 4;
  9392. A_UINT32
  9393. peer_id: 14,
  9394. tid: 4,
  9395. rsvd1: 14;
  9396. A_UINT32 tqm_flow_pntr_lo;
  9397. A_UINT32 tqm_flow_pntr_hi;
  9398. struct htt_tx_flow_metadata fse_meta_data;
  9399. } POSTPACK;
  9400. /* DWORD 0 */
  9401. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9402. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9403. /* DWORD 1 */
  9404. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9405. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9406. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9407. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9408. /* DWORD 0 */
  9409. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9410. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9411. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9412. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9413. do { \
  9414. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9415. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9416. } while (0)
  9417. /* DWORD 1 */
  9418. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9419. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9420. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9421. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9424. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9425. } while (0)
  9426. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9427. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9428. HTT_TX_MAP_FLOW_INFO_TID_S)
  9429. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9430. do { \
  9431. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9432. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9433. } while (0)
  9434. /*
  9435. * htt_dbg_ext_stats_status -
  9436. * present - The requested stats have been delivered in full.
  9437. * This indicates that either the stats information was contained
  9438. * in its entirety within this message, or else this message
  9439. * completes the delivery of the requested stats info that was
  9440. * partially delivered through earlier STATS_CONF messages.
  9441. * partial - The requested stats have been delivered in part.
  9442. * One or more subsequent STATS_CONF messages with the same
  9443. * cookie value will be sent to deliver the remainder of the
  9444. * information.
  9445. * error - The requested stats could not be delivered, for example due
  9446. * to a shortage of memory to construct a message holding the
  9447. * requested stats.
  9448. * invalid - The requested stat type is either not recognized, or the
  9449. * target is configured to not gather the stats type in question.
  9450. */
  9451. enum htt_dbg_ext_stats_status {
  9452. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9453. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9454. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9455. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9456. };
  9457. /**
  9458. * @brief target -> host ppdu stats upload
  9459. *
  9460. * @details
  9461. * The following field definitions describe the format of the HTT target
  9462. * to host ppdu stats indication message.
  9463. *
  9464. *
  9465. * |31 16|15 12|11 10|9 8|7 0 |
  9466. * |----------------------------------------------------------------------|
  9467. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9468. * |----------------------------------------------------------------------|
  9469. * | ppdu_id |
  9470. * |----------------------------------------------------------------------|
  9471. * | Timestamp in us |
  9472. * |----------------------------------------------------------------------|
  9473. * | reserved |
  9474. * |----------------------------------------------------------------------|
  9475. * | type-specific stats info |
  9476. * | (see htt_ppdu_stats.h) |
  9477. * |----------------------------------------------------------------------|
  9478. * Header fields:
  9479. * - MSG_TYPE
  9480. * Bits 7:0
  9481. * Purpose: Identifies this is a PPDU STATS indication
  9482. * message.
  9483. * Value: 0x1d
  9484. * - mac_id
  9485. * Bits 9:8
  9486. * Purpose: mac_id of this ppdu_id
  9487. * Value: 0-3
  9488. * - pdev_id
  9489. * Bits 11:10
  9490. * Purpose: pdev_id of this ppdu_id
  9491. * Value: 0-3
  9492. * 0 (for rings at SOC level),
  9493. * 1/2/3 PDEV -> 0/1/2
  9494. * - payload_size
  9495. * Bits 31:16
  9496. * Purpose: total tlv size
  9497. * Value: payload_size in bytes
  9498. */
  9499. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9500. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9501. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9502. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9503. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9504. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9505. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9506. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9507. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9508. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9509. do { \
  9510. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9511. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9512. } while (0)
  9513. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9514. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9515. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9516. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9517. do { \
  9518. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9519. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9520. } while (0)
  9521. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9522. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9523. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9524. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9525. do { \
  9526. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9527. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9528. } while (0)
  9529. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9530. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9531. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9532. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9533. do { \
  9534. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9535. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9536. } while (0)
  9537. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9538. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9539. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9540. /* htt_t2h_ppdu_stats_ind_hdr_t
  9541. * This struct contains the fields within the header of the
  9542. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9543. * stats info.
  9544. * This struct assumes little-endian layout, and thus is only
  9545. * suitable for use within processors known to be little-endian
  9546. * (such as the target).
  9547. * In contrast, the above macros provide endian-portable methods
  9548. * to get and set the bitfields within this PPDU_STATS_IND header.
  9549. */
  9550. typedef struct {
  9551. A_UINT32 msg_type: 8, /* bits 7:0 */
  9552. mac_id: 2, /* bits 9:8 */
  9553. pdev_id: 2, /* bits 11:10 */
  9554. reserved1: 4, /* bits 15:12 */
  9555. payload_size: 16; /* bits 31:16 */
  9556. A_UINT32 ppdu_id;
  9557. A_UINT32 timestamp_us;
  9558. A_UINT32 reserved2;
  9559. } htt_t2h_ppdu_stats_ind_hdr_t;
  9560. /**
  9561. * @brief target -> host extended statistics upload
  9562. *
  9563. * @details
  9564. * The following field definitions describe the format of the HTT target
  9565. * to host stats upload confirmation message.
  9566. * The message contains a cookie echoed from the HTT host->target stats
  9567. * upload request, which identifies which request the confirmation is
  9568. * for, and a single stats can span over multiple HTT stats indication
  9569. * due to the HTT message size limitation so every HTT ext stats indication
  9570. * will have tag-length-value stats information elements.
  9571. * The tag-length header for each HTT stats IND message also includes a
  9572. * status field, to indicate whether the request for the stat type in
  9573. * question was fully met, partially met, unable to be met, or invalid
  9574. * (if the stat type in question is disabled in the target).
  9575. * A Done bit 1's indicate the end of the of stats info elements.
  9576. *
  9577. *
  9578. * |31 16|15 12|11|10 8|7 5|4 0|
  9579. * |--------------------------------------------------------------|
  9580. * | reserved | msg type |
  9581. * |--------------------------------------------------------------|
  9582. * | cookie LSBs |
  9583. * |--------------------------------------------------------------|
  9584. * | cookie MSBs |
  9585. * |--------------------------------------------------------------|
  9586. * | stats entry length | rsvd | D| S | stat type |
  9587. * |--------------------------------------------------------------|
  9588. * | type-specific stats info |
  9589. * | (see htt_stats.h) |
  9590. * |--------------------------------------------------------------|
  9591. * Header fields:
  9592. * - MSG_TYPE
  9593. * Bits 7:0
  9594. * Purpose: Identifies this is a extended statistics upload confirmation
  9595. * message.
  9596. * Value: 0x1c
  9597. * - COOKIE_LSBS
  9598. * Bits 31:0
  9599. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9600. * message with its preceding host->target stats request message.
  9601. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9602. * - COOKIE_MSBS
  9603. * Bits 31:0
  9604. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9605. * message with its preceding host->target stats request message.
  9606. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9607. *
  9608. * Stats Information Element tag-length header fields:
  9609. * - STAT_TYPE
  9610. * Bits 7:0
  9611. * Purpose: identifies the type of statistics info held in the
  9612. * following information element
  9613. * Value: htt_dbg_ext_stats_type
  9614. * - STATUS
  9615. * Bits 10:8
  9616. * Purpose: indicate whether the requested stats are present
  9617. * Value: htt_dbg_ext_stats_status
  9618. * - DONE
  9619. * Bits 11
  9620. * Purpose:
  9621. * Indicates the completion of the stats entry, this will be the last
  9622. * stats conf HTT segment for the requested stats type.
  9623. * Value:
  9624. * 0 -> the stats retrieval is ongoing
  9625. * 1 -> the stats retrieval is complete
  9626. * - LENGTH
  9627. * Bits 31:16
  9628. * Purpose: indicate the stats information size
  9629. * Value: This field specifies the number of bytes of stats information
  9630. * that follows the element tag-length header.
  9631. * It is expected but not required that this length is a multiple of
  9632. * 4 bytes.
  9633. */
  9634. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9635. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9636. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9637. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9638. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9639. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9640. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9641. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9642. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9643. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9644. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9645. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9646. do { \
  9647. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9648. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9649. } while (0)
  9650. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9651. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9652. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9653. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9654. do { \
  9655. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9656. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9657. } while (0)
  9658. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9659. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9660. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9661. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9662. do { \
  9663. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9664. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9665. } while (0)
  9666. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9667. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9668. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9669. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9670. do { \
  9671. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9672. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9673. } while (0)
  9674. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9675. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9676. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9677. typedef enum {
  9678. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9679. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9680. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9681. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9682. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9683. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9684. /* Reserved from 128 - 255 for target internal use.*/
  9685. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9686. } HTT_PEER_TYPE;
  9687. /** 2 word representation of MAC addr */
  9688. typedef struct {
  9689. /** upper 4 bytes of MAC address */
  9690. A_UINT32 mac_addr31to0;
  9691. /** lower 2 bytes of MAC address */
  9692. A_UINT32 mac_addr47to32;
  9693. } htt_mac_addr;
  9694. /** macro to convert MAC address from char array to HTT word format */
  9695. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9696. (phtt_mac_addr)->mac_addr31to0 = \
  9697. (((c_macaddr)[0] << 0) | \
  9698. ((c_macaddr)[1] << 8) | \
  9699. ((c_macaddr)[2] << 16) | \
  9700. ((c_macaddr)[3] << 24)); \
  9701. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9702. } while (0)
  9703. /**
  9704. * @brief target -> host monitor mac header indication message
  9705. *
  9706. * @details
  9707. * The following diagram shows the format of the monitor mac header message
  9708. * sent from the target to the host.
  9709. * This message is primarily sent when promiscuous rx mode is enabled.
  9710. * One message is sent per rx PPDU.
  9711. *
  9712. * |31 24|23 16|15 8|7 0|
  9713. * |-------------------------------------------------------------|
  9714. * | peer_id | reserved0 | msg_type |
  9715. * |-------------------------------------------------------------|
  9716. * | reserved1 | num_mpdu |
  9717. * |-------------------------------------------------------------|
  9718. * | struct hw_rx_desc |
  9719. * | (see wal_rx_desc.h) |
  9720. * |-------------------------------------------------------------|
  9721. * | struct ieee80211_frame_addr4 |
  9722. * | (see ieee80211_defs.h) |
  9723. * |-------------------------------------------------------------|
  9724. * | struct ieee80211_frame_addr4 |
  9725. * | (see ieee80211_defs.h) |
  9726. * |-------------------------------------------------------------|
  9727. * | ...... |
  9728. * |-------------------------------------------------------------|
  9729. *
  9730. * Header fields:
  9731. * - msg_type
  9732. * Bits 7:0
  9733. * Purpose: Identifies this is a monitor mac header indication message.
  9734. * Value: 0x20
  9735. * - peer_id
  9736. * Bits 31:16
  9737. * Purpose: Software peer id given by host during association,
  9738. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9739. * for rx PPDUs received from unassociated peers.
  9740. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9741. * - num_mpdu
  9742. * Bits 15:0
  9743. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9744. * delivered within the message.
  9745. * Value: 1 to 32
  9746. * num_mpdu is limited to a maximum value of 32, due to buffer
  9747. * size limits. For PPDUs with more than 32 MPDUs, only the
  9748. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9749. * the PPDU will be provided.
  9750. */
  9751. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9752. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9753. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9754. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9755. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9756. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9757. do { \
  9758. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9759. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9760. } while (0)
  9761. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9762. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9763. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9764. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9765. do { \
  9766. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9767. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9768. } while (0)
  9769. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9770. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9771. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9772. /**
  9773. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9774. *
  9775. * @details
  9776. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9777. * the flow pool associated with the specified ID is resized
  9778. *
  9779. * The message would appear as follows:
  9780. *
  9781. * |31 16|15 8|7 0|
  9782. * |---------------------------------+----------------+----------------|
  9783. * | reserved0 | Msg type |
  9784. * |-------------------------------------------------------------------|
  9785. * | flow pool new size | flow pool ID |
  9786. * |-------------------------------------------------------------------|
  9787. *
  9788. * The message is interpreted as follows:
  9789. * b'0:7 - msg_type: This will be set to
  9790. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9791. *
  9792. * b'0:15 - flow pool ID: Existing flow pool ID
  9793. *
  9794. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9795. *
  9796. */
  9797. PREPACK struct htt_flow_pool_resize_t {
  9798. A_UINT32 msg_type:8,
  9799. reserved0:24;
  9800. A_UINT32 flow_pool_id:16,
  9801. flow_pool_new_size:16;
  9802. } POSTPACK;
  9803. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9804. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9805. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9806. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9807. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9808. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9809. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9810. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9811. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9812. do { \
  9813. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9814. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9815. } while (0)
  9816. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9817. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9818. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9819. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9820. do { \
  9821. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9822. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9823. } while (0)
  9824. /**
  9825. * @brief host -> target channel change message
  9826. *
  9827. * @details
  9828. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9829. * to associate RX frames to correct channel they were received on.
  9830. * The following field definitions describe the format of the HTT target
  9831. * to host channel change message.
  9832. * |31 16|15 8|7 5|4 0|
  9833. * |------------------------------------------------------------|
  9834. * | reserved | MSG_TYPE |
  9835. * |------------------------------------------------------------|
  9836. * | CHAN_MHZ |
  9837. * |------------------------------------------------------------|
  9838. * | BAND_CENTER_FREQ1 |
  9839. * |------------------------------------------------------------|
  9840. * | BAND_CENTER_FREQ2 |
  9841. * |------------------------------------------------------------|
  9842. * | CHAN_PHY_MODE |
  9843. * |------------------------------------------------------------|
  9844. * Header fields:
  9845. * - MSG_TYPE
  9846. * Bits 7:0
  9847. * Value: 0xf
  9848. * - CHAN_MHZ
  9849. * Bits 31:0
  9850. * Purpose: frequency of the primary 20mhz channel.
  9851. * - BAND_CENTER_FREQ1
  9852. * Bits 31:0
  9853. * Purpose: centre frequency of the full channel.
  9854. * - BAND_CENTER_FREQ2
  9855. * Bits 31:0
  9856. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9857. * - CHAN_PHY_MODE
  9858. * Bits 31:0
  9859. * Purpose: phy mode of the channel.
  9860. */
  9861. PREPACK struct htt_chan_change_msg {
  9862. A_UINT32 chan_mhz; /* frequency in mhz */
  9863. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9864. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9865. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9866. } POSTPACK;
  9867. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9868. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9869. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9870. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9871. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9872. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9873. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9874. /*
  9875. * The read and write indices point to the data within the host buffer.
  9876. * Because the first 4 bytes of the host buffer is used for the read index and
  9877. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9878. * The read index and write index are the byte offsets from the base of the
  9879. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9880. * Refer the ASCII text picture below.
  9881. */
  9882. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9883. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9884. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9885. /*
  9886. ***************************************************************************
  9887. *
  9888. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9889. *
  9890. ***************************************************************************
  9891. *
  9892. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9893. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9894. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9895. * written into the Host memory region mentioned below.
  9896. *
  9897. * Read index is updated by the Host. At any point of time, the read index will
  9898. * indicate the index that will next be read by the Host. The read index is
  9899. * in units of bytes offset from the base of the meta-data buffer.
  9900. *
  9901. * Write index is updated by the FW. At any point of time, the write index will
  9902. * indicate from where the FW can start writing any new data. The write index is
  9903. * in units of bytes offset from the base of the meta-data buffer.
  9904. *
  9905. * If the Host is not fast enough in reading the CFR data, any new capture data
  9906. * would be dropped if there is no space left to write the new captures.
  9907. *
  9908. * The last 4 bytes of the memory region will have the magic pattern
  9909. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9910. * not overrun the host buffer.
  9911. *
  9912. * ,--------------------. read and write indices store the
  9913. * | | byte offset from the base of the
  9914. * | ,--------+--------. meta-data buffer to the next
  9915. * | | | | location within the data buffer
  9916. * | | v v that will be read / written
  9917. * ************************************************************************
  9918. * * Read * Write * * Magic *
  9919. * * index * index * CFR data1 ...... CFR data N * pattern *
  9920. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9921. * ************************************************************************
  9922. * |<---------- data buffer ---------->|
  9923. *
  9924. * |<----------------- meta-data buffer allocated in Host ----------------|
  9925. *
  9926. * Note:
  9927. * - Considering the 4 bytes needed to store the Read index (R) and the
  9928. * Write index (W), the initial value is as follows:
  9929. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9930. * - Buffer empty condition:
  9931. * R = W
  9932. *
  9933. * Regarding CFR data format:
  9934. * --------------------------
  9935. *
  9936. * Each CFR tone is stored in HW as 16-bits with the following format:
  9937. * {bits[15:12], bits[11:6], bits[5:0]} =
  9938. * {unsigned exponent (4 bits),
  9939. * signed mantissa_real (6 bits),
  9940. * signed mantissa_imag (6 bits)}
  9941. *
  9942. * CFR_real = mantissa_real * 2^(exponent-5)
  9943. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9944. *
  9945. *
  9946. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9947. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9948. *
  9949. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9950. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9951. * .
  9952. * .
  9953. * .
  9954. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9955. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9956. */
  9957. /* Bandwidth of peer CFR captures */
  9958. typedef enum {
  9959. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9960. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9961. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9962. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9963. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9964. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9965. } HTT_PEER_CFR_CAPTURE_BW;
  9966. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9967. * was captured
  9968. */
  9969. typedef enum {
  9970. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9971. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9972. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9973. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9974. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9975. } HTT_PEER_CFR_CAPTURE_MODE;
  9976. typedef enum {
  9977. /* This message type is currently used for the below purpose:
  9978. *
  9979. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9980. * wmi_peer_cfr_capture_cmd.
  9981. * If payload_present bit is set to 0 then the associated memory region
  9982. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9983. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9984. * message; the CFR dump will be present at the end of the message,
  9985. * after the chan_phy_mode.
  9986. */
  9987. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9988. /* Always keep this last */
  9989. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9990. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9991. /**
  9992. * @brief target -> host CFR dump completion indication message definition
  9993. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9994. *
  9995. * @details
  9996. * The following diagram shows the format of the Channel Frequency Response
  9997. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9998. * the channel capture of a peer is copied by Firmware into the Host memory
  9999. *
  10000. * **************************************************************************
  10001. *
  10002. * Message format when the CFR capture message type is
  10003. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10004. *
  10005. * **************************************************************************
  10006. *
  10007. * |31 16|15 |8|7 0|
  10008. * |----------------------------------------------------------------|
  10009. * header: | reserved |P| msg_type |
  10010. * word 0 | | | |
  10011. * |----------------------------------------------------------------|
  10012. * payload: | cfr_capture_msg_type |
  10013. * word 1 | |
  10014. * |----------------------------------------------------------------|
  10015. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10016. * word 2 | | | | | | | | |
  10017. * |----------------------------------------------------------------|
  10018. * | mac_addr31to0 |
  10019. * word 3 | |
  10020. * |----------------------------------------------------------------|
  10021. * | unused / reserved | mac_addr47to32 |
  10022. * word 4 | | |
  10023. * |----------------------------------------------------------------|
  10024. * | index |
  10025. * word 5 | |
  10026. * |----------------------------------------------------------------|
  10027. * | length |
  10028. * word 6 | |
  10029. * |----------------------------------------------------------------|
  10030. * | timestamp |
  10031. * word 7 | |
  10032. * |----------------------------------------------------------------|
  10033. * | counter |
  10034. * word 8 | |
  10035. * |----------------------------------------------------------------|
  10036. * | chan_mhz |
  10037. * word 9 | |
  10038. * |----------------------------------------------------------------|
  10039. * | band_center_freq1 |
  10040. * word 10 | |
  10041. * |----------------------------------------------------------------|
  10042. * | band_center_freq2 |
  10043. * word 11 | |
  10044. * |----------------------------------------------------------------|
  10045. * | chan_phy_mode |
  10046. * word 12 | |
  10047. * |----------------------------------------------------------------|
  10048. * where,
  10049. * P - payload present bit (payload_present explained below)
  10050. * req_id - memory request id (mem_req_id explained below)
  10051. * S - status field (status explained below)
  10052. * capbw - capture bandwidth (capture_bw explained below)
  10053. * mode - mode of capture (mode explained below)
  10054. * sts - space time streams (sts_count explained below)
  10055. * chbw - channel bandwidth (channel_bw explained below)
  10056. * captype - capture type (cap_type explained below)
  10057. *
  10058. * The following field definitions describe the format of the CFR dump
  10059. * completion indication sent from the target to the host
  10060. *
  10061. * Header fields:
  10062. *
  10063. * Word 0
  10064. * - msg_type
  10065. * Bits 7:0
  10066. * Purpose: Identifies this as CFR TX completion indication
  10067. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10068. * - payload_present
  10069. * Bit 8
  10070. * Purpose: Identifies how CFR data is sent to host
  10071. * Value: 0 - If CFR Payload is written to host memory
  10072. * 1 - If CFR Payload is sent as part of HTT message
  10073. * (This is the requirement for SDIO/USB where it is
  10074. * not possible to write CFR data to host memory)
  10075. * - reserved
  10076. * Bits 31:9
  10077. * Purpose: Reserved
  10078. * Value: 0
  10079. *
  10080. * Payload fields:
  10081. *
  10082. * Word 1
  10083. * - cfr_capture_msg_type
  10084. * Bits 31:0
  10085. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10086. * to specify the format used for the remainder of the message
  10087. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10088. * (currently only MSG_TYPE_1 is defined)
  10089. *
  10090. * Word 2
  10091. * - mem_req_id
  10092. * Bits 6:0
  10093. * Purpose: Contain the mem request id of the region where the CFR capture
  10094. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10095. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10096. this value is invalid)
  10097. * - status
  10098. * Bit 7
  10099. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10100. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10101. * - capture_bw
  10102. * Bits 10:8
  10103. * Purpose: Carry the bandwidth of the CFR capture
  10104. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10105. * - mode
  10106. * Bits 13:11
  10107. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10108. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10109. * - sts_count
  10110. * Bits 16:14
  10111. * Purpose: Carry the number of space time streams
  10112. * Value: Number of space time streams
  10113. * - channel_bw
  10114. * Bits 19:17
  10115. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10116. * measurement
  10117. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10118. * - cap_type
  10119. * Bits 23:20
  10120. * Purpose: Carry the type of the capture
  10121. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10122. * - vdev_id
  10123. * Bits 31:24
  10124. * Purpose: Carry the virtual device id
  10125. * Value: vdev ID
  10126. *
  10127. * Word 3
  10128. * - mac_addr31to0
  10129. * Bits 31:0
  10130. * Purpose: Contain the bits 31:0 of the peer MAC address
  10131. * Value: Bits 31:0 of the peer MAC address
  10132. *
  10133. * Word 4
  10134. * - mac_addr47to32
  10135. * Bits 15:0
  10136. * Purpose: Contain the bits 47:32 of the peer MAC address
  10137. * Value: Bits 47:32 of the peer MAC address
  10138. *
  10139. * Word 5
  10140. * - index
  10141. * Bits 31:0
  10142. * Purpose: Contain the index at which this CFR dump was written in the Host
  10143. * allocated memory. This index is the number of bytes from the base address.
  10144. * Value: Index position
  10145. *
  10146. * Word 6
  10147. * - length
  10148. * Bits 31:0
  10149. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10150. * Value: Length of the CFR capture of the peer
  10151. *
  10152. * Word 7
  10153. * - timestamp
  10154. * Bits 31:0
  10155. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10156. * clock used for this timestamp is private to the target and not visible to
  10157. * the host i.e., Host can interpret only the relative timestamp deltas from
  10158. * one message to the next, but can't interpret the absolute timestamp from a
  10159. * single message.
  10160. * Value: Timestamp in microseconds
  10161. *
  10162. * Word 8
  10163. * - counter
  10164. * Bits 31:0
  10165. * Purpose: Carry the count of the current CFR capture from FW. This is
  10166. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10167. * in host memory)
  10168. * Value: Count of the current CFR capture
  10169. *
  10170. * Word 9
  10171. * - chan_mhz
  10172. * Bits 31:0
  10173. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10174. * Value: Primary 20 channel frequency
  10175. *
  10176. * Word 10
  10177. * - band_center_freq1
  10178. * Bits 31:0
  10179. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10180. * Value: Center frequency 1 in MHz
  10181. *
  10182. * Word 11
  10183. * - band_center_freq2
  10184. * Bits 31:0
  10185. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10186. * the VDEV
  10187. * 80plus80 mode
  10188. * Value: Center frequency 2 in MHz
  10189. *
  10190. * Word 12
  10191. * - chan_phy_mode
  10192. * Bits 31:0
  10193. * Purpose: Carry the phy mode of the channel, of the VDEV
  10194. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10195. */
  10196. PREPACK struct htt_cfr_dump_ind_type_1 {
  10197. A_UINT32 mem_req_id:7,
  10198. status:1,
  10199. capture_bw:3,
  10200. mode:3,
  10201. sts_count:3,
  10202. channel_bw:3,
  10203. cap_type:4,
  10204. vdev_id:8;
  10205. htt_mac_addr addr;
  10206. A_UINT32 index;
  10207. A_UINT32 length;
  10208. A_UINT32 timestamp;
  10209. A_UINT32 counter;
  10210. struct htt_chan_change_msg chan;
  10211. } POSTPACK;
  10212. PREPACK struct htt_cfr_dump_compl_ind {
  10213. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10214. union {
  10215. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10216. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10217. /* If there is a need to change the memory layout and its associated
  10218. * HTT indication format, a new CFR capture message type can be
  10219. * introduced and added into this union.
  10220. */
  10221. };
  10222. } POSTPACK;
  10223. /*
  10224. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10225. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10226. */
  10227. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10228. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10229. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10230. do { \
  10231. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10232. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10233. } while(0)
  10234. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10235. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10236. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10237. /*
  10238. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10239. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10240. */
  10241. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10242. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10243. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10244. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10245. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10246. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10247. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10248. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10249. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10250. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10251. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10252. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10253. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10254. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10255. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10256. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10257. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10258. do { \
  10259. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10260. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10261. } while (0)
  10262. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10263. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10264. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10265. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10266. do { \
  10267. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10268. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10269. } while (0)
  10270. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10271. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10272. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10273. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10274. do { \
  10275. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10276. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10277. } while (0)
  10278. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10279. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10280. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10281. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10282. do { \
  10283. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10284. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10285. } while (0)
  10286. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10287. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10288. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10289. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10290. do { \
  10291. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10292. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10293. } while (0)
  10294. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10295. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10296. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10297. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10298. do { \
  10299. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10300. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10301. } while (0)
  10302. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10303. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10304. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10305. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10306. do { \
  10307. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10308. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10309. } while (0)
  10310. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10311. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10312. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10313. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10314. do { \
  10315. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10316. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10317. } while (0)
  10318. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10319. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10320. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10321. /**
  10322. * @brief target -> host peer (PPDU) stats message
  10323. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10324. * @details
  10325. * This message is generated by FW when FW is sending stats to host
  10326. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10327. * This message is sent autonomously by the target rather than upon request
  10328. * by the host.
  10329. * The following field definitions describe the format of the HTT target
  10330. * to host peer stats indication message.
  10331. *
  10332. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10333. * or more PPDU stats records.
  10334. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10335. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10336. * then the message would start with the
  10337. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10338. * below.
  10339. *
  10340. * |31 16|15|14|13 11|10 9|8|7 0|
  10341. * |-------------------------------------------------------------|
  10342. * | reserved |MSG_TYPE |
  10343. * |-------------------------------------------------------------|
  10344. * rec 0 | TLV header |
  10345. * rec 0 |-------------------------------------------------------------|
  10346. * rec 0 | ppdu successful bytes |
  10347. * rec 0 |-------------------------------------------------------------|
  10348. * rec 0 | ppdu retry bytes |
  10349. * rec 0 |-------------------------------------------------------------|
  10350. * rec 0 | ppdu failed bytes |
  10351. * rec 0 |-------------------------------------------------------------|
  10352. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10353. * rec 0 |-------------------------------------------------------------|
  10354. * rec 0 | retried MSDUs | successful MSDUs |
  10355. * rec 0 |-------------------------------------------------------------|
  10356. * rec 0 | TX duration | failed MSDUs |
  10357. * rec 0 |-------------------------------------------------------------|
  10358. * ...
  10359. * |-------------------------------------------------------------|
  10360. * rec N | TLV header |
  10361. * rec N |-------------------------------------------------------------|
  10362. * rec N | ppdu successful bytes |
  10363. * rec N |-------------------------------------------------------------|
  10364. * rec N | ppdu retry bytes |
  10365. * rec N |-------------------------------------------------------------|
  10366. * rec N | ppdu failed bytes |
  10367. * rec N |-------------------------------------------------------------|
  10368. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10369. * rec N |-------------------------------------------------------------|
  10370. * rec N | retried MSDUs | successful MSDUs |
  10371. * rec N |-------------------------------------------------------------|
  10372. * rec N | TX duration | failed MSDUs |
  10373. * rec N |-------------------------------------------------------------|
  10374. *
  10375. * where:
  10376. * A = is A-MPDU flag
  10377. * BA = block-ack failure flags
  10378. * BW = bandwidth spec
  10379. * SG = SGI enabled spec
  10380. * S = skipped rate ctrl
  10381. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10382. *
  10383. * Header
  10384. * ------
  10385. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10386. * dword0 - b'8:31 - reserved : Reserved for future use
  10387. *
  10388. * payload include below peer_stats information
  10389. * --------------------------------------------
  10390. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10391. * @tx_success_bytes : total successful bytes in the PPDU.
  10392. * @tx_retry_bytes : total retried bytes in the PPDU.
  10393. * @tx_failed_bytes : total failed bytes in the PPDU.
  10394. * @tx_ratecode : rate code used for the PPDU.
  10395. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10396. * @ba_ack_failed : BA/ACK failed for this PPDU
  10397. * b00 -> BA received
  10398. * b01 -> BA failed once
  10399. * b10 -> BA failed twice, when HW retry is enabled.
  10400. * @bw : BW
  10401. * b00 -> 20 MHz
  10402. * b01 -> 40 MHz
  10403. * b10 -> 80 MHz
  10404. * b11 -> 160 MHz (or 80+80)
  10405. * @sg : SGI enabled
  10406. * @s : skipped ratectrl
  10407. * @peer_id : peer id
  10408. * @tx_success_msdus : successful MSDUs
  10409. * @tx_retry_msdus : retried MSDUs
  10410. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10411. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10412. */
  10413. /**
  10414. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  10415. *
  10416. * @details
  10417. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  10418. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  10419. * This message will only be sent if the backpressure condition has existed
  10420. * continuously for an initial period (100 ms).
  10421. * Repeat messages with updated information will be sent after each
  10422. * subsequent period (100 ms) as long as the backpressure remains unabated.
  10423. * This message indicates the ring id along with current head and tail index
  10424. * locations (i.e. write and read indices).
  10425. * The backpressure time indicates the time in ms for which continous
  10426. * backpressure has been observed in the ring.
  10427. *
  10428. * The message format is as follows:
  10429. *
  10430. * |31 24|23 16|15 8|7 0|
  10431. * |----------------+----------------+----------------+----------------|
  10432. * | ring_id | ring_type | pdev_id | msg_type |
  10433. * |-------------------------------------------------------------------|
  10434. * | tail_idx | head_idx |
  10435. * |-------------------------------------------------------------------|
  10436. * | backpressure_time_ms |
  10437. * |-------------------------------------------------------------------|
  10438. *
  10439. * The message is interpreted as follows:
  10440. * dword0 - b'0:7 - msg_type: This will be set to
  10441. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  10442. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  10443. * 1, 2, 3 indicates pdev_id 0,1,2 and
  10444. the msg is for LMAC ring.
  10445. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  10446. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  10447. * htt_backpressure_lmac_ring_id. This represents
  10448. * the ring id for which continous backpressure is seen
  10449. *
  10450. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  10451. * the ring indicated by the ring_id
  10452. *
  10453. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  10454. * the ring indicated by the ring id
  10455. *
  10456. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  10457. * backpressure has been seen in the ring
  10458. * indicated by the ring_id.
  10459. * Units = milliseconds
  10460. */
  10461. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  10462. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  10463. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  10464. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  10465. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  10466. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  10467. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  10468. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  10469. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  10470. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  10471. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  10472. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  10473. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  10474. do { \
  10475. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  10476. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  10477. } while (0)
  10478. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  10479. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  10480. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  10481. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  10484. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  10485. } while (0)
  10486. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  10487. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  10488. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  10489. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  10490. do { \
  10491. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  10492. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  10493. } while (0)
  10494. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  10495. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  10496. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  10497. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  10498. do { \
  10499. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  10500. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  10501. } while (0)
  10502. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  10503. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  10504. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  10505. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  10506. do { \
  10507. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  10508. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  10509. } while (0)
  10510. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  10511. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  10512. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  10513. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  10514. do { \
  10515. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  10516. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  10517. } while (0)
  10518. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  10519. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  10520. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  10521. enum htt_backpressure_ring_type {
  10522. HTT_SW_RING_TYPE_UMAC,
  10523. HTT_SW_RING_TYPE_LMAC,
  10524. HTT_SW_RING_TYPE_MAX,
  10525. };
  10526. /* Ring id for which the message is sent to host */
  10527. enum htt_backpressure_umac_ringid {
  10528. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  10529. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  10530. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  10531. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  10532. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  10533. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  10534. HTT_SW_RING_IDX_REO_REO2FW_RING,
  10535. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  10536. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  10537. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  10538. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  10539. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  10540. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  10541. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  10542. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  10543. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  10544. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  10545. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  10546. HTT_SW_UMAC_RING_IDX_MAX,
  10547. };
  10548. enum htt_backpressure_lmac_ringid {
  10549. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  10550. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  10551. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  10552. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  10553. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  10554. HTT_SW_RING_IDX_RXDMA2FW_RING,
  10555. HTT_SW_RING_IDX_RXDMA2SW_RING,
  10556. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  10557. HTT_SW_RING_IDX_RXDMA2REO_RING,
  10558. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  10559. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  10560. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  10561. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  10562. HTT_SW_LMAC_RING_IDX_MAX,
  10563. };
  10564. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  10565. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  10566. pdev_id: 8,
  10567. ring_type: 8, /* htt_backpressure_ring_type */
  10568. /*
  10569. * ring_id holds an enum value from either
  10570. * htt_backpressure_umac_ringid or
  10571. * htt_backpressure_lmac_ringid, based on
  10572. * the ring_type setting.
  10573. */
  10574. ring_id: 8;
  10575. A_UINT16 head_idx;
  10576. A_UINT16 tail_idx;
  10577. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  10578. } POSTPACK;
  10579. #endif