htt.h 651 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. */
  208. #define HTT_CURRENT_VERSION_MAJOR 3
  209. #define HTT_CURRENT_VERSION_MINOR 89
  210. #define HTT_NUM_TX_FRAG_DESC 1024
  211. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  212. #define HTT_CHECK_SET_VAL(field, val) \
  213. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  214. /* macros to assist in sign-extending fields from HTT messages */
  215. #define HTT_SIGN_BIT_MASK(field) \
  216. ((field ## _M + (1 << field ## _S)) >> 1)
  217. #define HTT_SIGN_BIT(_val, field) \
  218. (_val & HTT_SIGN_BIT_MASK(field))
  219. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  220. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  221. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  222. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  223. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  224. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  225. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  226. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  227. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  228. /*
  229. * TEMPORARY:
  230. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  231. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  232. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  233. * updated.
  234. */
  235. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  236. /*
  237. * TEMPORARY:
  238. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  239. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  240. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  241. * updated.
  242. */
  243. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  244. /*
  245. * htt_dbg_stats_type -
  246. * bit positions for each stats type within a stats type bitmask
  247. * The bitmask contains 24 bits.
  248. */
  249. enum htt_dbg_stats_type {
  250. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  251. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  252. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  253. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  254. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  255. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  256. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  257. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  258. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  259. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  260. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  261. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  262. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  263. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  264. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  265. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  266. /* bits 16-23 currently reserved */
  267. /* keep this last */
  268. HTT_DBG_NUM_STATS
  269. };
  270. /*=== HTT option selection TLVs ===
  271. * Certain HTT messages have alternatives or options.
  272. * For such cases, the host and target need to agree on which option to use.
  273. * Option specification TLVs can be appended to the VERSION_REQ and
  274. * VERSION_CONF messages to select options other than the default.
  275. * These TLVs are entirely optional - if they are not provided, there is a
  276. * well-defined default for each option. If they are provided, they can be
  277. * provided in any order. Each TLV can be present or absent independent of
  278. * the presence / absence of other TLVs.
  279. *
  280. * The HTT option selection TLVs use the following format:
  281. * |31 16|15 8|7 0|
  282. * |---------------------------------+----------------+----------------|
  283. * | value (payload) | length | tag |
  284. * |-------------------------------------------------------------------|
  285. * The value portion need not be only 2 bytes; it can be extended by any
  286. * integer number of 4-byte units. The total length of the TLV, including
  287. * the tag and length fields, must be a multiple of 4 bytes. The length
  288. * field specifies the total TLV size in 4-byte units. Thus, the typical
  289. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  290. * field, would store 0x1 in its length field, to show that the TLV occupies
  291. * a single 4-byte unit.
  292. */
  293. /*--- TLV header format - applies to all HTT option TLVs ---*/
  294. enum HTT_OPTION_TLV_TAGS {
  295. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  296. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  297. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  298. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  299. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  300. };
  301. PREPACK struct htt_option_tlv_header_t {
  302. A_UINT8 tag;
  303. A_UINT8 length;
  304. } POSTPACK;
  305. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  306. #define HTT_OPTION_TLV_TAG_S 0
  307. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  308. #define HTT_OPTION_TLV_LENGTH_S 8
  309. /*
  310. * value0 - 16 bit value field stored in word0
  311. * The TLV's value field may be longer than 2 bytes, in which case
  312. * the remainder of the value is stored in word1, word2, etc.
  313. */
  314. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  315. #define HTT_OPTION_TLV_VALUE0_S 16
  316. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  317. do { \
  318. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  319. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  320. } while (0)
  321. #define HTT_OPTION_TLV_TAG_GET(word) \
  322. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  323. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  329. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  330. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  336. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  337. /*--- format of specific HTT option TLVs ---*/
  338. /*
  339. * HTT option TLV for specifying LL bus address size
  340. * Some chips require bus addresses used by the target to access buffers
  341. * within the host's memory to be 32 bits; others require bus addresses
  342. * used by the target to access buffers within the host's memory to be
  343. * 64 bits.
  344. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  345. * a suffix to the VERSION_CONF message to specify which bus address format
  346. * the target requires.
  347. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  348. * default to providing bus addresses to the target in 32-bit format.
  349. */
  350. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  351. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  352. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  353. };
  354. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  355. struct htt_option_tlv_header_t hdr;
  356. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  357. } POSTPACK;
  358. /*
  359. * HTT option TLV for specifying whether HL systems should indicate
  360. * over-the-air tx completion for individual frames, or should instead
  361. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  362. * requests an OTA tx completion for a particular tx frame.
  363. * This option does not apply to LL systems, where the TX_COMPL_IND
  364. * is mandatory.
  365. * This option is primarily intended for HL systems in which the tx frame
  366. * downloads over the host --> target bus are as slow as or slower than
  367. * the transmissions over the WLAN PHY. For cases where the bus is faster
  368. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  369. * and consquently will send one TX_COMPL_IND message that covers several
  370. * tx frames. For cases where the WLAN PHY is faster than the bus,
  371. * the target will end up transmitting very short A-MPDUs, and consequently
  372. * sending many TX_COMPL_IND messages, which each cover a very small number
  373. * of tx frames.
  374. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  375. * a suffix to the VERSION_REQ message to request whether the host desires to
  376. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  377. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  378. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  379. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  380. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  381. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  382. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  383. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  384. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  385. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  386. * TLV.
  387. */
  388. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  389. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  390. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  391. };
  392. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  393. struct htt_option_tlv_header_t hdr;
  394. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  395. } POSTPACK;
  396. /*
  397. * HTT option TLV for specifying how many tx queue groups the target
  398. * may establish.
  399. * This TLV specifies the maximum value the target may send in the
  400. * txq_group_id field of any TXQ_GROUP information elements sent by
  401. * the target to the host. This allows the host to pre-allocate an
  402. * appropriate number of tx queue group structs.
  403. *
  404. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  405. * a suffix to the VERSION_REQ message to specify whether the host supports
  406. * tx queue groups at all, and if so if there is any limit on the number of
  407. * tx queue groups that the host supports.
  408. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  409. * a suffix to the VERSION_CONF message. If the host has specified in the
  410. * VER_REQ message a limit on the number of tx queue groups the host can
  411. * supprt, the target shall limit its specification of the maximum tx groups
  412. * to be no larger than this host-specified limit.
  413. *
  414. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  415. * shall preallocate 4 tx queue group structs, and the target shall not
  416. * specify a txq_group_id larger than 3.
  417. */
  418. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  419. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  420. /*
  421. * values 1 through N specify the max number of tx queue groups
  422. * the sender supports
  423. */
  424. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  425. };
  426. /* TEMPORARY backwards-compatibility alias for a typo fix -
  427. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  428. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  429. * to support the old name (with the typo) until all references to the
  430. * old name are replaced with the new name.
  431. */
  432. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  433. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  434. struct htt_option_tlv_header_t hdr;
  435. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  436. } POSTPACK;
  437. /*
  438. * HTT option TLV for specifying whether the target supports an extended
  439. * version of the HTT tx descriptor. If the target provides this TLV
  440. * and specifies in the TLV that the target supports an extended version
  441. * of the HTT tx descriptor, the target must check the "extension" bit in
  442. * the HTT tx descriptor, and if the extension bit is set, to expect a
  443. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  444. * descriptor. Furthermore, the target must provide room for the HTT
  445. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  446. * This option is intended for systems where the host needs to explicitly
  447. * control the transmission parameters such as tx power for individual
  448. * tx frames.
  449. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  450. * as a suffix to the VERSION_CONF message to explicitly specify whether
  451. * the target supports the HTT tx MSDU extension descriptor.
  452. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  453. * by the host as lack of target support for the HTT tx MSDU extension
  454. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  455. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  456. * the HTT tx MSDU extension descriptor.
  457. * The host is not required to provide the HTT tx MSDU extension descriptor
  458. * just because the target supports it; the target must check the
  459. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  460. * extension descriptor is present.
  461. */
  462. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  463. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  464. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  465. };
  466. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  467. struct htt_option_tlv_header_t hdr;
  468. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  469. } POSTPACK;
  470. /*=== host -> target messages ===============================================*/
  471. enum htt_h2t_msg_type {
  472. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  473. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  474. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  475. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  476. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  477. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  478. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  479. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  480. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  481. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  482. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  483. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  484. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  485. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  486. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  487. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  488. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  489. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  490. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  491. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  492. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  493. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  494. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  495. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  496. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  497. /* keep this last */
  498. HTT_H2T_NUM_MSGS
  499. };
  500. /*
  501. * HTT host to target message type -
  502. * stored in bits 7:0 of the first word of the message
  503. */
  504. #define HTT_H2T_MSG_TYPE_M 0xff
  505. #define HTT_H2T_MSG_TYPE_S 0
  506. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  507. do { \
  508. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  509. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  510. } while (0)
  511. #define HTT_H2T_MSG_TYPE_GET(word) \
  512. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  513. /**
  514. * @brief host -> target version number request message definition
  515. *
  516. * |31 24|23 16|15 8|7 0|
  517. * |----------------+----------------+----------------+----------------|
  518. * | reserved | msg type |
  519. * |-------------------------------------------------------------------|
  520. * : option request TLV (optional) |
  521. * :...................................................................:
  522. *
  523. * The VER_REQ message may consist of a single 4-byte word, or may be
  524. * extended with TLVs that specify which HTT options the host is requesting
  525. * from the target.
  526. * The following option TLVs may be appended to the VER_REQ message:
  527. * - HL_SUPPRESS_TX_COMPL_IND
  528. * - HL_MAX_TX_QUEUE_GROUPS
  529. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  530. * may be appended to the VER_REQ message (but only one TLV of each type).
  531. *
  532. * Header fields:
  533. * - MSG_TYPE
  534. * Bits 7:0
  535. * Purpose: identifies this as a version number request message
  536. * Value: 0x0
  537. */
  538. #define HTT_VER_REQ_BYTES 4
  539. /* TBDXXX: figure out a reasonable number */
  540. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  541. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  542. /**
  543. * @brief HTT tx MSDU descriptor
  544. *
  545. * @details
  546. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  547. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  548. * the target firmware needs for the FW's tx processing, particularly
  549. * for creating the HW msdu descriptor.
  550. * The same HTT tx descriptor is used for HL and LL systems, though
  551. * a few fields within the tx descriptor are used only by LL or
  552. * only by HL.
  553. * The HTT tx descriptor is defined in two manners: by a struct with
  554. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  555. * definitions.
  556. * The target should use the struct def, for simplicitly and clarity,
  557. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  558. * neutral. Specifically, the host shall use the get/set macros built
  559. * around the mask + shift defs.
  560. */
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  569. #define HTT_TX_VDEV_ID_WORD 0
  570. #define HTT_TX_VDEV_ID_MASK 0x3f
  571. #define HTT_TX_VDEV_ID_SHIFT 16
  572. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  573. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  574. #define HTT_TX_MSDU_LEN_DWORD 1
  575. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  576. /*
  577. * HTT_VAR_PADDR macros
  578. * Allow physical / bus addresses to be either a single 32-bit value,
  579. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  580. */
  581. #define HTT_VAR_PADDR32(var_name) \
  582. A_UINT32 var_name
  583. #define HTT_VAR_PADDR64_LE(var_name) \
  584. struct { \
  585. /* little-endian: lo precedes hi */ \
  586. A_UINT32 lo; \
  587. A_UINT32 hi; \
  588. } var_name
  589. /*
  590. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  591. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  592. * addresses are stored in a XXX-bit field.
  593. * This macro is used to define both htt_tx_msdu_desc32_t and
  594. * htt_tx_msdu_desc64_t structs.
  595. */
  596. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  597. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  598. { \
  599. /* DWORD 0: flags and meta-data */ \
  600. A_UINT32 \
  601. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  602. \
  603. /* pkt_subtype - \
  604. * Detailed specification of the tx frame contents, extending the \
  605. * general specification provided by pkt_type. \
  606. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  607. * pkt_type | pkt_subtype \
  608. * ============================================================== \
  609. * 802.3 | bit 0:3 - Reserved \
  610. * | bit 4: 0x0 - Copy-Engine Classification Results \
  611. * | not appended to the HTT message \
  612. * | 0x1 - Copy-Engine Classification Results \
  613. * | appended to the HTT message in the \
  614. * | format: \
  615. * | [HTT tx desc, frame header, \
  616. * | CE classification results] \
  617. * | The CE classification results begin \
  618. * | at the next 4-byte boundary after \
  619. * | the frame header. \
  620. * ------------+------------------------------------------------- \
  621. * Eth2 | bit 0:3 - Reserved \
  622. * | bit 4: 0x0 - Copy-Engine Classification Results \
  623. * | not appended to the HTT message \
  624. * | 0x1 - Copy-Engine Classification Results \
  625. * | appended to the HTT message. \
  626. * | See the above specification of the \
  627. * | CE classification results location. \
  628. * ------------+------------------------------------------------- \
  629. * native WiFi | bit 0:3 - Reserved \
  630. * | bit 4: 0x0 - Copy-Engine Classification Results \
  631. * | not appended to the HTT message \
  632. * | 0x1 - Copy-Engine Classification Results \
  633. * | appended to the HTT message. \
  634. * | See the above specification of the \
  635. * | CE classification results location. \
  636. * ------------+------------------------------------------------- \
  637. * mgmt | 0x0 - 802.11 MAC header absent \
  638. * | 0x1 - 802.11 MAC header present \
  639. * ------------+------------------------------------------------- \
  640. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  641. * | 0x1 - 802.11 MAC header present \
  642. * | bit 1: 0x0 - allow aggregation \
  643. * | 0x1 - don't allow aggregation \
  644. * | bit 2: 0x0 - perform encryption \
  645. * | 0x1 - don't perform encryption \
  646. * | bit 3: 0x0 - perform tx classification / queuing \
  647. * | 0x1 - don't perform tx classification; \
  648. * | insert the frame into the "misc" \
  649. * | tx queue \
  650. * | bit 4: 0x0 - Copy-Engine Classification Results \
  651. * | not appended to the HTT message \
  652. * | 0x1 - Copy-Engine Classification Results \
  653. * | appended to the HTT message. \
  654. * | See the above specification of the \
  655. * | CE classification results location. \
  656. */ \
  657. pkt_subtype: 5, \
  658. \
  659. /* pkt_type - \
  660. * General specification of the tx frame contents. \
  661. * The htt_pkt_type enum should be used to specify and check the \
  662. * value of this field. \
  663. */ \
  664. pkt_type: 3, \
  665. \
  666. /* vdev_id - \
  667. * ID for the vdev that is sending this tx frame. \
  668. * For certain non-standard packet types, e.g. pkt_type == raw \
  669. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  670. * This field is used primarily for determining where to queue \
  671. * broadcast and multicast frames. \
  672. */ \
  673. vdev_id: 6, \
  674. /* ext_tid - \
  675. * The extended traffic ID. \
  676. * If the TID is unknown, the extended TID is set to \
  677. * HTT_TX_EXT_TID_INVALID. \
  678. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  679. * value of the QoS TID. \
  680. * If the tx frame is non-QoS data, then the extended TID is set to \
  681. * HTT_TX_EXT_TID_NON_QOS. \
  682. * If the tx frame is multicast or broadcast, then the extended TID \
  683. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  684. */ \
  685. ext_tid: 5, \
  686. \
  687. /* postponed - \
  688. * This flag indicates whether the tx frame has been downloaded to \
  689. * the target before but discarded by the target, and now is being \
  690. * downloaded again; or if this is a new frame that is being \
  691. * downloaded for the first time. \
  692. * This flag allows the target to determine the correct order for \
  693. * transmitting new vs. old frames. \
  694. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  695. * This flag only applies to HL systems, since in LL systems, \
  696. * the tx flow control is handled entirely within the target. \
  697. */ \
  698. postponed: 1, \
  699. \
  700. /* extension - \
  701. * This flag indicates whether a HTT tx MSDU extension descriptor \
  702. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  703. * \
  704. * 0x0 - no extension MSDU descriptor is present \
  705. * 0x1 - an extension MSDU descriptor immediately follows the \
  706. * regular MSDU descriptor \
  707. */ \
  708. extension: 1, \
  709. \
  710. /* cksum_offload - \
  711. * This flag indicates whether checksum offload is enabled or not \
  712. * for this frame. Target FW use this flag to turn on HW checksumming \
  713. * 0x0 - No checksum offload \
  714. * 0x1 - L3 header checksum only \
  715. * 0x2 - L4 checksum only \
  716. * 0x3 - L3 header checksum + L4 checksum \
  717. */ \
  718. cksum_offload: 2, \
  719. \
  720. /* tx_comp_req - \
  721. * This flag indicates whether Tx Completion \
  722. * from fw is required or not. \
  723. * This flag is only relevant if tx completion is not \
  724. * universally enabled. \
  725. * For all LL systems, tx completion is mandatory, \
  726. * so this flag will be irrelevant. \
  727. * For HL systems tx completion is optional, but HL systems in which \
  728. * the bus throughput exceeds the WLAN throughput will \
  729. * probably want to always use tx completion, and thus \
  730. * would not check this flag. \
  731. * This flag is required when tx completions are not used universally, \
  732. * but are still required for certain tx frames for which \
  733. * an OTA delivery acknowledgment is needed by the host. \
  734. * In practice, this would be for HL systems in which the \
  735. * bus throughput is less than the WLAN throughput. \
  736. * \
  737. * 0x0 - Tx Completion Indication from Fw not required \
  738. * 0x1 - Tx Completion Indication from Fw is required \
  739. */ \
  740. tx_compl_req: 1; \
  741. \
  742. \
  743. /* DWORD 1: MSDU length and ID */ \
  744. A_UINT32 \
  745. len: 16, /* MSDU length, in bytes */ \
  746. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  747. * and this id is used to calculate fragmentation \
  748. * descriptor pointer inside the target based on \
  749. * the base address, configured inside the target. \
  750. */ \
  751. \
  752. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  753. /* frags_desc_ptr - \
  754. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  755. * where the tx frame's fragments reside in memory. \
  756. * This field only applies to LL systems, since in HL systems the \
  757. * (degenerate single-fragment) fragmentation descriptor is created \
  758. * within the target. \
  759. */ \
  760. _paddr__frags_desc_ptr_; \
  761. \
  762. /* DWORD 3 (or 4): peerid, chanfreq */ \
  763. /* \
  764. * Peer ID : Target can use this value to know which peer-id packet \
  765. * destined to. \
  766. * It's intended to be specified by host in case of NAWDS. \
  767. */ \
  768. A_UINT16 peerid; \
  769. \
  770. /* \
  771. * Channel frequency: This identifies the desired channel \
  772. * frequency (in mhz) for tx frames. This is used by FW to help \
  773. * determine when it is safe to transmit or drop frames for \
  774. * off-channel operation. \
  775. * The default value of zero indicates to FW that the corresponding \
  776. * VDEV's home channel (if there is one) is the desired channel \
  777. * frequency. \
  778. */ \
  779. A_UINT16 chanfreq; \
  780. \
  781. /* Reason reserved is commented is increasing the htt structure size \
  782. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  783. * A_UINT32 reserved_dword3_bits0_31; \
  784. */ \
  785. } POSTPACK
  786. /* define a htt_tx_msdu_desc32_t type */
  787. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  788. /* define a htt_tx_msdu_desc64_t type */
  789. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  790. /*
  791. * Make htt_tx_msdu_desc_t be an alias for either
  792. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  793. */
  794. #if HTT_PADDR64
  795. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  796. #else
  797. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  798. #endif
  799. /* decriptor information for Management frame*/
  800. /*
  801. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  802. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  803. */
  804. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  805. extern A_UINT32 mgmt_hdr_len;
  806. PREPACK struct htt_mgmt_tx_desc_t {
  807. A_UINT32 msg_type;
  808. #if HTT_PADDR64
  809. A_UINT64 frag_paddr; /* DMAble address of the data */
  810. #else
  811. A_UINT32 frag_paddr; /* DMAble address of the data */
  812. #endif
  813. A_UINT32 desc_id; /* returned to host during completion
  814. * to free the meory*/
  815. A_UINT32 len; /* Fragment length */
  816. A_UINT32 vdev_id; /* virtual device ID*/
  817. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  818. } POSTPACK;
  819. PREPACK struct htt_mgmt_tx_compl_ind {
  820. A_UINT32 desc_id;
  821. A_UINT32 status;
  822. } POSTPACK;
  823. /*
  824. * This SDU header size comes from the summation of the following:
  825. * 1. Max of:
  826. * a. Native WiFi header, for native WiFi frames: 24 bytes
  827. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  828. * b. 802.11 header, for raw frames: 36 bytes
  829. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  830. * QoS header, HT header)
  831. * c. 802.3 header, for ethernet frames: 14 bytes
  832. * (destination address, source address, ethertype / length)
  833. * 2. Max of:
  834. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  835. * b. IPv6 header, up through the Traffic Class: 2 bytes
  836. * 3. 802.1Q VLAN header: 4 bytes
  837. * 4. LLC/SNAP header: 8 bytes
  838. */
  839. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  840. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  841. #define HTT_TX_HDR_SIZE_ETHERNET 14
  842. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  843. A_COMPILE_TIME_ASSERT(
  844. htt_encap_hdr_size_max_check_nwifi,
  845. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  846. A_COMPILE_TIME_ASSERT(
  847. htt_encap_hdr_size_max_check_enet,
  848. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  849. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  850. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  851. #define HTT_TX_HDR_SIZE_802_1Q 4
  852. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  853. #define HTT_COMMON_TX_FRM_HDR_LEN \
  854. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  855. HTT_TX_HDR_SIZE_802_1Q + \
  856. HTT_TX_HDR_SIZE_LLC_SNAP)
  857. #define HTT_HL_TX_FRM_HDR_LEN \
  858. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  859. #define HTT_LL_TX_FRM_HDR_LEN \
  860. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  861. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  862. /* dword 0 */
  863. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  866. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  867. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  868. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  870. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  871. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  872. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  874. #define HTT_TX_DESC_PKT_TYPE_S 13
  875. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  876. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  878. #define HTT_TX_DESC_VDEV_ID_S 16
  879. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  880. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  881. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  882. #define HTT_TX_DESC_EXT_TID_S 22
  883. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  884. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  885. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  886. #define HTT_TX_DESC_POSTPONED_S 27
  887. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  888. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  889. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  890. #define HTT_TX_DESC_EXTENSION_S 28
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  892. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  893. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  894. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  895. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  896. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  897. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  898. #define HTT_TX_DESC_TX_COMP_S 31
  899. /* dword 1 */
  900. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  901. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  902. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  903. #define HTT_TX_DESC_FRM_LEN_S 0
  904. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  905. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  906. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  907. #define HTT_TX_DESC_FRM_ID_S 16
  908. /* dword 2 */
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  910. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  911. /* for systems using 64-bit format for bus addresses */
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  913. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  916. /* for systems using 32-bit format for bus addresses */
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  919. /* dword 3 */
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  923. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  925. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  926. #if HTT_PADDR64
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  929. #else
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  932. #endif
  933. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  934. #define HTT_TX_DESC_PEER_ID_S 0
  935. /*
  936. * TEMPORARY:
  937. * The original definitions for the PEER_ID fields contained typos
  938. * (with _DESC_PADDR appended to this PEER_ID field name).
  939. * Retain deprecated original names for PEER_ID fields until all code that
  940. * refers to them has been updated.
  941. */
  942. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  943. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  944. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  945. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  946. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  947. HTT_TX_DESC_PEER_ID_M
  948. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  949. HTT_TX_DESC_PEER_ID_S
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  953. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  955. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  956. #if HTT_PADDR64
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  959. #else
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  962. #endif
  963. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  964. #define HTT_TX_DESC_CHAN_FREQ_S 16
  965. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  966. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  967. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  973. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  974. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  980. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  981. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  987. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  988. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  994. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  995. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1002. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1009. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1016. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1023. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1030. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1034. } while (0)
  1035. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1036. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1037. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1038. do { \
  1039. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1040. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1041. } while (0)
  1042. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1043. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1044. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1045. do { \
  1046. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1047. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1048. } while (0)
  1049. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1050. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1051. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1052. do { \
  1053. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1054. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1055. } while (0)
  1056. /* enums used in the HTT tx MSDU extension descriptor */
  1057. enum {
  1058. htt_tx_guard_interval_regular = 0,
  1059. htt_tx_guard_interval_short = 1,
  1060. };
  1061. enum {
  1062. htt_tx_preamble_type_ofdm = 0,
  1063. htt_tx_preamble_type_cck = 1,
  1064. htt_tx_preamble_type_ht = 2,
  1065. htt_tx_preamble_type_vht = 3,
  1066. };
  1067. enum {
  1068. htt_tx_bandwidth_5MHz = 0,
  1069. htt_tx_bandwidth_10MHz = 1,
  1070. htt_tx_bandwidth_20MHz = 2,
  1071. htt_tx_bandwidth_40MHz = 3,
  1072. htt_tx_bandwidth_80MHz = 4,
  1073. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1074. };
  1075. /**
  1076. * @brief HTT tx MSDU extension descriptor
  1077. * @details
  1078. * If the target supports HTT tx MSDU extension descriptors, the host has
  1079. * the option of appending the following struct following the regular
  1080. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1081. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1082. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1083. * tx specs for each frame.
  1084. */
  1085. PREPACK struct htt_tx_msdu_desc_ext_t {
  1086. /* DWORD 0: flags */
  1087. A_UINT32
  1088. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1089. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1090. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1091. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1092. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1093. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1094. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1095. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1096. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1097. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1098. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1099. /* DWORD 1: tx power, tx rate, tx BW */
  1100. A_UINT32
  1101. /* pwr -
  1102. * Specify what power the tx frame needs to be transmitted at.
  1103. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1104. * The value needs to be appropriately sign-extended when extracting
  1105. * the value from the message and storing it in a variable that is
  1106. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1107. * automatically handles this sign-extension.)
  1108. * If the transmission uses multiple tx chains, this power spec is
  1109. * the total transmit power, assuming incoherent combination of
  1110. * per-chain power to produce the total power.
  1111. */
  1112. pwr: 8,
  1113. /* mcs_mask -
  1114. * Specify the allowable values for MCS index (modulation and coding)
  1115. * to use for transmitting the frame.
  1116. *
  1117. * For HT / VHT preamble types, this mask directly corresponds to
  1118. * the HT or VHT MCS indices that are allowed. For each bit N set
  1119. * within the mask, MCS index N is allowed for transmitting the frame.
  1120. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1121. * rates versus OFDM rates, so the host has the option of specifying
  1122. * that the target must transmit the frame with CCK or OFDM rates
  1123. * (not HT or VHT), but leaving the decision to the target whether
  1124. * to use CCK or OFDM.
  1125. *
  1126. * For CCK and OFDM, the bits within this mask are interpreted as
  1127. * follows:
  1128. * bit 0 -> CCK 1 Mbps rate is allowed
  1129. * bit 1 -> CCK 2 Mbps rate is allowed
  1130. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1131. * bit 3 -> CCK 11 Mbps rate is allowed
  1132. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1133. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1134. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1135. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1136. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1137. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1138. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1139. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1140. *
  1141. * The MCS index specification needs to be compatible with the
  1142. * bandwidth mask specification. For example, a MCS index == 9
  1143. * specification is inconsistent with a preamble type == VHT,
  1144. * Nss == 1, and channel bandwidth == 20 MHz.
  1145. *
  1146. * Furthermore, the host has only a limited ability to specify to
  1147. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1148. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1149. */
  1150. mcs_mask: 12,
  1151. /* nss_mask -
  1152. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1153. * Each bit in this mask corresponds to a Nss value:
  1154. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1155. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1156. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1157. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1158. * The values in the Nss mask must be suitable for the recipient, e.g.
  1159. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1160. * recipient which only supports 2x2 MIMO.
  1161. */
  1162. nss_mask: 4,
  1163. /* guard_interval -
  1164. * Specify a htt_tx_guard_interval enum value to indicate whether
  1165. * the transmission should use a regular guard interval or a
  1166. * short guard interval.
  1167. */
  1168. guard_interval: 1,
  1169. /* preamble_type_mask -
  1170. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1171. * may choose from for transmitting this frame.
  1172. * The bits in this mask correspond to the values in the
  1173. * htt_tx_preamble_type enum. For example, to allow the target
  1174. * to transmit the frame as either CCK or OFDM, this field would
  1175. * be set to
  1176. * (1 << htt_tx_preamble_type_ofdm) |
  1177. * (1 << htt_tx_preamble_type_cck)
  1178. */
  1179. preamble_type_mask: 4,
  1180. reserved1_31_29: 3; /* unused, set to 0x0 */
  1181. /* DWORD 2: tx chain mask, tx retries */
  1182. A_UINT32
  1183. /* chain_mask - specify which chains to transmit from */
  1184. chain_mask: 4,
  1185. /* retry_limit -
  1186. * Specify the maximum number of transmissions, including the
  1187. * initial transmission, to attempt before giving up if no ack
  1188. * is received.
  1189. * If the tx rate is specified, then all retries shall use the
  1190. * same rate as the initial transmission.
  1191. * If no tx rate is specified, the target can choose whether to
  1192. * retain the original rate during the retransmissions, or to
  1193. * fall back to a more robust rate.
  1194. */
  1195. retry_limit: 4,
  1196. /* bandwidth_mask -
  1197. * Specify what channel widths may be used for the transmission.
  1198. * A value of zero indicates "don't care" - the target may choose
  1199. * the transmission bandwidth.
  1200. * The bits within this mask correspond to the htt_tx_bandwidth
  1201. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1202. * The bandwidth_mask must be consistent with the preamble_type_mask
  1203. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1204. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1205. */
  1206. bandwidth_mask: 6,
  1207. reserved2_31_14: 18; /* unused, set to 0x0 */
  1208. /* DWORD 3: tx expiry time (TSF) LSBs */
  1209. A_UINT32 expire_tsf_lo;
  1210. /* DWORD 4: tx expiry time (TSF) MSBs */
  1211. A_UINT32 expire_tsf_hi;
  1212. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1213. } POSTPACK;
  1214. /* DWORD 0 */
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1235. /* DWORD 1 */
  1236. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1237. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1238. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1239. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1240. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1241. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1242. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1243. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1244. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1245. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1246. /* DWORD 2 */
  1247. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1248. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1249. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1250. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1251. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1252. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1253. /* DWORD 0 */
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1255. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1256. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1261. } while (0)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1263. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1269. } while (0)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1271. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1272. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1274. do { \
  1275. HTT_CHECK_SET_VAL( \
  1276. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1277. ((_var) |= ((_val) \
  1278. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL( \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1287. ((_var) |= ((_val) \
  1288. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1297. } while (0)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1329. } while (0)
  1330. /* DWORD 1 */
  1331. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1335. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1336. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1337. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1338. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1339. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1340. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1355. } while (0)
  1356. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1363. } while (0)
  1364. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1371. } while (0)
  1372. /* DWORD 2 */
  1373. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1380. } while (0)
  1381. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1382. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1383. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1384. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1388. } while (0)
  1389. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1390. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1391. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1392. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1393. do { \
  1394. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1395. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1396. } while (0)
  1397. typedef enum {
  1398. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1399. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1400. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1401. } htt_11ax_ltf_subtype_t;
  1402. typedef enum {
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1408. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1409. } htt_tx_ext2_preamble_type_t;
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1422. /**
  1423. * @brief HTT tx MSDU extension descriptor v2
  1424. * @details
  1425. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1426. * is received as tcl_exit_base->host_meta_info in firmware.
  1427. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1428. * are already part of tcl_exit_base.
  1429. */
  1430. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1431. /* DWORD 0: flags */
  1432. A_UINT32
  1433. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1434. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1435. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1436. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1437. valid_retries : 1, /* if set, tx retries spec is valid */
  1438. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1439. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1440. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1441. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1442. valid_key_flags : 1, /* if set, key flags is valid */
  1443. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1444. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1445. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1446. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1447. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1448. 1 = ENCRYPT,
  1449. 2 ~ 3 - Reserved */
  1450. /* retry_limit -
  1451. * Specify the maximum number of transmissions, including the
  1452. * initial transmission, to attempt before giving up if no ack
  1453. * is received.
  1454. * If the tx rate is specified, then all retries shall use the
  1455. * same rate as the initial transmission.
  1456. * If no tx rate is specified, the target can choose whether to
  1457. * retain the original rate during the retransmissions, or to
  1458. * fall back to a more robust rate.
  1459. */
  1460. retry_limit : 4,
  1461. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1462. * Valid only for 11ax preamble types HE_SU
  1463. * and HE_EXT_SU
  1464. */
  1465. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1466. * Valid only for 11ax preamble types HE_SU
  1467. * and HE_EXT_SU
  1468. */
  1469. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1470. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1471. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1472. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1473. */
  1474. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1475. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1476. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1477. * Use cases:
  1478. * Any time firmware uses TQM-BYPASS for Data
  1479. * TID, firmware expect host to set this bit.
  1480. */
  1481. /* DWORD 1: tx power, tx rate */
  1482. A_UINT32
  1483. power : 8, /* unit of the power field is 0.5 dbm
  1484. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1485. * signed value ranging from -64dbm to 63.5 dbm
  1486. */
  1487. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1488. * Setting more than one MCS isn't currently
  1489. * supported by the target (but is supported
  1490. * in the interface in case in the future
  1491. * the target supports specifications of
  1492. * a limited set of MCS values.
  1493. */
  1494. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1495. * Setting more than one Nss isn't currently
  1496. * supported by the target (but is supported
  1497. * in the interface in case in the future
  1498. * the target supports specifications of
  1499. * a limited set of Nss values.
  1500. */
  1501. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1502. update_peer_cache : 1; /* When set these custom values will be
  1503. * used for all packets, until the next
  1504. * update via this ext header.
  1505. * This is to make sure not all packets
  1506. * need to include this header.
  1507. */
  1508. /* DWORD 2: tx chain mask, tx retries */
  1509. A_UINT32
  1510. /* chain_mask - specify which chains to transmit from */
  1511. chain_mask : 8,
  1512. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1513. * TODO: Update Enum values for key_flags
  1514. */
  1515. /*
  1516. * Channel frequency: This identifies the desired channel
  1517. * frequency (in MHz) for tx frames. This is used by FW to help
  1518. * determine when it is safe to transmit or drop frames for
  1519. * off-channel operation.
  1520. * The default value of zero indicates to FW that the corresponding
  1521. * VDEV's home channel (if there is one) is the desired channel
  1522. * frequency.
  1523. */
  1524. chanfreq : 16;
  1525. /* DWORD 3: tx expiry time (TSF) LSBs */
  1526. A_UINT32 expire_tsf_lo;
  1527. /* DWORD 4: tx expiry time (TSF) MSBs */
  1528. A_UINT32 expire_tsf_hi;
  1529. /* DWORD 5: flags to control routing / processing of the MSDU */
  1530. A_UINT32
  1531. /* learning_frame
  1532. * When this flag is set, this frame will be dropped by FW
  1533. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1534. */
  1535. learning_frame : 1,
  1536. /* send_as_standalone
  1537. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1538. * i.e. with no A-MSDU or A-MPDU aggregation.
  1539. * The scope is extended to other use-cases.
  1540. */
  1541. send_as_standalone : 1,
  1542. /* is_host_opaque_valid
  1543. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1544. * with valid information.
  1545. */
  1546. is_host_opaque_valid : 1,
  1547. rsvd0 : 29;
  1548. /* DWORD 6 : Host opaque cookie for special frames */
  1549. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1550. rsvd1 : 16;
  1551. /*
  1552. * This structure can be expanded further up to 40 bytes
  1553. * by adding further DWORDs as needed.
  1554. */
  1555. } POSTPACK;
  1556. /* DWORD 0 */
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1583. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1584. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1585. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1586. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1587. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1588. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1589. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1590. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1591. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1592. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1593. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1594. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1596. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1597. /* DWORD 1 */
  1598. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1599. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1600. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1601. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1602. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1603. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1604. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1605. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1606. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1607. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1608. /* DWORD 2 */
  1609. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1610. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1611. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1612. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1613. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1614. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1615. /* DWORD 5 */
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1622. /* DWORD 6 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1624. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1625. /* DWORD 0 */
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1633. } while (0)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1635. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1636. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1638. do { \
  1639. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1640. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1641. } while (0)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1643. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1644. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1646. do { \
  1647. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1648. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1649. } while (0)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1651. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1652. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1654. do { \
  1655. HTT_CHECK_SET_VAL( \
  1656. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1657. ((_var) |= ((_val) \
  1658. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL( \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1683. ((_var) |= ((_val) \
  1684. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1696. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1697. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1709. } while (0)
  1710. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1711. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1712. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1713. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1714. do { \
  1715. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1716. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1717. } while (0)
  1718. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1719. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1720. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1721. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1722. do { \
  1723. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1724. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1725. } while (0)
  1726. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1727. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1728. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1729. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1730. do { \
  1731. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1732. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1733. } while (0)
  1734. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1748. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1749. } while (0)
  1750. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1751. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1752. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1753. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1754. do { \
  1755. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1756. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1757. } while (0)
  1758. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1759. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1760. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1761. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1762. do { \
  1763. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1764. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1765. } while (0)
  1766. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1767. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1768. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1769. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1770. do { \
  1771. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1772. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1773. } while (0)
  1774. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1775. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1776. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1777. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1778. do { \
  1779. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1780. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1781. } while (0)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1783. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1784. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1786. do { \
  1787. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1788. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1789. } while (0)
  1790. /* DWORD 1 */
  1791. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1795. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1796. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1798. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1799. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1804. do { \
  1805. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1806. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1807. } while (0)
  1808. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1814. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1815. } while (0)
  1816. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1820. do { \
  1821. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1822. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1823. } while (0)
  1824. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1825. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1826. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1827. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1828. do { \
  1829. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1830. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1831. } while (0)
  1832. /* DWORD 2 */
  1833. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1848. } while (0)
  1849. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1850. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1851. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1852. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1855. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1856. } while (0)
  1857. /* DWORD 5 */
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1865. } while (0)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1867. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1868. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1872. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1873. } while (0)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1875. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1876. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1878. do { \
  1879. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1880. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1881. } while (0)
  1882. /* DWORD 6 */
  1883. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1890. } while (0)
  1891. typedef enum {
  1892. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1893. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1894. } htt_tcl_metadata_type;
  1895. /**
  1896. * @brief HTT TCL command number format
  1897. * @details
  1898. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1899. * available to firmware as tcl_exit_base->tcl_status_number.
  1900. * For regular / multicast packets host will send vdev and mac id and for
  1901. * NAWDS packets, host will send peer id.
  1902. * A_UINT32 is used to avoid endianness conversion problems.
  1903. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1904. */
  1905. typedef struct {
  1906. A_UINT32
  1907. type: 1, /* vdev_id based or peer_id based */
  1908. rsvd: 31;
  1909. } htt_tx_tcl_vdev_or_peer_t;
  1910. typedef struct {
  1911. A_UINT32
  1912. type: 1, /* vdev_id based or peer_id based */
  1913. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1914. vdev_id: 8,
  1915. pdev_id: 2,
  1916. host_inspected:1,
  1917. rsvd: 19;
  1918. } htt_tx_tcl_vdev_metadata;
  1919. typedef struct {
  1920. A_UINT32
  1921. type: 1, /* vdev_id based or peer_id based */
  1922. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1923. peer_id: 14,
  1924. rsvd: 16;
  1925. } htt_tx_tcl_peer_metadata;
  1926. PREPACK struct htt_tx_tcl_metadata {
  1927. union {
  1928. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1929. htt_tx_tcl_vdev_metadata vdev_meta;
  1930. htt_tx_tcl_peer_metadata peer_meta;
  1931. };
  1932. } POSTPACK;
  1933. /* DWORD 0 */
  1934. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1935. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1936. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1937. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1938. /* VDEV metadata */
  1939. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1940. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1941. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1942. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1943. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1944. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1945. /* PEER metadata */
  1946. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1947. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1948. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1949. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1950. HTT_TX_TCL_METADATA_TYPE_S)
  1951. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1955. } while (0)
  1956. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1957. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1958. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1959. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1963. } while (0)
  1964. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1965. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1966. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1967. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1971. } while (0)
  1972. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1973. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1974. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1975. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1978. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1979. } while (0)
  1980. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1981. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1982. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1983. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1984. do { \
  1985. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1986. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1987. } while (0)
  1988. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1989. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1990. HTT_TX_TCL_METADATA_PEER_ID_S)
  1991. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1995. } while (0)
  1996. typedef enum {
  1997. HTT_TX_FW2WBM_TX_STATUS_OK,
  1998. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1999. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2000. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2001. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2002. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2003. HTT_TX_FW2WBM_TX_STATUS_MAX
  2004. } htt_tx_fw2wbm_tx_status_t;
  2005. typedef enum {
  2006. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2007. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2008. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2013. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2014. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2015. } htt_tx_fw2wbm_reinject_reason_t;
  2016. /**
  2017. * @brief HTT TX WBM Completion from firmware to host
  2018. * @details
  2019. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2020. * DWORD 3 and 4 for software based completions (Exception frames and
  2021. * TQM bypass frames)
  2022. * For software based completions, wbm_release_ring->release_source_module will
  2023. * be set to release_source_fw
  2024. */
  2025. PREPACK struct htt_tx_wbm_completion {
  2026. A_UINT32
  2027. sch_cmd_id: 24,
  2028. exception_frame: 1, /* If set, this packet was queued via exception path */
  2029. rsvd0_31_25: 7;
  2030. A_UINT32
  2031. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2032. * reception of an ACK or BA, this field indicates
  2033. * the RSSI of the received ACK or BA frame.
  2034. * When the frame is removed as result of a direct
  2035. * remove command from the SW, this field is set
  2036. * to 0x0 (which is never a valid value when real
  2037. * RSSI is available).
  2038. * Units: dB w.r.t noise floor
  2039. */
  2040. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2041. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2042. rsvd1_31_16: 16;
  2043. } POSTPACK;
  2044. /* DWORD 0 */
  2045. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2046. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2047. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2048. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2049. /* DWORD 1 */
  2050. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2051. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2052. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2053. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2054. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2055. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2056. /* DWORD 0 */
  2057. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2058. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2059. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2060. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2064. } while (0)
  2065. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2066. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2067. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2068. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2072. } while (0)
  2073. /* DWORD 1 */
  2074. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2075. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2076. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2077. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2081. } while (0)
  2082. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2083. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2084. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2085. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2089. } while (0)
  2090. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2091. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2092. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2093. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2097. } while (0)
  2098. /**
  2099. * @brief HTT TX WBM Completion from firmware to host
  2100. * @details
  2101. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2102. * (WBM) offload HW.
  2103. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2104. * For software based completions, release_source_module will
  2105. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2106. * struct wbm_release_ring and then switch to this after looking at
  2107. * release_source_module.
  2108. */
  2109. PREPACK struct htt_tx_wbm_completion_v2 {
  2110. A_UINT32
  2111. used_by_hw0; /* Refer to struct wbm_release_ring */
  2112. A_UINT32
  2113. used_by_hw1; /* Refer to struct wbm_release_ring */
  2114. A_UINT32
  2115. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2116. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2117. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2118. exception_frame: 1,
  2119. rsvd0: 12, /* For future use */
  2120. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2121. rsvd1: 1; /* For future use */
  2122. A_UINT32
  2123. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2124. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2125. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2126. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2127. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2128. */
  2129. A_UINT32
  2130. data1: 32;
  2131. A_UINT32
  2132. data2: 32;
  2133. A_UINT32
  2134. used_by_hw3; /* Refer to struct wbm_release_ring */
  2135. } POSTPACK;
  2136. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2137. /* DWORD 3 */
  2138. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2139. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2140. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2141. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2142. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2143. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2144. /* DWORD 3 */
  2145. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2146. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2147. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2148. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2152. } while (0)
  2153. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2154. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2155. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2156. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2157. do { \
  2158. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2159. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2160. } while (0)
  2161. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2162. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2163. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2164. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2165. do { \
  2166. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2167. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2168. } while (0)
  2169. /**
  2170. * @brief HTT TX WBM transmit status from firmware to host
  2171. * @details
  2172. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2173. * (WBM) offload HW.
  2174. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2175. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2176. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2177. */
  2178. PREPACK struct htt_tx_wbm_transmit_status {
  2179. A_UINT32
  2180. sch_cmd_id: 24,
  2181. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2182. * reception of an ACK or BA, this field indicates
  2183. * the RSSI of the received ACK or BA frame.
  2184. * When the frame is removed as result of a direct
  2185. * remove command from the SW, this field is set
  2186. * to 0x0 (which is never a valid value when real
  2187. * RSSI is available).
  2188. * Units: dB w.r.t noise floor
  2189. */
  2190. A_UINT32
  2191. sw_peer_id: 16,
  2192. tid_num: 5,
  2193. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2194. * and tid_num fields contain valid data.
  2195. * If this "valid" flag is not set, the
  2196. * sw_peer_id and tid_num fields must be ignored.
  2197. */
  2198. mcast: 1,
  2199. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2200. * contains valid data.
  2201. */
  2202. reserved0: 8;
  2203. A_UINT32
  2204. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2205. * packets in the wbm completion path
  2206. */
  2207. } POSTPACK;
  2208. /* DWORD 4 */
  2209. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2210. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2211. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2212. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2213. /* DWORD 5 */
  2214. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2215. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2216. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2217. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2218. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2219. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2220. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2221. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2222. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2223. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2224. /* DWORD 4 */
  2225. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2226. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2227. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2228. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2229. do { \
  2230. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2231. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2232. } while (0)
  2233. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2234. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2235. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2236. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2239. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2240. } while (0)
  2241. /* DWORD 5 */
  2242. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2244. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2245. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2249. } while (0)
  2250. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2252. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2253. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2257. } while (0)
  2258. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2259. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2260. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2261. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2265. } while (0)
  2266. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2267. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2268. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2269. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2273. } while (0)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2276. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2277. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2281. } while (0)
  2282. /**
  2283. * @brief HTT TX WBM reinject status from firmware to host
  2284. * @details
  2285. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2286. * (WBM) offload HW.
  2287. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2288. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2289. */
  2290. PREPACK struct htt_tx_wbm_reinject_status {
  2291. A_UINT32
  2292. reserved0: 32;
  2293. A_UINT32
  2294. reserved1: 32;
  2295. A_UINT32
  2296. reserved2: 32;
  2297. } POSTPACK;
  2298. /**
  2299. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2300. * @details
  2301. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2302. * (WBM) offload HW.
  2303. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2304. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2305. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2306. * STA side.
  2307. */
  2308. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2309. A_UINT32
  2310. mec_sa_addr_31_0;
  2311. A_UINT32
  2312. mec_sa_addr_47_32: 16,
  2313. sa_ast_index: 16;
  2314. A_UINT32
  2315. vdev_id: 8,
  2316. reserved0: 24;
  2317. } POSTPACK;
  2318. /* DWORD 4 - mec_sa_addr_31_0 */
  2319. /* DWORD 5 */
  2320. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2321. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2322. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2323. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2324. /* DWORD 6 */
  2325. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2326. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2327. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2328. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2329. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2330. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2331. do { \
  2332. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2333. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2334. } while (0)
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2336. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2337. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2338. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2339. do { \
  2340. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2341. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2342. } while (0)
  2343. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2344. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2345. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2346. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2350. } while (0)
  2351. typedef enum {
  2352. TX_FLOW_PRIORITY_BE,
  2353. TX_FLOW_PRIORITY_HIGH,
  2354. TX_FLOW_PRIORITY_LOW,
  2355. } htt_tx_flow_priority_t;
  2356. typedef enum {
  2357. TX_FLOW_LATENCY_SENSITIVE,
  2358. TX_FLOW_LATENCY_INSENSITIVE,
  2359. } htt_tx_flow_latency_t;
  2360. typedef enum {
  2361. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2362. TX_FLOW_INTERACTIVE_TRAFFIC,
  2363. TX_FLOW_PERIODIC_TRAFFIC,
  2364. TX_FLOW_BURSTY_TRAFFIC,
  2365. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2366. } htt_tx_flow_traffic_pattern_t;
  2367. /**
  2368. * @brief HTT TX Flow search metadata format
  2369. * @details
  2370. * Host will set this metadata in flow table's flow search entry along with
  2371. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2372. * firmware and TQM ring if the flow search entry wins.
  2373. * This metadata is available to firmware in that first MSDU's
  2374. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2375. * to one of the available flows for specific tid and returns the tqm flow
  2376. * pointer as part of htt_tx_map_flow_info message.
  2377. */
  2378. PREPACK struct htt_tx_flow_metadata {
  2379. A_UINT32
  2380. rsvd0_1_0: 2,
  2381. tid: 4,
  2382. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2383. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2384. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2385. * Else choose final tid based on latency, priority.
  2386. */
  2387. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2388. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2389. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2390. } POSTPACK;
  2391. /* DWORD 0 */
  2392. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2393. #define HTT_TX_FLOW_METADATA_TID_S 2
  2394. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2395. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2396. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2397. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2398. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2399. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2400. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2401. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2402. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2403. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2404. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2405. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2406. /* DWORD 0 */
  2407. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2408. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2409. HTT_TX_FLOW_METADATA_TID_S)
  2410. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2411. do { \
  2412. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2413. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2414. } while (0)
  2415. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2416. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2417. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2418. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2422. } while (0)
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2424. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2425. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2426. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2430. } while (0)
  2431. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2432. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2433. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2434. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2438. } while (0)
  2439. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2440. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2441. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2442. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2446. } while (0)
  2447. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2448. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2449. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2450. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2454. } while (0)
  2455. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2456. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2457. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2458. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2461. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2462. } while (0)
  2463. /**
  2464. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2465. *
  2466. * @details
  2467. * HTT wds entry from source port learning
  2468. * Host will learn wds entries from rx and send this message to firmware
  2469. * to enable firmware to configure/delete AST entries for wds clients.
  2470. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2471. * and when SA's entry is deleted, firmware removes this AST entry
  2472. *
  2473. * The message would appear as follows:
  2474. *
  2475. * |31 30|29 |17 16|15 8|7 0|
  2476. * |----------------+----------------+----------------+----------------|
  2477. * | rsvd0 |PDVID| vdev_id | msg_type |
  2478. * |-------------------------------------------------------------------|
  2479. * | sa_addr_31_0 |
  2480. * |-------------------------------------------------------------------|
  2481. * | | ta_peer_id | sa_addr_47_32 |
  2482. * |-------------------------------------------------------------------|
  2483. * Where PDVID = pdev_id
  2484. *
  2485. * The message is interpreted as follows:
  2486. *
  2487. * dword0 - b'0:7 - msg_type: This will be set to
  2488. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2489. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2490. *
  2491. * dword0 - b'8:15 - vdev_id
  2492. *
  2493. * dword0 - b'16:17 - pdev_id
  2494. *
  2495. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2496. *
  2497. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2498. *
  2499. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2500. *
  2501. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2502. */
  2503. PREPACK struct htt_wds_entry {
  2504. A_UINT32
  2505. msg_type: 8,
  2506. vdev_id: 8,
  2507. pdev_id: 2,
  2508. rsvd0: 14;
  2509. A_UINT32 sa_addr_31_0;
  2510. A_UINT32
  2511. sa_addr_47_32: 16,
  2512. ta_peer_id: 14,
  2513. rsvd2: 2;
  2514. } POSTPACK;
  2515. /* DWORD 0 */
  2516. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2517. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2518. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2519. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2520. /* DWORD 2 */
  2521. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2522. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2523. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2524. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2525. /* DWORD 0 */
  2526. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2527. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2528. HTT_WDS_ENTRY_VDEV_ID_S)
  2529. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2530. do { \
  2531. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2532. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2533. } while (0)
  2534. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2535. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2536. HTT_WDS_ENTRY_PDEV_ID_S)
  2537. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2540. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2541. } while (0)
  2542. /* DWORD 2 */
  2543. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2544. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2545. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2546. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2547. do { \
  2548. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2549. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2550. } while (0)
  2551. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2552. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2553. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2554. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2555. do { \
  2556. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2557. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2558. } while (0)
  2559. /**
  2560. * @brief MAC DMA rx ring setup specification
  2561. * @details
  2562. * To allow for dynamic rx ring reconfiguration and to avoid race
  2563. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2564. * it uses. Instead, it sends this message to the target, indicating how
  2565. * the rx ring used by the host should be set up and maintained.
  2566. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2567. * specifications.
  2568. *
  2569. * |31 16|15 8|7 0|
  2570. * |---------------------------------------------------------------|
  2571. * header: | reserved | num rings | msg type |
  2572. * |---------------------------------------------------------------|
  2573. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2574. #if HTT_PADDR64
  2575. * | FW_IDX shadow register physical address (bits 63:32) |
  2576. #endif
  2577. * |---------------------------------------------------------------|
  2578. * | rx ring base physical address (bits 31:0) |
  2579. #if HTT_PADDR64
  2580. * | rx ring base physical address (bits 63:32) |
  2581. #endif
  2582. * |---------------------------------------------------------------|
  2583. * | rx ring buffer size | rx ring length |
  2584. * |---------------------------------------------------------------|
  2585. * | FW_IDX initial value | enabled flags |
  2586. * |---------------------------------------------------------------|
  2587. * | MSDU payload offset | 802.11 header offset |
  2588. * |---------------------------------------------------------------|
  2589. * | PPDU end offset | PPDU start offset |
  2590. * |---------------------------------------------------------------|
  2591. * | MPDU end offset | MPDU start offset |
  2592. * |---------------------------------------------------------------|
  2593. * | MSDU end offset | MSDU start offset |
  2594. * |---------------------------------------------------------------|
  2595. * | frag info offset | rx attention offset |
  2596. * |---------------------------------------------------------------|
  2597. * payload 2, if present, has the same format as payload 1
  2598. * Header fields:
  2599. * - MSG_TYPE
  2600. * Bits 7:0
  2601. * Purpose: identifies this as an rx ring configuration message
  2602. * Value: 0x2
  2603. * - NUM_RINGS
  2604. * Bits 15:8
  2605. * Purpose: indicates whether the host is setting up one rx ring or two
  2606. * Value: 1 or 2
  2607. * Payload:
  2608. * for systems using 64-bit format for bus addresses:
  2609. * - IDX_SHADOW_REG_PADDR_LO
  2610. * Bits 31:0
  2611. * Value: lower 4 bytes of physical address of the host's
  2612. * FW_IDX shadow register
  2613. * - IDX_SHADOW_REG_PADDR_HI
  2614. * Bits 31:0
  2615. * Value: upper 4 bytes of physical address of the host's
  2616. * FW_IDX shadow register
  2617. * - RING_BASE_PADDR_LO
  2618. * Bits 31:0
  2619. * Value: lower 4 bytes of physical address of the host's rx ring
  2620. * - RING_BASE_PADDR_HI
  2621. * Bits 31:0
  2622. * Value: uppper 4 bytes of physical address of the host's rx ring
  2623. * for systems using 32-bit format for bus addresses:
  2624. * - IDX_SHADOW_REG_PADDR
  2625. * Bits 31:0
  2626. * Value: physical address of the host's FW_IDX shadow register
  2627. * - RING_BASE_PADDR
  2628. * Bits 31:0
  2629. * Value: physical address of the host's rx ring
  2630. * - RING_LEN
  2631. * Bits 15:0
  2632. * Value: number of elements in the rx ring
  2633. * - RING_BUF_SZ
  2634. * Bits 31:16
  2635. * Value: size of the buffers referenced by the rx ring, in byte units
  2636. * - ENABLED_FLAGS
  2637. * Bits 15:0
  2638. * Value: 1-bit flags to show whether different rx fields are enabled
  2639. * bit 0: 802.11 header enabled (1) or disabled (0)
  2640. * bit 1: MSDU payload enabled (1) or disabled (0)
  2641. * bit 2: PPDU start enabled (1) or disabled (0)
  2642. * bit 3: PPDU end enabled (1) or disabled (0)
  2643. * bit 4: MPDU start enabled (1) or disabled (0)
  2644. * bit 5: MPDU end enabled (1) or disabled (0)
  2645. * bit 6: MSDU start enabled (1) or disabled (0)
  2646. * bit 7: MSDU end enabled (1) or disabled (0)
  2647. * bit 8: rx attention enabled (1) or disabled (0)
  2648. * bit 9: frag info enabled (1) or disabled (0)
  2649. * bit 10: unicast rx enabled (1) or disabled (0)
  2650. * bit 11: multicast rx enabled (1) or disabled (0)
  2651. * bit 12: ctrl rx enabled (1) or disabled (0)
  2652. * bit 13: mgmt rx enabled (1) or disabled (0)
  2653. * bit 14: null rx enabled (1) or disabled (0)
  2654. * bit 15: phy data rx enabled (1) or disabled (0)
  2655. * - IDX_INIT_VAL
  2656. * Bits 31:16
  2657. * Purpose: Specify the initial value for the FW_IDX.
  2658. * Value: the number of buffers initially present in the host's rx ring
  2659. * - OFFSET_802_11_HDR
  2660. * Bits 15:0
  2661. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2662. * - OFFSET_MSDU_PAYLOAD
  2663. * Bits 31:16
  2664. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2665. * - OFFSET_PPDU_START
  2666. * Bits 15:0
  2667. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2668. * - OFFSET_PPDU_END
  2669. * Bits 31:16
  2670. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2671. * - OFFSET_MPDU_START
  2672. * Bits 15:0
  2673. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2674. * - OFFSET_MPDU_END
  2675. * Bits 31:16
  2676. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2677. * - OFFSET_MSDU_START
  2678. * Bits 15:0
  2679. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2680. * - OFFSET_MSDU_END
  2681. * Bits 31:16
  2682. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2683. * - OFFSET_RX_ATTN
  2684. * Bits 15:0
  2685. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2686. * - OFFSET_FRAG_INFO
  2687. * Bits 31:16
  2688. * Value: offset in QUAD-bytes of frag info table
  2689. */
  2690. /* header fields */
  2691. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2692. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2693. /* payload fields */
  2694. /* for systems using a 64-bit format for bus addresses */
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2696. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2697. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2698. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2702. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2703. /* for systems using a 32-bit format for bus addresses */
  2704. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2705. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2707. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2708. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2709. #define HTT_RX_RING_CFG_LEN_S 0
  2710. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2711. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2712. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2713. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2714. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2715. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2716. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2717. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2718. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2719. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2720. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2721. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2722. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2723. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2724. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2725. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2726. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2727. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2728. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2729. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2730. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2731. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2732. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2733. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2734. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2735. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2736. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2737. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2738. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2739. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2740. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2741. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2742. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2743. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2744. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2745. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2746. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2747. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2748. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2749. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2750. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2751. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2752. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2753. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2754. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2755. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2756. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2757. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2758. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2759. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2760. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2761. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2762. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2763. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2764. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2765. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2766. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2767. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2768. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2769. #if HTT_PADDR64
  2770. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2771. #else
  2772. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2773. #endif
  2774. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2775. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2776. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2777. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2778. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2781. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2782. } while (0)
  2783. /* degenerate case for 32-bit fields */
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2785. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2786. ((_var) = (_val))
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2788. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2789. ((_var) = (_val))
  2790. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2791. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2792. ((_var) = (_val))
  2793. /* degenerate case for 32-bit fields */
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2798. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2799. ((_var) = (_val))
  2800. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2801. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2802. ((_var) = (_val))
  2803. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2805. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2808. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2809. } while (0)
  2810. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2811. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2812. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2815. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2816. } while (0)
  2817. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2818. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2819. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2820. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2827. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2828. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2831. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2832. } while (0)
  2833. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2834. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2835. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2836. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2839. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2840. } while (0)
  2841. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2842. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2843. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2844. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2847. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2848. } while (0)
  2849. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2850. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2851. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2852. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2853. do { \
  2854. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2855. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2856. } while (0)
  2857. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2858. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2859. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2860. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2861. do { \
  2862. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2863. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2864. } while (0)
  2865. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2866. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2867. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2868. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2871. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2872. } while (0)
  2873. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2874. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2875. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2876. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2877. do { \
  2878. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2879. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2880. } while (0)
  2881. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2882. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2883. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2884. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2885. do { \
  2886. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2887. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2888. } while (0)
  2889. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2890. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2891. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2892. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2893. do { \
  2894. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2895. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2896. } while (0)
  2897. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2898. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2899. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2900. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2901. do { \
  2902. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2903. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2904. } while (0)
  2905. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2906. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2907. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2908. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2909. do { \
  2910. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2911. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2912. } while (0)
  2913. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2914. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2915. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2916. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2917. do { \
  2918. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2919. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2920. } while (0)
  2921. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2922. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2923. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2924. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2925. do { \
  2926. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2927. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2928. } while (0)
  2929. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2930. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2931. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2932. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2933. do { \
  2934. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2935. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2936. } while (0)
  2937. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2938. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2939. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2940. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2941. do { \
  2942. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2943. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2944. } while (0)
  2945. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2946. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2947. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2948. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2951. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2952. } while (0)
  2953. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2954. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2955. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2956. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2959. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2960. } while (0)
  2961. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2962. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2963. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2965. do { \
  2966. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2967. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2968. } while (0)
  2969. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2970. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2971. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2972. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2975. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2976. } while (0)
  2977. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2978. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2979. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2980. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2983. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2984. } while (0)
  2985. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2986. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2987. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2988. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2989. do { \
  2990. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2991. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2992. } while (0)
  2993. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2994. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2995. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2996. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2997. do { \
  2998. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2999. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3000. } while (0)
  3001. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3002. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3003. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3004. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3005. do { \
  3006. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3007. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3008. } while (0)
  3009. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3010. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3011. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3012. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3013. do { \
  3014. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3015. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3016. } while (0)
  3017. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3018. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3019. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3020. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3021. do { \
  3022. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3023. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3024. } while (0)
  3025. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3026. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3027. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3028. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3029. do { \
  3030. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3031. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3032. } while (0)
  3033. /**
  3034. * @brief host -> target FW statistics retrieve
  3035. *
  3036. * @details
  3037. * The following field definitions describe the format of the HTT host
  3038. * to target FW stats retrieve message. The message specifies the type of
  3039. * stats host wants to retrieve.
  3040. *
  3041. * |31 24|23 16|15 8|7 0|
  3042. * |-----------------------------------------------------------|
  3043. * | stats types request bitmask | msg type |
  3044. * |-----------------------------------------------------------|
  3045. * | stats types reset bitmask | reserved |
  3046. * |-----------------------------------------------------------|
  3047. * | stats type | config value |
  3048. * |-----------------------------------------------------------|
  3049. * | cookie LSBs |
  3050. * |-----------------------------------------------------------|
  3051. * | cookie MSBs |
  3052. * |-----------------------------------------------------------|
  3053. * Header fields:
  3054. * - MSG_TYPE
  3055. * Bits 7:0
  3056. * Purpose: identifies this is a stats upload request message
  3057. * Value: 0x3
  3058. * - UPLOAD_TYPES
  3059. * Bits 31:8
  3060. * Purpose: identifies which types of FW statistics to upload
  3061. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3062. * - RESET_TYPES
  3063. * Bits 31:8
  3064. * Purpose: identifies which types of FW statistics to reset
  3065. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3066. * - CFG_VAL
  3067. * Bits 23:0
  3068. * Purpose: give an opaque configuration value to the specified stats type
  3069. * Value: stats-type specific configuration value
  3070. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3071. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3072. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3073. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3074. * - CFG_STAT_TYPE
  3075. * Bits 31:24
  3076. * Purpose: specify which stats type (if any) the config value applies to
  3077. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3078. * a valid configuration specification
  3079. * - COOKIE_LSBS
  3080. * Bits 31:0
  3081. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3082. * message with its preceding host->target stats request message.
  3083. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3084. * - COOKIE_MSBS
  3085. * Bits 31:0
  3086. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3087. * message with its preceding host->target stats request message.
  3088. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3089. */
  3090. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3091. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3092. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3093. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3094. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3095. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3096. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3097. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3098. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3099. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3100. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3101. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3102. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3103. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3106. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3107. } while (0)
  3108. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3109. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3110. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3111. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3112. do { \
  3113. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3114. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3115. } while (0)
  3116. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3117. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3118. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3119. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3120. do { \
  3121. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3122. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3123. } while (0)
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3125. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3126. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3127. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3128. do { \
  3129. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3130. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3131. } while (0)
  3132. /**
  3133. * @brief host -> target HTT out-of-band sync request
  3134. *
  3135. * @details
  3136. * The HTT SYNC tells the target to suspend processing of subsequent
  3137. * HTT host-to-target messages until some other target agent locally
  3138. * informs the target HTT FW that the current sync counter is equal to
  3139. * or greater than (in a modulo sense) the sync counter specified in
  3140. * the SYNC message.
  3141. * This allows other host-target components to synchronize their operation
  3142. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3143. * security key has been downloaded to and activated by the target.
  3144. * In the absence of any explicit synchronization counter value
  3145. * specification, the target HTT FW will use zero as the default current
  3146. * sync value.
  3147. *
  3148. * |31 24|23 16|15 8|7 0|
  3149. * |-----------------------------------------------------------|
  3150. * | reserved | sync count | msg type |
  3151. * |-----------------------------------------------------------|
  3152. * Header fields:
  3153. * - MSG_TYPE
  3154. * Bits 7:0
  3155. * Purpose: identifies this as a sync message
  3156. * Value: 0x4
  3157. * - SYNC_COUNT
  3158. * Bits 15:8
  3159. * Purpose: specifies what sync value the HTT FW will wait for from
  3160. * an out-of-band specification to resume its operation
  3161. * Value: in-band sync counter value to compare against the out-of-band
  3162. * counter spec.
  3163. * The HTT target FW will suspend its host->target message processing
  3164. * as long as
  3165. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3166. */
  3167. #define HTT_H2T_SYNC_MSG_SZ 4
  3168. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3169. #define HTT_H2T_SYNC_COUNT_S 8
  3170. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3171. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3172. HTT_H2T_SYNC_COUNT_S)
  3173. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3176. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3177. } while (0)
  3178. /**
  3179. * @brief HTT aggregation configuration
  3180. */
  3181. #define HTT_AGGR_CFG_MSG_SZ 4
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3184. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3185. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3186. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3187. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3188. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3189. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3190. do { \
  3191. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3192. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3193. } while (0)
  3194. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3195. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3196. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3197. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3198. do { \
  3199. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3200. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3201. } while (0)
  3202. /**
  3203. * @brief host -> target HTT configure max amsdu info per vdev
  3204. *
  3205. * @details
  3206. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3207. *
  3208. * |31 21|20 16|15 8|7 0|
  3209. * |-----------------------------------------------------------|
  3210. * | reserved | vdev id | max amsdu | msg type |
  3211. * |-----------------------------------------------------------|
  3212. * Header fields:
  3213. * - MSG_TYPE
  3214. * Bits 7:0
  3215. * Purpose: identifies this as a aggr cfg ex message
  3216. * Value: 0xa
  3217. * - MAX_NUM_AMSDU_SUBFRM
  3218. * Bits 15:8
  3219. * Purpose: max MSDUs per A-MSDU
  3220. * - VDEV_ID
  3221. * Bits 20:16
  3222. * Purpose: ID of the vdev to which this limit is applied
  3223. */
  3224. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3225. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3226. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3227. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3228. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3229. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3230. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3231. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3232. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3233. do { \
  3234. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3235. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3236. } while (0)
  3237. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3238. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3239. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3240. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3241. do { \
  3242. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3243. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3244. } while (0)
  3245. /**
  3246. * @brief HTT WDI_IPA Config Message
  3247. *
  3248. * @details
  3249. * The HTT WDI_IPA config message is created/sent by host at driver
  3250. * init time. It contains information about data structures used on
  3251. * WDI_IPA TX and RX path.
  3252. * TX CE ring is used for pushing packet metadata from IPA uC
  3253. * to WLAN FW
  3254. * TX Completion ring is used for generating TX completions from
  3255. * WLAN FW to IPA uC
  3256. * RX Indication ring is used for indicating RX packets from FW
  3257. * to IPA uC
  3258. * RX Ring2 is used as either completion ring or as second
  3259. * indication ring. when Ring2 is used as completion ring, IPA uC
  3260. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3261. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3262. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3263. * indicated in RX Indication ring. Please see WDI_IPA specification
  3264. * for more details.
  3265. * |31 24|23 16|15 8|7 0|
  3266. * |----------------+----------------+----------------+----------------|
  3267. * | tx pkt pool size | Rsvd | msg_type |
  3268. * |-------------------------------------------------------------------|
  3269. * | tx comp ring base (bits 31:0) |
  3270. #if HTT_PADDR64
  3271. * | tx comp ring base (bits 63:32) |
  3272. #endif
  3273. * |-------------------------------------------------------------------|
  3274. * | tx comp ring size |
  3275. * |-------------------------------------------------------------------|
  3276. * | tx comp WR_IDX physical address (bits 31:0) |
  3277. #if HTT_PADDR64
  3278. * | tx comp WR_IDX physical address (bits 63:32) |
  3279. #endif
  3280. * |-------------------------------------------------------------------|
  3281. * | tx CE WR_IDX physical address (bits 31:0) |
  3282. #if HTT_PADDR64
  3283. * | tx CE WR_IDX physical address (bits 63:32) |
  3284. #endif
  3285. * |-------------------------------------------------------------------|
  3286. * | rx indication ring base (bits 31:0) |
  3287. #if HTT_PADDR64
  3288. * | rx indication ring base (bits 63:32) |
  3289. #endif
  3290. * |-------------------------------------------------------------------|
  3291. * | rx indication ring size |
  3292. * |-------------------------------------------------------------------|
  3293. * | rx ind RD_IDX physical address (bits 31:0) |
  3294. #if HTT_PADDR64
  3295. * | rx ind RD_IDX physical address (bits 63:32) |
  3296. #endif
  3297. * |-------------------------------------------------------------------|
  3298. * | rx ind WR_IDX physical address (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | rx ind WR_IDX physical address (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * |-------------------------------------------------------------------|
  3304. * | rx ring2 base (bits 31:0) |
  3305. #if HTT_PADDR64
  3306. * | rx ring2 base (bits 63:32) |
  3307. #endif
  3308. * |-------------------------------------------------------------------|
  3309. * | rx ring2 size |
  3310. * |-------------------------------------------------------------------|
  3311. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3312. #if HTT_PADDR64
  3313. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3314. #endif
  3315. * |-------------------------------------------------------------------|
  3316. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3317. #if HTT_PADDR64
  3318. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3319. #endif
  3320. * |-------------------------------------------------------------------|
  3321. *
  3322. * Header fields:
  3323. * Header fields:
  3324. * - MSG_TYPE
  3325. * Bits 7:0
  3326. * Purpose: Identifies this as WDI_IPA config message
  3327. * value: = 0x8
  3328. * - TX_PKT_POOL_SIZE
  3329. * Bits 15:0
  3330. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3331. * WDI_IPA TX path
  3332. * For systems using 32-bit format for bus addresses:
  3333. * - TX_COMP_RING_BASE_ADDR
  3334. * Bits 31:0
  3335. * Purpose: TX Completion Ring base address in DDR
  3336. * - TX_COMP_RING_SIZE
  3337. * Bits 31:0
  3338. * Purpose: TX Completion Ring size (must be power of 2)
  3339. * - TX_COMP_WR_IDX_ADDR
  3340. * Bits 31:0
  3341. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3342. * updates the Write Index for WDI_IPA TX completion ring
  3343. * - TX_CE_WR_IDX_ADDR
  3344. * Bits 31:0
  3345. * Purpose: DDR address where IPA uC
  3346. * updates the WR Index for TX CE ring
  3347. * (needed for fusion platforms)
  3348. * - RX_IND_RING_BASE_ADDR
  3349. * Bits 31:0
  3350. * Purpose: RX Indication Ring base address in DDR
  3351. * - RX_IND_RING_SIZE
  3352. * Bits 31:0
  3353. * Purpose: RX Indication Ring size
  3354. * - RX_IND_RD_IDX_ADDR
  3355. * Bits 31:0
  3356. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3357. * RX indication ring
  3358. * - RX_IND_WR_IDX_ADDR
  3359. * Bits 31:0
  3360. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3361. * updates the Write Index for WDI_IPA RX indication ring
  3362. * - RX_RING2_BASE_ADDR
  3363. * Bits 31:0
  3364. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3365. * - RX_RING2_SIZE
  3366. * Bits 31:0
  3367. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3368. * - RX_RING2_RD_IDX_ADDR
  3369. * Bits 31:0
  3370. * Purpose: If Second RX ring is Indication ring, DDR address where
  3371. * IPA uC updates the Read Index for Ring2.
  3372. * If Second RX ring is completion ring, this is NOT used
  3373. * - RX_RING2_WR_IDX_ADDR
  3374. * Bits 31:0
  3375. * Purpose: If Second RX ring is Indication ring, DDR address where
  3376. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3377. * If second RX ring is completion ring, DDR address where
  3378. * IPA uC updates the Write Index for Ring 2.
  3379. * For systems using 64-bit format for bus addresses:
  3380. * - TX_COMP_RING_BASE_ADDR_LO
  3381. * Bits 31:0
  3382. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3383. * - TX_COMP_RING_BASE_ADDR_HI
  3384. * Bits 31:0
  3385. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3386. * - TX_COMP_RING_SIZE
  3387. * Bits 31:0
  3388. * Purpose: TX Completion Ring size (must be power of 2)
  3389. * - TX_COMP_WR_IDX_ADDR_LO
  3390. * Bits 31:0
  3391. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3392. * Lower 4 bytes of DDR address where WIFI FW
  3393. * updates the Write Index for WDI_IPA TX completion ring
  3394. * - TX_COMP_WR_IDX_ADDR_HI
  3395. * Bits 31:0
  3396. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3397. * Higher 4 bytes of DDR address where WIFI FW
  3398. * updates the Write Index for WDI_IPA TX completion ring
  3399. * - TX_CE_WR_IDX_ADDR_LO
  3400. * Bits 31:0
  3401. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3402. * updates the WR Index for TX CE ring
  3403. * (needed for fusion platforms)
  3404. * - TX_CE_WR_IDX_ADDR_HI
  3405. * Bits 31:0
  3406. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3407. * updates the WR Index for TX CE ring
  3408. * (needed for fusion platforms)
  3409. * - RX_IND_RING_BASE_ADDR_LO
  3410. * Bits 31:0
  3411. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3412. * - RX_IND_RING_BASE_ADDR_HI
  3413. * Bits 31:0
  3414. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3415. * - RX_IND_RING_SIZE
  3416. * Bits 31:0
  3417. * Purpose: RX Indication Ring size
  3418. * - RX_IND_RD_IDX_ADDR_LO
  3419. * Bits 31:0
  3420. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3421. * for WDI_IPA RX indication ring
  3422. * - RX_IND_RD_IDX_ADDR_HI
  3423. * Bits 31:0
  3424. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3425. * for WDI_IPA RX indication ring
  3426. * - RX_IND_WR_IDX_ADDR_LO
  3427. * Bits 31:0
  3428. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3429. * Lower 4 bytes of DDR address where WIFI FW
  3430. * updates the Write Index for WDI_IPA RX indication ring
  3431. * - RX_IND_WR_IDX_ADDR_HI
  3432. * Bits 31:0
  3433. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3434. * Higher 4 bytes of DDR address where WIFI FW
  3435. * updates the Write Index for WDI_IPA RX indication ring
  3436. * - RX_RING2_BASE_ADDR_LO
  3437. * Bits 31:0
  3438. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3439. * - RX_RING2_BASE_ADDR_HI
  3440. * Bits 31:0
  3441. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3442. * - RX_RING2_SIZE
  3443. * Bits 31:0
  3444. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3445. * - RX_RING2_RD_IDX_ADDR_LO
  3446. * Bits 31:0
  3447. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3448. * DDR address where IPA uC updates the Read Index for Ring2.
  3449. * If Second RX ring is completion ring, this is NOT used
  3450. * - RX_RING2_RD_IDX_ADDR_HI
  3451. * Bits 31:0
  3452. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3453. * DDR address where IPA uC updates the Read Index for Ring2.
  3454. * If Second RX ring is completion ring, this is NOT used
  3455. * - RX_RING2_WR_IDX_ADDR_LO
  3456. * Bits 31:0
  3457. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3458. * DDR address where WIFI FW updates the Write Index
  3459. * for WDI_IPA RX ring2
  3460. * If second RX ring is completion ring, lower 4 bytes of
  3461. * DDR address where IPA uC updates the Write Index for Ring 2.
  3462. * - RX_RING2_WR_IDX_ADDR_HI
  3463. * Bits 31:0
  3464. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3465. * DDR address where WIFI FW updates the Write Index
  3466. * for WDI_IPA RX ring2
  3467. * If second RX ring is completion ring, higher 4 bytes of
  3468. * DDR address where IPA uC updates the Write Index for Ring 2.
  3469. */
  3470. #if HTT_PADDR64
  3471. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3472. #else
  3473. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3474. #endif
  3475. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3476. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3493. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3495. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3537. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3538. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3539. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3542. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3543. } while (0)
  3544. /* for systems using 32-bit format for bus addr */
  3545. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3546. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3547. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3550. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3551. } while (0)
  3552. /* for systems using 64-bit format for bus addr */
  3553. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3554. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3555. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3559. } while (0)
  3560. /* for systems using 64-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3563. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3567. } while (0)
  3568. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3569. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3573. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3574. } while (0)
  3575. /* for systems using 32-bit format for bus addr */
  3576. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3577. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3581. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3582. } while (0)
  3583. /* for systems using 64-bit format for bus addr */
  3584. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3585. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3586. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3587. do { \
  3588. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3589. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3590. } while (0)
  3591. /* for systems using 64-bit format for bus addr */
  3592. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3593. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3594. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3597. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3598. } while (0)
  3599. /* for systems using 32-bit format for bus addr */
  3600. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3601. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3602. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3603. do { \
  3604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3605. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3606. } while (0)
  3607. /* for systems using 64-bit format for bus addr */
  3608. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3609. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3610. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3611. do { \
  3612. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3613. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3614. } while (0)
  3615. /* for systems using 64-bit format for bus addr */
  3616. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3617. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3618. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3621. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3622. } while (0)
  3623. /* for systems using 32-bit format for bus addr */
  3624. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3625. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3626. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3630. } while (0)
  3631. /* for systems using 64-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3634. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3638. } while (0)
  3639. /* for systems using 64-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3642. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3646. } while (0)
  3647. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3648. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3652. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3653. } while (0)
  3654. /* for systems using 32-bit format for bus addr */
  3655. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3656. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3660. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3661. } while (0)
  3662. /* for systems using 64-bit format for bus addr */
  3663. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3664. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3665. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3668. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3669. } while (0)
  3670. /* for systems using 64-bit format for bus addr */
  3671. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3672. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3673. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3676. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3677. } while (0)
  3678. /* for systems using 32-bit format for bus addr */
  3679. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3680. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3681. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3684. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3685. } while (0)
  3686. /* for systems using 64-bit format for bus addr */
  3687. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3688. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3689. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3692. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3693. } while (0)
  3694. /* for systems using 64-bit format for bus addr */
  3695. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3696. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3697. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3700. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3701. } while (0)
  3702. /* for systems using 32-bit format for bus addr */
  3703. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3704. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3705. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3706. do { \
  3707. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3708. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3709. } while (0)
  3710. /* for systems using 64-bit format for bus addr */
  3711. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3712. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3713. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3714. do { \
  3715. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3716. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3717. } while (0)
  3718. /* for systems using 64-bit format for bus addr */
  3719. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3720. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3721. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3722. do { \
  3723. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3724. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3725. } while (0)
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3727. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3729. do { \
  3730. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3731. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3732. } while (0)
  3733. /* for systems using 32-bit format for bus addr */
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3735. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3739. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3740. } while (0)
  3741. /* for systems using 64-bit format for bus addr */
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3743. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3747. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3748. } while (0)
  3749. /* for systems using 64-bit format for bus addr */
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3751. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3753. do { \
  3754. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3755. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3756. } while (0)
  3757. /* for systems using 32-bit format for bus addr */
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3759. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3761. do { \
  3762. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3763. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3764. } while (0)
  3765. /* for systems using 64-bit format for bus addr */
  3766. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3767. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3768. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3771. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3772. } while (0)
  3773. /* for systems using 64-bit format for bus addr */
  3774. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3775. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3776. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3779. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3780. } while (0)
  3781. /*
  3782. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3783. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3784. * addresses are stored in a XXX-bit field.
  3785. * This macro is used to define both htt_wdi_ipa_config32_t and
  3786. * htt_wdi_ipa_config64_t structs.
  3787. */
  3788. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3789. _paddr__tx_comp_ring_base_addr_, \
  3790. _paddr__tx_comp_wr_idx_addr_, \
  3791. _paddr__tx_ce_wr_idx_addr_, \
  3792. _paddr__rx_ind_ring_base_addr_, \
  3793. _paddr__rx_ind_rd_idx_addr_, \
  3794. _paddr__rx_ind_wr_idx_addr_, \
  3795. _paddr__rx_ring2_base_addr_,\
  3796. _paddr__rx_ring2_rd_idx_addr_,\
  3797. _paddr__rx_ring2_wr_idx_addr_) \
  3798. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3799. { \
  3800. /* DWORD 0: flags and meta-data */ \
  3801. A_UINT32 \
  3802. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3803. reserved: 8, \
  3804. tx_pkt_pool_size: 16;\
  3805. /* DWORD 1 */\
  3806. _paddr__tx_comp_ring_base_addr_;\
  3807. /* DWORD 2 (or 3)*/\
  3808. A_UINT32 tx_comp_ring_size;\
  3809. /* DWORD 3 (or 4)*/\
  3810. _paddr__tx_comp_wr_idx_addr_;\
  3811. /* DWORD 4 (or 6)*/\
  3812. _paddr__tx_ce_wr_idx_addr_;\
  3813. /* DWORD 5 (or 8)*/\
  3814. _paddr__rx_ind_ring_base_addr_;\
  3815. /* DWORD 6 (or 10)*/\
  3816. A_UINT32 rx_ind_ring_size;\
  3817. /* DWORD 7 (or 11)*/\
  3818. _paddr__rx_ind_rd_idx_addr_;\
  3819. /* DWORD 8 (or 13)*/\
  3820. _paddr__rx_ind_wr_idx_addr_;\
  3821. /* DWORD 9 (or 15)*/\
  3822. _paddr__rx_ring2_base_addr_;\
  3823. /* DWORD 10 (or 17) */\
  3824. A_UINT32 rx_ring2_size;\
  3825. /* DWORD 11 (or 18) */\
  3826. _paddr__rx_ring2_rd_idx_addr_;\
  3827. /* DWORD 12 (or 20) */\
  3828. _paddr__rx_ring2_wr_idx_addr_;\
  3829. } POSTPACK
  3830. /* define a htt_wdi_ipa_config32_t type */
  3831. 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));
  3832. /* define a htt_wdi_ipa_config64_t type */
  3833. 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));
  3834. #if HTT_PADDR64
  3835. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3836. #else
  3837. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3838. #endif
  3839. enum htt_wdi_ipa_op_code {
  3840. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3841. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3842. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3843. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3844. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3845. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3846. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3847. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3848. /* keep this last */
  3849. HTT_WDI_IPA_OPCODE_MAX
  3850. };
  3851. /**
  3852. * @brief HTT WDI_IPA Operation Request Message
  3853. *
  3854. * @details
  3855. * HTT WDI_IPA Operation Request message is sent by host
  3856. * to either suspend or resume WDI_IPA TX or RX path.
  3857. * |31 24|23 16|15 8|7 0|
  3858. * |----------------+----------------+----------------+----------------|
  3859. * | op_code | Rsvd | msg_type |
  3860. * |-------------------------------------------------------------------|
  3861. *
  3862. * Header fields:
  3863. * - MSG_TYPE
  3864. * Bits 7:0
  3865. * Purpose: Identifies this as WDI_IPA Operation Request message
  3866. * value: = 0x9
  3867. * - OP_CODE
  3868. * Bits 31:16
  3869. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3870. * value: = enum htt_wdi_ipa_op_code
  3871. */
  3872. PREPACK struct htt_wdi_ipa_op_request_t
  3873. {
  3874. /* DWORD 0: flags and meta-data */
  3875. A_UINT32
  3876. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3877. reserved: 8,
  3878. op_code: 16;
  3879. } POSTPACK;
  3880. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3881. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3882. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3883. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3884. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3885. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3886. do { \
  3887. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3888. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3889. } while (0)
  3890. /*
  3891. * @brief host -> target HTT_SRING_SETUP message
  3892. *
  3893. * @details
  3894. * After target is booted up, Host can send SRING setup message for
  3895. * each host facing LMAC SRING. Target setups up HW registers based
  3896. * on setup message and confirms back to Host if response_required is set.
  3897. * Host should wait for confirmation message before sending new SRING
  3898. * setup message
  3899. *
  3900. * The message would appear as follows:
  3901. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3902. * |--------------- +-----------------+-----------------+-----------------|
  3903. * | ring_type | ring_id | pdev_id | msg_type |
  3904. * |----------------------------------------------------------------------|
  3905. * | ring_base_addr_lo |
  3906. * |----------------------------------------------------------------------|
  3907. * | ring_base_addr_hi |
  3908. * |----------------------------------------------------------------------|
  3909. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3910. * |----------------------------------------------------------------------|
  3911. * | ring_head_offset32_remote_addr_lo |
  3912. * |----------------------------------------------------------------------|
  3913. * | ring_head_offset32_remote_addr_hi |
  3914. * |----------------------------------------------------------------------|
  3915. * | ring_tail_offset32_remote_addr_lo |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_tail_offset32_remote_addr_hi |
  3918. * |----------------------------------------------------------------------|
  3919. * | ring_msi_addr_lo |
  3920. * |----------------------------------------------------------------------|
  3921. * | ring_msi_addr_hi |
  3922. * |----------------------------------------------------------------------|
  3923. * | ring_msi_data |
  3924. * |----------------------------------------------------------------------|
  3925. * | intr_timer_th |IM| intr_batch_counter_th |
  3926. * |----------------------------------------------------------------------|
  3927. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3928. * |----------------------------------------------------------------------|
  3929. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3930. * |----------------------------------------------------------------------|
  3931. * Where
  3932. * IM = sw_intr_mode
  3933. * RR = response_required
  3934. * PTCF = prefetch_timer_cfg
  3935. * IP = IPA drop flag
  3936. *
  3937. * The message is interpreted as follows:
  3938. * dword0 - b'0:7 - msg_type: This will be set to
  3939. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3940. * b'8:15 - pdev_id:
  3941. * 0 (for rings at SOC/UMAC level),
  3942. * 1/2/3 mac id (for rings at LMAC level)
  3943. * b'16:23 - ring_id: identify which ring is to setup,
  3944. * more details can be got from enum htt_srng_ring_id
  3945. * b'24:31 - ring_type: identify type of host rings,
  3946. * more details can be got from enum htt_srng_ring_type
  3947. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3948. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3949. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3950. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3951. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3952. * SW_TO_HW_RING.
  3953. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3954. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3955. * Lower 32 bits of memory address of the remote variable
  3956. * storing the 4-byte word offset that identifies the head
  3957. * element within the ring.
  3958. * (The head offset variable has type A_UINT32.)
  3959. * Valid for HW_TO_SW and SW_TO_SW rings.
  3960. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3961. * Upper 32 bits of memory address of the remote variable
  3962. * storing the 4-byte word offset that identifies the head
  3963. * element within the ring.
  3964. * (The head offset variable has type A_UINT32.)
  3965. * Valid for HW_TO_SW and SW_TO_SW rings.
  3966. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3967. * Lower 32 bits of memory address of the remote variable
  3968. * storing the 4-byte word offset that identifies the tail
  3969. * element within the ring.
  3970. * (The tail offset variable has type A_UINT32.)
  3971. * Valid for HW_TO_SW and SW_TO_SW rings.
  3972. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3973. * Upper 32 bits of memory address of the remote variable
  3974. * storing the 4-byte word offset that identifies the tail
  3975. * element within the ring.
  3976. * (The tail offset variable has type A_UINT32.)
  3977. * Valid for HW_TO_SW and SW_TO_SW rings.
  3978. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3979. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3980. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3981. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3982. * dword10 - b'0:31 - ring_msi_data: MSI data
  3983. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3984. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3985. * dword11 - b'0:14 - intr_batch_counter_th:
  3986. * batch counter threshold is in units of 4-byte words.
  3987. * HW internally maintains and increments batch count.
  3988. * (see SRING spec for detail description).
  3989. * When batch count reaches threshold value, an interrupt
  3990. * is generated by HW.
  3991. * b'15 - sw_intr_mode:
  3992. * This configuration shall be static.
  3993. * Only programmed at power up.
  3994. * 0: generate pulse style sw interrupts
  3995. * 1: generate level style sw interrupts
  3996. * b'16:31 - intr_timer_th:
  3997. * The timer init value when timer is idle or is
  3998. * initialized to start downcounting.
  3999. * In 8us units (to cover a range of 0 to 524 ms)
  4000. * dword12 - b'0:15 - intr_low_threshold:
  4001. * Used only by Consumer ring to generate ring_sw_int_p.
  4002. * Ring entries low threshold water mark, that is used
  4003. * in combination with the interrupt timer as well as
  4004. * the the clearing of the level interrupt.
  4005. * b'16:18 - prefetch_timer_cfg:
  4006. * Used only by Consumer ring to set timer mode to
  4007. * support Application prefetch handling.
  4008. * The external tail offset/pointer will be updated
  4009. * at following intervals:
  4010. * 3'b000: (Prefetch feature disabled; used only for debug)
  4011. * 3'b001: 1 usec
  4012. * 3'b010: 4 usec
  4013. * 3'b011: 8 usec (default)
  4014. * 3'b100: 16 usec
  4015. * Others: Reserverd
  4016. * b'19 - response_required:
  4017. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4018. * b'20 - ipa_drop_flag:
  4019. Indicates that host will config ipa drop threshold percentage
  4020. * b'21:31 - reserved: reserved for future use
  4021. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4022. * b'8:15 - ipa drop high threshold percentage:
  4023. * b'16:31 - Reserved
  4024. */
  4025. PREPACK struct htt_sring_setup_t {
  4026. A_UINT32 msg_type: 8,
  4027. pdev_id: 8,
  4028. ring_id: 8,
  4029. ring_type: 8;
  4030. A_UINT32 ring_base_addr_lo;
  4031. A_UINT32 ring_base_addr_hi;
  4032. A_UINT32 ring_size: 16,
  4033. ring_entry_size: 8,
  4034. ring_misc_cfg_flag: 8;
  4035. A_UINT32 ring_head_offset32_remote_addr_lo;
  4036. A_UINT32 ring_head_offset32_remote_addr_hi;
  4037. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4038. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4039. A_UINT32 ring_msi_addr_lo;
  4040. A_UINT32 ring_msi_addr_hi;
  4041. A_UINT32 ring_msi_data;
  4042. A_UINT32 intr_batch_counter_th: 15,
  4043. sw_intr_mode: 1,
  4044. intr_timer_th: 16;
  4045. A_UINT32 intr_low_threshold: 16,
  4046. prefetch_timer_cfg: 3,
  4047. response_required: 1,
  4048. ipa_drop_flag: 1,
  4049. reserved1: 11;
  4050. A_UINT32 ipa_drop_low_threshold: 8,
  4051. ipa_drop_high_threshold: 8,
  4052. reserved: 16;
  4053. } POSTPACK;
  4054. enum htt_srng_ring_type {
  4055. HTT_HW_TO_SW_RING = 0,
  4056. HTT_SW_TO_HW_RING,
  4057. HTT_SW_TO_SW_RING,
  4058. /* Insert new ring types above this line */
  4059. };
  4060. enum htt_srng_ring_id {
  4061. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4062. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4063. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4064. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4065. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4066. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4067. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4068. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4069. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4070. /* Add Other SRING which can't be directly configured by host software above this line */
  4071. };
  4072. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4073. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4074. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4075. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4076. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4077. HTT_SRING_SETUP_PDEV_ID_S)
  4078. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4079. do { \
  4080. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4081. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4082. } while (0)
  4083. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4084. #define HTT_SRING_SETUP_RING_ID_S 16
  4085. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4086. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4087. HTT_SRING_SETUP_RING_ID_S)
  4088. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4089. do { \
  4090. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4091. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4092. } while (0)
  4093. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4094. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4095. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4096. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4097. HTT_SRING_SETUP_RING_TYPE_S)
  4098. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4101. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4102. } while (0)
  4103. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4104. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4105. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4106. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4107. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4108. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4111. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4112. } while (0)
  4113. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4114. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4115. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4116. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4117. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4118. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4121. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4122. } while (0)
  4123. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4124. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4125. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4126. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4127. HTT_SRING_SETUP_RING_SIZE_S)
  4128. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4131. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4132. } while (0)
  4133. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4134. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4135. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4136. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4137. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4138. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4141. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4142. } while (0)
  4143. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4144. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4145. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4146. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4147. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4148. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4151. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4152. } while (0)
  4153. /* This control bit is applicable to only Producer, which updates Ring ID field
  4154. * of each descriptor before pushing into the ring.
  4155. * 0: updates ring_id(default)
  4156. * 1: ring_id updating disabled */
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4160. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4161. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4162. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4165. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4166. } while (0)
  4167. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4168. * of each descriptor before pushing into the ring.
  4169. * 0: updates Loopcnt(default)
  4170. * 1: Loopcnt updating disabled */
  4171. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4173. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4175. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4176. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4180. } while (0)
  4181. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4182. * into security_id port of GXI/AXI. */
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4187. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4192. } while (0)
  4193. /* During MSI write operation, SRNG drives value of this register bit into
  4194. * swap bit of GXI/AXI. */
  4195. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4199. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4204. } while (0)
  4205. /* During Pointer write operation, SRNG drives value of this register bit into
  4206. * swap bit of GXI/AXI. */
  4207. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4210. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4211. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4215. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4216. } while (0)
  4217. /* During any data or TLV write operation, SRNG drives value of this register
  4218. * bit into swap bit of GXI/AXI. */
  4219. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4222. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4223. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4227. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4228. } while (0)
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4230. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4231. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4232. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4233. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4234. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4235. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4236. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4239. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4240. } while (0)
  4241. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4242. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4243. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4244. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4245. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4246. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4249. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4250. } while (0)
  4251. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4252. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4253. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4254. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4255. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4256. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4259. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4260. } while (0)
  4261. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4262. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4263. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4264. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4265. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4266. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4269. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4270. } while (0)
  4271. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4272. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4273. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4274. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4275. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4276. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4279. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4280. } while (0)
  4281. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4282. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4283. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4284. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4285. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4286. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4289. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4290. } while (0)
  4291. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4292. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4293. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4294. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4295. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4296. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4299. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4300. } while (0)
  4301. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4302. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4303. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4304. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4305. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4306. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4309. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4310. } while (0)
  4311. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4312. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4313. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4314. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4315. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4316. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4319. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4320. } while (0)
  4321. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4322. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4323. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4324. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4325. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4326. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4329. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4330. } while (0)
  4331. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4332. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4333. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4334. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4335. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4336. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4339. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4340. } while (0)
  4341. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4342. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4343. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4344. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4345. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4346. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4349. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4350. } while (0)
  4351. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4352. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4353. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4354. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4355. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4356. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4359. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4360. } while (0)
  4361. /**
  4362. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4363. *
  4364. * @details
  4365. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4366. * configure RXDMA rings.
  4367. * The configuration is per ring based and includes both packet subtypes
  4368. * and PPDU/MPDU TLVs.
  4369. *
  4370. * The message would appear as follows:
  4371. *
  4372. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4373. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4374. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4375. * |-------------------------------------------------------------------|
  4376. * | rsvd2 | ring_buffer_size |
  4377. * |-------------------------------------------------------------------|
  4378. * | packet_type_enable_flags_0 |
  4379. * |-------------------------------------------------------------------|
  4380. * | packet_type_enable_flags_1 |
  4381. * |-------------------------------------------------------------------|
  4382. * | packet_type_enable_flags_2 |
  4383. * |-------------------------------------------------------------------|
  4384. * | packet_type_enable_flags_3 |
  4385. * |-------------------------------------------------------------------|
  4386. * | tlv_filter_in_flags |
  4387. * |-------------------------------------------------------------------|
  4388. * | rx_header_offset | rx_packet_offset |
  4389. * |-------------------------------------------------------------------|
  4390. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4391. * |-------------------------------------------------------------------|
  4392. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4393. * |-------------------------------------------------------------------|
  4394. * | rsvd3 | rx_attention_offset |
  4395. * |-------------------------------------------------------------------|
  4396. * | rsvd4 | mo| fp| rx_drop_threshold |
  4397. * | |ndp|ndp| |
  4398. * |-------------------------------------------------------------------|
  4399. * Where:
  4400. * PS = pkt_swap
  4401. * SS = status_swap
  4402. * OV = rx_offsets_valid
  4403. * DT = drop_thresh_valid
  4404. * The message is interpreted as follows:
  4405. * dword0 - b'0:7 - msg_type: This will be set to
  4406. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4407. * b'8:15 - pdev_id:
  4408. * 0 (for rings at SOC/UMAC level),
  4409. * 1/2/3 mac id (for rings at LMAC level)
  4410. * b'16:23 - ring_id : Identify the ring to configure.
  4411. * More details can be got from enum htt_srng_ring_id
  4412. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4413. * BUF_RING_CFG_0 defs within HW .h files,
  4414. * e.g. wmac_top_reg_seq_hwioreg.h
  4415. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4416. * BUF_RING_CFG_0 defs within HW .h files,
  4417. * e.g. wmac_top_reg_seq_hwioreg.h
  4418. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4419. * configuration fields are valid
  4420. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4421. * rx_drop_threshold field is valid
  4422. * b'28:31 - rsvd1: reserved for future use
  4423. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4424. * in byte units.
  4425. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4426. * - b'16:31 - rsvd2: Reserved for future use
  4427. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4428. * Enable MGMT packet from 0b0000 to 0b1001
  4429. * bits from low to high: FP, MD, MO - 3 bits
  4430. * FP: Filter_Pass
  4431. * MD: Monitor_Direct
  4432. * MO: Monitor_Other
  4433. * 10 mgmt subtypes * 3 bits -> 30 bits
  4434. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4435. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4436. * Enable MGMT packet from 0b1010 to 0b1111
  4437. * bits from low to high: FP, MD, MO - 3 bits
  4438. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4439. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4440. * Enable CTRL packet from 0b0000 to 0b1001
  4441. * bits from low to high: FP, MD, MO - 3 bits
  4442. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4443. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4444. * Enable CTRL packet from 0b1010 to 0b1111,
  4445. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4446. * bits from low to high: FP, MD, MO - 3 bits
  4447. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4448. * dword6 - b'0:31 - tlv_filter_in_flags:
  4449. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4450. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4451. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4452. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4453. * A value of 0 will be considered as ignore this config.
  4454. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4455. * e.g. wmac_top_reg_seq_hwioreg.h
  4456. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4457. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4458. * A value of 0 will be considered as ignore this config.
  4459. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4460. * e.g. wmac_top_reg_seq_hwioreg.h
  4461. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4462. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4463. * A value of 0 will be considered as ignore this config.
  4464. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4465. * e.g. wmac_top_reg_seq_hwioreg.h
  4466. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4467. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4468. * A value of 0 will be considered as ignore this config.
  4469. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4470. * e.g. wmac_top_reg_seq_hwioreg.h
  4471. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4472. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4473. * A value of 0 will be considered as ignore this config.
  4474. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4475. * e.g. wmac_top_reg_seq_hwioreg.h
  4476. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4477. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4478. * A value of 0 will be considered as ignore this config.
  4479. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4480. * e.g. wmac_top_reg_seq_hwioreg.h
  4481. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4482. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4483. * A value of 0 will be considered as ignore this config.
  4484. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4485. * e.g. wmac_top_reg_seq_hwioreg.h
  4486. * - b'16:31 - rsvd3 for future use
  4487. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4488. * to source rings. Consumer drops packets if the available
  4489. * words in the ring falls below the configured threshold
  4490. * value.
  4491. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4492. * by host. 1 -> subscribed
  4493. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4494. * by host. 1 -> subscribed
  4495. */
  4496. PREPACK struct htt_rx_ring_selection_cfg_t {
  4497. A_UINT32 msg_type: 8,
  4498. pdev_id: 8,
  4499. ring_id: 8,
  4500. status_swap: 1,
  4501. pkt_swap: 1,
  4502. rx_offsets_valid: 1,
  4503. drop_thresh_valid: 1,
  4504. rsvd1: 4;
  4505. A_UINT32 ring_buffer_size: 16,
  4506. rsvd2: 16;
  4507. A_UINT32 packet_type_enable_flags_0;
  4508. A_UINT32 packet_type_enable_flags_1;
  4509. A_UINT32 packet_type_enable_flags_2;
  4510. A_UINT32 packet_type_enable_flags_3;
  4511. A_UINT32 tlv_filter_in_flags;
  4512. A_UINT32 rx_packet_offset: 16,
  4513. rx_header_offset: 16;
  4514. A_UINT32 rx_mpdu_end_offset: 16,
  4515. rx_mpdu_start_offset: 16;
  4516. A_UINT32 rx_msdu_end_offset: 16,
  4517. rx_msdu_start_offset: 16;
  4518. A_UINT32 rx_attn_offset: 16,
  4519. rsvd3: 16;
  4520. A_UINT32 rx_drop_threshold: 10,
  4521. fp_ndp: 1,
  4522. mo_ndp: 1,
  4523. rsvd4: 20;
  4524. } POSTPACK;
  4525. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4526. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4527. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4528. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4529. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4530. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4531. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4535. } while (0)
  4536. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4537. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4538. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4539. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4540. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4541. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4545. } while (0)
  4546. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4547. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4548. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4549. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4550. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4551. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4555. } while (0)
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4559. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4560. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4565. } while (0)
  4566. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4567. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4569. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4570. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4571. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4575. } while (0)
  4576. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4577. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4578. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4579. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4580. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4581. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4582. do { \
  4583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4585. } while (0)
  4586. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4587. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4588. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4589. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4590. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4591. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4592. do { \
  4593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4595. } while (0)
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4599. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4600. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4602. do { \
  4603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4605. } while (0)
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4609. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4610. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4612. do { \
  4613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4615. } while (0)
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4619. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4620. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4622. do { \
  4623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4625. } while (0)
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4629. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4630. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4632. do { \
  4633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4635. } while (0)
  4636. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4637. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4638. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4639. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4640. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4641. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4642. do { \
  4643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4645. } while (0)
  4646. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4647. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4648. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4649. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4650. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4651. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4652. do { \
  4653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4655. } while (0)
  4656. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4657. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4658. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4659. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4660. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4662. do { \
  4663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4665. } while (0)
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4667. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4668. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4669. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4670. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4672. do { \
  4673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4675. } while (0)
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4677. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4679. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4680. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4682. do { \
  4683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4685. } while (0)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4687. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4689. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4690. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4692. do { \
  4693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4695. } while (0)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4697. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4699. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4700. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4702. do { \
  4703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4705. } while (0)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4707. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4709. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4710. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4712. do { \
  4713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4715. } while (0)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4717. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4719. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4720. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4722. do { \
  4723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4725. } while (0)
  4726. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4727. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4728. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4729. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4730. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4731. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4732. do { \
  4733. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4734. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4735. } while (0)
  4736. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4737. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4738. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4739. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4740. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4741. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4745. } while (0)
  4746. /*
  4747. * Subtype based MGMT frames enable bits.
  4748. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4749. */
  4750. /* association request */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4757. /* association response */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4764. /* Reassociation request */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4771. /* Reassociation response */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4778. /* Probe request */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4785. /* Probe response */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4792. /* Timing Advertisement */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4799. /* Reserved */
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4806. /* Beacon */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4813. /* ATIM */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4820. /* Disassociation */
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4827. /* Authentication */
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4834. /* Deauthentication */
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4841. /* Action */
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4848. /* Action No Ack */
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4855. /* Reserved */
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4862. /*
  4863. * Subtype based CTRL frames enable bits.
  4864. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4865. */
  4866. /* Reserved */
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4873. /* Reserved */
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4880. /* Reserved */
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4887. /* Reserved */
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4894. /* Reserved */
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4901. /* Reserved */
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4908. /* Reserved */
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4915. /* Control Wrapper */
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4922. /* Block Ack Request */
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4929. /* Block Ack*/
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4936. /* PS-POLL */
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4943. /* RTS */
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4950. /* CTS */
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4957. /* ACK */
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4964. /* CF-END */
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4971. /* CF-END + CF-ACK */
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4978. /* Multicast data */
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4985. /* Unicast data */
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4992. /* NULL data */
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(httsym, value); \
  5002. (word) |= (value) << httsym##_S; \
  5003. } while (0)
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5005. (((word) & httsym##_M) >> httsym##_S)
  5006. #define htt_rx_ring_pkt_enable_subtype_set( \
  5007. word, flag, mode, type, subtype, val) \
  5008. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5009. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5010. #define htt_rx_ring_pkt_enable_subtype_get( \
  5011. word, flag, mode, type, subtype) \
  5012. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5013. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5014. /* Definition to filter in TLVs */
  5015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5041. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5042. do { \
  5043. HTT_CHECK_SET_VAL(httsym, enable); \
  5044. (word) |= (enable) << httsym##_S; \
  5045. } while (0)
  5046. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5047. (((word) & httsym##_M) >> httsym##_S)
  5048. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5049. HTT_RX_RING_TLV_ENABLE_SET( \
  5050. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5051. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5052. HTT_RX_RING_TLV_ENABLE_GET( \
  5053. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5054. /**
  5055. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5056. * host --> target Receive Flow Steering configuration message definition.
  5057. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5058. * The reason for this is we want RFS to be configured and ready before MAC
  5059. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5060. *
  5061. * |31 24|23 16|15 9|8|7 0|
  5062. * |----------------+----------------+----------------+----------------|
  5063. * | reserved |E| msg type |
  5064. * |-------------------------------------------------------------------|
  5065. * Where E = RFS enable flag
  5066. *
  5067. * The RFS_CONFIG message consists of a single 4-byte word.
  5068. *
  5069. * Header fields:
  5070. * - MSG_TYPE
  5071. * Bits 7:0
  5072. * Purpose: identifies this as a RFS config msg
  5073. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5074. * - RFS_CONFIG
  5075. * Bit 8
  5076. * Purpose: Tells target whether to enable (1) or disable (0)
  5077. * flow steering feature when sending rx indication messages to host
  5078. */
  5079. #define HTT_H2T_RFS_CONFIG_M 0x100
  5080. #define HTT_H2T_RFS_CONFIG_S 8
  5081. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5082. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5083. HTT_H2T_RFS_CONFIG_S)
  5084. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5085. do { \
  5086. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5087. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5088. } while (0)
  5089. #define HTT_RFS_CFG_REQ_BYTES 4
  5090. /**
  5091. * @brief host -> target FW extended statistics retrieve
  5092. *
  5093. * @details
  5094. * The following field definitions describe the format of the HTT host
  5095. * to target FW extended stats retrieve message.
  5096. * The message specifies the type of stats the host wants to retrieve.
  5097. *
  5098. * |31 24|23 16|15 8|7 0|
  5099. * |-----------------------------------------------------------|
  5100. * | reserved | stats type | pdev_mask | msg type |
  5101. * |-----------------------------------------------------------|
  5102. * | config param [0] |
  5103. * |-----------------------------------------------------------|
  5104. * | config param [1] |
  5105. * |-----------------------------------------------------------|
  5106. * | config param [2] |
  5107. * |-----------------------------------------------------------|
  5108. * | config param [3] |
  5109. * |-----------------------------------------------------------|
  5110. * | reserved |
  5111. * |-----------------------------------------------------------|
  5112. * | cookie LSBs |
  5113. * |-----------------------------------------------------------|
  5114. * | cookie MSBs |
  5115. * |-----------------------------------------------------------|
  5116. * Header fields:
  5117. * - MSG_TYPE
  5118. * Bits 7:0
  5119. * Purpose: identifies this is a extended stats upload request message
  5120. * Value: 0x10
  5121. * - PDEV_MASK
  5122. * Bits 8:15
  5123. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5124. * Value: This is a overloaded field, refer to usage and interpretation of
  5125. * PDEV in interface document.
  5126. * Bit 8 : Reserved for SOC stats
  5127. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5128. * Indicates MACID_MASK in DBS
  5129. * - STATS_TYPE
  5130. * Bits 23:16
  5131. * Purpose: identifies which FW statistics to upload
  5132. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5133. * - Reserved
  5134. * Bits 31:24
  5135. * - CONFIG_PARAM [0]
  5136. * Bits 31:0
  5137. * Purpose: give an opaque configuration value to the specified stats type
  5138. * Value: stats-type specific configuration value
  5139. * Refer to htt_stats.h for interpretation for each stats sub_type
  5140. * - CONFIG_PARAM [1]
  5141. * Bits 31:0
  5142. * Purpose: give an opaque configuration value to the specified stats type
  5143. * Value: stats-type specific configuration value
  5144. * Refer to htt_stats.h for interpretation for each stats sub_type
  5145. * - CONFIG_PARAM [2]
  5146. * Bits 31:0
  5147. * Purpose: give an opaque configuration value to the specified stats type
  5148. * Value: stats-type specific configuration value
  5149. * Refer to htt_stats.h for interpretation for each stats sub_type
  5150. * - CONFIG_PARAM [3]
  5151. * Bits 31:0
  5152. * Purpose: give an opaque configuration value to the specified stats type
  5153. * Value: stats-type specific configuration value
  5154. * Refer to htt_stats.h for interpretation for each stats sub_type
  5155. * - Reserved [31:0] for future use.
  5156. * - COOKIE_LSBS
  5157. * Bits 31:0
  5158. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5159. * message with its preceding host->target stats request message.
  5160. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5161. * - COOKIE_MSBS
  5162. * Bits 31:0
  5163. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5164. * message with its preceding host->target stats request message.
  5165. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5166. */
  5167. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5168. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5169. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5170. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5171. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5172. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5173. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5174. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5175. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5176. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5177. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5178. do { \
  5179. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5180. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5181. } while (0)
  5182. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5183. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5184. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5185. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5186. do { \
  5187. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5188. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5189. } while (0)
  5190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5191. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5192. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5193. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5194. do { \
  5195. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5196. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5197. } while (0)
  5198. /**
  5199. * @brief host -> target FW PPDU_STATS request message
  5200. *
  5201. * @details
  5202. * The following field definitions describe the format of the HTT host
  5203. * to target FW for PPDU_STATS_CFG msg.
  5204. * The message allows the host to configure the PPDU_STATS_IND messages
  5205. * produced by the target.
  5206. *
  5207. * |31 24|23 16|15 8|7 0|
  5208. * |-----------------------------------------------------------|
  5209. * | REQ bit mask | pdev_mask | msg type |
  5210. * |-----------------------------------------------------------|
  5211. * Header fields:
  5212. * - MSG_TYPE
  5213. * Bits 7:0
  5214. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5215. * Value: 0x11
  5216. * - PDEV_MASK
  5217. * Bits 8:15
  5218. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5219. * Value: This is a overloaded field, refer to usage and interpretation of
  5220. * PDEV in interface document.
  5221. * Bit 8 : Reserved for SOC stats
  5222. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5223. * Indicates MACID_MASK in DBS
  5224. * - REQ_TLV_BIT_MASK
  5225. * Bits 16:31
  5226. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5227. * needs to be included in the target's PPDU_STATS_IND messages.
  5228. * Value: refer htt_ppdu_stats_tlv_tag_t
  5229. *
  5230. */
  5231. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5232. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5233. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5234. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5235. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5236. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5237. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5238. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5239. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5240. do { \
  5241. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5242. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5243. } while (0)
  5244. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5245. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5246. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5247. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5248. do { \
  5249. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5250. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5251. } while (0)
  5252. /**
  5253. * @brief Host-->target HTT RX FSE setup message
  5254. * @details
  5255. * Through this message, the host will provide details of the flow tables
  5256. * in host DDR along with hash keys.
  5257. * This message can be sent per SOC or per PDEV, which is differentiated
  5258. * by pdev id values.
  5259. * The host will allocate flow search table and sends table size,
  5260. * physical DMA address of flow table, and hash keys to firmware to
  5261. * program into the RXOLE FSE HW block.
  5262. *
  5263. * The following field definitions describe the format of the RX FSE setup
  5264. * message sent from the host to target
  5265. *
  5266. * Header fields:
  5267. * dword0 - b'7:0 - msg_type: This will be set to
  5268. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5269. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5270. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5271. * pdev's LMAC ring.
  5272. * b'31:16 - reserved : Reserved for future use
  5273. * dword1 - b'19:0 - number of records: This field indicates the number of
  5274. * entries in the flow table. For example: 8k number of
  5275. * records is equivalent to
  5276. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5277. * b'27:20 - max search: This field specifies the skid length to FSE
  5278. * parser HW module whenever match is not found at the
  5279. * exact index pointed by hash.
  5280. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5281. * Refer htt_ip_da_sa_prefix below for more details.
  5282. * b'31:30 - reserved: Reserved for future use
  5283. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5284. * table allocated by host in DDR
  5285. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5286. * table allocated by host in DDR
  5287. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5288. * entry hashing
  5289. *
  5290. *
  5291. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5292. * |---------------------------------------------------------------|
  5293. * | reserved | pdev_id | MSG_TYPE |
  5294. * |---------------------------------------------------------------|
  5295. * |resvd|IPDSA| max_search | Number of records |
  5296. * |---------------------------------------------------------------|
  5297. * | base address lo |
  5298. * |---------------------------------------------------------------|
  5299. * | base address high |
  5300. * |---------------------------------------------------------------|
  5301. * | toeplitz key 31_0 |
  5302. * |---------------------------------------------------------------|
  5303. * | toeplitz key 63_32 |
  5304. * |---------------------------------------------------------------|
  5305. * | toeplitz key 95_64 |
  5306. * |---------------------------------------------------------------|
  5307. * | toeplitz key 127_96 |
  5308. * |---------------------------------------------------------------|
  5309. * | toeplitz key 159_128 |
  5310. * |---------------------------------------------------------------|
  5311. * | toeplitz key 191_160 |
  5312. * |---------------------------------------------------------------|
  5313. * | toeplitz key 223_192 |
  5314. * |---------------------------------------------------------------|
  5315. * | toeplitz key 255_224 |
  5316. * |---------------------------------------------------------------|
  5317. * | toeplitz key 287_256 |
  5318. * |---------------------------------------------------------------|
  5319. * | reserved | toeplitz key 314_288(26:0 bits) |
  5320. * |---------------------------------------------------------------|
  5321. * where:
  5322. * IPDSA = ip_da_sa
  5323. */
  5324. /**
  5325. * @brief: htt_ip_da_sa_prefix
  5326. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5327. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5328. * documentation per RFC3849
  5329. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5330. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5331. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5332. */
  5333. enum htt_ip_da_sa_prefix {
  5334. HTT_RX_IPV6_20010db8,
  5335. HTT_RX_IPV4_MAPPED_IPV6,
  5336. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5337. HTT_RX_IPV6_64FF9B,
  5338. };
  5339. /**
  5340. * @brief Host-->target HTT RX FISA configure and enable
  5341. * @details
  5342. * The host will send this command down to configure and enable the FISA
  5343. * operational params.
  5344. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5345. * register.
  5346. * Should configure both the MACs.
  5347. *
  5348. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5349. *
  5350. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5351. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5352. * pdev's LMAC ring.
  5353. * b'31:16 - reserved : Reserved for future use
  5354. *
  5355. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5356. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5357. * packets. 1 flow search will be skipped
  5358. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5359. * tcp,udp packets
  5360. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5361. * calculation
  5362. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5363. * calculation
  5364. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5365. * calculation
  5366. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5367. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5368. * length
  5369. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5370. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5371. * length
  5372. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5373. * num jump
  5374. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5375. * num jump
  5376. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5377. * data type switch has happend for MPDU Sequence num jump
  5378. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5379. * for MPDU Sequence num jump
  5380. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5381. * for decrypt errors
  5382. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5383. * while aggregating a msdu
  5384. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5385. * The aggregation is done until (number of MSDUs aggregated
  5386. * < LIMIT + 1)
  5387. * b'31:18 - Reserved
  5388. *
  5389. * fisa_control_value - 32bit value FW can write to register
  5390. *
  5391. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5392. * Threshold value for FISA timeout (units are microseconds).
  5393. * When the global timestamp exceeds this threshold, FISA
  5394. * aggregation will be restarted.
  5395. * A value of 0 means timeout is disabled.
  5396. * Compare the threshold register with timestamp field in
  5397. * flow entry to generate timeout for the flow.
  5398. *
  5399. * |31 18 |17 16|15 8|7 0|
  5400. * |-------------------------------------------------------------|
  5401. * | reserved | pdev_mask | msg type |
  5402. * |-------------------------------------------------------------|
  5403. * | reserved | FISA_CTRL |
  5404. * |-------------------------------------------------------------|
  5405. * | FISA_TIMEOUT_THRESH |
  5406. * |-------------------------------------------------------------|
  5407. */
  5408. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5409. A_UINT32 msg_type:8,
  5410. pdev_id:8,
  5411. reserved0:16;
  5412. /**
  5413. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5414. * [17:0]
  5415. */
  5416. union {
  5417. /*
  5418. * fisa_control_bits structure is deprecated.
  5419. * Please use fisa_control_bits_v2 going forward.
  5420. */
  5421. struct {
  5422. A_UINT32 fisa_enable: 1,
  5423. ipsec_skip_search: 1,
  5424. nontcp_skip_search: 1,
  5425. add_ipv4_fixed_hdr_len: 1,
  5426. add_ipv6_fixed_hdr_len: 1,
  5427. add_tcp_fixed_hdr_len: 1,
  5428. add_udp_hdr_len: 1,
  5429. chksum_cum_ip_len_en: 1,
  5430. disable_tid_check: 1,
  5431. disable_ta_check: 1,
  5432. disable_qos_check: 1,
  5433. disable_raw_check: 1,
  5434. disable_decrypt_err_check: 1,
  5435. disable_msdu_drop_check: 1,
  5436. fisa_aggr_limit: 4,
  5437. reserved: 14;
  5438. } fisa_control_bits;
  5439. struct {
  5440. A_UINT32 fisa_enable: 1,
  5441. fisa_aggr_limit: 4,
  5442. reserved: 27;
  5443. } fisa_control_bits_v2;
  5444. A_UINT32 fisa_control_value;
  5445. } u_fisa_control;
  5446. /**
  5447. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5448. * timeout threshold for aggregation. Unit in usec.
  5449. * [31:0]
  5450. */
  5451. A_UINT32 fisa_timeout_threshold;
  5452. } POSTPACK;
  5453. /* DWord 0: pdev-ID */
  5454. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5455. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5456. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5457. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5458. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5459. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5462. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5463. } while (0)
  5464. /* Dword 1: fisa_control_value fisa config */
  5465. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5466. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5467. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5468. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5469. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5470. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5471. do { \
  5472. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5473. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5474. } while (0)
  5475. /* Dword 1: fisa_control_value ipsec_skip_search */
  5476. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5477. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5478. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5479. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5480. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5481. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5485. } while (0)
  5486. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5487. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5488. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5489. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5490. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5491. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5492. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5495. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5496. } while (0)
  5497. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5498. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5499. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5500. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5501. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5502. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5503. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5504. do { \
  5505. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5506. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5507. } while (0)
  5508. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5509. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5510. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5511. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5512. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5513. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5514. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5517. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5518. } while (0)
  5519. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5520. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5521. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5522. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5523. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5524. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5525. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5526. do { \
  5527. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5528. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5529. } while (0)
  5530. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5531. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5532. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5533. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5534. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5535. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5536. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5537. do { \
  5538. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5539. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5540. } while (0)
  5541. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5542. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5543. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5544. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5545. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5546. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5547. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5548. do { \
  5549. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5550. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5551. } while (0)
  5552. /* Dword 1: fisa_control_value disable_tid_check */
  5553. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5554. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5555. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5556. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5557. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5558. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5562. } while (0)
  5563. /* Dword 1: fisa_control_value disable_ta_check */
  5564. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5565. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5566. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5567. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5568. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5569. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5573. } while (0)
  5574. /* Dword 1: fisa_control_value disable_qos_check */
  5575. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5576. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5577. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5578. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5579. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5580. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5581. do { \
  5582. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5583. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5584. } while (0)
  5585. /* Dword 1: fisa_control_value disable_raw_check */
  5586. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5587. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5588. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5589. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5590. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5591. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5595. } while (0)
  5596. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5598. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5599. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5600. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5601. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5603. do { \
  5604. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5605. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5606. } while (0)
  5607. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5609. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5610. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5611. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5612. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5616. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5617. } while (0)
  5618. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5619. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5620. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5621. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5622. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5623. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5624. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5625. do { \
  5626. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5627. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5628. } while (0)
  5629. /* Dword 1: fisa_control_value fisa config */
  5630. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5631. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5632. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5633. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5634. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5635. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5636. do { \
  5637. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5638. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5639. } while (0)
  5640. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5641. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5642. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5643. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5644. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5645. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5646. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5647. do { \
  5648. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5649. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5650. } while (0)
  5651. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5652. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5653. pdev_id:8,
  5654. reserved0:16;
  5655. A_UINT32 num_records:20,
  5656. max_search:8,
  5657. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5658. reserved1:2;
  5659. A_UINT32 base_addr_lo;
  5660. A_UINT32 base_addr_hi;
  5661. A_UINT32 toeplitz31_0;
  5662. A_UINT32 toeplitz63_32;
  5663. A_UINT32 toeplitz95_64;
  5664. A_UINT32 toeplitz127_96;
  5665. A_UINT32 toeplitz159_128;
  5666. A_UINT32 toeplitz191_160;
  5667. A_UINT32 toeplitz223_192;
  5668. A_UINT32 toeplitz255_224;
  5669. A_UINT32 toeplitz287_256;
  5670. A_UINT32 toeplitz314_288:27,
  5671. reserved2:5;
  5672. } POSTPACK;
  5673. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5674. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5675. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5676. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5677. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5678. /* DWORD 0: Pdev ID */
  5679. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5680. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5681. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5682. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5683. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5684. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5687. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5688. } while (0)
  5689. /* DWORD 1:num of records */
  5690. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5691. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5692. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5693. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5694. HTT_RX_FSE_SETUP_NUM_REC_S)
  5695. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5696. do { \
  5697. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5698. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5699. } while (0)
  5700. /* DWORD 1:max_search */
  5701. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5702. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5703. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5704. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5705. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5706. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5707. do { \
  5708. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5709. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5710. } while (0)
  5711. /* DWORD 1:ip_da_sa prefix */
  5712. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5713. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5714. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5715. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5716. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5717. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5718. do { \
  5719. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5720. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5721. } while (0)
  5722. /* DWORD 2: Base Address LO */
  5723. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5724. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5725. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5726. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5727. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5728. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5729. do { \
  5730. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5731. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5732. } while (0)
  5733. /* DWORD 3: Base Address High */
  5734. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5735. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5736. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5737. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5738. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5739. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5742. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5743. } while (0)
  5744. /* DWORD 4-12: Hash Value */
  5745. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5746. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5747. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5748. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5749. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5750. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5751. do { \
  5752. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5753. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5754. } while (0)
  5755. /* DWORD 13: Hash Value 314:288 bits */
  5756. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5757. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5758. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5759. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5760. do { \
  5761. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5762. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5763. } while (0)
  5764. /**
  5765. * @brief Host-->target HTT RX FSE operation message
  5766. * @details
  5767. * The host will send this Flow Search Engine (FSE) operation message for
  5768. * every flow add/delete operation.
  5769. * The FSE operation includes FSE full cache invalidation or individual entry
  5770. * invalidation.
  5771. * This message can be sent per SOC or per PDEV which is differentiated
  5772. * by pdev id values.
  5773. *
  5774. * |31 16|15 8|7 1|0|
  5775. * |-------------------------------------------------------------|
  5776. * | reserved | pdev_id | MSG_TYPE |
  5777. * |-------------------------------------------------------------|
  5778. * | reserved | operation |I|
  5779. * |-------------------------------------------------------------|
  5780. * | ip_src_addr_31_0 |
  5781. * |-------------------------------------------------------------|
  5782. * | ip_src_addr_63_32 |
  5783. * |-------------------------------------------------------------|
  5784. * | ip_src_addr_95_64 |
  5785. * |-------------------------------------------------------------|
  5786. * | ip_src_addr_127_96 |
  5787. * |-------------------------------------------------------------|
  5788. * | ip_dst_addr_31_0 |
  5789. * |-------------------------------------------------------------|
  5790. * | ip_dst_addr_63_32 |
  5791. * |-------------------------------------------------------------|
  5792. * | ip_dst_addr_95_64 |
  5793. * |-------------------------------------------------------------|
  5794. * | ip_dst_addr_127_96 |
  5795. * |-------------------------------------------------------------|
  5796. * | l4_dst_port | l4_src_port |
  5797. * | (32-bit SPI incase of IPsec) |
  5798. * |-------------------------------------------------------------|
  5799. * | reserved | l4_proto |
  5800. * |-------------------------------------------------------------|
  5801. *
  5802. * where I is 1-bit ipsec_valid.
  5803. *
  5804. * The following field definitions describe the format of the RX FSE operation
  5805. * message sent from the host to target for every add/delete flow entry to flow
  5806. * table.
  5807. *
  5808. * Header fields:
  5809. * dword0 - b'7:0 - msg_type: This will be set to
  5810. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5811. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5812. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5813. * specified pdev's LMAC ring.
  5814. * b'31:16 - reserved : Reserved for future use
  5815. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5816. * (Internet Protocol Security).
  5817. * IPsec describes the framework for providing security at
  5818. * IP layer. IPsec is defined for both versions of IP:
  5819. * IPV4 and IPV6.
  5820. * Please refer to htt_rx_flow_proto enumeration below for
  5821. * more info.
  5822. * ipsec_valid = 1 for IPSEC packets
  5823. * ipsec_valid = 0 for IP Packets
  5824. * b'7:1 - operation: This indicates types of FSE operation.
  5825. * Refer to htt_rx_fse_operation enumeration:
  5826. * 0 - No Cache Invalidation required
  5827. * 1 - Cache invalidate only one entry given by IP
  5828. * src/dest address at DWORD[2:9]
  5829. * 2 - Complete FSE Cache Invalidation
  5830. * 3 - FSE Disable
  5831. * 4 - FSE Enable
  5832. * b'31:8 - reserved: Reserved for future use
  5833. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5834. * for per flow addition/deletion
  5835. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5836. * and the subsequent 3 A_UINT32 will be padding bytes.
  5837. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5838. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5839. * from 0 to 65535 but only 0 to 1023 are designated as
  5840. * well-known ports. Refer to [RFC1700] for more details.
  5841. * This field is valid only if
  5842. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5843. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5844. * range from 0 to 65535 but only 0 to 1023 are designated
  5845. * as well-known ports. Refer to [RFC1700] for more details.
  5846. * This field is valid only if
  5847. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5848. * - SPI (31:0): Security Parameters Index is an
  5849. * identification tag added to the header while using IPsec
  5850. * for tunneling the IP traffici.
  5851. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5852. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5853. * Assigned Internet Protocol Numbers.
  5854. * l4_proto numbers for standard protocol like UDP/TCP
  5855. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5856. * l4_proto = 17 for UDP etc.
  5857. * b'31:8 - reserved: Reserved for future use.
  5858. *
  5859. */
  5860. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5861. A_UINT32 msg_type:8,
  5862. pdev_id:8,
  5863. reserved0:16;
  5864. A_UINT32 ipsec_valid:1,
  5865. operation:7,
  5866. reserved1:24;
  5867. A_UINT32 ip_src_addr_31_0;
  5868. A_UINT32 ip_src_addr_63_32;
  5869. A_UINT32 ip_src_addr_95_64;
  5870. A_UINT32 ip_src_addr_127_96;
  5871. A_UINT32 ip_dest_addr_31_0;
  5872. A_UINT32 ip_dest_addr_63_32;
  5873. A_UINT32 ip_dest_addr_95_64;
  5874. A_UINT32 ip_dest_addr_127_96;
  5875. union {
  5876. A_UINT32 spi;
  5877. struct {
  5878. A_UINT32 l4_src_port:16,
  5879. l4_dest_port:16;
  5880. } ip;
  5881. } u;
  5882. A_UINT32 l4_proto:8,
  5883. reserved:24;
  5884. } POSTPACK;
  5885. /**
  5886. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5887. * @details
  5888. * The host will send this Full monitor mode register configuration message.
  5889. * This message can be sent per SOC or per PDEV which is differentiated
  5890. * by pdev id values.
  5891. *
  5892. * |31 16|15 11|10 8|7 3|2|1|0|
  5893. * |-------------------------------------------------------------|
  5894. * | reserved | pdev_id | MSG_TYPE |
  5895. * |-------------------------------------------------------------|
  5896. * | reserved |Release Ring |N|Z|E|
  5897. * |-------------------------------------------------------------|
  5898. *
  5899. * where E is 1-bit full monitor mode enable/disable.
  5900. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5901. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5902. *
  5903. * The following field definitions describe the format of the full monitor
  5904. * mode configuration message sent from the host to target for each pdev.
  5905. *
  5906. * Header fields:
  5907. * dword0 - b'7:0 - msg_type: This will be set to
  5908. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5909. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5910. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5911. * specified pdev's LMAC ring.
  5912. * b'31:16 - reserved : Reserved for future use.
  5913. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5914. * monitor mode rxdma register is to be enabled or disabled.
  5915. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5916. * additional descriptors at ppdu end for zero mpdus
  5917. * enabled or disabled.
  5918. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5919. * additional descriptors at ppdu end for non zero mpdus
  5920. * enabled or disabled.
  5921. * b'10:3 - release_ring: This indicates the destination ring
  5922. * selection for the descriptor at the end of PPDU
  5923. * 0 - REO ring select
  5924. * 1 - FW ring select
  5925. * 2 - SW ring select
  5926. * 3 - Release ring select
  5927. * Refer to htt_rx_full_mon_release_ring.
  5928. * b'31:11 - reserved for future use
  5929. */
  5930. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5931. A_UINT32 msg_type:8,
  5932. pdev_id:8,
  5933. reserved0:16;
  5934. A_UINT32 full_monitor_mode_enable:1,
  5935. addnl_descs_zero_mpdus_end:1,
  5936. addnl_descs_non_zero_mpdus_end:1,
  5937. release_ring:8,
  5938. reserved1:21;
  5939. } POSTPACK;
  5940. /**
  5941. * Enumeration for full monitor mode destination ring select
  5942. * 0 - REO destination ring select
  5943. * 1 - FW destination ring select
  5944. * 2 - SW destination ring select
  5945. * 3 - Release destination ring select
  5946. */
  5947. enum htt_rx_full_mon_release_ring {
  5948. HTT_RX_MON_RING_REO,
  5949. HTT_RX_MON_RING_FW,
  5950. HTT_RX_MON_RING_SW,
  5951. HTT_RX_MON_RING_RELEASE,
  5952. };
  5953. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5954. /* DWORD 0: Pdev ID */
  5955. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5956. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5957. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5958. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5959. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5960. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5961. do { \
  5962. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5963. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5964. } while (0)
  5965. /* DWORD 1:ENABLE */
  5966. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5967. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5968. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5969. do { \
  5970. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5971. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5972. } while (0)
  5973. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5974. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5975. /* DWORD 1:ZERO_MPDU */
  5976. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5977. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5978. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5979. do { \
  5980. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5981. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5982. } while (0)
  5983. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5984. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5985. /* DWORD 1:NON_ZERO_MPDU */
  5986. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5987. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5988. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5989. do { \
  5990. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5991. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5992. } while (0)
  5993. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5994. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5995. /* DWORD 1:RELEASE_RINGS */
  5996. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5997. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5998. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5999. do { \
  6000. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6001. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6002. } while (0)
  6003. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6004. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6005. /**
  6006. * Enumeration for IP Protocol or IPSEC Protocol
  6007. * IPsec describes the framework for providing security at IP layer.
  6008. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6009. */
  6010. enum htt_rx_flow_proto {
  6011. HTT_RX_FLOW_IP_PROTO,
  6012. HTT_RX_FLOW_IPSEC_PROTO,
  6013. };
  6014. /**
  6015. * Enumeration for FSE Cache Invalidation
  6016. * 0 - No Cache Invalidation required
  6017. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6018. * 2 - Complete FSE Cache Invalidation
  6019. * 3 - FSE Disable
  6020. * 4 - FSE Enable
  6021. */
  6022. enum htt_rx_fse_operation {
  6023. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6024. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6025. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6026. HTT_RX_FSE_DISABLE,
  6027. HTT_RX_FSE_ENABLE,
  6028. };
  6029. /* DWORD 0: Pdev ID */
  6030. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6031. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6032. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6033. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6034. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6035. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6038. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6039. } while (0)
  6040. /* DWORD 1:IP PROTO or IPSEC */
  6041. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6042. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6043. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6044. do { \
  6045. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6046. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6047. } while (0)
  6048. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6049. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6050. /* DWORD 1:FSE Operation */
  6051. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6052. #define HTT_RX_FSE_OPERATION_S 1
  6053. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6054. do { \
  6055. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6056. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6057. } while (0)
  6058. #define HTT_RX_FSE_OPERATION_GET(word) \
  6059. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6060. /* DWORD 2-9:IP Address */
  6061. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6062. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6063. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6064. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6065. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6066. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6067. do { \
  6068. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6069. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6070. } while (0)
  6071. /* DWORD 10:Source Port Number */
  6072. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6073. #define HTT_RX_FSE_SOURCEPORT_S 0
  6074. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6075. do { \
  6076. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6077. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6078. } while (0)
  6079. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6080. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6081. /* DWORD 11:Destination Port Number */
  6082. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6083. #define HTT_RX_FSE_DESTPORT_S 16
  6084. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6085. do { \
  6086. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6087. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6088. } while (0)
  6089. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6090. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6091. /* DWORD 10-11:SPI (In case of IPSEC) */
  6092. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6093. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6094. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6095. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6096. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6097. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6098. do { \
  6099. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6100. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6101. } while (0)
  6102. /* DWORD 12:L4 PROTO */
  6103. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6104. #define HTT_RX_FSE_L4_PROTO_S 0
  6105. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6106. do { \
  6107. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6108. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6109. } while (0)
  6110. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6111. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6112. /**
  6113. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6114. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6115. *
  6116. * |31 24|23 |15 8|7 2|1|0|
  6117. * |----------------+----------------+----------------+----------------|
  6118. * | reserved | pdev_id | msg_type |
  6119. * |---------------------------------+----------------+----------------|
  6120. * | reserved |E|F|
  6121. * |---------------------------------+----------------+----------------|
  6122. * Where E = Configure the target to provide the 3-tuple hash value in
  6123. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6124. * F = Configure the target to provide the 3-tuple hash value in
  6125. * flow_id_toeplitz field of rx_msdu_start tlv
  6126. *
  6127. * The following field definitions describe the format of the 3 tuple hash value
  6128. * message sent from the host to target as part of initialization sequence.
  6129. *
  6130. * Header fields:
  6131. * dword0 - b'7:0 - msg_type: This will be set to
  6132. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6133. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6134. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6135. * specified pdev's LMAC ring.
  6136. * b'31:16 - reserved : Reserved for future use
  6137. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6138. * b'1 - toeplitz_hash_2_or_4_field_enable
  6139. * b'31:2 - reserved : Reserved for future use
  6140. * ---------+------+----------------------------------------------------------
  6141. * bit1 | bit0 | Functionality
  6142. * ---------+------+----------------------------------------------------------
  6143. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6144. * | | in flow_id_toeplitz field
  6145. * ---------+------+----------------------------------------------------------
  6146. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6147. * | | in toeplitz_hash_2_or_4 field
  6148. * ---------+------+----------------------------------------------------------
  6149. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6150. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6151. * ---------+------+----------------------------------------------------------
  6152. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6153. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6154. * | | toeplitz_hash_2_or_4 field
  6155. *----------------------------------------------------------------------------
  6156. */
  6157. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6158. A_UINT32 msg_type :8,
  6159. pdev_id :8,
  6160. reserved0 :16;
  6161. A_UINT32 flow_id_toeplitz_field_enable :1,
  6162. toeplitz_hash_2_or_4_field_enable :1,
  6163. reserved1 :30;
  6164. } POSTPACK;
  6165. /* DWORD0 : pdev_id configuration Macros */
  6166. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6167. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6168. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6169. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6170. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6171. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6172. do { \
  6173. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6174. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6175. } while (0)
  6176. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6177. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6178. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6179. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6180. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6181. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6182. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6185. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6186. } while (0)
  6187. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6188. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6189. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6190. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6191. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6192. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6193. do { \
  6194. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6195. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6196. } while (0)
  6197. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6198. /**
  6199. * @brief HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message
  6200. *
  6201. * @details
  6202. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6203. * provide the physical start address and size of each of the memory
  6204. * areas within host DDR that the target FW may need to access.
  6205. *
  6206. * For example, the host can use this message to allow the target FW
  6207. * to set up access to the host's pools of TQM link descriptors.
  6208. * The message would appear as follows:
  6209. *
  6210. * |31 24|23 16|15 8|7 0|
  6211. * |----------------+----------------+----------------+----------------|
  6212. * | reserved | num_entries | msg_type |
  6213. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6214. * | mem area 0 size |
  6215. * |----------------+----------------+----------------+----------------|
  6216. * | mem area 0 physical_address_lo |
  6217. * |----------------+----------------+----------------+----------------|
  6218. * | mem area 0 physical_address_hi |
  6219. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6220. * | mem area 1 size |
  6221. * |----------------+----------------+----------------+----------------|
  6222. * | mem area 1 physical_address_lo |
  6223. * |----------------+----------------+----------------+----------------|
  6224. * | mem area 1 physical_address_hi |
  6225. * |----------------+----------------+----------------+----------------|
  6226. * ...
  6227. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6228. * | mem area N size |
  6229. * |----------------+----------------+----------------+----------------|
  6230. * | mem area N physical_address_lo |
  6231. * |----------------+----------------+----------------+----------------|
  6232. * | mem area N physical_address_hi |
  6233. * |----------------+----------------+----------------+----------------|
  6234. *
  6235. * The message is interpreted as follows:
  6236. * dword0 - b'0:7 - msg_type: This will be set to
  6237. * HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6238. * b'8:15 - number_entries: Indicated the number of host memory
  6239. * areas specified within the remainder of the message
  6240. * b'16:31 - reserved.
  6241. * dword1 - b'0:31 - memory area 0 size in bytes
  6242. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6243. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6244. * and similar for memory area 1 through memory area N.
  6245. */
  6246. PREPACK struct htt_h2t_host_paddr_size {
  6247. A_UINT32 msg_type: 8,
  6248. num_entries: 8,
  6249. reserved: 16;
  6250. } POSTPACK;
  6251. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6252. A_UINT32 size;
  6253. A_UINT32 physical_address_lo;
  6254. A_UINT32 physical_address_hi;
  6255. } POSTPACK;
  6256. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6257. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6258. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6259. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6260. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6261. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6262. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6263. do { \
  6264. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6265. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6266. } while (0)
  6267. /*=== target -> host messages ===============================================*/
  6268. enum htt_t2h_msg_type {
  6269. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6270. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6271. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6272. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6273. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6274. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6275. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6276. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6277. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6278. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6279. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6280. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6281. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6282. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6283. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6284. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6285. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6286. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6287. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6288. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6289. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6290. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6291. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6292. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6293. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6294. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6295. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6296. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6297. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6298. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6299. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6300. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6301. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6302. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6303. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6304. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6305. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6306. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6307. /* TX_OFFLOAD_DELIVER_IND:
  6308. * Forward the target's locally-generated packets to the host,
  6309. * to provide to the monitor mode interface.
  6310. */
  6311. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6312. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6313. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6314. HTT_T2H_MSG_TYPE_TEST,
  6315. /* keep this last */
  6316. HTT_T2H_NUM_MSGS
  6317. };
  6318. /*
  6319. * HTT target to host message type -
  6320. * stored in bits 7:0 of the first word of the message
  6321. */
  6322. #define HTT_T2H_MSG_TYPE_M 0xff
  6323. #define HTT_T2H_MSG_TYPE_S 0
  6324. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6327. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6328. } while (0)
  6329. #define HTT_T2H_MSG_TYPE_GET(word) \
  6330. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6331. /**
  6332. * @brief target -> host version number confirmation message definition
  6333. *
  6334. * |31 24|23 16|15 8|7 0|
  6335. * |----------------+----------------+----------------+----------------|
  6336. * | reserved | major number | minor number | msg type |
  6337. * |-------------------------------------------------------------------|
  6338. * : option request TLV (optional) |
  6339. * :...................................................................:
  6340. *
  6341. * The VER_CONF message may consist of a single 4-byte word, or may be
  6342. * extended with TLVs that specify HTT options selected by the target.
  6343. * The following option TLVs may be appended to the VER_CONF message:
  6344. * - LL_BUS_ADDR_SIZE
  6345. * - HL_SUPPRESS_TX_COMPL_IND
  6346. * - MAX_TX_QUEUE_GROUPS
  6347. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6348. * may be appended to the VER_CONF message (but only one TLV of each type).
  6349. *
  6350. * Header fields:
  6351. * - MSG_TYPE
  6352. * Bits 7:0
  6353. * Purpose: identifies this as a version number confirmation message
  6354. * Value: 0x0
  6355. * - VER_MINOR
  6356. * Bits 15:8
  6357. * Purpose: Specify the minor number of the HTT message library version
  6358. * in use by the target firmware.
  6359. * The minor number specifies the specific revision within a range
  6360. * of fundamentally compatible HTT message definition revisions.
  6361. * Compatible revisions involve adding new messages or perhaps
  6362. * adding new fields to existing messages, in a backwards-compatible
  6363. * manner.
  6364. * Incompatible revisions involve changing the message type values,
  6365. * or redefining existing messages.
  6366. * Value: minor number
  6367. * - VER_MAJOR
  6368. * Bits 15:8
  6369. * Purpose: Specify the major number of the HTT message library version
  6370. * in use by the target firmware.
  6371. * The major number specifies the family of minor revisions that are
  6372. * fundamentally compatible with each other, but not with prior or
  6373. * later families.
  6374. * Value: major number
  6375. */
  6376. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6377. #define HTT_VER_CONF_MINOR_S 8
  6378. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6379. #define HTT_VER_CONF_MAJOR_S 16
  6380. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6383. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6384. } while (0)
  6385. #define HTT_VER_CONF_MINOR_GET(word) \
  6386. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6387. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6388. do { \
  6389. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6390. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6391. } while (0)
  6392. #define HTT_VER_CONF_MAJOR_GET(word) \
  6393. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6394. #define HTT_VER_CONF_BYTES 4
  6395. /**
  6396. * @brief - target -> host HTT Rx In order indication message
  6397. *
  6398. * @details
  6399. *
  6400. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6401. * |----------------+-------------------+---------------------+---------------|
  6402. * | peer ID | P| F| O| ext TID | msg type |
  6403. * |--------------------------------------------------------------------------|
  6404. * | MSDU count | Reserved | vdev id |
  6405. * |--------------------------------------------------------------------------|
  6406. * | MSDU 0 bus address (bits 31:0) |
  6407. #if HTT_PADDR64
  6408. * | MSDU 0 bus address (bits 63:32) |
  6409. #endif
  6410. * |--------------------------------------------------------------------------|
  6411. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6412. * |--------------------------------------------------------------------------|
  6413. * | MSDU 1 bus address (bits 31:0) |
  6414. #if HTT_PADDR64
  6415. * | MSDU 1 bus address (bits 63:32) |
  6416. #endif
  6417. * |--------------------------------------------------------------------------|
  6418. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6419. * |--------------------------------------------------------------------------|
  6420. */
  6421. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6422. *
  6423. * @details
  6424. * bits
  6425. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6426. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6427. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6428. * | | frag | | | | fail |chksum fail|
  6429. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6430. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6431. */
  6432. struct htt_rx_in_ord_paddr_ind_hdr_t
  6433. {
  6434. A_UINT32 /* word 0 */
  6435. msg_type: 8,
  6436. ext_tid: 5,
  6437. offload: 1,
  6438. frag: 1,
  6439. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6440. peer_id: 16;
  6441. A_UINT32 /* word 1 */
  6442. vap_id: 8,
  6443. /* NOTE:
  6444. * This reserved_1 field is not truly reserved - certain targets use
  6445. * this field internally to store debug information, and do not zero
  6446. * out the contents of the field before uploading the message to the
  6447. * host. Thus, any host-target communication supported by this field
  6448. * is limited to using values that are never used by the debug
  6449. * information stored by certain targets in the reserved_1 field.
  6450. * In particular, the targets in question don't use the value 0x3
  6451. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6452. * so this previously-unused value within these bits is available to
  6453. * use as the host / target PKT_CAPTURE_MODE flag.
  6454. */
  6455. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6456. /* if pkt_capture_mode == 0x3, host should
  6457. * send rx frames to monitor mode interface
  6458. */
  6459. msdu_cnt: 16;
  6460. };
  6461. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6462. {
  6463. A_UINT32 dma_addr;
  6464. A_UINT32
  6465. length: 16,
  6466. fw_desc: 8,
  6467. msdu_info:8;
  6468. };
  6469. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6470. {
  6471. A_UINT32 dma_addr_lo;
  6472. A_UINT32 dma_addr_hi;
  6473. A_UINT32
  6474. length: 16,
  6475. fw_desc: 8,
  6476. msdu_info:8;
  6477. };
  6478. #if HTT_PADDR64
  6479. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6480. #else
  6481. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6482. #endif
  6483. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6484. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6485. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6486. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6487. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6488. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6489. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6490. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6491. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6492. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6493. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6494. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6495. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6496. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6497. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6498. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6499. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6500. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6501. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6502. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6503. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6504. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6505. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6506. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6507. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6508. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6509. /* for systems using 64-bit format for bus addresses */
  6510. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6511. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6512. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6513. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6514. /* for systems using 32-bit format for bus addresses */
  6515. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6516. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6517. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6518. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6519. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6520. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6521. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6522. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6523. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6526. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6527. } while (0)
  6528. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6529. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6530. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6533. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6534. } while (0)
  6535. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6536. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6537. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6540. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6541. } while (0)
  6542. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6543. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6544. /*
  6545. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6546. * deliver the rx frames to the monitor mode interface.
  6547. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6548. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6549. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6550. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6551. */
  6552. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6553. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6554. do { \
  6555. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6556. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6557. } while (0)
  6558. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6559. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6560. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6561. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6564. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6565. } while (0)
  6566. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6567. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6568. /* for systems using 64-bit format for bus addresses */
  6569. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6570. do { \
  6571. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6572. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6573. } while (0)
  6574. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6575. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6576. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6577. do { \
  6578. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6579. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6580. } while (0)
  6581. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6582. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6583. /* for systems using 32-bit format for bus addresses */
  6584. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6585. do { \
  6586. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6587. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6588. } while (0)
  6589. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6590. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6591. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6594. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6595. } while (0)
  6596. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6597. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6598. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6599. do { \
  6600. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6601. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6602. } while (0)
  6603. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6604. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6605. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6606. do { \
  6607. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6608. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6609. } while (0)
  6610. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6611. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6612. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6615. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6616. } while (0)
  6617. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6618. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6619. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6620. do { \
  6621. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6622. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6623. } while (0)
  6624. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6625. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6626. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6627. do { \
  6628. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6629. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6630. } while (0)
  6631. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6632. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6633. /* definitions used within target -> host rx indication message */
  6634. PREPACK struct htt_rx_ind_hdr_prefix_t
  6635. {
  6636. A_UINT32 /* word 0 */
  6637. msg_type: 8,
  6638. ext_tid: 5,
  6639. release_valid: 1,
  6640. flush_valid: 1,
  6641. reserved0: 1,
  6642. peer_id: 16;
  6643. A_UINT32 /* word 1 */
  6644. flush_start_seq_num: 6,
  6645. flush_end_seq_num: 6,
  6646. release_start_seq_num: 6,
  6647. release_end_seq_num: 6,
  6648. num_mpdu_ranges: 8;
  6649. } POSTPACK;
  6650. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6651. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6652. #define HTT_TGT_RSSI_INVALID 0x80
  6653. PREPACK struct htt_rx_ppdu_desc_t
  6654. {
  6655. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6656. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6657. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6658. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6659. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6660. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6661. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6662. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6663. A_UINT32 /* word 0 */
  6664. rssi_cmb: 8,
  6665. timestamp_submicrosec: 8,
  6666. phy_err_code: 8,
  6667. phy_err: 1,
  6668. legacy_rate: 4,
  6669. legacy_rate_sel: 1,
  6670. end_valid: 1,
  6671. start_valid: 1;
  6672. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6673. union {
  6674. A_UINT32 /* word 1 */
  6675. rssi0_pri20: 8,
  6676. rssi0_ext20: 8,
  6677. rssi0_ext40: 8,
  6678. rssi0_ext80: 8;
  6679. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6680. } u0;
  6681. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6682. union {
  6683. A_UINT32 /* word 2 */
  6684. rssi1_pri20: 8,
  6685. rssi1_ext20: 8,
  6686. rssi1_ext40: 8,
  6687. rssi1_ext80: 8;
  6688. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6689. } u1;
  6690. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6691. union {
  6692. A_UINT32 /* word 3 */
  6693. rssi2_pri20: 8,
  6694. rssi2_ext20: 8,
  6695. rssi2_ext40: 8,
  6696. rssi2_ext80: 8;
  6697. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6698. } u2;
  6699. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6700. union {
  6701. A_UINT32 /* word 4 */
  6702. rssi3_pri20: 8,
  6703. rssi3_ext20: 8,
  6704. rssi3_ext40: 8,
  6705. rssi3_ext80: 8;
  6706. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6707. } u3;
  6708. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6709. A_UINT32 tsf32; /* word 5 */
  6710. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6711. A_UINT32 timestamp_microsec; /* word 6 */
  6712. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6713. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6714. A_UINT32 /* word 7 */
  6715. vht_sig_a1: 24,
  6716. preamble_type: 8;
  6717. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6718. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6719. A_UINT32 /* word 8 */
  6720. vht_sig_a2: 24,
  6721. /* sa_ant_matrix
  6722. * For cases where a single rx chain has options to be connected to
  6723. * different rx antennas, show which rx antennas were in use during
  6724. * receipt of a given PPDU.
  6725. * This sa_ant_matrix provides a bitmask of the antennas used while
  6726. * receiving this frame.
  6727. */
  6728. sa_ant_matrix: 8;
  6729. } POSTPACK;
  6730. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6731. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6732. PREPACK struct htt_rx_ind_hdr_suffix_t
  6733. {
  6734. A_UINT32 /* word 0 */
  6735. fw_rx_desc_bytes: 16,
  6736. reserved0: 16;
  6737. } POSTPACK;
  6738. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6739. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6740. PREPACK struct htt_rx_ind_hdr_t
  6741. {
  6742. struct htt_rx_ind_hdr_prefix_t prefix;
  6743. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6744. struct htt_rx_ind_hdr_suffix_t suffix;
  6745. } POSTPACK;
  6746. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6747. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6748. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6749. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6750. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6751. /*
  6752. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6753. * the offset into the HTT rx indication message at which the
  6754. * FW rx PPDU descriptor resides
  6755. */
  6756. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6757. /*
  6758. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6759. * the offset into the HTT rx indication message at which the
  6760. * header suffix (FW rx MSDU byte count) resides
  6761. */
  6762. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6763. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6764. /*
  6765. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6766. * the offset into the HTT rx indication message at which the per-MSDU
  6767. * information starts
  6768. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6769. * per-MSDU information portion of the message. The per-MSDU info itself
  6770. * starts at byte 12.
  6771. */
  6772. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6773. /**
  6774. * @brief target -> host rx indication message definition
  6775. *
  6776. * @details
  6777. * The following field definitions describe the format of the rx indication
  6778. * message sent from the target to the host.
  6779. * The message consists of three major sections:
  6780. * 1. a fixed-length header
  6781. * 2. a variable-length list of firmware rx MSDU descriptors
  6782. * 3. one or more 4-octet MPDU range information elements
  6783. * The fixed length header itself has two sub-sections
  6784. * 1. the message meta-information, including identification of the
  6785. * sender and type of the received data, and a 4-octet flush/release IE
  6786. * 2. the firmware rx PPDU descriptor
  6787. *
  6788. * The format of the message is depicted below.
  6789. * in this depiction, the following abbreviations are used for information
  6790. * elements within the message:
  6791. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6792. * elements associated with the PPDU start are valid.
  6793. * Specifically, the following fields are valid only if SV is set:
  6794. * RSSI (all variants), L, legacy rate, preamble type, service,
  6795. * VHT-SIG-A
  6796. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6797. * elements associated with the PPDU end are valid.
  6798. * Specifically, the following fields are valid only if EV is set:
  6799. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6800. * - L - Legacy rate selector - if legacy rates are used, this flag
  6801. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6802. * (L == 0) PHY.
  6803. * - P - PHY error flag - boolean indication of whether the rx frame had
  6804. * a PHY error
  6805. *
  6806. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6807. * |----------------+-------------------+---------------------+---------------|
  6808. * | peer ID | |RV|FV| ext TID | msg type |
  6809. * |--------------------------------------------------------------------------|
  6810. * | num | release | release | flush | flush |
  6811. * | MPDU | end | start | end | start |
  6812. * | ranges | seq num | seq num | seq num | seq num |
  6813. * |==========================================================================|
  6814. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6815. * |V|V| | rate | | | timestamp | RSSI |
  6816. * |--------------------------------------------------------------------------|
  6817. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6818. * |--------------------------------------------------------------------------|
  6819. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6820. * |--------------------------------------------------------------------------|
  6821. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6822. * |--------------------------------------------------------------------------|
  6823. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6824. * |--------------------------------------------------------------------------|
  6825. * | TSF LSBs |
  6826. * |--------------------------------------------------------------------------|
  6827. * | microsec timestamp |
  6828. * |--------------------------------------------------------------------------|
  6829. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6830. * |--------------------------------------------------------------------------|
  6831. * | service | HT-SIG / VHT-SIG-A2 |
  6832. * |==========================================================================|
  6833. * | reserved | FW rx desc bytes |
  6834. * |--------------------------------------------------------------------------|
  6835. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6836. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6837. * |--------------------------------------------------------------------------|
  6838. * : : :
  6839. * |--------------------------------------------------------------------------|
  6840. * | alignment | MSDU Rx |
  6841. * | padding | desc Bn |
  6842. * |--------------------------------------------------------------------------|
  6843. * | reserved | MPDU range status | MPDU count |
  6844. * |--------------------------------------------------------------------------|
  6845. * : reserved : MPDU range status : MPDU count :
  6846. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6847. *
  6848. * Header fields:
  6849. * - MSG_TYPE
  6850. * Bits 7:0
  6851. * Purpose: identifies this as an rx indication message
  6852. * Value: 0x1
  6853. * - EXT_TID
  6854. * Bits 12:8
  6855. * Purpose: identify the traffic ID of the rx data, including
  6856. * special "extended" TID values for multicast, broadcast, and
  6857. * non-QoS data frames
  6858. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6859. * - FLUSH_VALID (FV)
  6860. * Bit 13
  6861. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6862. * is valid
  6863. * Value:
  6864. * 1 -> flush IE is valid and needs to be processed
  6865. * 0 -> flush IE is not valid and should be ignored
  6866. * - REL_VALID (RV)
  6867. * Bit 13
  6868. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6869. * is valid
  6870. * Value:
  6871. * 1 -> release IE is valid and needs to be processed
  6872. * 0 -> release IE is not valid and should be ignored
  6873. * - PEER_ID
  6874. * Bits 31:16
  6875. * Purpose: Identify, by ID, which peer sent the rx data
  6876. * Value: ID of the peer who sent the rx data
  6877. * - FLUSH_SEQ_NUM_START
  6878. * Bits 5:0
  6879. * Purpose: Indicate the start of a series of MPDUs to flush
  6880. * Not all MPDUs within this series are necessarily valid - the host
  6881. * must check each sequence number within this range to see if the
  6882. * corresponding MPDU is actually present.
  6883. * This field is only valid if the FV bit is set.
  6884. * Value:
  6885. * The sequence number for the first MPDUs to check to flush.
  6886. * The sequence number is masked by 0x3f.
  6887. * - FLUSH_SEQ_NUM_END
  6888. * Bits 11:6
  6889. * Purpose: Indicate the end of a series of MPDUs to flush
  6890. * Value:
  6891. * The sequence number one larger than the sequence number of the
  6892. * last MPDU to check to flush.
  6893. * The sequence number is masked by 0x3f.
  6894. * Not all MPDUs within this series are necessarily valid - the host
  6895. * must check each sequence number within this range to see if the
  6896. * corresponding MPDU is actually present.
  6897. * This field is only valid if the FV bit is set.
  6898. * - REL_SEQ_NUM_START
  6899. * Bits 17:12
  6900. * Purpose: Indicate the start of a series of MPDUs to release.
  6901. * All MPDUs within this series are present and valid - the host
  6902. * need not check each sequence number within this range to see if
  6903. * the corresponding MPDU is actually present.
  6904. * This field is only valid if the RV bit is set.
  6905. * Value:
  6906. * The sequence number for the first MPDUs to check to release.
  6907. * The sequence number is masked by 0x3f.
  6908. * - REL_SEQ_NUM_END
  6909. * Bits 23:18
  6910. * Purpose: Indicate the end of a series of MPDUs to release.
  6911. * Value:
  6912. * The sequence number one larger than the sequence number of the
  6913. * last MPDU to check to release.
  6914. * The sequence number is masked by 0x3f.
  6915. * All MPDUs within this series are present and valid - the host
  6916. * need not check each sequence number within this range to see if
  6917. * the corresponding MPDU is actually present.
  6918. * This field is only valid if the RV bit is set.
  6919. * - NUM_MPDU_RANGES
  6920. * Bits 31:24
  6921. * Purpose: Indicate how many ranges of MPDUs are present.
  6922. * Each MPDU range consists of a series of contiguous MPDUs within the
  6923. * rx frame sequence which all have the same MPDU status.
  6924. * Value: 1-63 (typically a small number, like 1-3)
  6925. *
  6926. * Rx PPDU descriptor fields:
  6927. * - RSSI_CMB
  6928. * Bits 7:0
  6929. * Purpose: Combined RSSI from all active rx chains, across the active
  6930. * bandwidth.
  6931. * Value: RSSI dB units w.r.t. noise floor
  6932. * - TIMESTAMP_SUBMICROSEC
  6933. * Bits 15:8
  6934. * Purpose: high-resolution timestamp
  6935. * Value:
  6936. * Sub-microsecond time of PPDU reception.
  6937. * This timestamp ranges from [0,MAC clock MHz).
  6938. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6939. * to form a high-resolution, large range rx timestamp.
  6940. * - PHY_ERR_CODE
  6941. * Bits 23:16
  6942. * Purpose:
  6943. * If the rx frame processing resulted in a PHY error, indicate what
  6944. * type of rx PHY error occurred.
  6945. * Value:
  6946. * This field is valid if the "P" (PHY_ERR) flag is set.
  6947. * TBD: document/specify the values for this field
  6948. * - PHY_ERR
  6949. * Bit 24
  6950. * Purpose: indicate whether the rx PPDU had a PHY error
  6951. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6952. * - LEGACY_RATE
  6953. * Bits 28:25
  6954. * Purpose:
  6955. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6956. * specify which rate was used.
  6957. * Value:
  6958. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6959. * flag.
  6960. * If LEGACY_RATE_SEL is 0:
  6961. * 0x8: OFDM 48 Mbps
  6962. * 0x9: OFDM 24 Mbps
  6963. * 0xA: OFDM 12 Mbps
  6964. * 0xB: OFDM 6 Mbps
  6965. * 0xC: OFDM 54 Mbps
  6966. * 0xD: OFDM 36 Mbps
  6967. * 0xE: OFDM 18 Mbps
  6968. * 0xF: OFDM 9 Mbps
  6969. * If LEGACY_RATE_SEL is 1:
  6970. * 0x8: CCK 11 Mbps long preamble
  6971. * 0x9: CCK 5.5 Mbps long preamble
  6972. * 0xA: CCK 2 Mbps long preamble
  6973. * 0xB: CCK 1 Mbps long preamble
  6974. * 0xC: CCK 11 Mbps short preamble
  6975. * 0xD: CCK 5.5 Mbps short preamble
  6976. * 0xE: CCK 2 Mbps short preamble
  6977. * - LEGACY_RATE_SEL
  6978. * Bit 29
  6979. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6980. * Value:
  6981. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6982. * used a legacy rate.
  6983. * 0 -> OFDM, 1 -> CCK
  6984. * - END_VALID
  6985. * Bit 30
  6986. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6987. * the start of the PPDU are valid. Specifically, the following
  6988. * fields are only valid if END_VALID is set:
  6989. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6990. * TIMESTAMP_SUBMICROSEC
  6991. * Value:
  6992. * 0 -> rx PPDU desc end fields are not valid
  6993. * 1 -> rx PPDU desc end fields are valid
  6994. * - START_VALID
  6995. * Bit 31
  6996. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6997. * the end of the PPDU are valid. Specifically, the following
  6998. * fields are only valid if START_VALID is set:
  6999. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  7000. * VHT-SIG-A
  7001. * Value:
  7002. * 0 -> rx PPDU desc start fields are not valid
  7003. * 1 -> rx PPDU desc start fields are valid
  7004. * - RSSI0_PRI20
  7005. * Bits 7:0
  7006. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7007. * Value: RSSI dB units w.r.t. noise floor
  7008. *
  7009. * - RSSI0_EXT20
  7010. * Bits 7:0
  7011. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7012. * (if the rx bandwidth was >= 40 MHz)
  7013. * Value: RSSI dB units w.r.t. noise floor
  7014. * - RSSI0_EXT40
  7015. * Bits 7:0
  7016. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7017. * (if the rx bandwidth was >= 80 MHz)
  7018. * Value: RSSI dB units w.r.t. noise floor
  7019. * - RSSI0_EXT80
  7020. * Bits 7:0
  7021. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7022. * (if the rx bandwidth was >= 160 MHz)
  7023. * Value: RSSI dB units w.r.t. noise floor
  7024. *
  7025. * - RSSI1_PRI20
  7026. * Bits 7:0
  7027. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7028. * Value: RSSI dB units w.r.t. noise floor
  7029. * - RSSI1_EXT20
  7030. * Bits 7:0
  7031. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7032. * (if the rx bandwidth was >= 40 MHz)
  7033. * Value: RSSI dB units w.r.t. noise floor
  7034. * - RSSI1_EXT40
  7035. * Bits 7:0
  7036. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7037. * (if the rx bandwidth was >= 80 MHz)
  7038. * Value: RSSI dB units w.r.t. noise floor
  7039. * - RSSI1_EXT80
  7040. * Bits 7:0
  7041. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7042. * (if the rx bandwidth was >= 160 MHz)
  7043. * Value: RSSI dB units w.r.t. noise floor
  7044. *
  7045. * - RSSI2_PRI20
  7046. * Bits 7:0
  7047. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7048. * Value: RSSI dB units w.r.t. noise floor
  7049. * - RSSI2_EXT20
  7050. * Bits 7:0
  7051. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7052. * (if the rx bandwidth was >= 40 MHz)
  7053. * Value: RSSI dB units w.r.t. noise floor
  7054. * - RSSI2_EXT40
  7055. * Bits 7:0
  7056. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7057. * (if the rx bandwidth was >= 80 MHz)
  7058. * Value: RSSI dB units w.r.t. noise floor
  7059. * - RSSI2_EXT80
  7060. * Bits 7:0
  7061. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7062. * (if the rx bandwidth was >= 160 MHz)
  7063. * Value: RSSI dB units w.r.t. noise floor
  7064. *
  7065. * - RSSI3_PRI20
  7066. * Bits 7:0
  7067. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7068. * Value: RSSI dB units w.r.t. noise floor
  7069. * - RSSI3_EXT20
  7070. * Bits 7:0
  7071. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7072. * (if the rx bandwidth was >= 40 MHz)
  7073. * Value: RSSI dB units w.r.t. noise floor
  7074. * - RSSI3_EXT40
  7075. * Bits 7:0
  7076. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7077. * (if the rx bandwidth was >= 80 MHz)
  7078. * Value: RSSI dB units w.r.t. noise floor
  7079. * - RSSI3_EXT80
  7080. * Bits 7:0
  7081. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7082. * (if the rx bandwidth was >= 160 MHz)
  7083. * Value: RSSI dB units w.r.t. noise floor
  7084. *
  7085. * - TSF32
  7086. * Bits 31:0
  7087. * Purpose: specify the time the rx PPDU was received, in TSF units
  7088. * Value: 32 LSBs of the TSF
  7089. * - TIMESTAMP_MICROSEC
  7090. * Bits 31:0
  7091. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7092. * Value: PPDU rx time, in microseconds
  7093. * - VHT_SIG_A1
  7094. * Bits 23:0
  7095. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7096. * from the rx PPDU
  7097. * Value:
  7098. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7099. * VHT-SIG-A1 data.
  7100. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7101. * first 24 bits of the HT-SIG data.
  7102. * Otherwise, this field is invalid.
  7103. * Refer to the the 802.11 protocol for the definition of the
  7104. * HT-SIG and VHT-SIG-A1 fields
  7105. * - VHT_SIG_A2
  7106. * Bits 23:0
  7107. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7108. * from the rx PPDU
  7109. * Value:
  7110. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7111. * VHT-SIG-A2 data.
  7112. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7113. * last 24 bits of the HT-SIG data.
  7114. * Otherwise, this field is invalid.
  7115. * Refer to the the 802.11 protocol for the definition of the
  7116. * HT-SIG and VHT-SIG-A2 fields
  7117. * - PREAMBLE_TYPE
  7118. * Bits 31:24
  7119. * Purpose: indicate the PHY format of the received burst
  7120. * Value:
  7121. * 0x4: Legacy (OFDM/CCK)
  7122. * 0x8: HT
  7123. * 0x9: HT with TxBF
  7124. * 0xC: VHT
  7125. * 0xD: VHT with TxBF
  7126. * - SERVICE
  7127. * Bits 31:24
  7128. * Purpose: TBD
  7129. * Value: TBD
  7130. *
  7131. * Rx MSDU descriptor fields:
  7132. * - FW_RX_DESC_BYTES
  7133. * Bits 15:0
  7134. * Purpose: Indicate how many bytes in the Rx indication are used for
  7135. * FW Rx descriptors
  7136. *
  7137. * Payload fields:
  7138. * - MPDU_COUNT
  7139. * Bits 7:0
  7140. * Purpose: Indicate how many sequential MPDUs share the same status.
  7141. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7142. * - MPDU_STATUS
  7143. * Bits 15:8
  7144. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7145. * received successfully.
  7146. * Value:
  7147. * 0x1: success
  7148. * 0x2: FCS error
  7149. * 0x3: duplicate error
  7150. * 0x4: replay error
  7151. * 0x5: invalid peer
  7152. */
  7153. /* header fields */
  7154. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7155. #define HTT_RX_IND_EXT_TID_S 8
  7156. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7157. #define HTT_RX_IND_FLUSH_VALID_S 13
  7158. #define HTT_RX_IND_REL_VALID_M 0x4000
  7159. #define HTT_RX_IND_REL_VALID_S 14
  7160. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7161. #define HTT_RX_IND_PEER_ID_S 16
  7162. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7163. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7164. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7165. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7166. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7167. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7168. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7169. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7170. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7171. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7172. /* rx PPDU descriptor fields */
  7173. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7174. #define HTT_RX_IND_RSSI_CMB_S 0
  7175. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7176. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7177. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7178. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7179. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7180. #define HTT_RX_IND_PHY_ERR_S 24
  7181. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7182. #define HTT_RX_IND_LEGACY_RATE_S 25
  7183. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7184. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7185. #define HTT_RX_IND_END_VALID_M 0x40000000
  7186. #define HTT_RX_IND_END_VALID_S 30
  7187. #define HTT_RX_IND_START_VALID_M 0x80000000
  7188. #define HTT_RX_IND_START_VALID_S 31
  7189. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7190. #define HTT_RX_IND_RSSI_PRI20_S 0
  7191. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7192. #define HTT_RX_IND_RSSI_EXT20_S 8
  7193. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7194. #define HTT_RX_IND_RSSI_EXT40_S 16
  7195. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7196. #define HTT_RX_IND_RSSI_EXT80_S 24
  7197. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7198. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7199. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7200. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7201. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7202. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7203. #define HTT_RX_IND_SERVICE_M 0xff000000
  7204. #define HTT_RX_IND_SERVICE_S 24
  7205. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7206. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7207. /* rx MSDU descriptor fields */
  7208. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7209. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7210. /* payload fields */
  7211. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7212. #define HTT_RX_IND_MPDU_COUNT_S 0
  7213. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7214. #define HTT_RX_IND_MPDU_STATUS_S 8
  7215. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7218. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7219. } while (0)
  7220. #define HTT_RX_IND_EXT_TID_GET(word) \
  7221. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7222. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7223. do { \
  7224. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7225. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7226. } while (0)
  7227. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7228. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7229. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7230. do { \
  7231. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7232. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7233. } while (0)
  7234. #define HTT_RX_IND_REL_VALID_GET(word) \
  7235. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7236. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7239. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7240. } while (0)
  7241. #define HTT_RX_IND_PEER_ID_GET(word) \
  7242. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7243. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7246. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7247. } while (0)
  7248. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7249. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7250. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7251. do { \
  7252. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7253. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7254. } while (0)
  7255. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7256. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7257. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7258. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7259. do { \
  7260. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7261. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7262. } while (0)
  7263. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7264. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7265. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7266. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7267. do { \
  7268. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7269. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7270. } while (0)
  7271. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7272. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7273. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7274. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7275. do { \
  7276. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7277. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7278. } while (0)
  7279. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7280. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7281. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7282. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7283. do { \
  7284. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7285. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7286. } while (0)
  7287. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7288. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7289. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7290. /* FW rx PPDU descriptor fields */
  7291. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7292. do { \
  7293. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7294. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7295. } while (0)
  7296. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7297. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7298. HTT_RX_IND_RSSI_CMB_S)
  7299. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7300. do { \
  7301. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7302. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7303. } while (0)
  7304. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7305. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7306. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7307. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7308. do { \
  7309. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7310. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7311. } while (0)
  7312. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7313. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7314. HTT_RX_IND_PHY_ERR_CODE_S)
  7315. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7316. do { \
  7317. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7318. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7319. } while (0)
  7320. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7321. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7322. HTT_RX_IND_PHY_ERR_S)
  7323. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7324. do { \
  7325. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7326. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7327. } while (0)
  7328. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7329. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7330. HTT_RX_IND_LEGACY_RATE_S)
  7331. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7332. do { \
  7333. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7334. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7335. } while (0)
  7336. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7337. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7338. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7339. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7342. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7343. } while (0)
  7344. #define HTT_RX_IND_END_VALID_GET(word) \
  7345. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7346. HTT_RX_IND_END_VALID_S)
  7347. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7350. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7351. } while (0)
  7352. #define HTT_RX_IND_START_VALID_GET(word) \
  7353. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7354. HTT_RX_IND_START_VALID_S)
  7355. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7356. do { \
  7357. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7358. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7359. } while (0)
  7360. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7361. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7362. HTT_RX_IND_RSSI_PRI20_S)
  7363. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7364. do { \
  7365. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7366. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7367. } while (0)
  7368. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7369. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7370. HTT_RX_IND_RSSI_EXT20_S)
  7371. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7372. do { \
  7373. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7374. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7375. } while (0)
  7376. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7377. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7378. HTT_RX_IND_RSSI_EXT40_S)
  7379. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7380. do { \
  7381. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7382. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7383. } while (0)
  7384. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7385. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7386. HTT_RX_IND_RSSI_EXT80_S)
  7387. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7388. do { \
  7389. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7390. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7391. } while (0)
  7392. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7393. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7394. HTT_RX_IND_VHT_SIG_A1_S)
  7395. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7396. do { \
  7397. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7398. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7399. } while (0)
  7400. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7401. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7402. HTT_RX_IND_VHT_SIG_A2_S)
  7403. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7404. do { \
  7405. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7406. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7407. } while (0)
  7408. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7409. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7410. HTT_RX_IND_PREAMBLE_TYPE_S)
  7411. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7412. do { \
  7413. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7414. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7415. } while (0)
  7416. #define HTT_RX_IND_SERVICE_GET(word) \
  7417. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7418. HTT_RX_IND_SERVICE_S)
  7419. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7420. do { \
  7421. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7422. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7423. } while (0)
  7424. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7425. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7426. HTT_RX_IND_SA_ANT_MATRIX_S)
  7427. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7428. do { \
  7429. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7430. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7431. } while (0)
  7432. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7433. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7434. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7435. do { \
  7436. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7437. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7438. } while (0)
  7439. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7440. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7441. #define HTT_RX_IND_HL_BYTES \
  7442. (HTT_RX_IND_HDR_BYTES + \
  7443. 4 /* single FW rx MSDU descriptor */ + \
  7444. 4 /* single MPDU range information element */)
  7445. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7446. /* Could we use one macro entry? */
  7447. #define HTT_WORD_SET(word, field, value) \
  7448. do { \
  7449. HTT_CHECK_SET_VAL(field, value); \
  7450. (word) |= ((value) << field ## _S); \
  7451. } while (0)
  7452. #define HTT_WORD_GET(word, field) \
  7453. (((word) & field ## _M) >> field ## _S)
  7454. PREPACK struct hl_htt_rx_ind_base {
  7455. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7456. } POSTPACK;
  7457. /*
  7458. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7459. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7460. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7461. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7462. * htt_rx_ind_hl_rx_desc_t.
  7463. */
  7464. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7465. struct htt_rx_ind_hl_rx_desc_t {
  7466. A_UINT8 ver;
  7467. A_UINT8 len;
  7468. struct {
  7469. A_UINT8
  7470. first_msdu: 1,
  7471. last_msdu: 1,
  7472. c3_failed: 1,
  7473. c4_failed: 1,
  7474. ipv6: 1,
  7475. tcp: 1,
  7476. udp: 1,
  7477. reserved: 1;
  7478. } flags;
  7479. /* NOTE: no reserved space - don't append any new fields here */
  7480. };
  7481. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7482. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7483. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7484. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7485. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7486. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7487. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7488. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7489. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7490. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7491. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7492. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7493. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7494. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7495. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7496. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7497. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7498. /* This structure is used in HL, the basic descriptor information
  7499. * used by host. the structure is translated by FW from HW desc
  7500. * or generated by FW. But in HL monitor mode, the host would use
  7501. * the same structure with LL.
  7502. */
  7503. PREPACK struct hl_htt_rx_desc_base {
  7504. A_UINT32
  7505. seq_num:12,
  7506. encrypted:1,
  7507. chan_info_present:1,
  7508. resv0:2,
  7509. mcast_bcast:1,
  7510. fragment:1,
  7511. key_id_oct:8,
  7512. resv1:6;
  7513. A_UINT32
  7514. pn_31_0;
  7515. union {
  7516. struct {
  7517. A_UINT16 pn_47_32;
  7518. A_UINT16 pn_63_48;
  7519. } pn16;
  7520. A_UINT32 pn_63_32;
  7521. } u0;
  7522. A_UINT32
  7523. pn_95_64;
  7524. A_UINT32
  7525. pn_127_96;
  7526. } POSTPACK;
  7527. /*
  7528. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7529. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7530. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7531. * Please see htt_chan_change_t for description of the fields.
  7532. */
  7533. PREPACK struct htt_chan_info_t
  7534. {
  7535. A_UINT32 primary_chan_center_freq_mhz: 16,
  7536. contig_chan1_center_freq_mhz: 16;
  7537. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7538. phy_mode: 8,
  7539. reserved: 8;
  7540. } POSTPACK;
  7541. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7542. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7543. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7544. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7545. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7546. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7547. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7548. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7549. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7550. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7551. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7552. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7553. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7554. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7555. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7556. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7557. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7558. /* Channel information */
  7559. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7560. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7561. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7562. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7563. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7564. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7565. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7566. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7567. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7568. do { \
  7569. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7570. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7571. } while (0)
  7572. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7573. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7574. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7575. do { \
  7576. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7577. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7578. } while (0)
  7579. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7580. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7581. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7582. do { \
  7583. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7584. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7585. } while (0)
  7586. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7587. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7588. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7591. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7592. } while (0)
  7593. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7594. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7595. /*
  7596. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7597. * @brief target -> host message definition for FW offloaded pkts
  7598. *
  7599. * @details
  7600. * The following field definitions describe the format of the firmware
  7601. * offload deliver message sent from the target to the host.
  7602. *
  7603. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7604. *
  7605. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7606. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7607. * | reserved_1 | msg type |
  7608. * |--------------------------------------------------------------------------|
  7609. * | phy_timestamp_l32 |
  7610. * |--------------------------------------------------------------------------|
  7611. * | WORD2 (see below) |
  7612. * |--------------------------------------------------------------------------|
  7613. * | seqno | framectrl |
  7614. * |--------------------------------------------------------------------------|
  7615. * | reserved_3 | vdev_id | tid_num|
  7616. * |--------------------------------------------------------------------------|
  7617. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7618. * |--------------------------------------------------------------------------|
  7619. *
  7620. * where:
  7621. * STAT = status
  7622. * F = format (802.3 vs. 802.11)
  7623. *
  7624. * definition for word 2
  7625. *
  7626. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7627. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7628. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7629. * |--------------------------------------------------------------------------|
  7630. *
  7631. * where:
  7632. * PR = preamble
  7633. * BF = beamformed
  7634. */
  7635. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7636. {
  7637. A_UINT32 /* word 0 */
  7638. msg_type:8, /* [ 7: 0] */
  7639. reserved_1:24; /* [31: 8] */
  7640. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7641. A_UINT32 /* word 2 */
  7642. /* preamble:
  7643. * 0-OFDM,
  7644. * 1-CCk,
  7645. * 2-HT,
  7646. * 3-VHT
  7647. */
  7648. preamble: 2, /* [1:0] */
  7649. /* mcs:
  7650. * In case of HT preamble interpret
  7651. * MCS along with NSS.
  7652. * Valid values for HT are 0 to 7.
  7653. * HT mcs 0 with NSS 2 is mcs 8.
  7654. * Valid values for VHT are 0 to 9.
  7655. */
  7656. mcs: 4, /* [5:2] */
  7657. /* rate:
  7658. * This is applicable only for
  7659. * CCK and OFDM preamble type
  7660. * rate 0: OFDM 48 Mbps,
  7661. * 1: OFDM 24 Mbps,
  7662. * 2: OFDM 12 Mbps
  7663. * 3: OFDM 6 Mbps
  7664. * 4: OFDM 54 Mbps
  7665. * 5: OFDM 36 Mbps
  7666. * 6: OFDM 18 Mbps
  7667. * 7: OFDM 9 Mbps
  7668. * rate 0: CCK 11 Mbps Long
  7669. * 1: CCK 5.5 Mbps Long
  7670. * 2: CCK 2 Mbps Long
  7671. * 3: CCK 1 Mbps Long
  7672. * 4: CCK 11 Mbps Short
  7673. * 5: CCK 5.5 Mbps Short
  7674. * 6: CCK 2 Mbps Short
  7675. */
  7676. rate : 3, /* [ 8: 6] */
  7677. rssi : 8, /* [16: 9] units=dBm */
  7678. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7679. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7680. stbc : 1, /* [22] */
  7681. sgi : 1, /* [23] */
  7682. ldpc : 1, /* [24] */
  7683. beamformed: 1, /* [25] */
  7684. reserved_2: 6; /* [31:26] */
  7685. A_UINT32 /* word 3 */
  7686. framectrl:16, /* [15: 0] */
  7687. seqno:16; /* [31:16] */
  7688. A_UINT32 /* word 4 */
  7689. tid_num:5, /* [ 4: 0] actual TID number */
  7690. vdev_id:8, /* [12: 5] */
  7691. reserved_3:19; /* [31:13] */
  7692. A_UINT32 /* word 5 */
  7693. /* status:
  7694. * 0: tx_ok
  7695. * 1: retry
  7696. * 2: drop
  7697. * 3: filtered
  7698. * 4: abort
  7699. * 5: tid delete
  7700. * 6: sw abort
  7701. * 7: dropped by peer migration
  7702. */
  7703. status:3, /* [2:0] */
  7704. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7705. tx_mpdu_bytes:16, /* [19:4] */
  7706. /* Indicates retry count of offloaded/local generated Data tx frames */
  7707. tx_retry_cnt:6, /* [25:20] */
  7708. reserved_4:6; /* [31:26] */
  7709. } POSTPACK;
  7710. /* FW offload deliver ind message header fields */
  7711. /* DWORD one */
  7712. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7713. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7714. /* DWORD two */
  7715. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7716. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7717. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7718. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7719. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7720. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7721. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7722. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7723. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7724. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7725. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7726. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7727. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7728. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7729. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7730. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7731. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7732. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7733. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7734. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7735. /* DWORD three*/
  7736. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7737. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7738. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7739. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7740. /* DWORD four */
  7741. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7742. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7743. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7744. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7745. /* DWORD five */
  7746. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7747. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7748. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7749. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7750. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7751. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7752. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7753. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7754. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7755. do { \
  7756. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7757. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7758. } while (0)
  7759. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7760. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7761. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7762. do { \
  7763. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7764. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7765. } while (0)
  7766. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7767. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7768. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7769. do { \
  7770. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7771. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7772. } while (0)
  7773. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7774. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7775. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7778. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7779. } while (0)
  7780. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7781. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7782. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7783. do { \
  7784. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7785. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7786. } while (0)
  7787. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7788. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7789. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7790. do { \
  7791. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7792. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7793. } while (0)
  7794. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7795. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7796. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7797. do { \
  7798. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7799. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7800. } while (0)
  7801. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7802. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7803. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7804. do { \
  7805. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7806. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7807. } while (0)
  7808. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7809. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7810. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7811. do { \
  7812. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7813. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7814. } while (0)
  7815. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7816. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7817. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7818. do { \
  7819. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7820. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7821. } while (0)
  7822. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7823. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7824. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7825. do { \
  7826. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7827. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7828. } while (0)
  7829. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7830. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7831. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7832. do { \
  7833. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7834. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7835. } while (0)
  7836. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7837. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7838. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7839. do { \
  7840. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7841. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7842. } while (0)
  7843. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7844. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7845. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7846. do { \
  7847. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7848. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7849. } while (0)
  7850. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7851. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7852. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7853. do { \
  7854. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7855. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7856. } while (0)
  7857. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7858. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7859. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7860. do { \
  7861. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7862. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7863. } while (0)
  7864. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7865. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7866. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7867. do { \
  7868. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7869. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7870. } while (0)
  7871. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7872. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7873. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7874. do { \
  7875. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7876. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7877. } while (0)
  7878. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7879. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7880. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7881. do { \
  7882. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7883. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7884. } while (0)
  7885. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7886. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7887. /*
  7888. * @brief target -> host rx reorder flush message definition
  7889. *
  7890. * @details
  7891. * The following field definitions describe the format of the rx flush
  7892. * message sent from the target to the host.
  7893. * The message consists of a 4-octet header, followed by one or more
  7894. * 4-octet payload information elements.
  7895. *
  7896. * |31 24|23 8|7 0|
  7897. * |--------------------------------------------------------------|
  7898. * | TID | peer ID | msg type |
  7899. * |--------------------------------------------------------------|
  7900. * | seq num end | seq num start | MPDU status | reserved |
  7901. * |--------------------------------------------------------------|
  7902. * First DWORD:
  7903. * - MSG_TYPE
  7904. * Bits 7:0
  7905. * Purpose: identifies this as an rx flush message
  7906. * Value: 0x2
  7907. * - PEER_ID
  7908. * Bits 23:8 (only bits 18:8 actually used)
  7909. * Purpose: identify which peer's rx data is being flushed
  7910. * Value: (rx) peer ID
  7911. * - TID
  7912. * Bits 31:24 (only bits 27:24 actually used)
  7913. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7914. * Value: traffic identifier
  7915. * Second DWORD:
  7916. * - MPDU_STATUS
  7917. * Bits 15:8
  7918. * Purpose:
  7919. * Indicate whether the flushed MPDUs should be discarded or processed.
  7920. * Value:
  7921. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7922. * stages of rx processing
  7923. * other: discard the MPDUs
  7924. * It is anticipated that flush messages will always have
  7925. * MPDU status == 1, but the status flag is included for
  7926. * flexibility.
  7927. * - SEQ_NUM_START
  7928. * Bits 23:16
  7929. * Purpose:
  7930. * Indicate the start of a series of consecutive MPDUs being flushed.
  7931. * Not all MPDUs within this range are necessarily valid - the host
  7932. * must check each sequence number within this range to see if the
  7933. * corresponding MPDU is actually present.
  7934. * Value:
  7935. * The sequence number for the first MPDU in the sequence.
  7936. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7937. * - SEQ_NUM_END
  7938. * Bits 30:24
  7939. * Purpose:
  7940. * Indicate the end of a series of consecutive MPDUs being flushed.
  7941. * Value:
  7942. * The sequence number one larger than the sequence number of the
  7943. * last MPDU being flushed.
  7944. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7945. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7946. * are to be released for further rx processing.
  7947. * Not all MPDUs within this range are necessarily valid - the host
  7948. * must check each sequence number within this range to see if the
  7949. * corresponding MPDU is actually present.
  7950. */
  7951. /* first DWORD */
  7952. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7953. #define HTT_RX_FLUSH_PEER_ID_S 8
  7954. #define HTT_RX_FLUSH_TID_M 0xff000000
  7955. #define HTT_RX_FLUSH_TID_S 24
  7956. /* second DWORD */
  7957. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7958. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7959. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7960. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7961. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7962. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7963. #define HTT_RX_FLUSH_BYTES 8
  7964. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7965. do { \
  7966. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7967. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7968. } while (0)
  7969. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7970. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7971. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7972. do { \
  7973. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7974. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7975. } while (0)
  7976. #define HTT_RX_FLUSH_TID_GET(word) \
  7977. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7978. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7981. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7982. } while (0)
  7983. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7984. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7985. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7986. do { \
  7987. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7988. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7989. } while (0)
  7990. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7991. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7992. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7993. do { \
  7994. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7995. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7996. } while (0)
  7997. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7998. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7999. /*
  8000. * @brief target -> host rx pn check indication message
  8001. *
  8002. * @details
  8003. * The following field definitions describe the format of the Rx PN check
  8004. * indication message sent from the target to the host.
  8005. * The message consists of a 4-octet header, followed by the start and
  8006. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8007. * IE is one octet containing the sequence number that failed the PN
  8008. * check.
  8009. *
  8010. * |31 24|23 8|7 0|
  8011. * |--------------------------------------------------------------|
  8012. * | TID | peer ID | msg type |
  8013. * |--------------------------------------------------------------|
  8014. * | Reserved | PN IE count | seq num end | seq num start|
  8015. * |--------------------------------------------------------------|
  8016. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8017. * |--------------------------------------------------------------|
  8018. * First DWORD:
  8019. * - MSG_TYPE
  8020. * Bits 7:0
  8021. * Purpose: Identifies this as an rx pn check indication message
  8022. * Value: 0x2
  8023. * - PEER_ID
  8024. * Bits 23:8 (only bits 18:8 actually used)
  8025. * Purpose: identify which peer
  8026. * Value: (rx) peer ID
  8027. * - TID
  8028. * Bits 31:24 (only bits 27:24 actually used)
  8029. * Purpose: identify traffic identifier
  8030. * Value: traffic identifier
  8031. * Second DWORD:
  8032. * - SEQ_NUM_START
  8033. * Bits 7:0
  8034. * Purpose:
  8035. * Indicates the starting sequence number of the MPDU in this
  8036. * series of MPDUs that went though PN check.
  8037. * Value:
  8038. * The sequence number for the first MPDU in the sequence.
  8039. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8040. * - SEQ_NUM_END
  8041. * Bits 15:8
  8042. * Purpose:
  8043. * Indicates the ending sequence number of the MPDU in this
  8044. * series of MPDUs that went though PN check.
  8045. * Value:
  8046. * The sequence number one larger then the sequence number of the last
  8047. * MPDU being flushed.
  8048. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8049. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8050. * for invalid PN numbers and are ready to be released for further processing.
  8051. * Not all MPDUs within this range are necessarily valid - the host
  8052. * must check each sequence number within this range to see if the
  8053. * corresponding MPDU is actually present.
  8054. * - PN_IE_COUNT
  8055. * Bits 23:16
  8056. * Purpose:
  8057. * Used to determine the variable number of PN information elements in this
  8058. * message
  8059. *
  8060. * PN information elements:
  8061. * - PN_IE_x-
  8062. * Purpose:
  8063. * Each PN information element contains the sequence number of the MPDU that
  8064. * has failed the target PN check.
  8065. * Value:
  8066. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8067. * that failed the PN check.
  8068. */
  8069. /* first DWORD */
  8070. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8071. #define HTT_RX_PN_IND_PEER_ID_S 8
  8072. #define HTT_RX_PN_IND_TID_M 0xff000000
  8073. #define HTT_RX_PN_IND_TID_S 24
  8074. /* second DWORD */
  8075. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8076. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8077. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8078. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8079. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8080. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8081. #define HTT_RX_PN_IND_BYTES 8
  8082. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8085. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8086. } while (0)
  8087. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8088. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8089. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8090. do { \
  8091. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8092. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8093. } while (0)
  8094. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8095. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8096. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8097. do { \
  8098. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8099. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8100. } while (0)
  8101. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8102. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8103. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8104. do { \
  8105. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8106. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8107. } while (0)
  8108. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8109. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8110. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8111. do { \
  8112. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8113. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8114. } while (0)
  8115. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8116. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8117. /*
  8118. * @brief target -> host rx offload deliver message for LL system
  8119. *
  8120. * @details
  8121. * In a low latency system this message is sent whenever the offload
  8122. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8123. * The DMA of the actual packets into host memory is done before sending out
  8124. * this message. This message indicates only how many MSDUs to reap. The
  8125. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8126. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8127. * DMA'd by the MAC directly into host memory these packets do not contain
  8128. * the MAC descriptors in the header portion of the packet. Instead they contain
  8129. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8130. * message, the packets are delivered directly to the NW stack without going
  8131. * through the regular reorder buffering and PN checking path since it has
  8132. * already been done in target.
  8133. *
  8134. * |31 24|23 16|15 8|7 0|
  8135. * |-----------------------------------------------------------------------|
  8136. * | Total MSDU count | reserved | msg type |
  8137. * |-----------------------------------------------------------------------|
  8138. *
  8139. * @brief target -> host rx offload deliver message for HL system
  8140. *
  8141. * @details
  8142. * In a high latency system this message is sent whenever the offload manager
  8143. * flushes out the packets it has coalesced in its coalescing buffer. The
  8144. * actual packets are also carried along with this message. When the host
  8145. * receives this message, it is expected to deliver these packets to the NW
  8146. * stack directly instead of routing them through the reorder buffering and
  8147. * PN checking path since it has already been done in target.
  8148. *
  8149. * |31 24|23 16|15 8|7 0|
  8150. * |-----------------------------------------------------------------------|
  8151. * | Total MSDU count | reserved | msg type |
  8152. * |-----------------------------------------------------------------------|
  8153. * | peer ID | MSDU length |
  8154. * |-----------------------------------------------------------------------|
  8155. * | MSDU payload | FW Desc | tid | vdev ID |
  8156. * |-----------------------------------------------------------------------|
  8157. * | MSDU payload contd. |
  8158. * |-----------------------------------------------------------------------|
  8159. * | peer ID | MSDU length |
  8160. * |-----------------------------------------------------------------------|
  8161. * | MSDU payload | FW Desc | tid | vdev ID |
  8162. * |-----------------------------------------------------------------------|
  8163. * | MSDU payload contd. |
  8164. * |-----------------------------------------------------------------------|
  8165. *
  8166. */
  8167. /* first DWORD */
  8168. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8169. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8170. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8171. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8172. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8173. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8174. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8175. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8176. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8177. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8178. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8179. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8180. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8181. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8182. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8183. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8184. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8187. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8188. } while (0)
  8189. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8190. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8191. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8194. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8195. } while (0)
  8196. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8197. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8198. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8199. do { \
  8200. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8201. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8202. } while (0)
  8203. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8204. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8205. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8206. do { \
  8207. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8208. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8209. } while (0)
  8210. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8211. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8212. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8213. do { \
  8214. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8215. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8216. } while (0)
  8217. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8218. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8219. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8220. do { \
  8221. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8222. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8223. } while (0)
  8224. /**
  8225. * @brief target -> host rx peer map/unmap message definition
  8226. *
  8227. * @details
  8228. * The following diagram shows the format of the rx peer map message sent
  8229. * from the target to the host. This layout assumes the target operates
  8230. * as little-endian.
  8231. *
  8232. * This message always contains a SW peer ID. The main purpose of the
  8233. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8234. * with, so that the host can use that peer ID to determine which peer
  8235. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8236. * other purposes, such as identifying during tx completions which peer
  8237. * the tx frames in question were transmitted to.
  8238. *
  8239. * In certain generations of chips, the peer map message also contains
  8240. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8241. * to identify which peer the frame needs to be forwarded to (i.e. the
  8242. * peer assocated with the Destination MAC Address within the packet),
  8243. * and particularly which vdev needs to transmit the frame (for cases
  8244. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8245. * meaning as AST_INDEX_0.
  8246. * This DA-based peer ID that is provided for certain rx frames
  8247. * (the rx frames that need to be re-transmitted as tx frames)
  8248. * is the ID that the HW uses for referring to the peer in question,
  8249. * rather than the peer ID that the SW+FW use to refer to the peer.
  8250. *
  8251. *
  8252. * |31 24|23 16|15 8|7 0|
  8253. * |-----------------------------------------------------------------------|
  8254. * | SW peer ID | VDEV ID | msg type |
  8255. * |-----------------------------------------------------------------------|
  8256. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8257. * |-----------------------------------------------------------------------|
  8258. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8259. * |-----------------------------------------------------------------------|
  8260. *
  8261. *
  8262. * The following diagram shows the format of the rx peer unmap message sent
  8263. * from the target to the host.
  8264. *
  8265. * |31 24|23 16|15 8|7 0|
  8266. * |-----------------------------------------------------------------------|
  8267. * | SW peer ID | VDEV ID | msg type |
  8268. * |-----------------------------------------------------------------------|
  8269. *
  8270. * The following field definitions describe the format of the rx peer map
  8271. * and peer unmap messages sent from the target to the host.
  8272. * - MSG_TYPE
  8273. * Bits 7:0
  8274. * Purpose: identifies this as an rx peer map or peer unmap message
  8275. * Value: peer map -> 0x3, peer unmap -> 0x4
  8276. * - VDEV_ID
  8277. * Bits 15:8
  8278. * Purpose: Indicates which virtual device the peer is associated
  8279. * with.
  8280. * Value: vdev ID (used in the host to look up the vdev object)
  8281. * - PEER_ID (a.k.a. SW_PEER_ID)
  8282. * Bits 31:16
  8283. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8284. * freeing (unmap)
  8285. * Value: (rx) peer ID
  8286. * - MAC_ADDR_L32 (peer map only)
  8287. * Bits 31:0
  8288. * Purpose: Identifies which peer node the peer ID is for.
  8289. * Value: lower 4 bytes of peer node's MAC address
  8290. * - MAC_ADDR_U16 (peer map only)
  8291. * Bits 15:0
  8292. * Purpose: Identifies which peer node the peer ID is for.
  8293. * Value: upper 2 bytes of peer node's MAC address
  8294. * - HW_PEER_ID
  8295. * Bits 31:16
  8296. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8297. * address, so for rx frames marked for rx --> tx forwarding, the
  8298. * host can determine from the HW peer ID provided as meta-data with
  8299. * the rx frame which peer the frame is supposed to be forwarded to.
  8300. * Value: ID used by the MAC HW to identify the peer
  8301. */
  8302. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8303. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8304. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8305. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8306. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8307. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8308. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8309. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8310. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8311. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8312. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8313. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8314. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8315. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8316. do { \
  8317. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8318. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8319. } while (0)
  8320. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8321. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8322. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8323. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8324. do { \
  8325. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8326. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8327. } while (0)
  8328. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8329. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8330. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8331. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8332. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8333. do { \
  8334. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8335. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8336. } while (0)
  8337. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8338. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8339. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8340. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8341. #define HTT_RX_PEER_MAP_BYTES 12
  8342. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8343. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8344. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8345. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8346. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8347. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8348. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8349. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8350. #define HTT_RX_PEER_UNMAP_BYTES 4
  8351. /**
  8352. * @brief target -> host rx peer map V2 message definition
  8353. *
  8354. * @details
  8355. * The following diagram shows the format of the rx peer map v2 message sent
  8356. * from the target to the host. This layout assumes the target operates
  8357. * as little-endian.
  8358. *
  8359. * This message always contains a SW peer ID. The main purpose of the
  8360. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8361. * with, so that the host can use that peer ID to determine which peer
  8362. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8363. * other purposes, such as identifying during tx completions which peer
  8364. * the tx frames in question were transmitted to.
  8365. *
  8366. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8367. * is used during rx --> tx frame forwarding to identify which peer the
  8368. * frame needs to be forwarded to (i.e. the peer assocated with the
  8369. * Destination MAC Address within the packet), and particularly which vdev
  8370. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8371. * This DA-based peer ID that is provided for certain rx frames
  8372. * (the rx frames that need to be re-transmitted as tx frames)
  8373. * is the ID that the HW uses for referring to the peer in question,
  8374. * rather than the peer ID that the SW+FW use to refer to the peer.
  8375. *
  8376. * The HW peer id here is the same meaning as AST_INDEX_0.
  8377. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8378. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8379. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8380. * AST is valid.
  8381. *
  8382. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8383. * |-------------------------------------------------------------------------|
  8384. * | SW peer ID | VDEV ID | msg type |
  8385. * |-------------------------------------------------------------------------|
  8386. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8387. * |-------------------------------------------------------------------------|
  8388. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8389. * |-------------------------------------------------------------------------|
  8390. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8391. * |-------------------------------------------------------------------------|
  8392. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8393. * |-------------------------------------------------------------------------|
  8394. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8395. * |-------------------------------------------------------------------------|
  8396. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8397. * |-------------------------------------------------------------------------|
  8398. * | Reserved_2 |
  8399. * |-------------------------------------------------------------------------|
  8400. * Where:
  8401. * NH = Next Hop
  8402. * ASTVM = AST valid mask
  8403. * OA = on-chip AST valid bit
  8404. * ASTFM = AST flow mask
  8405. *
  8406. * The following field definitions describe the format of the rx peer map v2
  8407. * messages sent from the target to the host.
  8408. * - MSG_TYPE
  8409. * Bits 7:0
  8410. * Purpose: identifies this as an rx peer map v2 message
  8411. * Value: peer map v2 -> 0x1e
  8412. * - VDEV_ID
  8413. * Bits 15:8
  8414. * Purpose: Indicates which virtual device the peer is associated with.
  8415. * Value: vdev ID (used in the host to look up the vdev object)
  8416. * - SW_PEER_ID
  8417. * Bits 31:16
  8418. * Purpose: The peer ID (index) that WAL is allocating
  8419. * Value: (rx) peer ID
  8420. * - MAC_ADDR_L32
  8421. * Bits 31:0
  8422. * Purpose: Identifies which peer node the peer ID is for.
  8423. * Value: lower 4 bytes of peer node's MAC address
  8424. * - MAC_ADDR_U16
  8425. * Bits 15:0
  8426. * Purpose: Identifies which peer node the peer ID is for.
  8427. * Value: upper 2 bytes of peer node's MAC address
  8428. * - HW_PEER_ID / AST_INDEX_0
  8429. * Bits 31:16
  8430. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8431. * address, so for rx frames marked for rx --> tx forwarding, the
  8432. * host can determine from the HW peer ID provided as meta-data with
  8433. * the rx frame which peer the frame is supposed to be forwarded to.
  8434. * Value: ID used by the MAC HW to identify the peer
  8435. * - AST_HASH_VALUE
  8436. * Bits 15:0
  8437. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8438. * override feature.
  8439. * - NEXT_HOP
  8440. * Bit 16
  8441. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8442. * (Wireless Distribution System).
  8443. * - AST_VALID_MASK
  8444. * Bits 19:17
  8445. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8446. * - ONCHIP_AST_VALID_FLAG
  8447. * Bit 20
  8448. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8449. * is valid.
  8450. * - AST_INDEX_1
  8451. * Bits 15:0
  8452. * Purpose: indicate the second AST index for this peer
  8453. * - AST_0_FLOW_MASK
  8454. * Bits 19:16
  8455. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8456. * - AST_1_FLOW_MASK
  8457. * Bits 23:20
  8458. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8459. * - AST_2_FLOW_MASK
  8460. * Bits 27:24
  8461. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8462. * - AST_3_FLOW_MASK
  8463. * Bits 31:28
  8464. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8465. * - AST_INDEX_2
  8466. * Bits 15:0
  8467. * Purpose: indicate the third AST index for this peer
  8468. * - TID_VALID_HI_PRI
  8469. * Bits 23:16
  8470. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8471. * - TID_VALID_LOW_PRI
  8472. * Bits 31:24
  8473. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8474. * - AST_INDEX_3
  8475. * Bits 15:0
  8476. * Purpose: indicate the fourth AST index for this peer
  8477. * - ONCHIP_AST_IDX / RESERVED
  8478. * Bits 31:16
  8479. * Purpose: This field is valid only when split AST feature is enabled.
  8480. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8481. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8482. * address, this ast_idx is used for LMAC modules for RXPCU.
  8483. * Value: ID used by the LMAC HW to identify the peer
  8484. */
  8485. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8486. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8487. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8488. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8489. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8490. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8491. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8492. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8493. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8494. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8495. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8496. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8497. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8498. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8499. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8500. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8501. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8502. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8503. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8504. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8505. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8506. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8507. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8508. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8509. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8510. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8511. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8512. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8513. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8514. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8515. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8516. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8517. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8518. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8519. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8520. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8521. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8522. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8523. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8526. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8527. } while (0)
  8528. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8529. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8530. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8531. do { \
  8532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8533. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8534. } while (0)
  8535. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8536. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8537. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8538. do { \
  8539. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8540. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8541. } while (0)
  8542. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8543. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8544. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8545. do { \
  8546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8547. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8548. } while (0)
  8549. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8550. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8551. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8552. do { \
  8553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8554. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8555. } while (0)
  8556. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8557. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8558. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8559. do { \
  8560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8561. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8562. } while (0)
  8563. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8564. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8565. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8566. do { \
  8567. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8568. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8569. } while (0)
  8570. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8571. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8572. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8573. do { \
  8574. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8575. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8576. } while (0)
  8577. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8578. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8579. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8580. do { \
  8581. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8582. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8583. } while (0)
  8584. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8585. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8586. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8587. do { \
  8588. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8589. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8590. } while (0)
  8591. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8592. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8593. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8594. do { \
  8595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8596. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8597. } while (0)
  8598. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8599. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8600. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8601. do { \
  8602. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8603. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8604. } while (0)
  8605. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8606. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8607. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8608. do { \
  8609. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8610. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8611. } while (0)
  8612. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8613. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8614. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8615. do { \
  8616. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8617. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8618. } while (0)
  8619. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8620. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8621. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8624. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8625. } while (0)
  8626. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8627. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8628. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8631. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8632. } while (0)
  8633. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8634. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8635. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8638. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8639. } while (0)
  8640. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8641. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8642. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8643. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8644. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8645. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8646. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8647. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8648. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8649. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8650. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8651. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8652. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8653. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8654. /**
  8655. * @brief target -> host rx peer unmap V2 message definition
  8656. *
  8657. *
  8658. * The following diagram shows the format of the rx peer unmap message sent
  8659. * from the target to the host.
  8660. *
  8661. * |31 24|23 16|15 8|7 0|
  8662. * |-----------------------------------------------------------------------|
  8663. * | SW peer ID | VDEV ID | msg type |
  8664. * |-----------------------------------------------------------------------|
  8665. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8666. * |-----------------------------------------------------------------------|
  8667. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8668. * |-----------------------------------------------------------------------|
  8669. * | Peer Delete Duration |
  8670. * |-----------------------------------------------------------------------|
  8671. * | Reserved_0 | WDS Free Count |
  8672. * |-----------------------------------------------------------------------|
  8673. * | Reserved_1 |
  8674. * |-----------------------------------------------------------------------|
  8675. * | Reserved_2 |
  8676. * |-----------------------------------------------------------------------|
  8677. *
  8678. *
  8679. * The following field definitions describe the format of the rx peer unmap
  8680. * messages sent from the target to the host.
  8681. * - MSG_TYPE
  8682. * Bits 7:0
  8683. * Purpose: identifies this as an rx peer unmap v2 message
  8684. * Value: peer unmap v2 -> 0x1f
  8685. * - VDEV_ID
  8686. * Bits 15:8
  8687. * Purpose: Indicates which virtual device the peer is associated
  8688. * with.
  8689. * Value: vdev ID (used in the host to look up the vdev object)
  8690. * - SW_PEER_ID
  8691. * Bits 31:16
  8692. * Purpose: The peer ID (index) that WAL is freeing
  8693. * Value: (rx) peer ID
  8694. * - MAC_ADDR_L32
  8695. * Bits 31:0
  8696. * Purpose: Identifies which peer node the peer ID is for.
  8697. * Value: lower 4 bytes of peer node's MAC address
  8698. * - MAC_ADDR_U16
  8699. * Bits 15:0
  8700. * Purpose: Identifies which peer node the peer ID is for.
  8701. * Value: upper 2 bytes of peer node's MAC address
  8702. * - NEXT_HOP
  8703. * Bits 16
  8704. * Purpose: Bit indicates next_hop AST entry used for WDS
  8705. * (Wireless Distribution System).
  8706. * - PEER_DELETE_DURATION
  8707. * Bits 31:0
  8708. * Purpose: Time taken to delete peer, in msec,
  8709. * Used for monitoring / debugging PEER delete response delay
  8710. * - PEER_WDS_FREE_COUNT
  8711. * Bits 15:0
  8712. * Purpose: Count of WDS entries deleted associated to peer deleted
  8713. */
  8714. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8715. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8716. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8717. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8718. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8719. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8720. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8721. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8722. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8723. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8724. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8725. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8726. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8727. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8728. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8729. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8730. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8731. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8732. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8733. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8734. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8735. do { \
  8736. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8737. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8738. } while (0)
  8739. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8740. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8741. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8742. do { \
  8743. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8744. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8745. } while (0)
  8746. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8747. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8748. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8749. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8750. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8751. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8752. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8753. /**
  8754. * @brief target -> host message specifying security parameters
  8755. *
  8756. * @details
  8757. * The following diagram shows the format of the security specification
  8758. * message sent from the target to the host.
  8759. * This security specification message tells the host whether a PN check is
  8760. * necessary on rx data frames, and if so, how large the PN counter is.
  8761. * This message also tells the host about the security processing to apply
  8762. * to defragmented rx frames - specifically, whether a Message Integrity
  8763. * Check is required, and the Michael key to use.
  8764. *
  8765. * |31 24|23 16|15|14 8|7 0|
  8766. * |-----------------------------------------------------------------------|
  8767. * | peer ID | U| security type | msg type |
  8768. * |-----------------------------------------------------------------------|
  8769. * | Michael Key K0 |
  8770. * |-----------------------------------------------------------------------|
  8771. * | Michael Key K1 |
  8772. * |-----------------------------------------------------------------------|
  8773. * | WAPI RSC Low0 |
  8774. * |-----------------------------------------------------------------------|
  8775. * | WAPI RSC Low1 |
  8776. * |-----------------------------------------------------------------------|
  8777. * | WAPI RSC Hi0 |
  8778. * |-----------------------------------------------------------------------|
  8779. * | WAPI RSC Hi1 |
  8780. * |-----------------------------------------------------------------------|
  8781. *
  8782. * The following field definitions describe the format of the security
  8783. * indication message sent from the target to the host.
  8784. * - MSG_TYPE
  8785. * Bits 7:0
  8786. * Purpose: identifies this as a security specification message
  8787. * Value: 0xb
  8788. * - SEC_TYPE
  8789. * Bits 14:8
  8790. * Purpose: specifies which type of security applies to the peer
  8791. * Value: htt_sec_type enum value
  8792. * - UNICAST
  8793. * Bit 15
  8794. * Purpose: whether this security is applied to unicast or multicast data
  8795. * Value: 1 -> unicast, 0 -> multicast
  8796. * - PEER_ID
  8797. * Bits 31:16
  8798. * Purpose: The ID number for the peer the security specification is for
  8799. * Value: peer ID
  8800. * - MICHAEL_KEY_K0
  8801. * Bits 31:0
  8802. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8803. * Value: Michael Key K0 (if security type is TKIP)
  8804. * - MICHAEL_KEY_K1
  8805. * Bits 31:0
  8806. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8807. * Value: Michael Key K1 (if security type is TKIP)
  8808. * - WAPI_RSC_LOW0
  8809. * Bits 31:0
  8810. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8811. * Value: WAPI RSC Low0 (if security type is WAPI)
  8812. * - WAPI_RSC_LOW1
  8813. * Bits 31:0
  8814. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8815. * Value: WAPI RSC Low1 (if security type is WAPI)
  8816. * - WAPI_RSC_HI0
  8817. * Bits 31:0
  8818. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8819. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8820. * - WAPI_RSC_HI1
  8821. * Bits 31:0
  8822. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8823. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8824. */
  8825. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8826. #define HTT_SEC_IND_SEC_TYPE_S 8
  8827. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8828. #define HTT_SEC_IND_UNICAST_S 15
  8829. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8830. #define HTT_SEC_IND_PEER_ID_S 16
  8831. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8832. do { \
  8833. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8834. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8835. } while (0)
  8836. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8837. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8838. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8839. do { \
  8840. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8841. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8842. } while (0)
  8843. #define HTT_SEC_IND_UNICAST_GET(word) \
  8844. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8845. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8846. do { \
  8847. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8848. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8849. } while (0)
  8850. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8851. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8852. #define HTT_SEC_IND_BYTES 28
  8853. /**
  8854. * @brief target -> host rx ADDBA / DELBA message definitions
  8855. *
  8856. * @details
  8857. * The following diagram shows the format of the rx ADDBA message sent
  8858. * from the target to the host:
  8859. *
  8860. * |31 20|19 16|15 8|7 0|
  8861. * |---------------------------------------------------------------------|
  8862. * | peer ID | TID | window size | msg type |
  8863. * |---------------------------------------------------------------------|
  8864. *
  8865. * The following diagram shows the format of the rx DELBA message sent
  8866. * from the target to the host:
  8867. *
  8868. * |31 20|19 16|15 10|9 8|7 0|
  8869. * |---------------------------------------------------------------------|
  8870. * | peer ID | TID | window size | IR| msg type |
  8871. * |---------------------------------------------------------------------|
  8872. *
  8873. * The following field definitions describe the format of the rx ADDBA
  8874. * and DELBA messages sent from the target to the host.
  8875. * - MSG_TYPE
  8876. * Bits 7:0
  8877. * Purpose: identifies this as an rx ADDBA or DELBA message
  8878. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8879. * - IR (initiator / recipient)
  8880. * Bits 9:8 (DELBA only)
  8881. * Purpose: specify whether the DELBA handshake was initiated by the
  8882. * local STA/AP, or by the peer STA/AP
  8883. * Value:
  8884. * 0 - unspecified
  8885. * 1 - initiator (a.k.a. originator)
  8886. * 2 - recipient (a.k.a. responder)
  8887. * 3 - unused / reserved
  8888. * - WIN_SIZE
  8889. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8890. * Purpose: Specifies the length of the block ack window (max = 64).
  8891. * Value:
  8892. * block ack window length specified by the received ADDBA/DELBA
  8893. * management message.
  8894. * - TID
  8895. * Bits 19:16
  8896. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8897. * Value:
  8898. * TID specified by the received ADDBA or DELBA management message.
  8899. * - PEER_ID
  8900. * Bits 31:20
  8901. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8902. * Value:
  8903. * ID (hash value) used by the host for fast, direct lookup of
  8904. * host SW peer info, including rx reorder states.
  8905. */
  8906. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8907. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8908. #define HTT_RX_ADDBA_TID_M 0xf0000
  8909. #define HTT_RX_ADDBA_TID_S 16
  8910. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8911. #define HTT_RX_ADDBA_PEER_ID_S 20
  8912. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8913. do { \
  8914. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8915. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8916. } while (0)
  8917. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8918. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8919. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8920. do { \
  8921. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8922. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8923. } while (0)
  8924. #define HTT_RX_ADDBA_TID_GET(word) \
  8925. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8926. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8927. do { \
  8928. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8929. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8930. } while (0)
  8931. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8932. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8933. #define HTT_RX_ADDBA_BYTES 4
  8934. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8935. #define HTT_RX_DELBA_INITIATOR_S 8
  8936. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8937. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8938. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8939. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8940. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8941. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8942. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8943. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8944. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8945. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8946. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8947. do { \
  8948. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8949. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8950. } while (0)
  8951. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8952. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8953. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8954. do { \
  8955. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8956. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8957. } while (0)
  8958. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8959. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8960. #define HTT_RX_DELBA_BYTES 4
  8961. /**
  8962. * @brief tx queue group information element definition
  8963. *
  8964. * @details
  8965. * The following diagram shows the format of the tx queue group
  8966. * information element, which can be included in target --> host
  8967. * messages to specify the number of tx "credits" (tx descriptors
  8968. * for LL, or tx buffers for HL) available to a particular group
  8969. * of host-side tx queues, and which host-side tx queues belong to
  8970. * the group.
  8971. *
  8972. * |31|30 24|23 16|15|14|13 0|
  8973. * |------------------------------------------------------------------------|
  8974. * | X| reserved | tx queue grp ID | A| S| credit count |
  8975. * |------------------------------------------------------------------------|
  8976. * | vdev ID mask | AC mask |
  8977. * |------------------------------------------------------------------------|
  8978. *
  8979. * The following definitions describe the fields within the tx queue group
  8980. * information element:
  8981. * - credit_count
  8982. * Bits 13:1
  8983. * Purpose: specify how many tx credits are available to the tx queue group
  8984. * Value: An absolute or relative, positive or negative credit value
  8985. * The 'A' bit specifies whether the value is absolute or relative.
  8986. * The 'S' bit specifies whether the value is positive or negative.
  8987. * A negative value can only be relative, not absolute.
  8988. * An absolute value replaces any prior credit value the host has for
  8989. * the tx queue group in question.
  8990. * A relative value is added to the prior credit value the host has for
  8991. * the tx queue group in question.
  8992. * - sign
  8993. * Bit 14
  8994. * Purpose: specify whether the credit count is positive or negative
  8995. * Value: 0 -> positive, 1 -> negative
  8996. * - absolute
  8997. * Bit 15
  8998. * Purpose: specify whether the credit count is absolute or relative
  8999. * Value: 0 -> relative, 1 -> absolute
  9000. * - txq_group_id
  9001. * Bits 23:16
  9002. * Purpose: indicate which tx queue group's credit and/or membership are
  9003. * being specified
  9004. * Value: 0 to max_tx_queue_groups-1
  9005. * - reserved
  9006. * Bits 30:16
  9007. * Value: 0x0
  9008. * - eXtension
  9009. * Bit 31
  9010. * Purpose: specify whether another tx queue group info element follows
  9011. * Value: 0 -> no more tx queue group information elements
  9012. * 1 -> another tx queue group information element immediately follows
  9013. * - ac_mask
  9014. * Bits 15:0
  9015. * Purpose: specify which Access Categories belong to the tx queue group
  9016. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9017. * the tx queue group.
  9018. * The AC bit-mask values are obtained by left-shifting by the
  9019. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9020. * - vdev_id_mask
  9021. * Bits 31:16
  9022. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9023. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9024. * belong to the tx queue group.
  9025. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9026. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9027. */
  9028. PREPACK struct htt_txq_group {
  9029. A_UINT32
  9030. credit_count: 14,
  9031. sign: 1,
  9032. absolute: 1,
  9033. tx_queue_group_id: 8,
  9034. reserved0: 7,
  9035. extension: 1;
  9036. A_UINT32
  9037. ac_mask: 16,
  9038. vdev_id_mask: 16;
  9039. } POSTPACK;
  9040. /* first word */
  9041. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9042. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9043. #define HTT_TXQ_GROUP_SIGN_S 14
  9044. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9045. #define HTT_TXQ_GROUP_ABS_S 15
  9046. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9047. #define HTT_TXQ_GROUP_ID_S 16
  9048. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9049. #define HTT_TXQ_GROUP_EXT_S 31
  9050. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9051. /* second word */
  9052. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9053. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9054. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9055. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9056. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9057. do { \
  9058. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9059. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9060. } while (0)
  9061. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9062. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9063. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9064. do { \
  9065. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9066. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9067. } while (0)
  9068. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9069. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9070. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9073. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9074. } while (0)
  9075. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9076. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9077. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9078. do { \
  9079. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9080. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9081. } while (0)
  9082. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9083. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9084. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9085. do { \
  9086. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9087. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9088. } while (0)
  9089. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9090. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9091. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9092. do { \
  9093. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9094. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9095. } while (0)
  9096. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9097. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9098. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9099. do { \
  9100. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9101. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9102. } while (0)
  9103. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9104. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9105. /**
  9106. * @brief target -> host TX completion indication message definition
  9107. *
  9108. * @details
  9109. * The following diagram shows the format of the TX completion indication sent
  9110. * from the target to the host
  9111. *
  9112. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9113. * |-------------------------------------------------------------------|
  9114. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9115. * |-------------------------------------------------------------------|
  9116. * payload:| MSDU1 ID | MSDU0 ID |
  9117. * |-------------------------------------------------------------------|
  9118. * : MSDU3 ID | MSDU2 ID :
  9119. * |-------------------------------------------------------------------|
  9120. * | struct htt_tx_compl_ind_append_retries |
  9121. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9122. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9123. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9124. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9125. * |-------------------------------------------------------------------|
  9126. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9127. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9128. * | MSDU0 tx_tsf64_low |
  9129. * |-------------------------------------------------------------------|
  9130. * | MSDU0 tx_tsf64_high |
  9131. * |-------------------------------------------------------------------|
  9132. * | MSDU1 tx_tsf64_low |
  9133. * |-------------------------------------------------------------------|
  9134. * | MSDU1 tx_tsf64_high |
  9135. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9136. * | phy_timestamp |
  9137. * |-------------------------------------------------------------------|
  9138. * | rate specs (see below) |
  9139. * |-------------------------------------------------------------------|
  9140. * | seqctrl | framectrl |
  9141. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9142. * Where:
  9143. * A0 = append (a.k.a. append0)
  9144. * A1 = append1
  9145. * TP = MSDU tx power presence
  9146. * A2 = append2
  9147. * A3 = append3
  9148. * A4 = append4
  9149. *
  9150. * The following field definitions describe the format of the TX completion
  9151. * indication sent from the target to the host
  9152. * Header fields:
  9153. * - msg_type
  9154. * Bits 7:0
  9155. * Purpose: identifies this as HTT TX completion indication
  9156. * Value: 0x7
  9157. * - status
  9158. * Bits 10:8
  9159. * Purpose: the TX completion status of payload fragmentations descriptors
  9160. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9161. * - tid
  9162. * Bits 14:11
  9163. * Purpose: the tid associated with those fragmentation descriptors. It is
  9164. * valid or not, depending on the tid_invalid bit.
  9165. * Value: 0 to 15
  9166. * - tid_invalid
  9167. * Bits 15:15
  9168. * Purpose: this bit indicates whether the tid field is valid or not
  9169. * Value: 0 indicates valid; 1 indicates invalid
  9170. * - num
  9171. * Bits 23:16
  9172. * Purpose: the number of payload in this indication
  9173. * Value: 1 to 255
  9174. * - append (a.k.a. append0)
  9175. * Bits 24:24
  9176. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9177. * the number of tx retries for one MSDU at the end of this message
  9178. * Value: 0 indicates no appending; 1 indicates appending
  9179. * - append1
  9180. * Bits 25:25
  9181. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9182. * contains the timestamp info for each TX msdu id in payload.
  9183. * The order of the timestamps matches the order of the MSDU IDs.
  9184. * Note that a big-endian host needs to account for the reordering
  9185. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9186. * conversion) when determining which tx timestamp corresponds to
  9187. * which MSDU ID.
  9188. * Value: 0 indicates no appending; 1 indicates appending
  9189. * - msdu_tx_power_presence
  9190. * Bits 26:26
  9191. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9192. * for each MSDU referenced by the TX_COMPL_IND message.
  9193. * The tx power is reported in 0.5 dBm units.
  9194. * The order of the per-MSDU tx power reports matches the order
  9195. * of the MSDU IDs.
  9196. * Note that a big-endian host needs to account for the reordering
  9197. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9198. * conversion) when determining which Tx Power corresponds to
  9199. * which MSDU ID.
  9200. * Value: 0 indicates MSDU tx power reports are not appended,
  9201. * 1 indicates MSDU tx power reports are appended
  9202. * - append2
  9203. * Bits 27:27
  9204. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9205. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9206. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9207. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9208. * for each MSDU, for convenience.
  9209. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9210. * this append2 bit is set).
  9211. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9212. * dB above the noise floor.
  9213. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9214. * 1 indicates MSDU ACK RSSI values are appended.
  9215. * - append3
  9216. * Bits 28:28
  9217. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9218. * contains the tx tsf info based on wlan global TSF for
  9219. * each TX msdu id in payload.
  9220. * The order of the tx tsf matches the order of the MSDU IDs.
  9221. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9222. * values to indicate the the lower 32 bits and higher 32 bits of
  9223. * the tx tsf.
  9224. * The tx_tsf64 here represents the time MSDU was acked and the
  9225. * tx_tsf64 has microseconds units.
  9226. * Value: 0 indicates no appending; 1 indicates appending
  9227. * - append4
  9228. * Bits 29:29
  9229. * Purpose: Indicate whether data frame control fields and fields required
  9230. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9231. * message. The order of the this message matches the order of
  9232. * the MSDU IDs.
  9233. * Value: 0 indicates frame control fields and fields required for
  9234. * radio tap header values are not appended,
  9235. * 1 indicates frame control fields and fields required for
  9236. * radio tap header values are appended.
  9237. * Payload fields:
  9238. * - hmsdu_id
  9239. * Bits 15:0
  9240. * Purpose: this ID is used to track the Tx buffer in host
  9241. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9242. */
  9243. PREPACK struct htt_tx_data_hdr_information {
  9244. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9245. A_UINT32 /* word 1 */
  9246. /* preamble:
  9247. * 0-OFDM,
  9248. * 1-CCk,
  9249. * 2-HT,
  9250. * 3-VHT
  9251. */
  9252. preamble: 2, /* [1:0] */
  9253. /* mcs:
  9254. * In case of HT preamble interpret
  9255. * MCS along with NSS.
  9256. * Valid values for HT are 0 to 7.
  9257. * HT mcs 0 with NSS 2 is mcs 8.
  9258. * Valid values for VHT are 0 to 9.
  9259. */
  9260. mcs: 4, /* [5:2] */
  9261. /* rate:
  9262. * This is applicable only for
  9263. * CCK and OFDM preamble type
  9264. * rate 0: OFDM 48 Mbps,
  9265. * 1: OFDM 24 Mbps,
  9266. * 2: OFDM 12 Mbps
  9267. * 3: OFDM 6 Mbps
  9268. * 4: OFDM 54 Mbps
  9269. * 5: OFDM 36 Mbps
  9270. * 6: OFDM 18 Mbps
  9271. * 7: OFDM 9 Mbps
  9272. * rate 0: CCK 11 Mbps Long
  9273. * 1: CCK 5.5 Mbps Long
  9274. * 2: CCK 2 Mbps Long
  9275. * 3: CCK 1 Mbps Long
  9276. * 4: CCK 11 Mbps Short
  9277. * 5: CCK 5.5 Mbps Short
  9278. * 6: CCK 2 Mbps Short
  9279. */
  9280. rate : 3, /* [ 8: 6] */
  9281. rssi : 8, /* [16: 9] units=dBm */
  9282. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9283. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9284. stbc : 1, /* [22] */
  9285. sgi : 1, /* [23] */
  9286. ldpc : 1, /* [24] */
  9287. beamformed: 1, /* [25] */
  9288. /* tx_retry_cnt:
  9289. * Indicates retry count of data tx frames provided by the host.
  9290. */
  9291. tx_retry_cnt: 6; /* [31:26] */
  9292. A_UINT32 /* word 2 */
  9293. framectrl:16, /* [15: 0] */
  9294. seqno:16; /* [31:16] */
  9295. } POSTPACK;
  9296. #define HTT_TX_COMPL_IND_STATUS_S 8
  9297. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9298. #define HTT_TX_COMPL_IND_TID_S 11
  9299. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9300. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9301. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9302. #define HTT_TX_COMPL_IND_NUM_S 16
  9303. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9304. #define HTT_TX_COMPL_IND_APPEND_S 24
  9305. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9306. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9307. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9308. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9309. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9310. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9311. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9312. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9313. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9314. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9315. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9316. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9317. do { \
  9318. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9319. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9320. } while (0)
  9321. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9322. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9323. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9324. do { \
  9325. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9326. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9327. } while (0)
  9328. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9329. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9330. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9331. do { \
  9332. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9333. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9334. } while (0)
  9335. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9336. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9337. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9338. do { \
  9339. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9340. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9341. } while (0)
  9342. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9343. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9344. HTT_TX_COMPL_IND_TID_INV_S)
  9345. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9346. do { \
  9347. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9348. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9349. } while (0)
  9350. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9351. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9352. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9353. do { \
  9354. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9355. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9356. } while (0)
  9357. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9358. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9359. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9360. do { \
  9361. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9362. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9363. } while (0)
  9364. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9365. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9366. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9367. do { \
  9368. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9369. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9370. } while (0)
  9371. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9372. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9373. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9374. do { \
  9375. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9376. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9377. } while (0)
  9378. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9379. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9380. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9381. do { \
  9382. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9383. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9384. } while (0)
  9385. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9386. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9387. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9388. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9389. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9390. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9391. #define HTT_TX_COMPL_IND_STAT_OK 0
  9392. /* DISCARD:
  9393. * current meaning:
  9394. * MSDUs were queued for transmission but filtered by HW or SW
  9395. * without any over the air attempts
  9396. * legacy meaning (HL Rome):
  9397. * MSDUs were discarded by the target FW without any over the air
  9398. * attempts due to lack of space
  9399. */
  9400. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9401. /* NO_ACK:
  9402. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9403. */
  9404. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9405. /* POSTPONE:
  9406. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9407. * be downloaded again later (in the appropriate order), when they are
  9408. * deliverable.
  9409. */
  9410. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9411. /*
  9412. * The PEER_DEL tx completion status is used for HL cases
  9413. * where the peer the frame is for has been deleted.
  9414. * The host has already discarded its copy of the frame, but
  9415. * it still needs the tx completion to restore its credit.
  9416. */
  9417. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9418. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9419. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9420. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9421. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9422. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9423. PREPACK struct htt_tx_compl_ind_base {
  9424. A_UINT32 hdr;
  9425. A_UINT16 payload[1/*or more*/];
  9426. } POSTPACK;
  9427. PREPACK struct htt_tx_compl_ind_append_retries {
  9428. A_UINT16 msdu_id;
  9429. A_UINT8 tx_retries;
  9430. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9431. 0: this is the last append_retries struct */
  9432. } POSTPACK;
  9433. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9434. A_UINT32 timestamp[1/*or more*/];
  9435. } POSTPACK;
  9436. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9437. A_UINT32 tx_tsf64_low;
  9438. A_UINT32 tx_tsf64_high;
  9439. } POSTPACK;
  9440. /* htt_tx_data_hdr_information payload extension fields: */
  9441. /* DWORD zero */
  9442. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9443. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9444. /* DWORD one */
  9445. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9446. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9447. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9448. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9449. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9450. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9451. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9452. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9453. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9454. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9455. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9456. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9457. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9458. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9459. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9460. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9461. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9462. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9463. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9464. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9465. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9466. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9467. /* DWORD two */
  9468. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9469. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9470. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9471. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9472. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9473. do { \
  9474. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9475. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9476. } while (0)
  9477. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9478. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9479. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9480. do { \
  9481. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9482. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9483. } while (0)
  9484. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9485. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9486. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9487. do { \
  9488. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9489. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9490. } while (0)
  9491. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9492. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9493. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9494. do { \
  9495. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9496. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9497. } while (0)
  9498. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9499. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9500. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9501. do { \
  9502. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9503. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9504. } while (0)
  9505. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9506. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9507. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9508. do { \
  9509. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9510. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9511. } while (0)
  9512. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9513. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9514. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9515. do { \
  9516. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9517. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9518. } while (0)
  9519. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9520. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9521. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9522. do { \
  9523. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9524. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9525. } while (0)
  9526. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9527. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9528. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9529. do { \
  9530. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9531. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9532. } while (0)
  9533. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9534. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9535. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9536. do { \
  9537. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9538. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9539. } while (0)
  9540. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9541. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9542. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9543. do { \
  9544. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9545. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9546. } while (0)
  9547. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9548. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9549. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9550. do { \
  9551. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9552. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9553. } while (0)
  9554. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9555. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9556. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9557. do { \
  9558. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9559. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9560. } while (0)
  9561. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9562. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9563. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9564. do { \
  9565. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9566. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9567. } while (0)
  9568. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9569. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9570. /**
  9571. * @brief target -> host rate-control update indication message
  9572. *
  9573. * @details
  9574. * The following diagram shows the format of the RC Update message
  9575. * sent from the target to the host, while processing the tx-completion
  9576. * of a transmitted PPDU.
  9577. *
  9578. * |31 24|23 16|15 8|7 0|
  9579. * |-------------------------------------------------------------|
  9580. * | peer ID | vdev ID | msg_type |
  9581. * |-------------------------------------------------------------|
  9582. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9583. * |-------------------------------------------------------------|
  9584. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9585. * |-------------------------------------------------------------|
  9586. * | : |
  9587. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9588. * | : |
  9589. * |-------------------------------------------------------------|
  9590. * | : |
  9591. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9592. * | : |
  9593. * |-------------------------------------------------------------|
  9594. * : :
  9595. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9596. *
  9597. */
  9598. typedef struct {
  9599. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9600. A_UINT32 rate_code_flags;
  9601. A_UINT32 flags; /* Encodes information such as excessive
  9602. retransmission, aggregate, some info
  9603. from .11 frame control,
  9604. STBC, LDPC, (SGI and Tx Chain Mask
  9605. are encoded in ptx_rc->flags field),
  9606. AMPDU truncation (BT/time based etc.),
  9607. RTS/CTS attempt */
  9608. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9609. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9610. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9611. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9612. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9613. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9614. } HTT_RC_TX_DONE_PARAMS;
  9615. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9616. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9617. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9618. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9619. #define HTT_RC_UPDATE_VDEVID_S 8
  9620. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9621. #define HTT_RC_UPDATE_PEERID_S 16
  9622. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9623. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9624. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9625. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9626. do { \
  9627. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9628. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9629. } while (0)
  9630. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9631. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9632. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9633. do { \
  9634. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9635. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9636. } while (0)
  9637. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9638. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9639. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9640. do { \
  9641. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9642. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9643. } while (0)
  9644. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9645. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9646. /**
  9647. * @brief target -> host rx fragment indication message definition
  9648. *
  9649. * @details
  9650. * The following field definitions describe the format of the rx fragment
  9651. * indication message sent from the target to the host.
  9652. * The rx fragment indication message shares the format of the
  9653. * rx indication message, but not all fields from the rx indication message
  9654. * are relevant to the rx fragment indication message.
  9655. *
  9656. *
  9657. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9658. * |-----------+-------------------+---------------------+-------------|
  9659. * | peer ID | |FV| ext TID | msg type |
  9660. * |-------------------------------------------------------------------|
  9661. * | | flush | flush |
  9662. * | | end | start |
  9663. * | | seq num | seq num |
  9664. * |-------------------------------------------------------------------|
  9665. * | reserved | FW rx desc bytes |
  9666. * |-------------------------------------------------------------------|
  9667. * | | FW MSDU Rx |
  9668. * | | desc B0 |
  9669. * |-------------------------------------------------------------------|
  9670. * Header fields:
  9671. * - MSG_TYPE
  9672. * Bits 7:0
  9673. * Purpose: identifies this as an rx fragment indication message
  9674. * Value: 0xa
  9675. * - EXT_TID
  9676. * Bits 12:8
  9677. * Purpose: identify the traffic ID of the rx data, including
  9678. * special "extended" TID values for multicast, broadcast, and
  9679. * non-QoS data frames
  9680. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9681. * - FLUSH_VALID (FV)
  9682. * Bit 13
  9683. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9684. * is valid
  9685. * Value:
  9686. * 1 -> flush IE is valid and needs to be processed
  9687. * 0 -> flush IE is not valid and should be ignored
  9688. * - PEER_ID
  9689. * Bits 31:16
  9690. * Purpose: Identify, by ID, which peer sent the rx data
  9691. * Value: ID of the peer who sent the rx data
  9692. * - FLUSH_SEQ_NUM_START
  9693. * Bits 5:0
  9694. * Purpose: Indicate the start of a series of MPDUs to flush
  9695. * Not all MPDUs within this series are necessarily valid - the host
  9696. * must check each sequence number within this range to see if the
  9697. * corresponding MPDU is actually present.
  9698. * This field is only valid if the FV bit is set.
  9699. * Value:
  9700. * The sequence number for the first MPDUs to check to flush.
  9701. * The sequence number is masked by 0x3f.
  9702. * - FLUSH_SEQ_NUM_END
  9703. * Bits 11:6
  9704. * Purpose: Indicate the end of a series of MPDUs to flush
  9705. * Value:
  9706. * The sequence number one larger than the sequence number of the
  9707. * last MPDU to check to flush.
  9708. * The sequence number is masked by 0x3f.
  9709. * Not all MPDUs within this series are necessarily valid - the host
  9710. * must check each sequence number within this range to see if the
  9711. * corresponding MPDU is actually present.
  9712. * This field is only valid if the FV bit is set.
  9713. * Rx descriptor fields:
  9714. * - FW_RX_DESC_BYTES
  9715. * Bits 15:0
  9716. * Purpose: Indicate how many bytes in the Rx indication are used for
  9717. * FW Rx descriptors
  9718. * Value: 1
  9719. */
  9720. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9721. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9722. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9723. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9724. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9725. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9726. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9727. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9728. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9729. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9730. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9731. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9732. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9733. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9734. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9735. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9736. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9737. #define HTT_RX_FRAG_IND_BYTES \
  9738. (4 /* msg hdr */ + \
  9739. 4 /* flush spec */ + \
  9740. 4 /* (unused) FW rx desc bytes spec */ + \
  9741. 4 /* FW rx desc */)
  9742. /**
  9743. * @brief target -> host test message definition
  9744. *
  9745. * @details
  9746. * The following field definitions describe the format of the test
  9747. * message sent from the target to the host.
  9748. * The message consists of a 4-octet header, followed by a variable
  9749. * number of 32-bit integer values, followed by a variable number
  9750. * of 8-bit character values.
  9751. *
  9752. * |31 16|15 8|7 0|
  9753. * |-----------------------------------------------------------|
  9754. * | num chars | num ints | msg type |
  9755. * |-----------------------------------------------------------|
  9756. * | int 0 |
  9757. * |-----------------------------------------------------------|
  9758. * | int 1 |
  9759. * |-----------------------------------------------------------|
  9760. * | ... |
  9761. * |-----------------------------------------------------------|
  9762. * | char 3 | char 2 | char 1 | char 0 |
  9763. * |-----------------------------------------------------------|
  9764. * | | | ... | char 4 |
  9765. * |-----------------------------------------------------------|
  9766. * - MSG_TYPE
  9767. * Bits 7:0
  9768. * Purpose: identifies this as a test message
  9769. * Value: HTT_MSG_TYPE_TEST
  9770. * - NUM_INTS
  9771. * Bits 15:8
  9772. * Purpose: indicate how many 32-bit integers follow the message header
  9773. * - NUM_CHARS
  9774. * Bits 31:16
  9775. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9776. */
  9777. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9778. #define HTT_RX_TEST_NUM_INTS_S 8
  9779. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9780. #define HTT_RX_TEST_NUM_CHARS_S 16
  9781. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9784. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9785. } while (0)
  9786. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9787. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9788. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9789. do { \
  9790. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9791. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9792. } while (0)
  9793. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9794. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9795. /**
  9796. * @brief target -> host packet log message
  9797. *
  9798. * @details
  9799. * The following field definitions describe the format of the packet log
  9800. * message sent from the target to the host.
  9801. * The message consists of a 4-octet header,followed by a variable number
  9802. * of 32-bit character values.
  9803. *
  9804. * |31 16|15 12|11 10|9 8|7 0|
  9805. * |------------------------------------------------------------------|
  9806. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9807. * |------------------------------------------------------------------|
  9808. * | payload |
  9809. * |------------------------------------------------------------------|
  9810. * - MSG_TYPE
  9811. * Bits 7:0
  9812. * Purpose: identifies this as a pktlog message
  9813. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9814. * - mac_id
  9815. * Bits 9:8
  9816. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9817. * Value: 0-3
  9818. * - pdev_id
  9819. * Bits 11:10
  9820. * Purpose: pdev_id
  9821. * Value: 0-3
  9822. * 0 (for rings at SOC level),
  9823. * 1/2/3 PDEV -> 0/1/2
  9824. * - payload_size
  9825. * Bits 31:16
  9826. * Purpose: explicitly specify the payload size
  9827. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9828. */
  9829. PREPACK struct htt_pktlog_msg {
  9830. A_UINT32 header;
  9831. A_UINT32 payload[1/* or more */];
  9832. } POSTPACK;
  9833. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9834. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9835. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9836. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9837. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9838. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9839. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9840. do { \
  9841. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9842. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9843. } while (0)
  9844. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9845. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9846. HTT_T2H_PKTLOG_MAC_ID_S)
  9847. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9848. do { \
  9849. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9850. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9851. } while (0)
  9852. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9853. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9854. HTT_T2H_PKTLOG_PDEV_ID_S)
  9855. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9856. do { \
  9857. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9858. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9859. } while (0)
  9860. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9861. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9862. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9863. /*
  9864. * Rx reorder statistics
  9865. * NB: all the fields must be defined in 4 octets size.
  9866. */
  9867. struct rx_reorder_stats {
  9868. /* Non QoS MPDUs received */
  9869. A_UINT32 deliver_non_qos;
  9870. /* MPDUs received in-order */
  9871. A_UINT32 deliver_in_order;
  9872. /* Flush due to reorder timer expired */
  9873. A_UINT32 deliver_flush_timeout;
  9874. /* Flush due to move out of window */
  9875. A_UINT32 deliver_flush_oow;
  9876. /* Flush due to DELBA */
  9877. A_UINT32 deliver_flush_delba;
  9878. /* MPDUs dropped due to FCS error */
  9879. A_UINT32 fcs_error;
  9880. /* MPDUs dropped due to monitor mode non-data packet */
  9881. A_UINT32 mgmt_ctrl;
  9882. /* Unicast-data MPDUs dropped due to invalid peer */
  9883. A_UINT32 invalid_peer;
  9884. /* MPDUs dropped due to duplication (non aggregation) */
  9885. A_UINT32 dup_non_aggr;
  9886. /* MPDUs dropped due to processed before */
  9887. A_UINT32 dup_past;
  9888. /* MPDUs dropped due to duplicate in reorder queue */
  9889. A_UINT32 dup_in_reorder;
  9890. /* Reorder timeout happened */
  9891. A_UINT32 reorder_timeout;
  9892. /* invalid bar ssn */
  9893. A_UINT32 invalid_bar_ssn;
  9894. /* reorder reset due to bar ssn */
  9895. A_UINT32 ssn_reset;
  9896. /* Flush due to delete peer */
  9897. A_UINT32 deliver_flush_delpeer;
  9898. /* Flush due to offload*/
  9899. A_UINT32 deliver_flush_offload;
  9900. /* Flush due to out of buffer*/
  9901. A_UINT32 deliver_flush_oob;
  9902. /* MPDUs dropped due to PN check fail */
  9903. A_UINT32 pn_fail;
  9904. /* MPDUs dropped due to unable to allocate memory */
  9905. A_UINT32 store_fail;
  9906. /* Number of times the tid pool alloc succeeded */
  9907. A_UINT32 tid_pool_alloc_succ;
  9908. /* Number of times the MPDU pool alloc succeeded */
  9909. A_UINT32 mpdu_pool_alloc_succ;
  9910. /* Number of times the MSDU pool alloc succeeded */
  9911. A_UINT32 msdu_pool_alloc_succ;
  9912. /* Number of times the tid pool alloc failed */
  9913. A_UINT32 tid_pool_alloc_fail;
  9914. /* Number of times the MPDU pool alloc failed */
  9915. A_UINT32 mpdu_pool_alloc_fail;
  9916. /* Number of times the MSDU pool alloc failed */
  9917. A_UINT32 msdu_pool_alloc_fail;
  9918. /* Number of times the tid pool freed */
  9919. A_UINT32 tid_pool_free;
  9920. /* Number of times the MPDU pool freed */
  9921. A_UINT32 mpdu_pool_free;
  9922. /* Number of times the MSDU pool freed */
  9923. A_UINT32 msdu_pool_free;
  9924. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9925. A_UINT32 msdu_queued;
  9926. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9927. A_UINT32 msdu_recycled;
  9928. /* Number of MPDUs with invalid peer but A2 found in AST */
  9929. A_UINT32 invalid_peer_a2_in_ast;
  9930. /* Number of MPDUs with invalid peer but A3 found in AST */
  9931. A_UINT32 invalid_peer_a3_in_ast;
  9932. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9933. A_UINT32 invalid_peer_bmc_mpdus;
  9934. /* Number of MSDUs with err attention word */
  9935. A_UINT32 rxdesc_err_att;
  9936. /* Number of MSDUs with flag of peer_idx_invalid */
  9937. A_UINT32 rxdesc_err_peer_idx_inv;
  9938. /* Number of MSDUs with flag of peer_idx_timeout */
  9939. A_UINT32 rxdesc_err_peer_idx_to;
  9940. /* Number of MSDUs with flag of overflow */
  9941. A_UINT32 rxdesc_err_ov;
  9942. /* Number of MSDUs with flag of msdu_length_err */
  9943. A_UINT32 rxdesc_err_msdu_len;
  9944. /* Number of MSDUs with flag of mpdu_length_err */
  9945. A_UINT32 rxdesc_err_mpdu_len;
  9946. /* Number of MSDUs with flag of tkip_mic_err */
  9947. A_UINT32 rxdesc_err_tkip_mic;
  9948. /* Number of MSDUs with flag of decrypt_err */
  9949. A_UINT32 rxdesc_err_decrypt;
  9950. /* Number of MSDUs with flag of fcs_err */
  9951. A_UINT32 rxdesc_err_fcs;
  9952. /* Number of Unicast (bc_mc bit is not set in attention word)
  9953. * frames with invalid peer handler
  9954. */
  9955. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9956. /* Number of unicast frame directly (direct bit is set in attention word)
  9957. * to DUT with invalid peer handler
  9958. */
  9959. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9960. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9961. * frames with invalid peer handler
  9962. */
  9963. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9964. /* Number of MSDUs dropped due to no first MSDU flag */
  9965. A_UINT32 rxdesc_no_1st_msdu;
  9966. /* Number of MSDUs droped due to ring overflow */
  9967. A_UINT32 msdu_drop_ring_ov;
  9968. /* Number of MSDUs dropped due to FC mismatch */
  9969. A_UINT32 msdu_drop_fc_mismatch;
  9970. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9971. A_UINT32 msdu_drop_mgmt_remote_ring;
  9972. /* Number of MSDUs dropped due to errors not reported in attention word */
  9973. A_UINT32 msdu_drop_misc;
  9974. /* Number of MSDUs go to offload before reorder */
  9975. A_UINT32 offload_msdu_wal;
  9976. /* Number of data frame dropped by offload after reorder */
  9977. A_UINT32 offload_msdu_reorder;
  9978. /* Number of MPDUs with sequence number in the past and within the BA window */
  9979. A_UINT32 dup_past_within_window;
  9980. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9981. A_UINT32 dup_past_outside_window;
  9982. /* Number of MSDUs with decrypt/MIC error */
  9983. A_UINT32 rxdesc_err_decrypt_mic;
  9984. /* Number of data MSDUs received on both local and remote rings */
  9985. A_UINT32 data_msdus_on_both_rings;
  9986. /* MPDUs never filled */
  9987. A_UINT32 holes_not_filled;
  9988. };
  9989. /*
  9990. * Rx Remote buffer statistics
  9991. * NB: all the fields must be defined in 4 octets size.
  9992. */
  9993. struct rx_remote_buffer_mgmt_stats {
  9994. /* Total number of MSDUs reaped for Rx processing */
  9995. A_UINT32 remote_reaped;
  9996. /* MSDUs recycled within firmware */
  9997. A_UINT32 remote_recycled;
  9998. /* MSDUs stored by Data Rx */
  9999. A_UINT32 data_rx_msdus_stored;
  10000. /* Number of HTT indications from WAL Rx MSDU */
  10001. A_UINT32 wal_rx_ind;
  10002. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10003. A_UINT32 wal_rx_ind_unconsumed;
  10004. /* Number of HTT indications from Data Rx MSDU */
  10005. A_UINT32 data_rx_ind;
  10006. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10007. A_UINT32 data_rx_ind_unconsumed;
  10008. /* Number of HTT indications from ATHBUF */
  10009. A_UINT32 athbuf_rx_ind;
  10010. /* Number of remote buffers requested for refill */
  10011. A_UINT32 refill_buf_req;
  10012. /* Number of remote buffers filled by the host */
  10013. A_UINT32 refill_buf_rsp;
  10014. /* Number of times MAC hw_index = f/w write_index */
  10015. A_INT32 mac_no_bufs;
  10016. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10017. A_INT32 fw_indices_equal;
  10018. /* Number of times f/w finds no buffers to post */
  10019. A_INT32 host_no_bufs;
  10020. };
  10021. /*
  10022. * TXBF MU/SU packets and NDPA statistics
  10023. * NB: all the fields must be defined in 4 octets size.
  10024. */
  10025. struct rx_txbf_musu_ndpa_pkts_stats {
  10026. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10027. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10028. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10029. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10030. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10031. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10032. };
  10033. /*
  10034. * htt_dbg_stats_status -
  10035. * present - The requested stats have been delivered in full.
  10036. * This indicates that either the stats information was contained
  10037. * in its entirety within this message, or else this message
  10038. * completes the delivery of the requested stats info that was
  10039. * partially delivered through earlier STATS_CONF messages.
  10040. * partial - The requested stats have been delivered in part.
  10041. * One or more subsequent STATS_CONF messages with the same
  10042. * cookie value will be sent to deliver the remainder of the
  10043. * information.
  10044. * error - The requested stats could not be delivered, for example due
  10045. * to a shortage of memory to construct a message holding the
  10046. * requested stats.
  10047. * invalid - The requested stat type is either not recognized, or the
  10048. * target is configured to not gather the stats type in question.
  10049. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10050. * series_done - This special value indicates that no further stats info
  10051. * elements are present within a series of stats info elems
  10052. * (within a stats upload confirmation message).
  10053. */
  10054. enum htt_dbg_stats_status {
  10055. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10056. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10057. HTT_DBG_STATS_STATUS_ERROR = 2,
  10058. HTT_DBG_STATS_STATUS_INVALID = 3,
  10059. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10060. };
  10061. /**
  10062. * @brief target -> host statistics upload
  10063. *
  10064. * @details
  10065. * The following field definitions describe the format of the HTT target
  10066. * to host stats upload confirmation message.
  10067. * The message contains a cookie echoed from the HTT host->target stats
  10068. * upload request, which identifies which request the confirmation is
  10069. * for, and a series of tag-length-value stats information elements.
  10070. * The tag-length header for each stats info element also includes a
  10071. * status field, to indicate whether the request for the stat type in
  10072. * question was fully met, partially met, unable to be met, or invalid
  10073. * (if the stat type in question is disabled in the target).
  10074. * A special value of all 1's in this status field is used to indicate
  10075. * the end of the series of stats info elements.
  10076. *
  10077. *
  10078. * |31 16|15 8|7 5|4 0|
  10079. * |------------------------------------------------------------|
  10080. * | reserved | msg type |
  10081. * |------------------------------------------------------------|
  10082. * | cookie LSBs |
  10083. * |------------------------------------------------------------|
  10084. * | cookie MSBs |
  10085. * |------------------------------------------------------------|
  10086. * | stats entry length | reserved | S |stat type|
  10087. * |------------------------------------------------------------|
  10088. * | |
  10089. * | type-specific stats info |
  10090. * | |
  10091. * |------------------------------------------------------------|
  10092. * | stats entry length | reserved | S |stat type|
  10093. * |------------------------------------------------------------|
  10094. * | |
  10095. * | type-specific stats info |
  10096. * | |
  10097. * |------------------------------------------------------------|
  10098. * | n/a | reserved | 111 | n/a |
  10099. * |------------------------------------------------------------|
  10100. * Header fields:
  10101. * - MSG_TYPE
  10102. * Bits 7:0
  10103. * Purpose: identifies this is a statistics upload confirmation message
  10104. * Value: 0x9
  10105. * - COOKIE_LSBS
  10106. * Bits 31:0
  10107. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10108. * message with its preceding host->target stats request message.
  10109. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10110. * - COOKIE_MSBS
  10111. * Bits 31:0
  10112. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10113. * message with its preceding host->target stats request message.
  10114. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10115. *
  10116. * Stats Information Element tag-length header fields:
  10117. * - STAT_TYPE
  10118. * Bits 4:0
  10119. * Purpose: identifies the type of statistics info held in the
  10120. * following information element
  10121. * Value: htt_dbg_stats_type
  10122. * - STATUS
  10123. * Bits 7:5
  10124. * Purpose: indicate whether the requested stats are present
  10125. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10126. * the completion of the stats entry series
  10127. * - LENGTH
  10128. * Bits 31:16
  10129. * Purpose: indicate the stats information size
  10130. * Value: This field specifies the number of bytes of stats information
  10131. * that follows the element tag-length header.
  10132. * It is expected but not required that this length is a multiple of
  10133. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10134. * subsequent stats entry header will begin on a 4-byte aligned
  10135. * boundary.
  10136. */
  10137. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10138. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10139. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10140. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10141. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10142. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10143. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10144. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10145. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10146. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10147. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10148. do { \
  10149. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10150. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10151. } while (0)
  10152. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10153. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10154. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10155. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10156. do { \
  10157. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10158. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10159. } while (0)
  10160. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10161. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10162. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10163. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10164. do { \
  10165. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10166. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10167. } while (0)
  10168. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10169. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10170. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10171. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10172. #define HTT_MAX_AGGR 64
  10173. #define HTT_HL_MAX_AGGR 18
  10174. /**
  10175. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10176. *
  10177. * @details
  10178. * The following field definitions describe the format of the HTT host
  10179. * to target frag_desc/msdu_ext bank configuration message.
  10180. * The message contains the based address and the min and max id of the
  10181. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10182. * MSDU_EXT/FRAG_DESC.
  10183. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10184. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10185. * the hardware does the mapping/translation.
  10186. *
  10187. * Total banks that can be configured is configured to 16.
  10188. *
  10189. * This should be called before any TX has be initiated by the HTT
  10190. *
  10191. * |31 16|15 8|7 5|4 0|
  10192. * |------------------------------------------------------------|
  10193. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10194. * |------------------------------------------------------------|
  10195. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10196. #if HTT_PADDR64
  10197. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10198. #endif
  10199. * |------------------------------------------------------------|
  10200. * | ... |
  10201. * |------------------------------------------------------------|
  10202. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10203. #if HTT_PADDR64
  10204. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10205. #endif
  10206. * |------------------------------------------------------------|
  10207. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10208. * |------------------------------------------------------------|
  10209. * | ... |
  10210. * |------------------------------------------------------------|
  10211. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10212. * |------------------------------------------------------------|
  10213. * Header fields:
  10214. * - MSG_TYPE
  10215. * Bits 7:0
  10216. * Value: 0x6
  10217. * for systems with 64-bit format for bus addresses:
  10218. * - BANKx_BASE_ADDRESS_LO
  10219. * Bits 31:0
  10220. * Purpose: Provide a mechanism to specify the base address of the
  10221. * MSDU_EXT bank physical/bus address.
  10222. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10223. * - BANKx_BASE_ADDRESS_HI
  10224. * Bits 31:0
  10225. * Purpose: Provide a mechanism to specify the base address of the
  10226. * MSDU_EXT bank physical/bus address.
  10227. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10228. * for systems with 32-bit format for bus addresses:
  10229. * - BANKx_BASE_ADDRESS
  10230. * Bits 31:0
  10231. * Purpose: Provide a mechanism to specify the base address of the
  10232. * MSDU_EXT bank physical/bus address.
  10233. * Value: MSDU_EXT bank physical / bus address
  10234. * - BANKx_MIN_ID
  10235. * Bits 15:0
  10236. * Purpose: Provide a mechanism to specify the min index that needs to
  10237. * mapped.
  10238. * - BANKx_MAX_ID
  10239. * Bits 31:16
  10240. * Purpose: Provide a mechanism to specify the max index that needs to
  10241. * mapped.
  10242. *
  10243. */
  10244. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10245. * safe value.
  10246. * @note MAX supported banks is 16.
  10247. */
  10248. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10249. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10250. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10251. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10252. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10253. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10254. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10255. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10256. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10257. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10258. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10259. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10260. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10261. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10262. do { \
  10263. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10264. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10265. } while (0)
  10266. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10267. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10268. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10269. do { \
  10270. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10271. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10272. } while (0)
  10273. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10274. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10275. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10276. do { \
  10277. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10278. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10279. } while (0)
  10280. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10281. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10282. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10283. do { \
  10284. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10285. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10286. } while (0)
  10287. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10288. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10289. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10290. do { \
  10291. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10292. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10293. } while (0)
  10294. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10295. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10296. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10297. do { \
  10298. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10299. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10300. } while (0)
  10301. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10302. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10303. /*
  10304. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10305. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10306. * addresses are stored in a XXX-bit field.
  10307. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10308. * htt_tx_frag_desc64_bank_cfg_t structs.
  10309. */
  10310. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10311. _paddr_bits_, \
  10312. _paddr__bank_base_address_) \
  10313. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10314. /** word 0 \
  10315. * msg_type: 8, \
  10316. * pdev_id: 2, \
  10317. * swap: 1, \
  10318. * reserved0: 5, \
  10319. * num_banks: 8, \
  10320. * desc_size: 8; \
  10321. */ \
  10322. A_UINT32 word0; \
  10323. /* \
  10324. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10325. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10326. * the second A_UINT32). \
  10327. */ \
  10328. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10329. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10330. } POSTPACK
  10331. /* define htt_tx_frag_desc32_bank_cfg_t */
  10332. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10333. /* define htt_tx_frag_desc64_bank_cfg_t */
  10334. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10335. /*
  10336. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10337. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10338. */
  10339. #if HTT_PADDR64
  10340. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10341. #else
  10342. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10343. #endif
  10344. /**
  10345. * @brief target -> host HTT TX Credit total count update message definition
  10346. *
  10347. *|31 16|15|14 9| 8 |7 0 |
  10348. *|---------------------+--+----------+-------+----------|
  10349. *|cur htt credit delta | Q| reserved | sign | msg type |
  10350. *|------------------------------------------------------|
  10351. *
  10352. * Header fields:
  10353. * - MSG_TYPE
  10354. * Bits 7:0
  10355. * Purpose: identifies this as a htt tx credit delta update message
  10356. * Value: 0xe
  10357. * - SIGN
  10358. * Bits 8
  10359. * identifies whether credit delta is positive or negative
  10360. * Value:
  10361. * - 0x0: credit delta is positive, rebalance in some buffers
  10362. * - 0x1: credit delta is negative, rebalance out some buffers
  10363. * - reserved
  10364. * Bits 14:9
  10365. * Value: 0x0
  10366. * - TXQ_GRP
  10367. * Bit 15
  10368. * Purpose: indicates whether any tx queue group information elements
  10369. * are appended to the tx credit update message
  10370. * Value: 0 -> no tx queue group information element is present
  10371. * 1 -> a tx queue group information element immediately follows
  10372. * - DELTA_COUNT
  10373. * Bits 31:16
  10374. * Purpose: Specify current htt credit delta absolute count
  10375. */
  10376. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10377. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10378. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10379. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10380. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10381. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10382. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10383. do { \
  10384. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10385. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10386. } while (0)
  10387. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10388. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10389. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10390. do { \
  10391. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10392. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10393. } while (0)
  10394. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10395. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10396. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10397. do { \
  10398. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10399. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10400. } while (0)
  10401. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10402. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10403. #define HTT_TX_CREDIT_MSG_BYTES 4
  10404. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10405. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10406. /**
  10407. * @brief HTT WDI_IPA Operation Response Message
  10408. *
  10409. * @details
  10410. * HTT WDI_IPA Operation Response message is sent by target
  10411. * to host confirming suspend or resume operation.
  10412. * |31 24|23 16|15 8|7 0|
  10413. * |----------------+----------------+----------------+----------------|
  10414. * | op_code | Rsvd | msg_type |
  10415. * |-------------------------------------------------------------------|
  10416. * | Rsvd | Response len |
  10417. * |-------------------------------------------------------------------|
  10418. * | |
  10419. * | Response-type specific info |
  10420. * | |
  10421. * | |
  10422. * |-------------------------------------------------------------------|
  10423. * Header fields:
  10424. * - MSG_TYPE
  10425. * Bits 7:0
  10426. * Purpose: Identifies this as WDI_IPA Operation Response message
  10427. * value: = 0x13
  10428. * - OP_CODE
  10429. * Bits 31:16
  10430. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10431. * value: = enum htt_wdi_ipa_op_code
  10432. * - RSP_LEN
  10433. * Bits 16:0
  10434. * Purpose: length for the response-type specific info
  10435. * value: = length in bytes for response-type specific info
  10436. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10437. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10438. */
  10439. PREPACK struct htt_wdi_ipa_op_response_t
  10440. {
  10441. /* DWORD 0: flags and meta-data */
  10442. A_UINT32
  10443. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10444. reserved1: 8,
  10445. op_code: 16;
  10446. A_UINT32
  10447. rsp_len: 16,
  10448. reserved2: 16;
  10449. } POSTPACK;
  10450. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10451. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10452. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10453. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10454. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10455. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10456. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10457. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10460. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10461. } while (0)
  10462. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10463. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10464. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10465. do { \
  10466. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10467. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10468. } while (0)
  10469. enum htt_phy_mode {
  10470. htt_phy_mode_11a = 0,
  10471. htt_phy_mode_11g = 1,
  10472. htt_phy_mode_11b = 2,
  10473. htt_phy_mode_11g_only = 3,
  10474. htt_phy_mode_11na_ht20 = 4,
  10475. htt_phy_mode_11ng_ht20 = 5,
  10476. htt_phy_mode_11na_ht40 = 6,
  10477. htt_phy_mode_11ng_ht40 = 7,
  10478. htt_phy_mode_11ac_vht20 = 8,
  10479. htt_phy_mode_11ac_vht40 = 9,
  10480. htt_phy_mode_11ac_vht80 = 10,
  10481. htt_phy_mode_11ac_vht20_2g = 11,
  10482. htt_phy_mode_11ac_vht40_2g = 12,
  10483. htt_phy_mode_11ac_vht80_2g = 13,
  10484. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10485. htt_phy_mode_11ac_vht160 = 15,
  10486. htt_phy_mode_max,
  10487. };
  10488. /**
  10489. * @brief target -> host HTT channel change indication
  10490. * @details
  10491. * Specify when a channel change occurs.
  10492. * This allows the host to precisely determine which rx frames arrived
  10493. * on the old channel and which rx frames arrived on the new channel.
  10494. *
  10495. *|31 |7 0 |
  10496. *|-------------------------------------------+----------|
  10497. *| reserved | msg type |
  10498. *|------------------------------------------------------|
  10499. *| primary_chan_center_freq_mhz |
  10500. *|------------------------------------------------------|
  10501. *| contiguous_chan1_center_freq_mhz |
  10502. *|------------------------------------------------------|
  10503. *| contiguous_chan2_center_freq_mhz |
  10504. *|------------------------------------------------------|
  10505. *| phy_mode |
  10506. *|------------------------------------------------------|
  10507. *
  10508. * Header fields:
  10509. * - MSG_TYPE
  10510. * Bits 7:0
  10511. * Purpose: identifies this as a htt channel change indication message
  10512. * Value: 0x15
  10513. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10514. * Bits 31:0
  10515. * Purpose: identify the (center of the) new 20 MHz primary channel
  10516. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10517. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10518. * Bits 31:0
  10519. * Purpose: identify the (center of the) contiguous frequency range
  10520. * comprising the new channel.
  10521. * For example, if the new channel is a 80 MHz channel extending
  10522. * 60 MHz beyond the primary channel, this field would be 30 larger
  10523. * than the primary channel center frequency field.
  10524. * Value: center frequency of the contiguous frequency range comprising
  10525. * the full channel in MHz units
  10526. * (80+80 channels also use the CONTIG_CHAN2 field)
  10527. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10528. * Bits 31:0
  10529. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10530. * within a VHT 80+80 channel.
  10531. * This field is only relevant for VHT 80+80 channels.
  10532. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10533. * channel (arbitrary value for cases besides VHT 80+80)
  10534. * - PHY_MODE
  10535. * Bits 31:0
  10536. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10537. * and band
  10538. * Value: htt_phy_mode enum value
  10539. */
  10540. PREPACK struct htt_chan_change_t
  10541. {
  10542. /* DWORD 0: flags and meta-data */
  10543. A_UINT32
  10544. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10545. reserved1: 24;
  10546. A_UINT32 primary_chan_center_freq_mhz;
  10547. A_UINT32 contig_chan1_center_freq_mhz;
  10548. A_UINT32 contig_chan2_center_freq_mhz;
  10549. A_UINT32 phy_mode;
  10550. } POSTPACK;
  10551. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10552. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10553. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10554. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10555. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10556. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10557. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10558. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10559. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10560. do { \
  10561. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10562. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10563. } while (0)
  10564. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10565. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10566. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10567. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10568. do { \
  10569. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10570. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10571. } while (0)
  10572. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10573. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10574. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10575. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10576. do { \
  10577. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10578. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10579. } while (0)
  10580. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10581. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10582. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10583. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10584. do { \
  10585. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10586. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10587. } while (0)
  10588. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10589. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10590. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10591. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10592. /**
  10593. * @brief rx offload packet error message
  10594. *
  10595. * @details
  10596. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10597. * of target payload like mic err.
  10598. *
  10599. * |31 24|23 16|15 8|7 0|
  10600. * |----------------+----------------+----------------+----------------|
  10601. * | tid | vdev_id | msg_sub_type | msg_type |
  10602. * |-------------------------------------------------------------------|
  10603. * : (sub-type dependent content) :
  10604. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10605. * Header fields:
  10606. * - msg_type
  10607. * Bits 7:0
  10608. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10609. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10610. * - msg_sub_type
  10611. * Bits 15:8
  10612. * Purpose: Identifies which type of rx error is reported by this message
  10613. * value: htt_rx_ofld_pkt_err_type
  10614. * - vdev_id
  10615. * Bits 23:16
  10616. * Purpose: Identifies which vdev received the erroneous rx frame
  10617. * value:
  10618. * - tid
  10619. * Bits 31:24
  10620. * Purpose: Identifies the traffic type of the rx frame
  10621. * value:
  10622. *
  10623. * - The payload fields used if the sub-type == MIC error are shown below.
  10624. * Note - MIC err is per MSDU, while PN is per MPDU.
  10625. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10626. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10627. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10628. * instead of sending separate HTT messages for each wrong MSDU within
  10629. * the MPDU.
  10630. *
  10631. * |31 24|23 16|15 8|7 0|
  10632. * |----------------+----------------+----------------+----------------|
  10633. * | Rsvd | key_id | peer_id |
  10634. * |-------------------------------------------------------------------|
  10635. * | receiver MAC addr 31:0 |
  10636. * |-------------------------------------------------------------------|
  10637. * | Rsvd | receiver MAC addr 47:32 |
  10638. * |-------------------------------------------------------------------|
  10639. * | transmitter MAC addr 31:0 |
  10640. * |-------------------------------------------------------------------|
  10641. * | Rsvd | transmitter MAC addr 47:32 |
  10642. * |-------------------------------------------------------------------|
  10643. * | PN 31:0 |
  10644. * |-------------------------------------------------------------------|
  10645. * | Rsvd | PN 47:32 |
  10646. * |-------------------------------------------------------------------|
  10647. * - peer_id
  10648. * Bits 15:0
  10649. * Purpose: identifies which peer is frame is from
  10650. * value:
  10651. * - key_id
  10652. * Bits 23:16
  10653. * Purpose: identifies key_id of rx frame
  10654. * value:
  10655. * - RA_31_0 (receiver MAC addr 31:0)
  10656. * Bits 31:0
  10657. * Purpose: identifies by MAC address which vdev received the frame
  10658. * value: MAC address lower 4 bytes
  10659. * - RA_47_32 (receiver MAC addr 47:32)
  10660. * Bits 15:0
  10661. * Purpose: identifies by MAC address which vdev received the frame
  10662. * value: MAC address upper 2 bytes
  10663. * - TA_31_0 (transmitter MAC addr 31:0)
  10664. * Bits 31:0
  10665. * Purpose: identifies by MAC address which peer transmitted the frame
  10666. * value: MAC address lower 4 bytes
  10667. * - TA_47_32 (transmitter MAC addr 47:32)
  10668. * Bits 15:0
  10669. * Purpose: identifies by MAC address which peer transmitted the frame
  10670. * value: MAC address upper 2 bytes
  10671. * - PN_31_0
  10672. * Bits 31:0
  10673. * Purpose: Identifies pn of rx frame
  10674. * value: PN lower 4 bytes
  10675. * - PN_47_32
  10676. * Bits 15:0
  10677. * Purpose: Identifies pn of rx frame
  10678. * value:
  10679. * TKIP or CCMP: PN upper 2 bytes
  10680. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10681. */
  10682. enum htt_rx_ofld_pkt_err_type {
  10683. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10684. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10685. };
  10686. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10687. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10688. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10689. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10690. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10691. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10692. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10693. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10694. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10695. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10696. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10697. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10698. do { \
  10699. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10700. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10701. } while (0)
  10702. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10703. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10704. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10705. do { \
  10706. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10707. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10708. } while (0)
  10709. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10710. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10711. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10712. do { \
  10713. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10714. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10715. } while (0)
  10716. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10717. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10719. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10720. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10722. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10723. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10725. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10727. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10728. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10729. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10730. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10731. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10733. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10734. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10735. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10736. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10737. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10738. do { \
  10739. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10740. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10741. } while (0)
  10742. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10743. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10744. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10745. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10746. do { \
  10747. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10748. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10749. } while (0)
  10750. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10751. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10752. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10754. do { \
  10755. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10756. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10757. } while (0)
  10758. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10759. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10760. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10761. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10762. do { \
  10763. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10764. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10765. } while (0)
  10766. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10767. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10768. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10769. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10770. do { \
  10771. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10772. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10773. } while (0)
  10774. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10775. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10776. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10777. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10778. do { \
  10779. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10780. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10781. } while (0)
  10782. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10783. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10784. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10785. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10786. do { \
  10787. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10788. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10789. } while (0)
  10790. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10791. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10792. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10793. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10796. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10797. } while (0)
  10798. /**
  10799. * @brief peer rate report message
  10800. *
  10801. * @details
  10802. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10803. * justified rate of all the peers.
  10804. *
  10805. * |31 24|23 16|15 8|7 0|
  10806. * |----------------+----------------+----------------+----------------|
  10807. * | peer_count | | msg_type |
  10808. * |-------------------------------------------------------------------|
  10809. * : Payload (variant number of peer rate report) :
  10810. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10811. * Header fields:
  10812. * - msg_type
  10813. * Bits 7:0
  10814. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10815. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10816. * - reserved
  10817. * Bits 15:8
  10818. * Purpose:
  10819. * value:
  10820. * - peer_count
  10821. * Bits 31:16
  10822. * Purpose: Specify how many peer rate report elements are present in the payload.
  10823. * value:
  10824. *
  10825. * Payload:
  10826. * There are variant number of peer rate report follow the first 32 bits.
  10827. * The peer rate report is defined as follows.
  10828. *
  10829. * |31 20|19 16|15 0|
  10830. * |-----------------------+---------+---------------------------------|-
  10831. * | reserved | phy | peer_id | \
  10832. * |-------------------------------------------------------------------| -> report #0
  10833. * | rate | /
  10834. * |-----------------------+---------+---------------------------------|-
  10835. * | reserved | phy | peer_id | \
  10836. * |-------------------------------------------------------------------| -> report #1
  10837. * | rate | /
  10838. * |-----------------------+---------+---------------------------------|-
  10839. * | reserved | phy | peer_id | \
  10840. * |-------------------------------------------------------------------| -> report #2
  10841. * | rate | /
  10842. * |-------------------------------------------------------------------|-
  10843. * : :
  10844. * : :
  10845. * : :
  10846. * :-------------------------------------------------------------------:
  10847. *
  10848. * - peer_id
  10849. * Bits 15:0
  10850. * Purpose: identify the peer
  10851. * value:
  10852. * - phy
  10853. * Bits 19:16
  10854. * Purpose: identify which phy is in use
  10855. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10856. * Please see enum htt_peer_report_phy_type for detail.
  10857. * - reserved
  10858. * Bits 31:20
  10859. * Purpose:
  10860. * value:
  10861. * - rate
  10862. * Bits 31:0
  10863. * Purpose: represent the justified rate of the peer specified by peer_id
  10864. * value:
  10865. */
  10866. enum htt_peer_rate_report_phy_type {
  10867. HTT_PEER_RATE_REPORT_11B = 0,
  10868. HTT_PEER_RATE_REPORT_11A_G,
  10869. HTT_PEER_RATE_REPORT_11N,
  10870. HTT_PEER_RATE_REPORT_11AC,
  10871. };
  10872. #define HTT_PEER_RATE_REPORT_SIZE 8
  10873. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10874. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10875. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10876. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10877. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10878. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10879. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10880. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10881. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10882. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10883. do { \
  10884. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10885. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10886. } while (0)
  10887. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10888. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10889. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10890. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10891. do { \
  10892. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10893. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10894. } while (0)
  10895. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10896. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10897. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10898. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10899. do { \
  10900. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10901. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10902. } while (0)
  10903. /**
  10904. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10905. *
  10906. * @details
  10907. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10908. * a flow of descriptors.
  10909. *
  10910. * This message is in TLV format and indicates the parameters to be setup a
  10911. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10912. * receive descriptors from a specified pool.
  10913. *
  10914. * The message would appear as follows:
  10915. *
  10916. * |31 24|23 16|15 8|7 0|
  10917. * |----------------+----------------+----------------+----------------|
  10918. * header | reserved | num_flows | msg_type |
  10919. * |-------------------------------------------------------------------|
  10920. * | |
  10921. * : payload :
  10922. * | |
  10923. * |-------------------------------------------------------------------|
  10924. *
  10925. * The header field is one DWORD long and is interpreted as follows:
  10926. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10927. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10928. * this message
  10929. * b'16-31 - reserved: These bits are reserved for future use
  10930. *
  10931. * Payload:
  10932. * The payload would contain multiple objects of the following structure. Each
  10933. * object represents a flow.
  10934. *
  10935. * |31 24|23 16|15 8|7 0|
  10936. * |----------------+----------------+----------------+----------------|
  10937. * header | reserved | num_flows | msg_type |
  10938. * |-------------------------------------------------------------------|
  10939. * payload0| flow_type |
  10940. * |-------------------------------------------------------------------|
  10941. * | flow_id |
  10942. * |-------------------------------------------------------------------|
  10943. * | reserved0 | flow_pool_id |
  10944. * |-------------------------------------------------------------------|
  10945. * | reserved1 | flow_pool_size |
  10946. * |-------------------------------------------------------------------|
  10947. * | reserved2 |
  10948. * |-------------------------------------------------------------------|
  10949. * payload1| flow_type |
  10950. * |-------------------------------------------------------------------|
  10951. * | flow_id |
  10952. * |-------------------------------------------------------------------|
  10953. * | reserved0 | flow_pool_id |
  10954. * |-------------------------------------------------------------------|
  10955. * | reserved1 | flow_pool_size |
  10956. * |-------------------------------------------------------------------|
  10957. * | reserved2 |
  10958. * |-------------------------------------------------------------------|
  10959. * | . |
  10960. * | . |
  10961. * | . |
  10962. * |-------------------------------------------------------------------|
  10963. *
  10964. * Each payload is 5 DWORDS long and is interpreted as follows:
  10965. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10966. * this flow is associated. It can be VDEV, peer,
  10967. * or tid (AC). Based on enum htt_flow_type.
  10968. *
  10969. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10970. * object. For flow_type vdev it is set to the
  10971. * vdevid, for peer it is peerid and for tid, it is
  10972. * tid_num.
  10973. *
  10974. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10975. * in the host for this flow
  10976. * b'16:31 - reserved0: This field in reserved for the future. In case
  10977. * we have a hierarchical implementation (HCM) of
  10978. * pools, it can be used to indicate the ID of the
  10979. * parent-pool.
  10980. *
  10981. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10982. * Descriptors for this flow will be
  10983. * allocated from this pool in the host.
  10984. * b'16:31 - reserved1: This field in reserved for the future. In case
  10985. * we have a hierarchical implementation of pools,
  10986. * it can be used to indicate the max number of
  10987. * descriptors in the pool. The b'0:15 can be used
  10988. * to indicate min number of descriptors in the
  10989. * HCM scheme.
  10990. *
  10991. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10992. * we have a hierarchical implementation of pools,
  10993. * b'0:15 can be used to indicate the
  10994. * priority-based borrowing (PBB) threshold of
  10995. * the flow's pool. The b'16:31 are still left
  10996. * reserved.
  10997. */
  10998. enum htt_flow_type {
  10999. FLOW_TYPE_VDEV = 0,
  11000. /* Insert new flow types above this line */
  11001. };
  11002. PREPACK struct htt_flow_pool_map_payload_t {
  11003. A_UINT32 flow_type;
  11004. A_UINT32 flow_id;
  11005. A_UINT32 flow_pool_id:16,
  11006. reserved0:16;
  11007. A_UINT32 flow_pool_size:16,
  11008. reserved1:16;
  11009. A_UINT32 reserved2;
  11010. } POSTPACK;
  11011. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11012. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11013. (sizeof(struct htt_flow_pool_map_payload_t))
  11014. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11015. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11016. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11017. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11018. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11019. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11020. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11021. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11022. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11023. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11024. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11025. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11026. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11027. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11028. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11029. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11030. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11031. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11032. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11033. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11034. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11035. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11036. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11037. do { \
  11038. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11039. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11040. } while (0)
  11041. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11042. do { \
  11043. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11044. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11045. } while (0)
  11046. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11049. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11050. } while (0)
  11051. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11052. do { \
  11053. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11054. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11055. } while (0)
  11056. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11057. do { \
  11058. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11059. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11060. } while (0)
  11061. /**
  11062. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  11063. *
  11064. * @details
  11065. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11066. * down a flow of descriptors.
  11067. * This message indicates that for the flow (whose ID is provided) is wanting
  11068. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11069. * pool of descriptors from where descriptors are being allocated for this
  11070. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11071. * be unmapped by the host.
  11072. *
  11073. * The message would appear as follows:
  11074. *
  11075. * |31 24|23 16|15 8|7 0|
  11076. * |----------------+----------------+----------------+----------------|
  11077. * | reserved0 | msg_type |
  11078. * |-------------------------------------------------------------------|
  11079. * | flow_type |
  11080. * |-------------------------------------------------------------------|
  11081. * | flow_id |
  11082. * |-------------------------------------------------------------------|
  11083. * | reserved1 | flow_pool_id |
  11084. * |-------------------------------------------------------------------|
  11085. *
  11086. * The message is interpreted as follows:
  11087. * dword0 - b'0:7 - msg_type: This will be set to
  11088. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11089. * b'8:31 - reserved0: Reserved for future use
  11090. *
  11091. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11092. * this flow is associated. It can be VDEV, peer,
  11093. * or tid (AC). Based on enum htt_flow_type.
  11094. *
  11095. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11096. * object. For flow_type vdev it is set to the
  11097. * vdevid, for peer it is peerid and for tid, it is
  11098. * tid_num.
  11099. *
  11100. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11101. * used in the host for this flow
  11102. * b'16:31 - reserved0: This field in reserved for the future.
  11103. *
  11104. */
  11105. PREPACK struct htt_flow_pool_unmap_t {
  11106. A_UINT32 msg_type:8,
  11107. reserved0:24;
  11108. A_UINT32 flow_type;
  11109. A_UINT32 flow_id;
  11110. A_UINT32 flow_pool_id:16,
  11111. reserved1:16;
  11112. } POSTPACK;
  11113. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11114. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11115. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11116. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11117. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11118. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11119. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11120. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11121. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11122. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11123. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11124. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11125. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11126. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11127. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11128. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11129. do { \
  11130. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11131. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11132. } while (0)
  11133. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11134. do { \
  11135. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11136. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11137. } while (0)
  11138. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11139. do { \
  11140. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11141. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11142. } while (0)
  11143. /**
  11144. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11145. *
  11146. * @details
  11147. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11148. * SRNG ring setup is done
  11149. *
  11150. * This message indicates whether the last setup operation is successful.
  11151. * It will be sent to host when host set respose_required bit in
  11152. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11153. * The message would appear as follows:
  11154. *
  11155. * |31 24|23 16|15 8|7 0|
  11156. * |--------------- +----------------+----------------+----------------|
  11157. * | setup_status | ring_id | pdev_id | msg_type |
  11158. * |-------------------------------------------------------------------|
  11159. *
  11160. * The message is interpreted as follows:
  11161. * dword0 - b'0:7 - msg_type: This will be set to
  11162. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11163. * b'8:15 - pdev_id:
  11164. * 0 (for rings at SOC/UMAC level),
  11165. * 1/2/3 mac id (for rings at LMAC level)
  11166. * b'16:23 - ring_id: Identify the ring which is set up
  11167. * More details can be got from enum htt_srng_ring_id
  11168. * b'24:31 - setup_status: Indicate status of setup operation
  11169. * Refer to htt_ring_setup_status
  11170. */
  11171. PREPACK struct htt_sring_setup_done_t {
  11172. A_UINT32 msg_type: 8,
  11173. pdev_id: 8,
  11174. ring_id: 8,
  11175. setup_status: 8;
  11176. } POSTPACK;
  11177. enum htt_ring_setup_status {
  11178. htt_ring_setup_status_ok = 0,
  11179. htt_ring_setup_status_error,
  11180. };
  11181. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11182. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11183. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11184. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11185. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11186. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11187. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11190. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11191. } while (0)
  11192. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11193. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11194. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11195. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11196. HTT_SRING_SETUP_DONE_RING_ID_S)
  11197. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11200. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11201. } while (0)
  11202. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11203. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11204. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11205. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11206. HTT_SRING_SETUP_DONE_STATUS_S)
  11207. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11208. do { \
  11209. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11210. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11211. } while (0)
  11212. /**
  11213. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11214. *
  11215. * @details
  11216. * HTT TX map flow entry with tqm flow pointer
  11217. * Sent from firmware to host to add tqm flow pointer in corresponding
  11218. * flow search entry. Flow metadata is replayed back to host as part of this
  11219. * struct to enable host to find the specific flow search entry
  11220. *
  11221. * The message would appear as follows:
  11222. *
  11223. * |31 28|27 18|17 14|13 8|7 0|
  11224. * |-------+------------------------------------------+----------------|
  11225. * | rsvd0 | fse_hsh_idx | msg_type |
  11226. * |-------------------------------------------------------------------|
  11227. * | rsvd1 | tid | peer_id |
  11228. * |-------------------------------------------------------------------|
  11229. * | tqm_flow_pntr_lo |
  11230. * |-------------------------------------------------------------------|
  11231. * | tqm_flow_pntr_hi |
  11232. * |-------------------------------------------------------------------|
  11233. * | fse_meta_data |
  11234. * |-------------------------------------------------------------------|
  11235. *
  11236. * The message is interpreted as follows:
  11237. *
  11238. * dword0 - b'0:7 - msg_type: This will be set to
  11239. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11240. *
  11241. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11242. * for this flow entry
  11243. *
  11244. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11245. *
  11246. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11247. *
  11248. * dword1 - b'14:17 - tid
  11249. *
  11250. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11251. *
  11252. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11253. *
  11254. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11255. *
  11256. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11257. * given by host
  11258. */
  11259. PREPACK struct htt_tx_map_flow_info {
  11260. A_UINT32
  11261. msg_type: 8,
  11262. fse_hsh_idx: 20,
  11263. rsvd0: 4;
  11264. A_UINT32
  11265. peer_id: 14,
  11266. tid: 4,
  11267. rsvd1: 14;
  11268. A_UINT32 tqm_flow_pntr_lo;
  11269. A_UINT32 tqm_flow_pntr_hi;
  11270. struct htt_tx_flow_metadata fse_meta_data;
  11271. } POSTPACK;
  11272. /* DWORD 0 */
  11273. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11274. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11275. /* DWORD 1 */
  11276. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11277. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11278. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11279. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11280. /* DWORD 0 */
  11281. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11282. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11283. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11284. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11285. do { \
  11286. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11287. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11288. } while (0)
  11289. /* DWORD 1 */
  11290. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11291. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11292. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11293. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11296. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11297. } while (0)
  11298. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11299. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11300. HTT_TX_MAP_FLOW_INFO_TID_S)
  11301. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11302. do { \
  11303. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11304. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11305. } while (0)
  11306. /*
  11307. * htt_dbg_ext_stats_status -
  11308. * present - The requested stats have been delivered in full.
  11309. * This indicates that either the stats information was contained
  11310. * in its entirety within this message, or else this message
  11311. * completes the delivery of the requested stats info that was
  11312. * partially delivered through earlier STATS_CONF messages.
  11313. * partial - The requested stats have been delivered in part.
  11314. * One or more subsequent STATS_CONF messages with the same
  11315. * cookie value will be sent to deliver the remainder of the
  11316. * information.
  11317. * error - The requested stats could not be delivered, for example due
  11318. * to a shortage of memory to construct a message holding the
  11319. * requested stats.
  11320. * invalid - The requested stat type is either not recognized, or the
  11321. * target is configured to not gather the stats type in question.
  11322. */
  11323. enum htt_dbg_ext_stats_status {
  11324. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11325. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11326. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11327. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11328. };
  11329. /**
  11330. * @brief target -> host ppdu stats upload
  11331. *
  11332. * @details
  11333. * The following field definitions describe the format of the HTT target
  11334. * to host ppdu stats indication message.
  11335. *
  11336. *
  11337. * |31 16|15 12|11 10|9 8|7 0 |
  11338. * |----------------------------------------------------------------------|
  11339. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11340. * |----------------------------------------------------------------------|
  11341. * | ppdu_id |
  11342. * |----------------------------------------------------------------------|
  11343. * | Timestamp in us |
  11344. * |----------------------------------------------------------------------|
  11345. * | reserved |
  11346. * |----------------------------------------------------------------------|
  11347. * | type-specific stats info |
  11348. * | (see htt_ppdu_stats.h) |
  11349. * |----------------------------------------------------------------------|
  11350. * Header fields:
  11351. * - MSG_TYPE
  11352. * Bits 7:0
  11353. * Purpose: Identifies this is a PPDU STATS indication
  11354. * message.
  11355. * Value: 0x1d
  11356. * - mac_id
  11357. * Bits 9:8
  11358. * Purpose: mac_id of this ppdu_id
  11359. * Value: 0-3
  11360. * - pdev_id
  11361. * Bits 11:10
  11362. * Purpose: pdev_id of this ppdu_id
  11363. * Value: 0-3
  11364. * 0 (for rings at SOC level),
  11365. * 1/2/3 PDEV -> 0/1/2
  11366. * - payload_size
  11367. * Bits 31:16
  11368. * Purpose: total tlv size
  11369. * Value: payload_size in bytes
  11370. */
  11371. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11372. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11373. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11374. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11375. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11376. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11377. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11378. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11379. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11380. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11381. do { \
  11382. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11383. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11384. } while (0)
  11385. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11386. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11387. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11388. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11389. do { \
  11390. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11391. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11392. } while (0)
  11393. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11394. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11395. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11396. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11397. do { \
  11398. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11399. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11400. } while (0)
  11401. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11402. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11403. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11404. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11405. do { \
  11406. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11407. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11408. } while (0)
  11409. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11410. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11411. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11412. /* htt_t2h_ppdu_stats_ind_hdr_t
  11413. * This struct contains the fields within the header of the
  11414. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11415. * stats info.
  11416. * This struct assumes little-endian layout, and thus is only
  11417. * suitable for use within processors known to be little-endian
  11418. * (such as the target).
  11419. * In contrast, the above macros provide endian-portable methods
  11420. * to get and set the bitfields within this PPDU_STATS_IND header.
  11421. */
  11422. typedef struct {
  11423. A_UINT32 msg_type: 8, /* bits 7:0 */
  11424. mac_id: 2, /* bits 9:8 */
  11425. pdev_id: 2, /* bits 11:10 */
  11426. reserved1: 4, /* bits 15:12 */
  11427. payload_size: 16; /* bits 31:16 */
  11428. A_UINT32 ppdu_id;
  11429. A_UINT32 timestamp_us;
  11430. A_UINT32 reserved2;
  11431. } htt_t2h_ppdu_stats_ind_hdr_t;
  11432. /**
  11433. * @brief target -> host extended statistics upload
  11434. *
  11435. * @details
  11436. * The following field definitions describe the format of the HTT target
  11437. * to host stats upload confirmation message.
  11438. * The message contains a cookie echoed from the HTT host->target stats
  11439. * upload request, which identifies which request the confirmation is
  11440. * for, and a single stats can span over multiple HTT stats indication
  11441. * due to the HTT message size limitation so every HTT ext stats indication
  11442. * will have tag-length-value stats information elements.
  11443. * The tag-length header for each HTT stats IND message also includes a
  11444. * status field, to indicate whether the request for the stat type in
  11445. * question was fully met, partially met, unable to be met, or invalid
  11446. * (if the stat type in question is disabled in the target).
  11447. * A Done bit 1's indicate the end of the of stats info elements.
  11448. *
  11449. *
  11450. * |31 16|15 12|11|10 8|7 5|4 0|
  11451. * |--------------------------------------------------------------|
  11452. * | reserved | msg type |
  11453. * |--------------------------------------------------------------|
  11454. * | cookie LSBs |
  11455. * |--------------------------------------------------------------|
  11456. * | cookie MSBs |
  11457. * |--------------------------------------------------------------|
  11458. * | stats entry length | rsvd | D| S | stat type |
  11459. * |--------------------------------------------------------------|
  11460. * | type-specific stats info |
  11461. * | (see htt_stats.h) |
  11462. * |--------------------------------------------------------------|
  11463. * Header fields:
  11464. * - MSG_TYPE
  11465. * Bits 7:0
  11466. * Purpose: Identifies this is a extended statistics upload confirmation
  11467. * message.
  11468. * Value: 0x1c
  11469. * - COOKIE_LSBS
  11470. * Bits 31:0
  11471. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11472. * message with its preceding host->target stats request message.
  11473. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11474. * - COOKIE_MSBS
  11475. * Bits 31:0
  11476. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11477. * message with its preceding host->target stats request message.
  11478. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11479. *
  11480. * Stats Information Element tag-length header fields:
  11481. * - STAT_TYPE
  11482. * Bits 7:0
  11483. * Purpose: identifies the type of statistics info held in the
  11484. * following information element
  11485. * Value: htt_dbg_ext_stats_type
  11486. * - STATUS
  11487. * Bits 10:8
  11488. * Purpose: indicate whether the requested stats are present
  11489. * Value: htt_dbg_ext_stats_status
  11490. * - DONE
  11491. * Bits 11
  11492. * Purpose:
  11493. * Indicates the completion of the stats entry, this will be the last
  11494. * stats conf HTT segment for the requested stats type.
  11495. * Value:
  11496. * 0 -> the stats retrieval is ongoing
  11497. * 1 -> the stats retrieval is complete
  11498. * - LENGTH
  11499. * Bits 31:16
  11500. * Purpose: indicate the stats information size
  11501. * Value: This field specifies the number of bytes of stats information
  11502. * that follows the element tag-length header.
  11503. * It is expected but not required that this length is a multiple of
  11504. * 4 bytes.
  11505. */
  11506. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11507. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11508. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11509. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11510. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11511. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11512. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11513. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11514. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11515. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11516. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11517. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11518. do { \
  11519. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11520. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11521. } while (0)
  11522. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11523. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11524. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11525. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11526. do { \
  11527. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11528. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11529. } while (0)
  11530. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11531. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11532. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11533. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11534. do { \
  11535. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11536. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11537. } while (0)
  11538. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11539. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11540. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11541. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11542. do { \
  11543. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11544. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11545. } while (0)
  11546. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11547. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11548. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11549. typedef enum {
  11550. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11551. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11552. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11553. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11554. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11555. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11556. /* Reserved from 128 - 255 for target internal use.*/
  11557. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11558. } HTT_PEER_TYPE;
  11559. /** macro to convert MAC address from char array to HTT word format */
  11560. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11561. (phtt_mac_addr)->mac_addr31to0 = \
  11562. (((c_macaddr)[0] << 0) | \
  11563. ((c_macaddr)[1] << 8) | \
  11564. ((c_macaddr)[2] << 16) | \
  11565. ((c_macaddr)[3] << 24)); \
  11566. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11567. } while (0)
  11568. /**
  11569. * @brief target -> host monitor mac header indication message
  11570. *
  11571. * @details
  11572. * The following diagram shows the format of the monitor mac header message
  11573. * sent from the target to the host.
  11574. * This message is primarily sent when promiscuous rx mode is enabled.
  11575. * One message is sent per rx PPDU.
  11576. *
  11577. * |31 24|23 16|15 8|7 0|
  11578. * |-------------------------------------------------------------|
  11579. * | peer_id | reserved0 | msg_type |
  11580. * |-------------------------------------------------------------|
  11581. * | reserved1 | num_mpdu |
  11582. * |-------------------------------------------------------------|
  11583. * | struct hw_rx_desc |
  11584. * | (see wal_rx_desc.h) |
  11585. * |-------------------------------------------------------------|
  11586. * | struct ieee80211_frame_addr4 |
  11587. * | (see ieee80211_defs.h) |
  11588. * |-------------------------------------------------------------|
  11589. * | struct ieee80211_frame_addr4 |
  11590. * | (see ieee80211_defs.h) |
  11591. * |-------------------------------------------------------------|
  11592. * | ...... |
  11593. * |-------------------------------------------------------------|
  11594. *
  11595. * Header fields:
  11596. * - msg_type
  11597. * Bits 7:0
  11598. * Purpose: Identifies this is a monitor mac header indication message.
  11599. * Value: 0x20
  11600. * - peer_id
  11601. * Bits 31:16
  11602. * Purpose: Software peer id given by host during association,
  11603. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11604. * for rx PPDUs received from unassociated peers.
  11605. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11606. * - num_mpdu
  11607. * Bits 15:0
  11608. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11609. * delivered within the message.
  11610. * Value: 1 to 32
  11611. * num_mpdu is limited to a maximum value of 32, due to buffer
  11612. * size limits. For PPDUs with more than 32 MPDUs, only the
  11613. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11614. * the PPDU will be provided.
  11615. */
  11616. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11617. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11618. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11619. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11620. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11621. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11622. do { \
  11623. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11624. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11625. } while (0)
  11626. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11627. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11628. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11629. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11630. do { \
  11631. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11632. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11633. } while (0)
  11634. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11635. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11636. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11637. /**
  11638. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11639. *
  11640. * @details
  11641. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11642. * the flow pool associated with the specified ID is resized
  11643. *
  11644. * The message would appear as follows:
  11645. *
  11646. * |31 16|15 8|7 0|
  11647. * |---------------------------------+----------------+----------------|
  11648. * | reserved0 | Msg type |
  11649. * |-------------------------------------------------------------------|
  11650. * | flow pool new size | flow pool ID |
  11651. * |-------------------------------------------------------------------|
  11652. *
  11653. * The message is interpreted as follows:
  11654. * b'0:7 - msg_type: This will be set to
  11655. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11656. *
  11657. * b'0:15 - flow pool ID: Existing flow pool ID
  11658. *
  11659. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11660. *
  11661. */
  11662. PREPACK struct htt_flow_pool_resize_t {
  11663. A_UINT32 msg_type:8,
  11664. reserved0:24;
  11665. A_UINT32 flow_pool_id:16,
  11666. flow_pool_new_size:16;
  11667. } POSTPACK;
  11668. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11669. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11670. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11671. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11672. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11673. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11674. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11675. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11676. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11677. do { \
  11678. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11679. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11680. } while (0)
  11681. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11682. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11683. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11684. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11685. do { \
  11686. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11687. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11688. } while (0)
  11689. /**
  11690. * @brief host -> target channel change message
  11691. *
  11692. * @details
  11693. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11694. * to associate RX frames to correct channel they were received on.
  11695. * The following field definitions describe the format of the HTT target
  11696. * to host channel change message.
  11697. * |31 16|15 8|7 5|4 0|
  11698. * |------------------------------------------------------------|
  11699. * | reserved | MSG_TYPE |
  11700. * |------------------------------------------------------------|
  11701. * | CHAN_MHZ |
  11702. * |------------------------------------------------------------|
  11703. * | BAND_CENTER_FREQ1 |
  11704. * |------------------------------------------------------------|
  11705. * | BAND_CENTER_FREQ2 |
  11706. * |------------------------------------------------------------|
  11707. * | CHAN_PHY_MODE |
  11708. * |------------------------------------------------------------|
  11709. * Header fields:
  11710. * - MSG_TYPE
  11711. * Bits 7:0
  11712. * Value: 0xf
  11713. * - CHAN_MHZ
  11714. * Bits 31:0
  11715. * Purpose: frequency of the primary 20mhz channel.
  11716. * - BAND_CENTER_FREQ1
  11717. * Bits 31:0
  11718. * Purpose: centre frequency of the full channel.
  11719. * - BAND_CENTER_FREQ2
  11720. * Bits 31:0
  11721. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11722. * - CHAN_PHY_MODE
  11723. * Bits 31:0
  11724. * Purpose: phy mode of the channel.
  11725. */
  11726. PREPACK struct htt_chan_change_msg {
  11727. A_UINT32 chan_mhz; /* frequency in mhz */
  11728. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11729. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11730. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11731. } POSTPACK;
  11732. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11733. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11734. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11735. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11736. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11737. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11738. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11739. /*
  11740. * The read and write indices point to the data within the host buffer.
  11741. * Because the first 4 bytes of the host buffer is used for the read index and
  11742. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11743. * The read index and write index are the byte offsets from the base of the
  11744. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11745. * Refer the ASCII text picture below.
  11746. */
  11747. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11748. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11749. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11750. /*
  11751. ***************************************************************************
  11752. *
  11753. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11754. *
  11755. ***************************************************************************
  11756. *
  11757. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11758. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11759. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11760. * written into the Host memory region mentioned below.
  11761. *
  11762. * Read index is updated by the Host. At any point of time, the read index will
  11763. * indicate the index that will next be read by the Host. The read index is
  11764. * in units of bytes offset from the base of the meta-data buffer.
  11765. *
  11766. * Write index is updated by the FW. At any point of time, the write index will
  11767. * indicate from where the FW can start writing any new data. The write index is
  11768. * in units of bytes offset from the base of the meta-data buffer.
  11769. *
  11770. * If the Host is not fast enough in reading the CFR data, any new capture data
  11771. * would be dropped if there is no space left to write the new captures.
  11772. *
  11773. * The last 4 bytes of the memory region will have the magic pattern
  11774. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11775. * not overrun the host buffer.
  11776. *
  11777. * ,--------------------. read and write indices store the
  11778. * | | byte offset from the base of the
  11779. * | ,--------+--------. meta-data buffer to the next
  11780. * | | | | location within the data buffer
  11781. * | | v v that will be read / written
  11782. * ************************************************************************
  11783. * * Read * Write * * Magic *
  11784. * * index * index * CFR data1 ...... CFR data N * pattern *
  11785. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11786. * ************************************************************************
  11787. * |<---------- data buffer ---------->|
  11788. *
  11789. * |<----------------- meta-data buffer allocated in Host ----------------|
  11790. *
  11791. * Note:
  11792. * - Considering the 4 bytes needed to store the Read index (R) and the
  11793. * Write index (W), the initial value is as follows:
  11794. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11795. * - Buffer empty condition:
  11796. * R = W
  11797. *
  11798. * Regarding CFR data format:
  11799. * --------------------------
  11800. *
  11801. * Each CFR tone is stored in HW as 16-bits with the following format:
  11802. * {bits[15:12], bits[11:6], bits[5:0]} =
  11803. * {unsigned exponent (4 bits),
  11804. * signed mantissa_real (6 bits),
  11805. * signed mantissa_imag (6 bits)}
  11806. *
  11807. * CFR_real = mantissa_real * 2^(exponent-5)
  11808. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11809. *
  11810. *
  11811. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11812. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11813. *
  11814. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11815. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11816. * .
  11817. * .
  11818. * .
  11819. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11820. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11821. */
  11822. /* Bandwidth of peer CFR captures */
  11823. typedef enum {
  11824. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11825. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11826. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11827. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11828. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11829. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11830. } HTT_PEER_CFR_CAPTURE_BW;
  11831. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11832. * was captured
  11833. */
  11834. typedef enum {
  11835. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11836. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11837. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11838. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11839. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11840. } HTT_PEER_CFR_CAPTURE_MODE;
  11841. typedef enum {
  11842. /* This message type is currently used for the below purpose:
  11843. *
  11844. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11845. * wmi_peer_cfr_capture_cmd.
  11846. * If payload_present bit is set to 0 then the associated memory region
  11847. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11848. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11849. * message; the CFR dump will be present at the end of the message,
  11850. * after the chan_phy_mode.
  11851. */
  11852. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11853. /* Always keep this last */
  11854. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11855. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11856. /**
  11857. * @brief target -> host CFR dump completion indication message definition
  11858. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11859. *
  11860. * @details
  11861. * The following diagram shows the format of the Channel Frequency Response
  11862. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11863. * the channel capture of a peer is copied by Firmware into the Host memory
  11864. *
  11865. * **************************************************************************
  11866. *
  11867. * Message format when the CFR capture message type is
  11868. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11869. *
  11870. * **************************************************************************
  11871. *
  11872. * |31 16|15 |8|7 0|
  11873. * |----------------------------------------------------------------|
  11874. * header: | reserved |P| msg_type |
  11875. * word 0 | | | |
  11876. * |----------------------------------------------------------------|
  11877. * payload: | cfr_capture_msg_type |
  11878. * word 1 | |
  11879. * |----------------------------------------------------------------|
  11880. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11881. * word 2 | | | | | | | | |
  11882. * |----------------------------------------------------------------|
  11883. * | mac_addr31to0 |
  11884. * word 3 | |
  11885. * |----------------------------------------------------------------|
  11886. * | unused / reserved | mac_addr47to32 |
  11887. * word 4 | | |
  11888. * |----------------------------------------------------------------|
  11889. * | index |
  11890. * word 5 | |
  11891. * |----------------------------------------------------------------|
  11892. * | length |
  11893. * word 6 | |
  11894. * |----------------------------------------------------------------|
  11895. * | timestamp |
  11896. * word 7 | |
  11897. * |----------------------------------------------------------------|
  11898. * | counter |
  11899. * word 8 | |
  11900. * |----------------------------------------------------------------|
  11901. * | chan_mhz |
  11902. * word 9 | |
  11903. * |----------------------------------------------------------------|
  11904. * | band_center_freq1 |
  11905. * word 10 | |
  11906. * |----------------------------------------------------------------|
  11907. * | band_center_freq2 |
  11908. * word 11 | |
  11909. * |----------------------------------------------------------------|
  11910. * | chan_phy_mode |
  11911. * word 12 | |
  11912. * |----------------------------------------------------------------|
  11913. * where,
  11914. * P - payload present bit (payload_present explained below)
  11915. * req_id - memory request id (mem_req_id explained below)
  11916. * S - status field (status explained below)
  11917. * capbw - capture bandwidth (capture_bw explained below)
  11918. * mode - mode of capture (mode explained below)
  11919. * sts - space time streams (sts_count explained below)
  11920. * chbw - channel bandwidth (channel_bw explained below)
  11921. * captype - capture type (cap_type explained below)
  11922. *
  11923. * The following field definitions describe the format of the CFR dump
  11924. * completion indication sent from the target to the host
  11925. *
  11926. * Header fields:
  11927. *
  11928. * Word 0
  11929. * - msg_type
  11930. * Bits 7:0
  11931. * Purpose: Identifies this as CFR TX completion indication
  11932. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11933. * - payload_present
  11934. * Bit 8
  11935. * Purpose: Identifies how CFR data is sent to host
  11936. * Value: 0 - If CFR Payload is written to host memory
  11937. * 1 - If CFR Payload is sent as part of HTT message
  11938. * (This is the requirement for SDIO/USB where it is
  11939. * not possible to write CFR data to host memory)
  11940. * - reserved
  11941. * Bits 31:9
  11942. * Purpose: Reserved
  11943. * Value: 0
  11944. *
  11945. * Payload fields:
  11946. *
  11947. * Word 1
  11948. * - cfr_capture_msg_type
  11949. * Bits 31:0
  11950. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11951. * to specify the format used for the remainder of the message
  11952. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11953. * (currently only MSG_TYPE_1 is defined)
  11954. *
  11955. * Word 2
  11956. * - mem_req_id
  11957. * Bits 6:0
  11958. * Purpose: Contain the mem request id of the region where the CFR capture
  11959. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11960. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11961. this value is invalid)
  11962. * - status
  11963. * Bit 7
  11964. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11965. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11966. * - capture_bw
  11967. * Bits 10:8
  11968. * Purpose: Carry the bandwidth of the CFR capture
  11969. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11970. * - mode
  11971. * Bits 13:11
  11972. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11973. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11974. * - sts_count
  11975. * Bits 16:14
  11976. * Purpose: Carry the number of space time streams
  11977. * Value: Number of space time streams
  11978. * - channel_bw
  11979. * Bits 19:17
  11980. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11981. * measurement
  11982. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11983. * - cap_type
  11984. * Bits 23:20
  11985. * Purpose: Carry the type of the capture
  11986. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11987. * - vdev_id
  11988. * Bits 31:24
  11989. * Purpose: Carry the virtual device id
  11990. * Value: vdev ID
  11991. *
  11992. * Word 3
  11993. * - mac_addr31to0
  11994. * Bits 31:0
  11995. * Purpose: Contain the bits 31:0 of the peer MAC address
  11996. * Value: Bits 31:0 of the peer MAC address
  11997. *
  11998. * Word 4
  11999. * - mac_addr47to32
  12000. * Bits 15:0
  12001. * Purpose: Contain the bits 47:32 of the peer MAC address
  12002. * Value: Bits 47:32 of the peer MAC address
  12003. *
  12004. * Word 5
  12005. * - index
  12006. * Bits 31:0
  12007. * Purpose: Contain the index at which this CFR dump was written in the Host
  12008. * allocated memory. This index is the number of bytes from the base address.
  12009. * Value: Index position
  12010. *
  12011. * Word 6
  12012. * - length
  12013. * Bits 31:0
  12014. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12015. * Value: Length of the CFR capture of the peer
  12016. *
  12017. * Word 7
  12018. * - timestamp
  12019. * Bits 31:0
  12020. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12021. * clock used for this timestamp is private to the target and not visible to
  12022. * the host i.e., Host can interpret only the relative timestamp deltas from
  12023. * one message to the next, but can't interpret the absolute timestamp from a
  12024. * single message.
  12025. * Value: Timestamp in microseconds
  12026. *
  12027. * Word 8
  12028. * - counter
  12029. * Bits 31:0
  12030. * Purpose: Carry the count of the current CFR capture from FW. This is
  12031. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12032. * in host memory)
  12033. * Value: Count of the current CFR capture
  12034. *
  12035. * Word 9
  12036. * - chan_mhz
  12037. * Bits 31:0
  12038. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12039. * Value: Primary 20 channel frequency
  12040. *
  12041. * Word 10
  12042. * - band_center_freq1
  12043. * Bits 31:0
  12044. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12045. * Value: Center frequency 1 in MHz
  12046. *
  12047. * Word 11
  12048. * - band_center_freq2
  12049. * Bits 31:0
  12050. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12051. * the VDEV
  12052. * 80plus80 mode
  12053. * Value: Center frequency 2 in MHz
  12054. *
  12055. * Word 12
  12056. * - chan_phy_mode
  12057. * Bits 31:0
  12058. * Purpose: Carry the phy mode of the channel, of the VDEV
  12059. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12060. */
  12061. PREPACK struct htt_cfr_dump_ind_type_1 {
  12062. A_UINT32 mem_req_id:7,
  12063. status:1,
  12064. capture_bw:3,
  12065. mode:3,
  12066. sts_count:3,
  12067. channel_bw:3,
  12068. cap_type:4,
  12069. vdev_id:8;
  12070. htt_mac_addr addr;
  12071. A_UINT32 index;
  12072. A_UINT32 length;
  12073. A_UINT32 timestamp;
  12074. A_UINT32 counter;
  12075. struct htt_chan_change_msg chan;
  12076. } POSTPACK;
  12077. PREPACK struct htt_cfr_dump_compl_ind {
  12078. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12079. union {
  12080. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12081. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12082. /* If there is a need to change the memory layout and its associated
  12083. * HTT indication format, a new CFR capture message type can be
  12084. * introduced and added into this union.
  12085. */
  12086. };
  12087. } POSTPACK;
  12088. /*
  12089. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12090. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12091. */
  12092. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12093. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12094. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12095. do { \
  12096. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12097. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12098. } while(0)
  12099. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12100. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12101. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12102. /*
  12103. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12104. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12105. */
  12106. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12107. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12108. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12109. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12110. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12111. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12112. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12113. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12114. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12115. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12116. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12117. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12119. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12120. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12121. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12122. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12123. do { \
  12124. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12125. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12126. } while (0)
  12127. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12128. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12129. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12130. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12131. do { \
  12132. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12133. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12134. } while (0)
  12135. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12136. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12137. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12138. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12139. do { \
  12140. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12141. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12142. } while (0)
  12143. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12144. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12145. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12146. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12147. do { \
  12148. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12149. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12150. } while (0)
  12151. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12152. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12153. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12154. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12155. do { \
  12156. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12157. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12158. } while (0)
  12159. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12160. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12161. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12162. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12163. do { \
  12164. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12165. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12166. } while (0)
  12167. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12168. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12169. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12170. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12171. do { \
  12172. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12173. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12174. } while (0)
  12175. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12176. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12177. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12178. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12179. do { \
  12180. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12181. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12182. } while (0)
  12183. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12184. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12185. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12186. /**
  12187. * @brief target -> host peer (PPDU) stats message
  12188. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12189. * @details
  12190. * This message is generated by FW when FW is sending stats to host
  12191. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12192. * This message is sent autonomously by the target rather than upon request
  12193. * by the host.
  12194. * The following field definitions describe the format of the HTT target
  12195. * to host peer stats indication message.
  12196. *
  12197. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12198. * or more PPDU stats records.
  12199. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12200. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12201. * then the message would start with the
  12202. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12203. * below.
  12204. *
  12205. * |31 16|15|14|13 11|10 9|8|7 0|
  12206. * |-------------------------------------------------------------|
  12207. * | reserved |MSG_TYPE |
  12208. * |-------------------------------------------------------------|
  12209. * rec 0 | TLV header |
  12210. * rec 0 |-------------------------------------------------------------|
  12211. * rec 0 | ppdu successful bytes |
  12212. * rec 0 |-------------------------------------------------------------|
  12213. * rec 0 | ppdu retry bytes |
  12214. * rec 0 |-------------------------------------------------------------|
  12215. * rec 0 | ppdu failed bytes |
  12216. * rec 0 |-------------------------------------------------------------|
  12217. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12218. * rec 0 |-------------------------------------------------------------|
  12219. * rec 0 | retried MSDUs | successful MSDUs |
  12220. * rec 0 |-------------------------------------------------------------|
  12221. * rec 0 | TX duration | failed MSDUs |
  12222. * rec 0 |-------------------------------------------------------------|
  12223. * ...
  12224. * |-------------------------------------------------------------|
  12225. * rec N | TLV header |
  12226. * rec N |-------------------------------------------------------------|
  12227. * rec N | ppdu successful bytes |
  12228. * rec N |-------------------------------------------------------------|
  12229. * rec N | ppdu retry bytes |
  12230. * rec N |-------------------------------------------------------------|
  12231. * rec N | ppdu failed bytes |
  12232. * rec N |-------------------------------------------------------------|
  12233. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12234. * rec N |-------------------------------------------------------------|
  12235. * rec N | retried MSDUs | successful MSDUs |
  12236. * rec N |-------------------------------------------------------------|
  12237. * rec N | TX duration | failed MSDUs |
  12238. * rec N |-------------------------------------------------------------|
  12239. *
  12240. * where:
  12241. * A = is A-MPDU flag
  12242. * BA = block-ack failure flags
  12243. * BW = bandwidth spec
  12244. * SG = SGI enabled spec
  12245. * S = skipped rate ctrl
  12246. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12247. *
  12248. * Header
  12249. * ------
  12250. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12251. * dword0 - b'8:31 - reserved : Reserved for future use
  12252. *
  12253. * payload include below peer_stats information
  12254. * --------------------------------------------
  12255. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12256. * @tx_success_bytes : total successful bytes in the PPDU.
  12257. * @tx_retry_bytes : total retried bytes in the PPDU.
  12258. * @tx_failed_bytes : total failed bytes in the PPDU.
  12259. * @tx_ratecode : rate code used for the PPDU.
  12260. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12261. * @ba_ack_failed : BA/ACK failed for this PPDU
  12262. * b00 -> BA received
  12263. * b01 -> BA failed once
  12264. * b10 -> BA failed twice, when HW retry is enabled.
  12265. * @bw : BW
  12266. * b00 -> 20 MHz
  12267. * b01 -> 40 MHz
  12268. * b10 -> 80 MHz
  12269. * b11 -> 160 MHz (or 80+80)
  12270. * @sg : SGI enabled
  12271. * @s : skipped ratectrl
  12272. * @peer_id : peer id
  12273. * @tx_success_msdus : successful MSDUs
  12274. * @tx_retry_msdus : retried MSDUs
  12275. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12276. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12277. */
  12278. /**
  12279. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12280. *
  12281. * @details
  12282. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12283. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12284. * This message will only be sent if the backpressure condition has existed
  12285. * continuously for an initial period (100 ms).
  12286. * Repeat messages with updated information will be sent after each
  12287. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12288. * This message indicates the ring id along with current head and tail index
  12289. * locations (i.e. write and read indices).
  12290. * The backpressure time indicates the time in ms for which continous
  12291. * backpressure has been observed in the ring.
  12292. *
  12293. * The message format is as follows:
  12294. *
  12295. * |31 24|23 16|15 8|7 0|
  12296. * |----------------+----------------+----------------+----------------|
  12297. * | ring_id | ring_type | pdev_id | msg_type |
  12298. * |-------------------------------------------------------------------|
  12299. * | tail_idx | head_idx |
  12300. * |-------------------------------------------------------------------|
  12301. * | backpressure_time_ms |
  12302. * |-------------------------------------------------------------------|
  12303. *
  12304. * The message is interpreted as follows:
  12305. * dword0 - b'0:7 - msg_type: This will be set to
  12306. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12307. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12308. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12309. the msg is for LMAC ring.
  12310. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12311. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12312. * htt_backpressure_lmac_ring_id. This represents
  12313. * the ring id for which continous backpressure is seen
  12314. *
  12315. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12316. * the ring indicated by the ring_id
  12317. *
  12318. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12319. * the ring indicated by the ring id
  12320. *
  12321. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12322. * backpressure has been seen in the ring
  12323. * indicated by the ring_id.
  12324. * Units = milliseconds
  12325. */
  12326. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12327. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12328. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12329. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12330. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12331. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12332. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12333. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12334. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12335. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12336. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12337. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12338. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12339. do { \
  12340. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12341. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12342. } while (0)
  12343. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12344. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12345. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12346. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12347. do { \
  12348. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12349. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12350. } while (0)
  12351. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12352. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12353. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12354. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12355. do { \
  12356. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12357. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12358. } while (0)
  12359. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12360. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12361. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12362. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12363. do { \
  12364. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12365. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12366. } while (0)
  12367. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12368. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12369. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12370. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12371. do { \
  12372. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12373. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12374. } while (0)
  12375. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12376. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12377. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12378. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12379. do { \
  12380. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12381. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12382. } while (0)
  12383. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12384. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12385. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12386. enum htt_backpressure_ring_type {
  12387. HTT_SW_RING_TYPE_UMAC,
  12388. HTT_SW_RING_TYPE_LMAC,
  12389. HTT_SW_RING_TYPE_MAX,
  12390. };
  12391. /* Ring id for which the message is sent to host */
  12392. enum htt_backpressure_umac_ringid {
  12393. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12394. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12395. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12396. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12397. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12398. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12399. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12400. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12401. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12402. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12403. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12404. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12405. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12406. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12407. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12408. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12409. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12410. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12411. HTT_SW_UMAC_RING_IDX_MAX,
  12412. };
  12413. enum htt_backpressure_lmac_ringid {
  12414. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12415. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12416. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12417. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12418. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12419. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12420. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12421. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12422. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12423. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12424. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12425. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12426. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12427. HTT_SW_LMAC_RING_IDX_MAX,
  12428. };
  12429. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12430. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12431. pdev_id: 8,
  12432. ring_type: 8, /* htt_backpressure_ring_type */
  12433. /*
  12434. * ring_id holds an enum value from either
  12435. * htt_backpressure_umac_ringid or
  12436. * htt_backpressure_lmac_ringid, based on
  12437. * the ring_type setting.
  12438. */
  12439. ring_id: 8;
  12440. A_UINT16 head_idx;
  12441. A_UINT16 tail_idx;
  12442. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12443. } POSTPACK;
  12444. /*
  12445. * Defines two 32 bit words that can be used by the target to indicate a per
  12446. * user RU allocation and rate information.
  12447. *
  12448. * This information is currently provided in the "sw_response_reference_ptr"
  12449. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12450. * "rx_ppdu_end_user_stats" TLV.
  12451. *
  12452. * VALID:
  12453. * The consumer of these words must explicitly check the valid bit,
  12454. * and only attempt interpretation of any of the remaining fields if
  12455. * the valid bit is set to 1.
  12456. *
  12457. * VERSION:
  12458. * The consumer of these words must also explicitly check the version bit,
  12459. * and only use the V0 definition if the VERSION field is set to 0.
  12460. *
  12461. * Version 1 is currently undefined, with the exception of the VALID and
  12462. * VERSION fields.
  12463. *
  12464. * Version 0:
  12465. *
  12466. * The fields below are duplicated per BW.
  12467. *
  12468. * The consumer must determine which BW field to use, based on the UL OFDMA
  12469. * PPDU BW indicated by HW.
  12470. *
  12471. * RU_START: RU26 start index for the user.
  12472. * Note that this is always using the RU26 index, regardless
  12473. * of the actual RU assigned to the user
  12474. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12475. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12476. *
  12477. * For example, 20MHz (the value in the top row is RU_START)
  12478. *
  12479. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12480. * RU Size 1 (52): | | | | | |
  12481. * RU Size 2 (106): | | | |
  12482. * RU Size 3 (242): | |
  12483. *
  12484. * RU_SIZE: Indicates the RU size, as defined by enum
  12485. * htt_ul_ofdma_user_info_ru_size.
  12486. *
  12487. * LDPC: LDPC enabled (if 0, BCC is used)
  12488. *
  12489. * DCM: DCM enabled
  12490. *
  12491. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12492. * |---------------------------------+--------------------------------|
  12493. * |Ver|Valid| FW internal |
  12494. * |---------------------------------+--------------------------------|
  12495. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12496. * |---------------------------------+--------------------------------|
  12497. */
  12498. enum htt_ul_ofdma_user_info_ru_size {
  12499. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12500. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12501. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12502. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12503. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12504. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12505. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12506. };
  12507. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12508. struct htt_ul_ofdma_user_info_v0 {
  12509. A_UINT32 word0;
  12510. A_UINT32 word1;
  12511. };
  12512. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12513. A_UINT32 w0_fw_rsvd:30; \
  12514. A_UINT32 w0_valid:1; \
  12515. A_UINT32 w0_version:1;
  12516. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12517. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12518. };
  12519. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12520. A_UINT32 w1_nss:3; \
  12521. A_UINT32 w1_mcs:4; \
  12522. A_UINT32 w1_ldpc:1; \
  12523. A_UINT32 w1_dcm:1; \
  12524. A_UINT32 w1_ru_start:7; \
  12525. A_UINT32 w1_ru_size:3; \
  12526. A_UINT32 w1_trig_type:4; \
  12527. A_UINT32 w1_unused:9;
  12528. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12529. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12530. };
  12531. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12532. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12533. union {
  12534. A_UINT32 word0;
  12535. struct {
  12536. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12537. };
  12538. };
  12539. union {
  12540. A_UINT32 word1;
  12541. struct {
  12542. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12543. };
  12544. };
  12545. } POSTPACK;
  12546. enum HTT_UL_OFDMA_TRIG_TYPE {
  12547. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12548. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12549. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12550. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12551. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12552. };
  12553. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12554. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12555. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12556. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12557. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12558. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12559. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12560. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12561. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12562. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12563. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12564. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12565. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12566. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12567. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12568. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12569. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12570. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12576. /*--- word 0 ---*/
  12577. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12578. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12579. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12580. do { \
  12581. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12582. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12583. } while (0)
  12584. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12585. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12586. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12587. do { \
  12588. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12589. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12590. } while (0)
  12591. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12592. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12593. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12594. do { \
  12595. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12596. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12597. } while (0)
  12598. /*--- word 1 ---*/
  12599. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12600. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12601. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12602. do { \
  12603. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12604. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12605. } while (0)
  12606. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12607. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12608. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12609. do { \
  12610. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12611. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12612. } while (0)
  12613. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12614. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12615. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12616. do { \
  12617. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12618. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12619. } while (0)
  12620. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12621. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12622. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12623. do { \
  12624. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12625. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12626. } while (0)
  12627. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12628. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12629. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12630. do { \
  12631. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12632. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12633. } while (0)
  12634. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12635. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12636. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12637. do { \
  12638. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12639. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12640. } while (0)
  12641. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12642. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12643. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12644. do { \
  12645. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12646. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12647. } while (0)
  12648. /**
  12649. * @brief target -> host channel calibration data message
  12650. * @brief host -> target channel calibration data message
  12651. *
  12652. * @details
  12653. * The following field definitions describe the format of the channel
  12654. * calibration data message sent from the target to the host when
  12655. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12656. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12657. * The message is defined as htt_chan_caldata_msg followed by a variable
  12658. * number of 32-bit character values.
  12659. *
  12660. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12661. * |------------------------------------------------------------------|
  12662. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12663. * |------------------------------------------------------------------|
  12664. * | payload size | mhz |
  12665. * |------------------------------------------------------------------|
  12666. * | center frequency 2 | center frequency 1 |
  12667. * |------------------------------------------------------------------|
  12668. * | check sum |
  12669. * |------------------------------------------------------------------|
  12670. * | payload |
  12671. * |------------------------------------------------------------------|
  12672. * message info field:
  12673. * - MSG_TYPE
  12674. * Bits 7:0
  12675. * Purpose: identifies this as a channel calibration data message
  12676. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12677. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12678. * - SUB_TYPE
  12679. * Bits 11:8
  12680. * Purpose: T2H: indicates whether target is providing chan cal data
  12681. * to the host to store, or requesting that the host
  12682. * download previously-stored data.
  12683. * H2T: indicates whether the host is providing the requested
  12684. * channel cal data, or if it is rejecting the data
  12685. * request because it does not have the requested data.
  12686. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12687. * - CHKSUM_VALID
  12688. * Bit 12
  12689. * Purpose: indicates if the checksum field is valid
  12690. * value:
  12691. * - FRAG
  12692. * Bit 19:16
  12693. * Purpose: indicates the fragment index for message
  12694. * value: 0 for first fragment, 1 for second fragment, ...
  12695. * - APPEND
  12696. * Bit 20
  12697. * Purpose: indicates if this is the last fragment
  12698. * value: 0 = final fragment, 1 = more fragments will be appended
  12699. *
  12700. * channel and payload size field
  12701. * - MHZ
  12702. * Bits 15:0
  12703. * Purpose: indicates the channel primary frequency
  12704. * Value:
  12705. * - PAYLOAD_SIZE
  12706. * Bits 31:16
  12707. * Purpose: indicates the bytes of calibration data in payload
  12708. * Value:
  12709. *
  12710. * center frequency field
  12711. * - CENTER FREQUENCY 1
  12712. * Bits 15:0
  12713. * Purpose: indicates the channel center frequency
  12714. * Value: channel center frequency, in MHz units
  12715. * - CENTER FREQUENCY 2
  12716. * Bits 31:16
  12717. * Purpose: indicates the secondary channel center frequency,
  12718. * only for 11acvht 80plus80 mode
  12719. * Value: secondary channel center frequeny, in MHz units, if applicable
  12720. *
  12721. * checksum field
  12722. * - CHECK_SUM
  12723. * Bits 31:0
  12724. * Purpose: check the payload data, it is just for this fragment.
  12725. * This is intended for the target to check that the channel
  12726. * calibration data returned by the host is the unmodified data
  12727. * that was previously provided to the host by the target.
  12728. * value: checksum of fragment payload
  12729. */
  12730. PREPACK struct htt_chan_caldata_msg {
  12731. /* DWORD 0: message info */
  12732. A_UINT32
  12733. msg_type: 8,
  12734. sub_type: 4 ,
  12735. chksum_valid: 1, /** 1:valid, 0:invalid */
  12736. reserved1: 3,
  12737. frag_idx: 4, /** fragment index for calibration data */
  12738. appending: 1, /** 0: no fragment appending,
  12739. * 1: extra fragment appending */
  12740. reserved2: 11;
  12741. /* DWORD 1: channel and payload size */
  12742. A_UINT32
  12743. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12744. payload_size: 16; /** unit: bytes */
  12745. /* DWORD 2: center frequency */
  12746. A_UINT32
  12747. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12748. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12749. * valid only for 11acvht 80plus80 mode */
  12750. /* DWORD 3: check sum */
  12751. A_UINT32 chksum;
  12752. /* variable length for calibration data */
  12753. A_UINT32 payload[1/* or more */];
  12754. } POSTPACK;
  12755. /* T2H SUBTYPE */
  12756. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12757. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12758. /* H2T SUBTYPE */
  12759. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12760. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12761. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12762. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12763. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12764. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12765. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12766. do { \
  12767. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12768. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12769. } while (0)
  12770. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12771. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12772. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12773. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12774. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12775. do { \
  12776. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12777. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12778. } while (0)
  12779. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12780. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12781. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12782. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12783. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12784. do { \
  12785. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12786. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12787. } while (0)
  12788. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12789. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12790. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12791. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12792. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12793. do { \
  12794. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12795. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12796. } while (0)
  12797. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12798. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12799. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12800. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12801. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12802. do { \
  12803. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12804. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12805. } while (0)
  12806. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12807. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12808. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12809. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12810. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12811. do { \
  12812. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12813. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12814. } while (0)
  12815. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12816. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12817. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12818. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12819. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12820. do { \
  12821. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12822. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12823. } while (0)
  12824. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12825. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12826. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12827. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12828. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12829. do { \
  12830. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12831. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12832. } while (0)
  12833. /**
  12834. * @brief HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND Message
  12835. *
  12836. * @details
  12837. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  12838. * FSE placement in CMEM is enabled.
  12839. *
  12840. * This message sends the non-secure CMEM base address.
  12841. * It will be sent to host in response to message
  12842. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  12843. * The message would appear as follows:
  12844. *
  12845. * |31 24|23 16|15 8|7 0|
  12846. * |----------------+----------------+----------------+----------------|
  12847. * | reserved | num_entries | msg_type |
  12848. * |----------------+----------------+----------------+----------------|
  12849. * | base_address_lo |
  12850. * |----------------+----------------+----------------+----------------|
  12851. * | base_address_hi |
  12852. * |-------------------------------------------------------------------|
  12853. *
  12854. * The message is interpreted as follows:
  12855. * dword0 - b'0:7 - msg_type: This will be set to
  12856. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  12857. * b'8:15 - number_entries: Indicated the number of entries
  12858. * programmed.
  12859. * b'16:31 - reserved.
  12860. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  12861. * CMEM base address
  12862. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  12863. * CMEM base address
  12864. */
  12865. PREPACK struct htt_cmem_base_send_t {
  12866. A_UINT32 msg_type: 8,
  12867. num_entries: 8,
  12868. reserved: 16;
  12869. A_UINT32 base_address_lo;
  12870. A_UINT32 base_address_hi;
  12871. } POSTPACK;
  12872. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  12873. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  12874. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  12875. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  12876. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  12877. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  12878. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  12879. do { \
  12880. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  12881. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12882. } while (0)
  12883. /**
  12884. * @brief - HTT PPDU ID format
  12885. *
  12886. * @details
  12887. * The following field definitions describe the format of the PPDU ID.
  12888. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12889. *
  12890. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12891. * +--------------------------------------------------------------------------
  12892. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12893. * +--------------------------------------------------------------------------
  12894. *
  12895. * sch id :Schedule command id
  12896. * Bits [11 : 0] : monotonically increasing counter to track the
  12897. * PPDU posted to a specific transmit queue.
  12898. *
  12899. * hwq_id: Hardware Queue ID.
  12900. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12901. *
  12902. * mac_id: MAC ID
  12903. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12904. *
  12905. * seq_idx: Sequence index.
  12906. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12907. * a particular TXOP.
  12908. *
  12909. * tqm_cmd: HWSCH/TQM flag.
  12910. * Bit [23] : Always set to 0.
  12911. *
  12912. * seq_cmd_type: Sequence command type.
  12913. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12914. * Refer to enum HTT_STATS_FTYPE for values.
  12915. */
  12916. PREPACK struct htt_ppdu_id {
  12917. A_UINT32
  12918. sch_id: 12,
  12919. hwq_id: 5,
  12920. mac_id: 2,
  12921. seq_idx: 2,
  12922. reserved1: 2,
  12923. tqm_cmd: 1,
  12924. seq_cmd_type: 6,
  12925. reserved2: 2;
  12926. } POSTPACK;
  12927. #define HTT_PPDU_ID_SCH_ID_S 0
  12928. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12929. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12930. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12931. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12932. do { \
  12933. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12934. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12935. } while (0)
  12936. #define HTT_PPDU_ID_HWQ_ID_S 12
  12937. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12938. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12939. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12940. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12941. do { \
  12942. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12943. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12944. } while (0)
  12945. #define HTT_PPDU_ID_MAC_ID_S 17
  12946. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12947. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12948. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12949. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12950. do { \
  12951. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12952. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12953. } while (0)
  12954. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12955. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  12956. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12957. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12958. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12959. do { \
  12960. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12961. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12962. } while (0)
  12963. #define HTT_PPDU_ID_TQM_CMD_S 23
  12964. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12965. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12966. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12967. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12968. do { \
  12969. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12970. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12971. } while (0)
  12972. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12973. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12974. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12975. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12976. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12977. do { \
  12978. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12979. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12980. } while (0)
  12981. /**
  12982. * @brief target -> RX PEER METADATA V0 format
  12983. * Host will know the peer metadata version from the wmi_service_ready_ext2
  12984. * message from target, and will confirm to the target which peer metadata
  12985. * version to use in the wmi_init message.
  12986. *
  12987. * The following diagram shows the format of the RX PEER METADATA.
  12988. *
  12989. * |31 24|23 16|15 8|7 0|
  12990. * |-----------------------------------------------------------------------|
  12991. * | Reserved | VDEV ID | PEER ID |
  12992. * |-----------------------------------------------------------------------|
  12993. */
  12994. PREPACK struct htt_rx_peer_metadata_v0 {
  12995. A_UINT32
  12996. peer_id: 16,
  12997. vdev_id: 8,
  12998. reserved1: 8;
  12999. } POSTPACK;
  13000. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13001. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13002. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13003. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13004. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13005. do { \
  13006. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13007. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13008. } while (0)
  13009. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13010. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13011. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13012. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13013. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13014. do { \
  13015. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13016. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13017. } while (0)
  13018. /**
  13019. * @brief target -> RX PEER METADATA V1 format
  13020. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13021. * message from target, and will confirm to the target which peer metadata
  13022. * version to use in the wmi_init message.
  13023. *
  13024. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13025. *
  13026. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13027. * |-----------------------------------------------------------------------|
  13028. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13029. * |-----------------------------------------------------------------------|
  13030. */
  13031. PREPACK struct htt_rx_peer_metadata_v1 {
  13032. A_UINT32
  13033. peer_id: 13,
  13034. ml_peer_valid: 1,
  13035. reserved1: 2,
  13036. vdev_id: 8,
  13037. lmac_id: 2,
  13038. chip_id: 3,
  13039. reserved2: 3;
  13040. } POSTPACK;
  13041. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13042. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13043. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13044. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13045. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13046. do { \
  13047. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13048. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13049. } while (0)
  13050. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13051. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13052. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13053. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13054. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13055. do { \
  13056. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13057. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13058. } while (0)
  13059. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13060. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13061. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13062. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13063. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13064. do { \
  13065. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13066. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13067. } while (0)
  13068. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13069. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13070. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13071. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13072. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13073. do { \
  13074. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13075. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13076. } while (0)
  13077. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13078. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13079. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13080. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13081. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13082. do { \
  13083. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13084. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13085. } while (0)
  13086. /*
  13087. * In some systems, the host SW wants to specify priorities between
  13088. * different MSDU / flow queues within the same peer-TID.
  13089. * The below enums are used for the host to identify to the target
  13090. * which MSDU queue's priority it wants to adjust.
  13091. */
  13092. /*
  13093. * The MSDUQ index describe index of TCL HW, where each index is
  13094. * used for queuing particular types of MSDUs.
  13095. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  13096. */
  13097. enum HTT_MSDUQ_INDEX {
  13098. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  13099. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  13100. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  13101. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  13102. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  13103. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  13104. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  13105. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  13106. HTT_MSDUQ_MAX_INDEX,
  13107. };
  13108. /* MSDU qtype definition */
  13109. enum HTT_MSDU_QTYPE {
  13110. /*
  13111. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  13112. * relative priority. Instead, the relative priority of CRIT_0 versus
  13113. * CRIT_1 is controlled by the FW, through the configuration parameters
  13114. * it applies to the queues.
  13115. */
  13116. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  13117. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  13118. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  13119. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  13120. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  13121. /* New MSDU_QTYPE should be added above this line */
  13122. /*
  13123. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  13124. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  13125. * any host/target message definitions. The QTYPE_MAX value can
  13126. * only be used internally within the host or within the target.
  13127. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  13128. * it must regard the unexpected value as a default qtype value,
  13129. * or ignore it.
  13130. */
  13131. HTT_MSDU_QTYPE_MAX,
  13132. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  13133. };
  13134. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  13135. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  13136. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  13137. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  13138. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  13139. };
  13140. #endif