htt.h 630 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004
  1. /*
  2. * Copyright (c) 2011-2020 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. */
  196. #define HTT_CURRENT_VERSION_MAJOR 3
  197. #define HTT_CURRENT_VERSION_MINOR 77
  198. #define HTT_NUM_TX_FRAG_DESC 1024
  199. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  200. #define HTT_CHECK_SET_VAL(field, val) \
  201. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  202. /* macros to assist in sign-extending fields from HTT messages */
  203. #define HTT_SIGN_BIT_MASK(field) \
  204. ((field ## _M + (1 << field ## _S)) >> 1)
  205. #define HTT_SIGN_BIT(_val, field) \
  206. (_val & HTT_SIGN_BIT_MASK(field))
  207. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  208. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  209. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  210. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  211. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  212. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  213. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  214. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  215. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  216. /*
  217. * TEMPORARY:
  218. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  219. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  220. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  221. * updated.
  222. */
  223. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  224. /*
  225. * TEMPORARY:
  226. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  227. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  228. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  229. * updated.
  230. */
  231. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  232. /* HTT Access Category values */
  233. enum HTT_AC_WMM {
  234. /* WMM Access Categories */
  235. HTT_AC_WMM_BE = 0x0,
  236. HTT_AC_WMM_BK = 0x1,
  237. HTT_AC_WMM_VI = 0x2,
  238. HTT_AC_WMM_VO = 0x3,
  239. /* extension Access Categories */
  240. HTT_AC_EXT_NON_QOS = 0x4,
  241. HTT_AC_EXT_UCAST_MGMT = 0x5,
  242. HTT_AC_EXT_MCAST_DATA = 0x6,
  243. HTT_AC_EXT_MCAST_MGMT = 0x7,
  244. };
  245. enum HTT_AC_WMM_MASK {
  246. /* WMM Access Categories */
  247. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  248. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  249. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  250. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  251. /* extension Access Categories */
  252. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  253. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  254. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  255. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  256. };
  257. #define HTT_AC_MASK_WMM \
  258. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  259. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  260. #define HTT_AC_MASK_EXT \
  261. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  262. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  263. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  264. /*
  265. * htt_dbg_stats_type -
  266. * bit positions for each stats type within a stats type bitmask
  267. * The bitmask contains 24 bits.
  268. */
  269. enum htt_dbg_stats_type {
  270. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  271. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  272. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  273. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  274. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  275. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  276. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  277. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  278. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  279. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  280. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  281. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  282. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  283. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  284. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  285. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  286. /* bits 16-23 currently reserved */
  287. /* keep this last */
  288. HTT_DBG_NUM_STATS
  289. };
  290. /*=== HTT option selection TLVs ===
  291. * Certain HTT messages have alternatives or options.
  292. * For such cases, the host and target need to agree on which option to use.
  293. * Option specification TLVs can be appended to the VERSION_REQ and
  294. * VERSION_CONF messages to select options other than the default.
  295. * These TLVs are entirely optional - if they are not provided, there is a
  296. * well-defined default for each option. If they are provided, they can be
  297. * provided in any order. Each TLV can be present or absent independent of
  298. * the presence / absence of other TLVs.
  299. *
  300. * The HTT option selection TLVs use the following format:
  301. * |31 16|15 8|7 0|
  302. * |---------------------------------+----------------+----------------|
  303. * | value (payload) | length | tag |
  304. * |-------------------------------------------------------------------|
  305. * The value portion need not be only 2 bytes; it can be extended by any
  306. * integer number of 4-byte units. The total length of the TLV, including
  307. * the tag and length fields, must be a multiple of 4 bytes. The length
  308. * field specifies the total TLV size in 4-byte units. Thus, the typical
  309. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  310. * field, would store 0x1 in its length field, to show that the TLV occupies
  311. * a single 4-byte unit.
  312. */
  313. /*--- TLV header format - applies to all HTT option TLVs ---*/
  314. enum HTT_OPTION_TLV_TAGS {
  315. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  316. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  317. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  318. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  319. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  320. };
  321. PREPACK struct htt_option_tlv_header_t {
  322. A_UINT8 tag;
  323. A_UINT8 length;
  324. } POSTPACK;
  325. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  326. #define HTT_OPTION_TLV_TAG_S 0
  327. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  328. #define HTT_OPTION_TLV_LENGTH_S 8
  329. /*
  330. * value0 - 16 bit value field stored in word0
  331. * The TLV's value field may be longer than 2 bytes, in which case
  332. * the remainder of the value is stored in word1, word2, etc.
  333. */
  334. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  335. #define HTT_OPTION_TLV_VALUE0_S 16
  336. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  337. do { \
  338. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  339. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  340. } while (0)
  341. #define HTT_OPTION_TLV_TAG_GET(word) \
  342. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  343. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  349. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  350. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  356. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  357. /*--- format of specific HTT option TLVs ---*/
  358. /*
  359. * HTT option TLV for specifying LL bus address size
  360. * Some chips require bus addresses used by the target to access buffers
  361. * within the host's memory to be 32 bits; others require bus addresses
  362. * used by the target to access buffers within the host's memory to be
  363. * 64 bits.
  364. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  365. * a suffix to the VERSION_CONF message to specify which bus address format
  366. * the target requires.
  367. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  368. * default to providing bus addresses to the target in 32-bit format.
  369. */
  370. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  371. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  372. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  373. };
  374. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  375. struct htt_option_tlv_header_t hdr;
  376. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  377. } POSTPACK;
  378. /*
  379. * HTT option TLV for specifying whether HL systems should indicate
  380. * over-the-air tx completion for individual frames, or should instead
  381. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  382. * requests an OTA tx completion for a particular tx frame.
  383. * This option does not apply to LL systems, where the TX_COMPL_IND
  384. * is mandatory.
  385. * This option is primarily intended for HL systems in which the tx frame
  386. * downloads over the host --> target bus are as slow as or slower than
  387. * the transmissions over the WLAN PHY. For cases where the bus is faster
  388. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  389. * and consquently will send one TX_COMPL_IND message that covers several
  390. * tx frames. For cases where the WLAN PHY is faster than the bus,
  391. * the target will end up transmitting very short A-MPDUs, and consequently
  392. * sending many TX_COMPL_IND messages, which each cover a very small number
  393. * of tx frames.
  394. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  395. * a suffix to the VERSION_REQ message to request whether the host desires to
  396. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  397. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  398. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  399. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  400. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  401. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  402. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  403. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  404. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  405. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  406. * TLV.
  407. */
  408. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  409. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  410. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  411. };
  412. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  413. struct htt_option_tlv_header_t hdr;
  414. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  415. } POSTPACK;
  416. /*
  417. * HTT option TLV for specifying how many tx queue groups the target
  418. * may establish.
  419. * This TLV specifies the maximum value the target may send in the
  420. * txq_group_id field of any TXQ_GROUP information elements sent by
  421. * the target to the host. This allows the host to pre-allocate an
  422. * appropriate number of tx queue group structs.
  423. *
  424. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  425. * a suffix to the VERSION_REQ message to specify whether the host supports
  426. * tx queue groups at all, and if so if there is any limit on the number of
  427. * tx queue groups that the host supports.
  428. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  429. * a suffix to the VERSION_CONF message. If the host has specified in the
  430. * VER_REQ message a limit on the number of tx queue groups the host can
  431. * supprt, the target shall limit its specification of the maximum tx groups
  432. * to be no larger than this host-specified limit.
  433. *
  434. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  435. * shall preallocate 4 tx queue group structs, and the target shall not
  436. * specify a txq_group_id larger than 3.
  437. */
  438. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  439. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  440. /*
  441. * values 1 through N specify the max number of tx queue groups
  442. * the sender supports
  443. */
  444. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  445. };
  446. /* TEMPORARY backwards-compatibility alias for a typo fix -
  447. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  448. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  449. * to support the old name (with the typo) until all references to the
  450. * old name are replaced with the new name.
  451. */
  452. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  453. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  454. struct htt_option_tlv_header_t hdr;
  455. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  456. } POSTPACK;
  457. /*
  458. * HTT option TLV for specifying whether the target supports an extended
  459. * version of the HTT tx descriptor. If the target provides this TLV
  460. * and specifies in the TLV that the target supports an extended version
  461. * of the HTT tx descriptor, the target must check the "extension" bit in
  462. * the HTT tx descriptor, and if the extension bit is set, to expect a
  463. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  464. * descriptor. Furthermore, the target must provide room for the HTT
  465. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  466. * This option is intended for systems where the host needs to explicitly
  467. * control the transmission parameters such as tx power for individual
  468. * tx frames.
  469. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  470. * as a suffix to the VERSION_CONF message to explicitly specify whether
  471. * the target supports the HTT tx MSDU extension descriptor.
  472. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  473. * by the host as lack of target support for the HTT tx MSDU extension
  474. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  475. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  476. * the HTT tx MSDU extension descriptor.
  477. * The host is not required to provide the HTT tx MSDU extension descriptor
  478. * just because the target supports it; the target must check the
  479. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  480. * extension descriptor is present.
  481. */
  482. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  483. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  484. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  485. };
  486. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  487. struct htt_option_tlv_header_t hdr;
  488. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  489. } POSTPACK;
  490. /*=== host -> target messages ===============================================*/
  491. enum htt_h2t_msg_type {
  492. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  493. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  494. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  495. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  496. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  497. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  498. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  499. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  500. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  501. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  502. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  503. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  504. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  505. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  506. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  507. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  508. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  509. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  510. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  511. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  512. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  513. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  514. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  515. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  516. /* keep this last */
  517. HTT_H2T_NUM_MSGS
  518. };
  519. /*
  520. * HTT host to target message type -
  521. * stored in bits 7:0 of the first word of the message
  522. */
  523. #define HTT_H2T_MSG_TYPE_M 0xff
  524. #define HTT_H2T_MSG_TYPE_S 0
  525. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  526. do { \
  527. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  528. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  529. } while (0)
  530. #define HTT_H2T_MSG_TYPE_GET(word) \
  531. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  532. /**
  533. * @brief host -> target version number request message definition
  534. *
  535. * |31 24|23 16|15 8|7 0|
  536. * |----------------+----------------+----------------+----------------|
  537. * | reserved | msg type |
  538. * |-------------------------------------------------------------------|
  539. * : option request TLV (optional) |
  540. * :...................................................................:
  541. *
  542. * The VER_REQ message may consist of a single 4-byte word, or may be
  543. * extended with TLVs that specify which HTT options the host is requesting
  544. * from the target.
  545. * The following option TLVs may be appended to the VER_REQ message:
  546. * - HL_SUPPRESS_TX_COMPL_IND
  547. * - HL_MAX_TX_QUEUE_GROUPS
  548. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  549. * may be appended to the VER_REQ message (but only one TLV of each type).
  550. *
  551. * Header fields:
  552. * - MSG_TYPE
  553. * Bits 7:0
  554. * Purpose: identifies this as a version number request message
  555. * Value: 0x0
  556. */
  557. #define HTT_VER_REQ_BYTES 4
  558. /* TBDXXX: figure out a reasonable number */
  559. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  560. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  561. /**
  562. * @brief HTT tx MSDU descriptor
  563. *
  564. * @details
  565. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  566. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  567. * the target firmware needs for the FW's tx processing, particularly
  568. * for creating the HW msdu descriptor.
  569. * The same HTT tx descriptor is used for HL and LL systems, though
  570. * a few fields within the tx descriptor are used only by LL or
  571. * only by HL.
  572. * The HTT tx descriptor is defined in two manners: by a struct with
  573. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  574. * definitions.
  575. * The target should use the struct def, for simplicitly and clarity,
  576. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  577. * neutral. Specifically, the host shall use the get/set macros built
  578. * around the mask + shift defs.
  579. */
  580. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  581. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  582. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  583. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  584. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  585. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  586. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  587. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  588. #define HTT_TX_VDEV_ID_WORD 0
  589. #define HTT_TX_VDEV_ID_MASK 0x3f
  590. #define HTT_TX_VDEV_ID_SHIFT 16
  591. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  592. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  593. #define HTT_TX_MSDU_LEN_DWORD 1
  594. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  595. /*
  596. * HTT_VAR_PADDR macros
  597. * Allow physical / bus addresses to be either a single 32-bit value,
  598. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  599. */
  600. #define HTT_VAR_PADDR32(var_name) \
  601. A_UINT32 var_name
  602. #define HTT_VAR_PADDR64_LE(var_name) \
  603. struct { \
  604. /* little-endian: lo precedes hi */ \
  605. A_UINT32 lo; \
  606. A_UINT32 hi; \
  607. } var_name
  608. /*
  609. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  610. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  611. * addresses are stored in a XXX-bit field.
  612. * This macro is used to define both htt_tx_msdu_desc32_t and
  613. * htt_tx_msdu_desc64_t structs.
  614. */
  615. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  616. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  617. { \
  618. /* DWORD 0: flags and meta-data */ \
  619. A_UINT32 \
  620. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  621. \
  622. /* pkt_subtype - \
  623. * Detailed specification of the tx frame contents, extending the \
  624. * general specification provided by pkt_type. \
  625. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  626. * pkt_type | pkt_subtype \
  627. * ============================================================== \
  628. * 802.3 | bit 0:3 - Reserved \
  629. * | bit 4: 0x0 - Copy-Engine Classification Results \
  630. * | not appended to the HTT message \
  631. * | 0x1 - Copy-Engine Classification Results \
  632. * | appended to the HTT message in the \
  633. * | format: \
  634. * | [HTT tx desc, frame header, \
  635. * | CE classification results] \
  636. * | The CE classification results begin \
  637. * | at the next 4-byte boundary after \
  638. * | the frame header. \
  639. * ------------+------------------------------------------------- \
  640. * Eth2 | bit 0:3 - Reserved \
  641. * | bit 4: 0x0 - Copy-Engine Classification Results \
  642. * | not appended to the HTT message \
  643. * | 0x1 - Copy-Engine Classification Results \
  644. * | appended to the HTT message. \
  645. * | See the above specification of the \
  646. * | CE classification results location. \
  647. * ------------+------------------------------------------------- \
  648. * native WiFi | bit 0:3 - Reserved \
  649. * | bit 4: 0x0 - Copy-Engine Classification Results \
  650. * | not appended to the HTT message \
  651. * | 0x1 - Copy-Engine Classification Results \
  652. * | appended to the HTT message. \
  653. * | See the above specification of the \
  654. * | CE classification results location. \
  655. * ------------+------------------------------------------------- \
  656. * mgmt | 0x0 - 802.11 MAC header absent \
  657. * | 0x1 - 802.11 MAC header present \
  658. * ------------+------------------------------------------------- \
  659. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  660. * | 0x1 - 802.11 MAC header present \
  661. * | bit 1: 0x0 - allow aggregation \
  662. * | 0x1 - don't allow aggregation \
  663. * | bit 2: 0x0 - perform encryption \
  664. * | 0x1 - don't perform encryption \
  665. * | bit 3: 0x0 - perform tx classification / queuing \
  666. * | 0x1 - don't perform tx classification; \
  667. * | insert the frame into the "misc" \
  668. * | tx queue \
  669. * | bit 4: 0x0 - Copy-Engine Classification Results \
  670. * | not appended to the HTT message \
  671. * | 0x1 - Copy-Engine Classification Results \
  672. * | appended to the HTT message. \
  673. * | See the above specification of the \
  674. * | CE classification results location. \
  675. */ \
  676. pkt_subtype: 5, \
  677. \
  678. /* pkt_type - \
  679. * General specification of the tx frame contents. \
  680. * The htt_pkt_type enum should be used to specify and check the \
  681. * value of this field. \
  682. */ \
  683. pkt_type: 3, \
  684. \
  685. /* vdev_id - \
  686. * ID for the vdev that is sending this tx frame. \
  687. * For certain non-standard packet types, e.g. pkt_type == raw \
  688. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  689. * This field is used primarily for determining where to queue \
  690. * broadcast and multicast frames. \
  691. */ \
  692. vdev_id: 6, \
  693. /* ext_tid - \
  694. * The extended traffic ID. \
  695. * If the TID is unknown, the extended TID is set to \
  696. * HTT_TX_EXT_TID_INVALID. \
  697. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  698. * value of the QoS TID. \
  699. * If the tx frame is non-QoS data, then the extended TID is set to \
  700. * HTT_TX_EXT_TID_NON_QOS. \
  701. * If the tx frame is multicast or broadcast, then the extended TID \
  702. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  703. */ \
  704. ext_tid: 5, \
  705. \
  706. /* postponed - \
  707. * This flag indicates whether the tx frame has been downloaded to \
  708. * the target before but discarded by the target, and now is being \
  709. * downloaded again; or if this is a new frame that is being \
  710. * downloaded for the first time. \
  711. * This flag allows the target to determine the correct order for \
  712. * transmitting new vs. old frames. \
  713. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  714. * This flag only applies to HL systems, since in LL systems, \
  715. * the tx flow control is handled entirely within the target. \
  716. */ \
  717. postponed: 1, \
  718. \
  719. /* extension - \
  720. * This flag indicates whether a HTT tx MSDU extension descriptor \
  721. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  722. * \
  723. * 0x0 - no extension MSDU descriptor is present \
  724. * 0x1 - an extension MSDU descriptor immediately follows the \
  725. * regular MSDU descriptor \
  726. */ \
  727. extension: 1, \
  728. \
  729. /* cksum_offload - \
  730. * This flag indicates whether checksum offload is enabled or not \
  731. * for this frame. Target FW use this flag to turn on HW checksumming \
  732. * 0x0 - No checksum offload \
  733. * 0x1 - L3 header checksum only \
  734. * 0x2 - L4 checksum only \
  735. * 0x3 - L3 header checksum + L4 checksum \
  736. */ \
  737. cksum_offload: 2, \
  738. \
  739. /* tx_comp_req - \
  740. * This flag indicates whether Tx Completion \
  741. * from fw is required or not. \
  742. * This flag is only relevant if tx completion is not \
  743. * universally enabled. \
  744. * For all LL systems, tx completion is mandatory, \
  745. * so this flag will be irrelevant. \
  746. * For HL systems tx completion is optional, but HL systems in which \
  747. * the bus throughput exceeds the WLAN throughput will \
  748. * probably want to always use tx completion, and thus \
  749. * would not check this flag. \
  750. * This flag is required when tx completions are not used universally, \
  751. * but are still required for certain tx frames for which \
  752. * an OTA delivery acknowledgment is needed by the host. \
  753. * In practice, this would be for HL systems in which the \
  754. * bus throughput is less than the WLAN throughput. \
  755. * \
  756. * 0x0 - Tx Completion Indication from Fw not required \
  757. * 0x1 - Tx Completion Indication from Fw is required \
  758. */ \
  759. tx_compl_req: 1; \
  760. \
  761. \
  762. /* DWORD 1: MSDU length and ID */ \
  763. A_UINT32 \
  764. len: 16, /* MSDU length, in bytes */ \
  765. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  766. * and this id is used to calculate fragmentation \
  767. * descriptor pointer inside the target based on \
  768. * the base address, configured inside the target. \
  769. */ \
  770. \
  771. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  772. /* frags_desc_ptr - \
  773. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  774. * where the tx frame's fragments reside in memory. \
  775. * This field only applies to LL systems, since in HL systems the \
  776. * (degenerate single-fragment) fragmentation descriptor is created \
  777. * within the target. \
  778. */ \
  779. _paddr__frags_desc_ptr_; \
  780. \
  781. /* DWORD 3 (or 4): peerid, chanfreq */ \
  782. /* \
  783. * Peer ID : Target can use this value to know which peer-id packet \
  784. * destined to. \
  785. * It's intended to be specified by host in case of NAWDS. \
  786. */ \
  787. A_UINT16 peerid; \
  788. \
  789. /* \
  790. * Channel frequency: This identifies the desired channel \
  791. * frequency (in mhz) for tx frames. This is used by FW to help \
  792. * determine when it is safe to transmit or drop frames for \
  793. * off-channel operation. \
  794. * The default value of zero indicates to FW that the corresponding \
  795. * VDEV's home channel (if there is one) is the desired channel \
  796. * frequency. \
  797. */ \
  798. A_UINT16 chanfreq; \
  799. \
  800. /* Reason reserved is commented is increasing the htt structure size \
  801. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  802. * A_UINT32 reserved_dword3_bits0_31; \
  803. */ \
  804. } POSTPACK
  805. /* define a htt_tx_msdu_desc32_t type */
  806. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  807. /* define a htt_tx_msdu_desc64_t type */
  808. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  809. /*
  810. * Make htt_tx_msdu_desc_t be an alias for either
  811. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  812. */
  813. #if HTT_PADDR64
  814. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  815. #else
  816. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  817. #endif
  818. /* decriptor information for Management frame*/
  819. /*
  820. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  821. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  822. */
  823. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  824. extern A_UINT32 mgmt_hdr_len;
  825. PREPACK struct htt_mgmt_tx_desc_t {
  826. A_UINT32 msg_type;
  827. #if HTT_PADDR64
  828. A_UINT64 frag_paddr; /* DMAble address of the data */
  829. #else
  830. A_UINT32 frag_paddr; /* DMAble address of the data */
  831. #endif
  832. A_UINT32 desc_id; /* returned to host during completion
  833. * to free the meory*/
  834. A_UINT32 len; /* Fragment length */
  835. A_UINT32 vdev_id; /* virtual device ID*/
  836. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  837. } POSTPACK;
  838. PREPACK struct htt_mgmt_tx_compl_ind {
  839. A_UINT32 desc_id;
  840. A_UINT32 status;
  841. } POSTPACK;
  842. /*
  843. * This SDU header size comes from the summation of the following:
  844. * 1. Max of:
  845. * a. Native WiFi header, for native WiFi frames: 24 bytes
  846. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  847. * b. 802.11 header, for raw frames: 36 bytes
  848. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  849. * QoS header, HT header)
  850. * c. 802.3 header, for ethernet frames: 14 bytes
  851. * (destination address, source address, ethertype / length)
  852. * 2. Max of:
  853. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  854. * b. IPv6 header, up through the Traffic Class: 2 bytes
  855. * 3. 802.1Q VLAN header: 4 bytes
  856. * 4. LLC/SNAP header: 8 bytes
  857. */
  858. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  859. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  860. #define HTT_TX_HDR_SIZE_ETHERNET 14
  861. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  862. A_COMPILE_TIME_ASSERT(
  863. htt_encap_hdr_size_max_check_nwifi,
  864. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  865. A_COMPILE_TIME_ASSERT(
  866. htt_encap_hdr_size_max_check_enet,
  867. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  868. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  869. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  870. #define HTT_TX_HDR_SIZE_802_1Q 4
  871. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  872. #define HTT_COMMON_TX_FRM_HDR_LEN \
  873. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  874. HTT_TX_HDR_SIZE_802_1Q + \
  875. HTT_TX_HDR_SIZE_LLC_SNAP)
  876. #define HTT_HL_TX_FRM_HDR_LEN \
  877. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  878. #define HTT_LL_TX_FRM_HDR_LEN \
  879. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  880. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  881. /* dword 0 */
  882. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  885. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  886. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  889. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  890. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  893. #define HTT_TX_DESC_PKT_TYPE_S 13
  894. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  897. #define HTT_TX_DESC_VDEV_ID_S 16
  898. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  899. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  900. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  901. #define HTT_TX_DESC_EXT_TID_S 22
  902. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  903. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  904. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  905. #define HTT_TX_DESC_POSTPONED_S 27
  906. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  907. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  908. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  909. #define HTT_TX_DESC_EXTENSION_S 28
  910. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  911. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  912. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  913. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  914. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  915. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  916. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  917. #define HTT_TX_DESC_TX_COMP_S 31
  918. /* dword 1 */
  919. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  920. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  921. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  922. #define HTT_TX_DESC_FRM_LEN_S 0
  923. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  924. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  925. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  926. #define HTT_TX_DESC_FRM_ID_S 16
  927. /* dword 2 */
  928. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  929. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  930. /* for systems using 64-bit format for bus addresses */
  931. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  932. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  933. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  934. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  935. /* for systems using 32-bit format for bus addresses */
  936. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  937. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  938. /* dword 3 */
  939. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  940. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  941. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  942. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  943. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  944. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  945. #if HTT_PADDR64
  946. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  947. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  948. #else
  949. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  950. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  951. #endif
  952. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  953. #define HTT_TX_DESC_PEER_ID_S 0
  954. /*
  955. * TEMPORARY:
  956. * The original definitions for the PEER_ID fields contained typos
  957. * (with _DESC_PADDR appended to this PEER_ID field name).
  958. * Retain deprecated original names for PEER_ID fields until all code that
  959. * refers to them has been updated.
  960. */
  961. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  962. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  963. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  964. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  965. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  966. HTT_TX_DESC_PEER_ID_M
  967. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  968. HTT_TX_DESC_PEER_ID_S
  969. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  970. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  971. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  972. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  973. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  974. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  975. #if HTT_PADDR64
  976. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  977. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  978. #else
  979. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  980. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  981. #endif
  982. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  983. #define HTT_TX_DESC_CHAN_FREQ_S 16
  984. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  985. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  986. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  992. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  993. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  999. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1000. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1007. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1014. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1021. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1028. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1035. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1039. } while (0)
  1040. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1041. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1042. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1043. do { \
  1044. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1045. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1046. } while (0)
  1047. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1048. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1049. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1050. do { \
  1051. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1052. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1053. } while (0)
  1054. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1055. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1056. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1057. do { \
  1058. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1059. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1060. } while (0)
  1061. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1062. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1063. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1064. do { \
  1065. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1066. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1067. } while (0)
  1068. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1069. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1070. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1071. do { \
  1072. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1073. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1074. } while (0)
  1075. /* enums used in the HTT tx MSDU extension descriptor */
  1076. enum {
  1077. htt_tx_guard_interval_regular = 0,
  1078. htt_tx_guard_interval_short = 1,
  1079. };
  1080. enum {
  1081. htt_tx_preamble_type_ofdm = 0,
  1082. htt_tx_preamble_type_cck = 1,
  1083. htt_tx_preamble_type_ht = 2,
  1084. htt_tx_preamble_type_vht = 3,
  1085. };
  1086. enum {
  1087. htt_tx_bandwidth_5MHz = 0,
  1088. htt_tx_bandwidth_10MHz = 1,
  1089. htt_tx_bandwidth_20MHz = 2,
  1090. htt_tx_bandwidth_40MHz = 3,
  1091. htt_tx_bandwidth_80MHz = 4,
  1092. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1093. };
  1094. /**
  1095. * @brief HTT tx MSDU extension descriptor
  1096. * @details
  1097. * If the target supports HTT tx MSDU extension descriptors, the host has
  1098. * the option of appending the following struct following the regular
  1099. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1100. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1101. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1102. * tx specs for each frame.
  1103. */
  1104. PREPACK struct htt_tx_msdu_desc_ext_t {
  1105. /* DWORD 0: flags */
  1106. A_UINT32
  1107. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1108. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1109. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1110. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1111. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1112. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1113. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1114. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1115. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1116. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1117. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1118. /* DWORD 1: tx power, tx rate, tx BW */
  1119. A_UINT32
  1120. /* pwr -
  1121. * Specify what power the tx frame needs to be transmitted at.
  1122. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1123. * The value needs to be appropriately sign-extended when extracting
  1124. * the value from the message and storing it in a variable that is
  1125. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1126. * automatically handles this sign-extension.)
  1127. * If the transmission uses multiple tx chains, this power spec is
  1128. * the total transmit power, assuming incoherent combination of
  1129. * per-chain power to produce the total power.
  1130. */
  1131. pwr: 8,
  1132. /* mcs_mask -
  1133. * Specify the allowable values for MCS index (modulation and coding)
  1134. * to use for transmitting the frame.
  1135. *
  1136. * For HT / VHT preamble types, this mask directly corresponds to
  1137. * the HT or VHT MCS indices that are allowed. For each bit N set
  1138. * within the mask, MCS index N is allowed for transmitting the frame.
  1139. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1140. * rates versus OFDM rates, so the host has the option of specifying
  1141. * that the target must transmit the frame with CCK or OFDM rates
  1142. * (not HT or VHT), but leaving the decision to the target whether
  1143. * to use CCK or OFDM.
  1144. *
  1145. * For CCK and OFDM, the bits within this mask are interpreted as
  1146. * follows:
  1147. * bit 0 -> CCK 1 Mbps rate is allowed
  1148. * bit 1 -> CCK 2 Mbps rate is allowed
  1149. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1150. * bit 3 -> CCK 11 Mbps rate is allowed
  1151. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1152. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1153. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1154. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1155. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1156. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1157. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1158. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1159. *
  1160. * The MCS index specification needs to be compatible with the
  1161. * bandwidth mask specification. For example, a MCS index == 9
  1162. * specification is inconsistent with a preamble type == VHT,
  1163. * Nss == 1, and channel bandwidth == 20 MHz.
  1164. *
  1165. * Furthermore, the host has only a limited ability to specify to
  1166. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1167. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1168. */
  1169. mcs_mask: 12,
  1170. /* nss_mask -
  1171. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1172. * Each bit in this mask corresponds to a Nss value:
  1173. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1174. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1175. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1176. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1177. * The values in the Nss mask must be suitable for the recipient, e.g.
  1178. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1179. * recipient which only supports 2x2 MIMO.
  1180. */
  1181. nss_mask: 4,
  1182. /* guard_interval -
  1183. * Specify a htt_tx_guard_interval enum value to indicate whether
  1184. * the transmission should use a regular guard interval or a
  1185. * short guard interval.
  1186. */
  1187. guard_interval: 1,
  1188. /* preamble_type_mask -
  1189. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1190. * may choose from for transmitting this frame.
  1191. * The bits in this mask correspond to the values in the
  1192. * htt_tx_preamble_type enum. For example, to allow the target
  1193. * to transmit the frame as either CCK or OFDM, this field would
  1194. * be set to
  1195. * (1 << htt_tx_preamble_type_ofdm) |
  1196. * (1 << htt_tx_preamble_type_cck)
  1197. */
  1198. preamble_type_mask: 4,
  1199. reserved1_31_29: 3; /* unused, set to 0x0 */
  1200. /* DWORD 2: tx chain mask, tx retries */
  1201. A_UINT32
  1202. /* chain_mask - specify which chains to transmit from */
  1203. chain_mask: 4,
  1204. /* retry_limit -
  1205. * Specify the maximum number of transmissions, including the
  1206. * initial transmission, to attempt before giving up if no ack
  1207. * is received.
  1208. * If the tx rate is specified, then all retries shall use the
  1209. * same rate as the initial transmission.
  1210. * If no tx rate is specified, the target can choose whether to
  1211. * retain the original rate during the retransmissions, or to
  1212. * fall back to a more robust rate.
  1213. */
  1214. retry_limit: 4,
  1215. /* bandwidth_mask -
  1216. * Specify what channel widths may be used for the transmission.
  1217. * A value of zero indicates "don't care" - the target may choose
  1218. * the transmission bandwidth.
  1219. * The bits within this mask correspond to the htt_tx_bandwidth
  1220. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1221. * The bandwidth_mask must be consistent with the preamble_type_mask
  1222. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1223. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1224. */
  1225. bandwidth_mask: 6,
  1226. reserved2_31_14: 18; /* unused, set to 0x0 */
  1227. /* DWORD 3: tx expiry time (TSF) LSBs */
  1228. A_UINT32 expire_tsf_lo;
  1229. /* DWORD 4: tx expiry time (TSF) MSBs */
  1230. A_UINT32 expire_tsf_hi;
  1231. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1232. } POSTPACK;
  1233. /* DWORD 0 */
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1254. /* DWORD 1 */
  1255. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1256. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1257. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1258. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1259. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1260. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1261. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1262. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1263. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1264. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1265. /* DWORD 2 */
  1266. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1267. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1268. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1269. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1270. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1271. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1272. /* DWORD 0 */
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1274. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1279. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1280. } while (0)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL( \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1296. ((_var) |= ((_val) \
  1297. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1298. } while (0)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1300. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL( \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1306. ((_var) |= ((_val) \
  1307. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1308. } while (0)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1310. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1311. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1312. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1316. } while (0)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1318. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1319. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1320. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1324. } while (0)
  1325. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1332. } while (0)
  1333. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1334. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1335. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1336. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1340. } while (0)
  1341. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1348. } while (0)
  1349. /* DWORD 1 */
  1350. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1354. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1355. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1356. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1357. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1358. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1359. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1360. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1361. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1362. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1366. } while (0)
  1367. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1374. } while (0)
  1375. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1382. } while (0)
  1383. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1384. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1385. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1386. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1390. } while (0)
  1391. /* DWORD 2 */
  1392. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1393. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1394. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1395. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1396. do { \
  1397. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1398. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1399. } while (0)
  1400. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1401. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1402. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1403. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1404. do { \
  1405. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1406. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1407. } while (0)
  1408. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1409. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1410. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1411. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1412. do { \
  1413. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1414. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1415. } while (0)
  1416. typedef enum {
  1417. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1418. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1419. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1420. } htt_11ax_ltf_subtype_t;
  1421. typedef enum {
  1422. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1423. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1424. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1425. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1426. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1427. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1428. } htt_tx_ext2_preamble_type_t;
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1431. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1432. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1433. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1434. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1435. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1436. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1437. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1438. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1439. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1440. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1441. /**
  1442. * @brief HTT tx MSDU extension descriptor v2
  1443. * @details
  1444. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1445. * is received as tcl_exit_base->host_meta_info in firmware.
  1446. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1447. * are already part of tcl_exit_base.
  1448. */
  1449. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1450. /* DWORD 0: flags */
  1451. A_UINT32
  1452. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1453. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1454. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1455. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1456. valid_retries : 1, /* if set, tx retries spec is valid */
  1457. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1458. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1459. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1460. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1461. valid_key_flags : 1, /* if set, key flags is valid */
  1462. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1463. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1464. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1465. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1466. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1467. 1 = ENCRYPT,
  1468. 2 ~ 3 - Reserved */
  1469. /* retry_limit -
  1470. * Specify the maximum number of transmissions, including the
  1471. * initial transmission, to attempt before giving up if no ack
  1472. * is received.
  1473. * If the tx rate is specified, then all retries shall use the
  1474. * same rate as the initial transmission.
  1475. * If no tx rate is specified, the target can choose whether to
  1476. * retain the original rate during the retransmissions, or to
  1477. * fall back to a more robust rate.
  1478. */
  1479. retry_limit : 4,
  1480. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1481. * Valid only for 11ax preamble types HE_SU
  1482. * and HE_EXT_SU
  1483. */
  1484. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1485. * Valid only for 11ax preamble types HE_SU
  1486. * and HE_EXT_SU
  1487. */
  1488. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1489. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1490. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1491. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1492. */
  1493. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1494. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1495. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1496. * Use cases:
  1497. * Any time firmware uses TQM-BYPASS for Data
  1498. * TID, firmware expect host to set this bit.
  1499. */
  1500. /* DWORD 1: tx power, tx rate */
  1501. A_UINT32
  1502. power : 8, /* unit of the power field is 0.5 dbm
  1503. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1504. * signed value ranging from -64dbm to 63.5 dbm
  1505. */
  1506. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1507. * Setting more than one MCS isn't currently
  1508. * supported by the target (but is supported
  1509. * in the interface in case in the future
  1510. * the target supports specifications of
  1511. * a limited set of MCS values.
  1512. */
  1513. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1514. * Setting more than one Nss isn't currently
  1515. * supported by the target (but is supported
  1516. * in the interface in case in the future
  1517. * the target supports specifications of
  1518. * a limited set of Nss values.
  1519. */
  1520. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1521. update_peer_cache : 1; /* When set these custom values will be
  1522. * used for all packets, until the next
  1523. * update via this ext header.
  1524. * This is to make sure not all packets
  1525. * need to include this header.
  1526. */
  1527. /* DWORD 2: tx chain mask, tx retries */
  1528. A_UINT32
  1529. /* chain_mask - specify which chains to transmit from */
  1530. chain_mask : 8,
  1531. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1532. * TODO: Update Enum values for key_flags
  1533. */
  1534. /*
  1535. * Channel frequency: This identifies the desired channel
  1536. * frequency (in MHz) for tx frames. This is used by FW to help
  1537. * determine when it is safe to transmit or drop frames for
  1538. * off-channel operation.
  1539. * The default value of zero indicates to FW that the corresponding
  1540. * VDEV's home channel (if there is one) is the desired channel
  1541. * frequency.
  1542. */
  1543. chanfreq : 16;
  1544. /* DWORD 3: tx expiry time (TSF) LSBs */
  1545. A_UINT32 expire_tsf_lo;
  1546. /* DWORD 4: tx expiry time (TSF) MSBs */
  1547. A_UINT32 expire_tsf_hi;
  1548. /* DWORD 5: flags to control routing / processing of the MSDU */
  1549. A_UINT32
  1550. /* learning_frame
  1551. * When this flag is set, this frame will be dropped by FW
  1552. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1553. */
  1554. learning_frame : 1,
  1555. /* send_as_standalone
  1556. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1557. * i.e. with no A-MSDU or A-MPDU aggregation.
  1558. * The scope is extended to other use-cases.
  1559. */
  1560. send_as_standalone : 1,
  1561. /* is_host_opaque_valid
  1562. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1563. * with valid information.
  1564. */
  1565. is_host_opaque_valid : 1,
  1566. rsvd0 : 29;
  1567. /* DWORD 6 : Host opaque cookie for special frames */
  1568. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1569. rsvd1 : 16;
  1570. /*
  1571. * This structure can be expanded further up to 40 bytes
  1572. * by adding further DWORDs as needed.
  1573. */
  1574. } POSTPACK;
  1575. /* DWORD 0 */
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1602. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1603. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1604. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1605. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1606. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1607. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1608. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1609. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1610. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1611. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1612. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1613. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1616. /* DWORD 1 */
  1617. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1618. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1619. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1620. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1621. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1622. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1623. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1624. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1625. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1626. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1627. /* DWORD 2 */
  1628. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1629. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1630. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1631. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1632. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1633. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1634. /* DWORD 5 */
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1641. /* DWORD 6 */
  1642. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1643. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1644. /* DWORD 0 */
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL( \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1676. ((_var) |= ((_val) \
  1677. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL( \
  1701. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1702. ((_var) |= ((_val) \
  1703. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1707. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1708. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1712. } while (0)
  1713. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1714. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1715. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1716. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1719. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1735. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1736. } while (0)
  1737. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1738. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1739. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1740. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1743. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1744. } while (0)
  1745. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1746. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1747. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1749. do { \
  1750. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1751. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1752. } while (0)
  1753. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1754. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1755. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1756. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1757. do { \
  1758. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1759. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1760. } while (0)
  1761. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1762. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1763. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1764. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1765. do { \
  1766. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1767. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1768. } while (0)
  1769. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1792. } while (0)
  1793. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1795. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1796. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1800. } while (0)
  1801. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1802. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1803. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1804. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1805. do { \
  1806. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1807. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1808. } while (0)
  1809. /* DWORD 1 */
  1810. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1814. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1815. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1816. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1817. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1818. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1819. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1820. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1821. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1822. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1823. do { \
  1824. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1825. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1826. } while (0)
  1827. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1834. } while (0)
  1835. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1836. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1837. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1838. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1841. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1842. } while (0)
  1843. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1844. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1845. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1846. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1849. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1850. } while (0)
  1851. /* DWORD 2 */
  1852. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1853. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1854. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1855. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1856. do { \
  1857. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1858. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1859. } while (0)
  1860. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1861. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1862. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1863. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1866. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1867. } while (0)
  1868. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1869. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1870. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1871. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1875. } while (0)
  1876. /* DWORD 5 */
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1878. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1879. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1881. do { \
  1882. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1883. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1884. } while (0)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1892. } while (0)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1900. } while (0)
  1901. /* DWORD 6 */
  1902. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1903. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1904. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1905. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1906. do { \
  1907. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1908. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1909. } while (0)
  1910. typedef enum {
  1911. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1912. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1913. } htt_tcl_metadata_type;
  1914. /**
  1915. * @brief HTT TCL command number format
  1916. * @details
  1917. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1918. * available to firmware as tcl_exit_base->tcl_status_number.
  1919. * For regular / multicast packets host will send vdev and mac id and for
  1920. * NAWDS packets, host will send peer id.
  1921. * A_UINT32 is used to avoid endianness conversion problems.
  1922. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1923. */
  1924. typedef struct {
  1925. A_UINT32
  1926. type: 1, /* vdev_id based or peer_id based */
  1927. rsvd: 31;
  1928. } htt_tx_tcl_vdev_or_peer_t;
  1929. typedef struct {
  1930. A_UINT32
  1931. type: 1, /* vdev_id based or peer_id based */
  1932. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1933. vdev_id: 8,
  1934. pdev_id: 2,
  1935. host_inspected:1,
  1936. rsvd: 19;
  1937. } htt_tx_tcl_vdev_metadata;
  1938. typedef struct {
  1939. A_UINT32
  1940. type: 1, /* vdev_id based or peer_id based */
  1941. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1942. peer_id: 14,
  1943. rsvd: 16;
  1944. } htt_tx_tcl_peer_metadata;
  1945. PREPACK struct htt_tx_tcl_metadata {
  1946. union {
  1947. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1948. htt_tx_tcl_vdev_metadata vdev_meta;
  1949. htt_tx_tcl_peer_metadata peer_meta;
  1950. };
  1951. } POSTPACK;
  1952. /* DWORD 0 */
  1953. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1954. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1955. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1956. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1957. /* VDEV metadata */
  1958. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1959. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1960. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1961. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1962. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1963. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1964. /* PEER metadata */
  1965. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1966. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1967. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1968. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1969. HTT_TX_TCL_METADATA_TYPE_S)
  1970. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1974. } while (0)
  1975. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1976. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1977. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1978. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1982. } while (0)
  1983. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1984. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1985. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1986. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1990. } while (0)
  1991. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1992. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1993. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1994. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1998. } while (0)
  1999. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2000. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2001. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2002. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2006. } while (0)
  2007. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2008. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2009. HTT_TX_TCL_METADATA_PEER_ID_S)
  2010. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2014. } while (0)
  2015. typedef enum {
  2016. HTT_TX_FW2WBM_TX_STATUS_OK,
  2017. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2018. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2019. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2020. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2021. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2022. HTT_TX_FW2WBM_TX_STATUS_MAX
  2023. } htt_tx_fw2wbm_tx_status_t;
  2024. typedef enum {
  2025. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2026. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2027. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2028. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2029. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2030. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2031. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2032. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2033. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2034. } htt_tx_fw2wbm_reinject_reason_t;
  2035. /**
  2036. * @brief HTT TX WBM Completion from firmware to host
  2037. * @details
  2038. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2039. * DWORD 3 and 4 for software based completions (Exception frames and
  2040. * TQM bypass frames)
  2041. * For software based completions, wbm_release_ring->release_source_module will
  2042. * be set to release_source_fw
  2043. */
  2044. PREPACK struct htt_tx_wbm_completion {
  2045. A_UINT32
  2046. sch_cmd_id: 24,
  2047. exception_frame: 1, /* If set, this packet was queued via exception path */
  2048. rsvd0_31_25: 7;
  2049. A_UINT32
  2050. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2051. * reception of an ACK or BA, this field indicates
  2052. * the RSSI of the received ACK or BA frame.
  2053. * When the frame is removed as result of a direct
  2054. * remove command from the SW, this field is set
  2055. * to 0x0 (which is never a valid value when real
  2056. * RSSI is available).
  2057. * Units: dB w.r.t noise floor
  2058. */
  2059. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2060. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2061. rsvd1_31_16: 16;
  2062. } POSTPACK;
  2063. /* DWORD 0 */
  2064. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2065. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2066. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2067. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2068. /* DWORD 1 */
  2069. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2070. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2071. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2072. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2073. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2074. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2075. /* DWORD 0 */
  2076. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2077. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2078. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2079. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2083. } while (0)
  2084. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2086. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2087. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2091. } while (0)
  2092. /* DWORD 1 */
  2093. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2094. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2095. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2096. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2100. } while (0)
  2101. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2102. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2103. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2104. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2108. } while (0)
  2109. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2110. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2111. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2112. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2113. do { \
  2114. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2115. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2116. } while (0)
  2117. /**
  2118. * @brief HTT TX WBM Completion from firmware to host
  2119. * @details
  2120. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2121. * (WBM) offload HW.
  2122. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2123. * For software based completions, release_source_module will
  2124. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2125. * struct wbm_release_ring and then switch to this after looking at
  2126. * release_source_module.
  2127. */
  2128. PREPACK struct htt_tx_wbm_completion_v2 {
  2129. A_UINT32
  2130. used_by_hw0; /* Refer to struct wbm_release_ring */
  2131. A_UINT32
  2132. used_by_hw1; /* Refer to struct wbm_release_ring */
  2133. A_UINT32
  2134. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2135. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2136. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2137. exception_frame: 1,
  2138. rsvd0: 12, /* For future use */
  2139. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2140. rsvd1: 1; /* For future use */
  2141. A_UINT32
  2142. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2143. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2144. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2145. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2146. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2147. */
  2148. A_UINT32
  2149. data1: 32;
  2150. A_UINT32
  2151. data2: 32;
  2152. A_UINT32
  2153. used_by_hw3; /* Refer to struct wbm_release_ring */
  2154. } POSTPACK;
  2155. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2156. /* DWORD 3 */
  2157. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2158. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2159. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2160. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2161. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2162. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2163. /* DWORD 3 */
  2164. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2165. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2166. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2167. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2171. } while (0)
  2172. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2173. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2174. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2175. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2179. } while (0)
  2180. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2181. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2182. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2183. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2187. } while (0)
  2188. /**
  2189. * @brief HTT TX WBM transmit status from firmware to host
  2190. * @details
  2191. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2192. * (WBM) offload HW.
  2193. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2194. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2195. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2196. */
  2197. PREPACK struct htt_tx_wbm_transmit_status {
  2198. A_UINT32
  2199. sch_cmd_id: 24,
  2200. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2201. * reception of an ACK or BA, this field indicates
  2202. * the RSSI of the received ACK or BA frame.
  2203. * When the frame is removed as result of a direct
  2204. * remove command from the SW, this field is set
  2205. * to 0x0 (which is never a valid value when real
  2206. * RSSI is available).
  2207. * Units: dB w.r.t noise floor
  2208. */
  2209. A_UINT32
  2210. sw_peer_id: 16,
  2211. tid_num: 5,
  2212. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2213. * and tid_num fields contain valid data.
  2214. * If this "valid" flag is not set, the
  2215. * sw_peer_id and tid_num fields must be ignored.
  2216. */
  2217. mcast: 1,
  2218. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2219. * contains valid data.
  2220. */
  2221. reserved0: 8;
  2222. A_UINT32
  2223. reserved1: 32;
  2224. } POSTPACK;
  2225. /* DWORD 4 */
  2226. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2227. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2228. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2229. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2230. /* DWORD 5 */
  2231. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2232. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2233. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2234. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2235. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2236. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2237. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2238. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2239. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2240. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2241. /* DWORD 4 */
  2242. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2244. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2245. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2249. } while (0)
  2250. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2252. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2253. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2257. } while (0)
  2258. /* DWORD 5 */
  2259. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2260. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2261. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2262. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2266. } while (0)
  2267. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2268. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2269. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2270. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2274. } while (0)
  2275. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2276. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2277. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2278. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2282. } while (0)
  2283. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2284. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2285. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2286. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2290. } while (0)
  2291. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2292. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2293. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2294. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2298. } while (0)
  2299. /**
  2300. * @brief HTT TX WBM reinject status from firmware to host
  2301. * @details
  2302. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2303. * (WBM) offload HW.
  2304. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2305. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2306. */
  2307. PREPACK struct htt_tx_wbm_reinject_status {
  2308. A_UINT32
  2309. reserved0: 32;
  2310. A_UINT32
  2311. reserved1: 32;
  2312. A_UINT32
  2313. reserved2: 32;
  2314. } POSTPACK;
  2315. /**
  2316. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2317. * @details
  2318. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2319. * (WBM) offload HW.
  2320. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2321. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2322. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2323. * STA side.
  2324. */
  2325. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2326. A_UINT32
  2327. mec_sa_addr_31_0;
  2328. A_UINT32
  2329. mec_sa_addr_47_32: 16,
  2330. sa_ast_index: 16;
  2331. A_UINT32
  2332. vdev_id: 8,
  2333. reserved0: 24;
  2334. } POSTPACK;
  2335. /* DWORD 4 - mec_sa_addr_31_0 */
  2336. /* DWORD 5 */
  2337. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2338. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2339. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2340. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2341. /* DWORD 6 */
  2342. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2343. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2344. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2345. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2346. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2347. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2351. } while (0)
  2352. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2353. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2354. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2355. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2359. } while (0)
  2360. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2361. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2362. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2363. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2367. } while (0)
  2368. typedef enum {
  2369. TX_FLOW_PRIORITY_BE,
  2370. TX_FLOW_PRIORITY_HIGH,
  2371. TX_FLOW_PRIORITY_LOW,
  2372. } htt_tx_flow_priority_t;
  2373. typedef enum {
  2374. TX_FLOW_LATENCY_SENSITIVE,
  2375. TX_FLOW_LATENCY_INSENSITIVE,
  2376. } htt_tx_flow_latency_t;
  2377. typedef enum {
  2378. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2379. TX_FLOW_INTERACTIVE_TRAFFIC,
  2380. TX_FLOW_PERIODIC_TRAFFIC,
  2381. TX_FLOW_BURSTY_TRAFFIC,
  2382. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2383. } htt_tx_flow_traffic_pattern_t;
  2384. /**
  2385. * @brief HTT TX Flow search metadata format
  2386. * @details
  2387. * Host will set this metadata in flow table's flow search entry along with
  2388. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2389. * firmware and TQM ring if the flow search entry wins.
  2390. * This metadata is available to firmware in that first MSDU's
  2391. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2392. * to one of the available flows for specific tid and returns the tqm flow
  2393. * pointer as part of htt_tx_map_flow_info message.
  2394. */
  2395. PREPACK struct htt_tx_flow_metadata {
  2396. A_UINT32
  2397. rsvd0_1_0: 2,
  2398. tid: 4,
  2399. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2400. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2401. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2402. * Else choose final tid based on latency, priority.
  2403. */
  2404. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2405. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2406. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2407. } POSTPACK;
  2408. /* DWORD 0 */
  2409. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2410. #define HTT_TX_FLOW_METADATA_TID_S 2
  2411. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2412. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2413. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2414. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2415. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2416. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2417. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2418. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2419. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2420. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2421. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2422. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2423. /* DWORD 0 */
  2424. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2425. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2426. HTT_TX_FLOW_METADATA_TID_S)
  2427. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2431. } while (0)
  2432. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2433. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2434. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2435. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2439. } while (0)
  2440. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2441. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2442. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2443. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2447. } while (0)
  2448. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2449. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2450. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2451. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2455. } while (0)
  2456. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2457. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2458. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2459. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2463. } while (0)
  2464. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2465. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2466. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2467. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2471. } while (0)
  2472. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2473. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2474. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2475. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2476. do { \
  2477. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2478. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2479. } while (0)
  2480. /**
  2481. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2482. *
  2483. * @details
  2484. * HTT wds entry from source port learning
  2485. * Host will learn wds entries from rx and send this message to firmware
  2486. * to enable firmware to configure/delete AST entries for wds clients.
  2487. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2488. * and when SA's entry is deleted, firmware removes this AST entry
  2489. *
  2490. * The message would appear as follows:
  2491. *
  2492. * |31 30|29 |17 16|15 8|7 0|
  2493. * |----------------+----------------+----------------+----------------|
  2494. * | rsvd0 |PDVID| vdev_id | msg_type |
  2495. * |-------------------------------------------------------------------|
  2496. * | sa_addr_31_0 |
  2497. * |-------------------------------------------------------------------|
  2498. * | | ta_peer_id | sa_addr_47_32 |
  2499. * |-------------------------------------------------------------------|
  2500. * Where PDVID = pdev_id
  2501. *
  2502. * The message is interpreted as follows:
  2503. *
  2504. * dword0 - b'0:7 - msg_type: This will be set to
  2505. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2506. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2507. *
  2508. * dword0 - b'8:15 - vdev_id
  2509. *
  2510. * dword0 - b'16:17 - pdev_id
  2511. *
  2512. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2513. *
  2514. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2515. *
  2516. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2517. *
  2518. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2519. */
  2520. PREPACK struct htt_wds_entry {
  2521. A_UINT32
  2522. msg_type: 8,
  2523. vdev_id: 8,
  2524. pdev_id: 2,
  2525. rsvd0: 14;
  2526. A_UINT32 sa_addr_31_0;
  2527. A_UINT32
  2528. sa_addr_47_32: 16,
  2529. ta_peer_id: 14,
  2530. rsvd2: 2;
  2531. } POSTPACK;
  2532. /* DWORD 0 */
  2533. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2534. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2535. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2536. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2537. /* DWORD 2 */
  2538. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2539. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2540. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2541. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2542. /* DWORD 0 */
  2543. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2544. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2545. HTT_WDS_ENTRY_VDEV_ID_S)
  2546. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2547. do { \
  2548. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2549. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2550. } while (0)
  2551. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2552. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2553. HTT_WDS_ENTRY_PDEV_ID_S)
  2554. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2555. do { \
  2556. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2557. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2558. } while (0)
  2559. /* DWORD 2 */
  2560. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2561. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2562. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2563. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2564. do { \
  2565. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2566. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2567. } while (0)
  2568. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2569. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2570. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2571. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2574. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2575. } while (0)
  2576. /**
  2577. * @brief MAC DMA rx ring setup specification
  2578. * @details
  2579. * To allow for dynamic rx ring reconfiguration and to avoid race
  2580. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2581. * it uses. Instead, it sends this message to the target, indicating how
  2582. * the rx ring used by the host should be set up and maintained.
  2583. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2584. * specifications.
  2585. *
  2586. * |31 16|15 8|7 0|
  2587. * |---------------------------------------------------------------|
  2588. * header: | reserved | num rings | msg type |
  2589. * |---------------------------------------------------------------|
  2590. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2591. #if HTT_PADDR64
  2592. * | FW_IDX shadow register physical address (bits 63:32) |
  2593. #endif
  2594. * |---------------------------------------------------------------|
  2595. * | rx ring base physical address (bits 31:0) |
  2596. #if HTT_PADDR64
  2597. * | rx ring base physical address (bits 63:32) |
  2598. #endif
  2599. * |---------------------------------------------------------------|
  2600. * | rx ring buffer size | rx ring length |
  2601. * |---------------------------------------------------------------|
  2602. * | FW_IDX initial value | enabled flags |
  2603. * |---------------------------------------------------------------|
  2604. * | MSDU payload offset | 802.11 header offset |
  2605. * |---------------------------------------------------------------|
  2606. * | PPDU end offset | PPDU start offset |
  2607. * |---------------------------------------------------------------|
  2608. * | MPDU end offset | MPDU start offset |
  2609. * |---------------------------------------------------------------|
  2610. * | MSDU end offset | MSDU start offset |
  2611. * |---------------------------------------------------------------|
  2612. * | frag info offset | rx attention offset |
  2613. * |---------------------------------------------------------------|
  2614. * payload 2, if present, has the same format as payload 1
  2615. * Header fields:
  2616. * - MSG_TYPE
  2617. * Bits 7:0
  2618. * Purpose: identifies this as an rx ring configuration message
  2619. * Value: 0x2
  2620. * - NUM_RINGS
  2621. * Bits 15:8
  2622. * Purpose: indicates whether the host is setting up one rx ring or two
  2623. * Value: 1 or 2
  2624. * Payload:
  2625. * for systems using 64-bit format for bus addresses:
  2626. * - IDX_SHADOW_REG_PADDR_LO
  2627. * Bits 31:0
  2628. * Value: lower 4 bytes of physical address of the host's
  2629. * FW_IDX shadow register
  2630. * - IDX_SHADOW_REG_PADDR_HI
  2631. * Bits 31:0
  2632. * Value: upper 4 bytes of physical address of the host's
  2633. * FW_IDX shadow register
  2634. * - RING_BASE_PADDR_LO
  2635. * Bits 31:0
  2636. * Value: lower 4 bytes of physical address of the host's rx ring
  2637. * - RING_BASE_PADDR_HI
  2638. * Bits 31:0
  2639. * Value: uppper 4 bytes of physical address of the host's rx ring
  2640. * for systems using 32-bit format for bus addresses:
  2641. * - IDX_SHADOW_REG_PADDR
  2642. * Bits 31:0
  2643. * Value: physical address of the host's FW_IDX shadow register
  2644. * - RING_BASE_PADDR
  2645. * Bits 31:0
  2646. * Value: physical address of the host's rx ring
  2647. * - RING_LEN
  2648. * Bits 15:0
  2649. * Value: number of elements in the rx ring
  2650. * - RING_BUF_SZ
  2651. * Bits 31:16
  2652. * Value: size of the buffers referenced by the rx ring, in byte units
  2653. * - ENABLED_FLAGS
  2654. * Bits 15:0
  2655. * Value: 1-bit flags to show whether different rx fields are enabled
  2656. * bit 0: 802.11 header enabled (1) or disabled (0)
  2657. * bit 1: MSDU payload enabled (1) or disabled (0)
  2658. * bit 2: PPDU start enabled (1) or disabled (0)
  2659. * bit 3: PPDU end enabled (1) or disabled (0)
  2660. * bit 4: MPDU start enabled (1) or disabled (0)
  2661. * bit 5: MPDU end enabled (1) or disabled (0)
  2662. * bit 6: MSDU start enabled (1) or disabled (0)
  2663. * bit 7: MSDU end enabled (1) or disabled (0)
  2664. * bit 8: rx attention enabled (1) or disabled (0)
  2665. * bit 9: frag info enabled (1) or disabled (0)
  2666. * bit 10: unicast rx enabled (1) or disabled (0)
  2667. * bit 11: multicast rx enabled (1) or disabled (0)
  2668. * bit 12: ctrl rx enabled (1) or disabled (0)
  2669. * bit 13: mgmt rx enabled (1) or disabled (0)
  2670. * bit 14: null rx enabled (1) or disabled (0)
  2671. * bit 15: phy data rx enabled (1) or disabled (0)
  2672. * - IDX_INIT_VAL
  2673. * Bits 31:16
  2674. * Purpose: Specify the initial value for the FW_IDX.
  2675. * Value: the number of buffers initially present in the host's rx ring
  2676. * - OFFSET_802_11_HDR
  2677. * Bits 15:0
  2678. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2679. * - OFFSET_MSDU_PAYLOAD
  2680. * Bits 31:16
  2681. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2682. * - OFFSET_PPDU_START
  2683. * Bits 15:0
  2684. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2685. * - OFFSET_PPDU_END
  2686. * Bits 31:16
  2687. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2688. * - OFFSET_MPDU_START
  2689. * Bits 15:0
  2690. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2691. * - OFFSET_MPDU_END
  2692. * Bits 31:16
  2693. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2694. * - OFFSET_MSDU_START
  2695. * Bits 15:0
  2696. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2697. * - OFFSET_MSDU_END
  2698. * Bits 31:16
  2699. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2700. * - OFFSET_RX_ATTN
  2701. * Bits 15:0
  2702. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2703. * - OFFSET_FRAG_INFO
  2704. * Bits 31:16
  2705. * Value: offset in QUAD-bytes of frag info table
  2706. */
  2707. /* header fields */
  2708. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2709. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2710. /* payload fields */
  2711. /* for systems using a 64-bit format for bus addresses */
  2712. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2713. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2714. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2715. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2716. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2717. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2718. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2719. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2720. /* for systems using a 32-bit format for bus addresses */
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2723. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2724. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2725. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2726. #define HTT_RX_RING_CFG_LEN_S 0
  2727. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2728. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2729. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2730. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2731. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2732. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2733. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2734. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2735. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2736. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2737. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2738. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2739. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2740. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2743. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2744. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2745. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2746. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2747. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2748. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2749. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2750. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2751. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2752. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2753. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2754. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2755. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2756. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2757. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2758. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2759. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2760. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2761. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2762. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2763. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2764. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2765. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2766. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2767. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2768. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2769. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2770. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2771. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2772. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2773. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2774. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2776. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2777. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2778. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2779. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2780. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2781. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2782. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2783. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2784. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2785. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2786. #if HTT_PADDR64
  2787. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2788. #else
  2789. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2790. #endif
  2791. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2792. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2793. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2794. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2795. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2796. do { \
  2797. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2798. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2799. } while (0)
  2800. /* degenerate case for 32-bit fields */
  2801. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2803. ((_var) = (_val))
  2804. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2805. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2806. ((_var) = (_val))
  2807. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2808. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2809. ((_var) = (_val))
  2810. /* degenerate case for 32-bit fields */
  2811. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2813. ((_var) = (_val))
  2814. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2815. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2816. ((_var) = (_val))
  2817. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2818. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2819. ((_var) = (_val))
  2820. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2821. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2822. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2825. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2826. } while (0)
  2827. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2828. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2829. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2832. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2833. } while (0)
  2834. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2835. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2836. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2837. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2840. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2841. } while (0)
  2842. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2843. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2844. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2845. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2846. do { \
  2847. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2848. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2849. } while (0)
  2850. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2851. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2852. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2853. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2854. do { \
  2855. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2856. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2857. } while (0)
  2858. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2859. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2860. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2861. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2862. do { \
  2863. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2864. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2865. } while (0)
  2866. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2867. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2868. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2869. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2872. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2873. } while (0)
  2874. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2875. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2876. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2877. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2880. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2881. } while (0)
  2882. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2883. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2884. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2885. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2886. do { \
  2887. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2888. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2889. } while (0)
  2890. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2891. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2892. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2893. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2894. do { \
  2895. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2896. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2897. } while (0)
  2898. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2899. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2900. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2901. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2902. do { \
  2903. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2904. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2905. } while (0)
  2906. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2907. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2908. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2909. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2910. do { \
  2911. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2912. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2913. } while (0)
  2914. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2915. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2916. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2917. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2918. do { \
  2919. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2920. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2921. } while (0)
  2922. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2923. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2924. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2925. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2926. do { \
  2927. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2928. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2929. } while (0)
  2930. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2931. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2932. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2933. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2936. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2937. } while (0)
  2938. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2939. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2940. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2941. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2944. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2945. } while (0)
  2946. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2947. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2948. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2949. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2952. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2953. } while (0)
  2954. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2955. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2956. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2957. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2960. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2961. } while (0)
  2962. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2963. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2964. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2965. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2968. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2969. } while (0)
  2970. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2971. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2972. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2973. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2976. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2977. } while (0)
  2978. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2979. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2980. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2981. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2982. do { \
  2983. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2984. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2985. } while (0)
  2986. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2987. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2988. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2989. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2990. do { \
  2991. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2992. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2993. } while (0)
  2994. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2995. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2996. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2997. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3000. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3001. } while (0)
  3002. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3003. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3004. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3005. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3008. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3009. } while (0)
  3010. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3011. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3012. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3013. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3014. do { \
  3015. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3016. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3017. } while (0)
  3018. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3019. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3020. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3021. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3024. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3025. } while (0)
  3026. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3027. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3028. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3029. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3032. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3033. } while (0)
  3034. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3035. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3036. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3037. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3040. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3041. } while (0)
  3042. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3043. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3044. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3045. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3048. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3049. } while (0)
  3050. /**
  3051. * @brief host -> target FW statistics retrieve
  3052. *
  3053. * @details
  3054. * The following field definitions describe the format of the HTT host
  3055. * to target FW stats retrieve message. The message specifies the type of
  3056. * stats host wants to retrieve.
  3057. *
  3058. * |31 24|23 16|15 8|7 0|
  3059. * |-----------------------------------------------------------|
  3060. * | stats types request bitmask | msg type |
  3061. * |-----------------------------------------------------------|
  3062. * | stats types reset bitmask | reserved |
  3063. * |-----------------------------------------------------------|
  3064. * | stats type | config value |
  3065. * |-----------------------------------------------------------|
  3066. * | cookie LSBs |
  3067. * |-----------------------------------------------------------|
  3068. * | cookie MSBs |
  3069. * |-----------------------------------------------------------|
  3070. * Header fields:
  3071. * - MSG_TYPE
  3072. * Bits 7:0
  3073. * Purpose: identifies this is a stats upload request message
  3074. * Value: 0x3
  3075. * - UPLOAD_TYPES
  3076. * Bits 31:8
  3077. * Purpose: identifies which types of FW statistics to upload
  3078. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3079. * - RESET_TYPES
  3080. * Bits 31:8
  3081. * Purpose: identifies which types of FW statistics to reset
  3082. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3083. * - CFG_VAL
  3084. * Bits 23:0
  3085. * Purpose: give an opaque configuration value to the specified stats type
  3086. * Value: stats-type specific configuration value
  3087. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3088. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3089. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3090. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3091. * - CFG_STAT_TYPE
  3092. * Bits 31:24
  3093. * Purpose: specify which stats type (if any) the config value applies to
  3094. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3095. * a valid configuration specification
  3096. * - COOKIE_LSBS
  3097. * Bits 31:0
  3098. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3099. * message with its preceding host->target stats request message.
  3100. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3101. * - COOKIE_MSBS
  3102. * Bits 31:0
  3103. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3104. * message with its preceding host->target stats request message.
  3105. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3106. */
  3107. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3108. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3109. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3110. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3111. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3112. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3114. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3115. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3116. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3117. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3118. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3119. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3120. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3121. do { \
  3122. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3123. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3124. } while (0)
  3125. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3126. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3127. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3128. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3131. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3132. } while (0)
  3133. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3134. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3135. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3136. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3139. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3140. } while (0)
  3141. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3142. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3143. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3144. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3145. do { \
  3146. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3147. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3148. } while (0)
  3149. /**
  3150. * @brief host -> target HTT out-of-band sync request
  3151. *
  3152. * @details
  3153. * The HTT SYNC tells the target to suspend processing of subsequent
  3154. * HTT host-to-target messages until some other target agent locally
  3155. * informs the target HTT FW that the current sync counter is equal to
  3156. * or greater than (in a modulo sense) the sync counter specified in
  3157. * the SYNC message.
  3158. * This allows other host-target components to synchronize their operation
  3159. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3160. * security key has been downloaded to and activated by the target.
  3161. * In the absence of any explicit synchronization counter value
  3162. * specification, the target HTT FW will use zero as the default current
  3163. * sync value.
  3164. *
  3165. * |31 24|23 16|15 8|7 0|
  3166. * |-----------------------------------------------------------|
  3167. * | reserved | sync count | msg type |
  3168. * |-----------------------------------------------------------|
  3169. * Header fields:
  3170. * - MSG_TYPE
  3171. * Bits 7:0
  3172. * Purpose: identifies this as a sync message
  3173. * Value: 0x4
  3174. * - SYNC_COUNT
  3175. * Bits 15:8
  3176. * Purpose: specifies what sync value the HTT FW will wait for from
  3177. * an out-of-band specification to resume its operation
  3178. * Value: in-band sync counter value to compare against the out-of-band
  3179. * counter spec.
  3180. * The HTT target FW will suspend its host->target message processing
  3181. * as long as
  3182. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3183. */
  3184. #define HTT_H2T_SYNC_MSG_SZ 4
  3185. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3186. #define HTT_H2T_SYNC_COUNT_S 8
  3187. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3188. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3189. HTT_H2T_SYNC_COUNT_S)
  3190. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3191. do { \
  3192. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3193. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3194. } while (0)
  3195. /**
  3196. * @brief HTT aggregation configuration
  3197. */
  3198. #define HTT_AGGR_CFG_MSG_SZ 4
  3199. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3200. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3201. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3202. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3203. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3204. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3205. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3206. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3207. do { \
  3208. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3209. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3210. } while (0)
  3211. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3212. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3213. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3214. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3215. do { \
  3216. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3217. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3218. } while (0)
  3219. /**
  3220. * @brief host -> target HTT configure max amsdu info per vdev
  3221. *
  3222. * @details
  3223. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3224. *
  3225. * |31 21|20 16|15 8|7 0|
  3226. * |-----------------------------------------------------------|
  3227. * | reserved | vdev id | max amsdu | msg type |
  3228. * |-----------------------------------------------------------|
  3229. * Header fields:
  3230. * - MSG_TYPE
  3231. * Bits 7:0
  3232. * Purpose: identifies this as a aggr cfg ex message
  3233. * Value: 0xa
  3234. * - MAX_NUM_AMSDU_SUBFRM
  3235. * Bits 15:8
  3236. * Purpose: max MSDUs per A-MSDU
  3237. * - VDEV_ID
  3238. * Bits 20:16
  3239. * Purpose: ID of the vdev to which this limit is applied
  3240. */
  3241. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3242. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3243. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3244. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3245. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3246. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3247. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3248. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3249. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3250. do { \
  3251. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3252. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3253. } while (0)
  3254. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3255. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3256. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3257. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3258. do { \
  3259. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3260. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3261. } while (0)
  3262. /**
  3263. * @brief HTT WDI_IPA Config Message
  3264. *
  3265. * @details
  3266. * The HTT WDI_IPA config message is created/sent by host at driver
  3267. * init time. It contains information about data structures used on
  3268. * WDI_IPA TX and RX path.
  3269. * TX CE ring is used for pushing packet metadata from IPA uC
  3270. * to WLAN FW
  3271. * TX Completion ring is used for generating TX completions from
  3272. * WLAN FW to IPA uC
  3273. * RX Indication ring is used for indicating RX packets from FW
  3274. * to IPA uC
  3275. * RX Ring2 is used as either completion ring or as second
  3276. * indication ring. when Ring2 is used as completion ring, IPA uC
  3277. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3278. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3279. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3280. * indicated in RX Indication ring. Please see WDI_IPA specification
  3281. * for more details.
  3282. * |31 24|23 16|15 8|7 0|
  3283. * |----------------+----------------+----------------+----------------|
  3284. * | tx pkt pool size | Rsvd | msg_type |
  3285. * |-------------------------------------------------------------------|
  3286. * | tx comp ring base (bits 31:0) |
  3287. #if HTT_PADDR64
  3288. * | tx comp ring base (bits 63:32) |
  3289. #endif
  3290. * |-------------------------------------------------------------------|
  3291. * | tx comp ring size |
  3292. * |-------------------------------------------------------------------|
  3293. * | tx comp WR_IDX physical address (bits 31:0) |
  3294. #if HTT_PADDR64
  3295. * | tx comp WR_IDX physical address (bits 63:32) |
  3296. #endif
  3297. * |-------------------------------------------------------------------|
  3298. * | tx CE WR_IDX physical address (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | tx CE WR_IDX physical address (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * | rx indication ring base (bits 31:0) |
  3304. #if HTT_PADDR64
  3305. * | rx indication ring base (bits 63:32) |
  3306. #endif
  3307. * |-------------------------------------------------------------------|
  3308. * | rx indication ring size |
  3309. * |-------------------------------------------------------------------|
  3310. * | rx ind RD_IDX physical address (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | rx ind RD_IDX physical address (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. * | rx ind WR_IDX physical address (bits 31:0) |
  3316. #if HTT_PADDR64
  3317. * | rx ind WR_IDX physical address (bits 63:32) |
  3318. #endif
  3319. * |-------------------------------------------------------------------|
  3320. * |-------------------------------------------------------------------|
  3321. * | rx ring2 base (bits 31:0) |
  3322. #if HTT_PADDR64
  3323. * | rx ring2 base (bits 63:32) |
  3324. #endif
  3325. * |-------------------------------------------------------------------|
  3326. * | rx ring2 size |
  3327. * |-------------------------------------------------------------------|
  3328. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3329. #if HTT_PADDR64
  3330. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3331. #endif
  3332. * |-------------------------------------------------------------------|
  3333. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3334. #if HTT_PADDR64
  3335. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3336. #endif
  3337. * |-------------------------------------------------------------------|
  3338. *
  3339. * Header fields:
  3340. * Header fields:
  3341. * - MSG_TYPE
  3342. * Bits 7:0
  3343. * Purpose: Identifies this as WDI_IPA config message
  3344. * value: = 0x8
  3345. * - TX_PKT_POOL_SIZE
  3346. * Bits 15:0
  3347. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3348. * WDI_IPA TX path
  3349. * For systems using 32-bit format for bus addresses:
  3350. * - TX_COMP_RING_BASE_ADDR
  3351. * Bits 31:0
  3352. * Purpose: TX Completion Ring base address in DDR
  3353. * - TX_COMP_RING_SIZE
  3354. * Bits 31:0
  3355. * Purpose: TX Completion Ring size (must be power of 2)
  3356. * - TX_COMP_WR_IDX_ADDR
  3357. * Bits 31:0
  3358. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3359. * updates the Write Index for WDI_IPA TX completion ring
  3360. * - TX_CE_WR_IDX_ADDR
  3361. * Bits 31:0
  3362. * Purpose: DDR address where IPA uC
  3363. * updates the WR Index for TX CE ring
  3364. * (needed for fusion platforms)
  3365. * - RX_IND_RING_BASE_ADDR
  3366. * Bits 31:0
  3367. * Purpose: RX Indication Ring base address in DDR
  3368. * - RX_IND_RING_SIZE
  3369. * Bits 31:0
  3370. * Purpose: RX Indication Ring size
  3371. * - RX_IND_RD_IDX_ADDR
  3372. * Bits 31:0
  3373. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3374. * RX indication ring
  3375. * - RX_IND_WR_IDX_ADDR
  3376. * Bits 31:0
  3377. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3378. * updates the Write Index for WDI_IPA RX indication ring
  3379. * - RX_RING2_BASE_ADDR
  3380. * Bits 31:0
  3381. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3382. * - RX_RING2_SIZE
  3383. * Bits 31:0
  3384. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3385. * - RX_RING2_RD_IDX_ADDR
  3386. * Bits 31:0
  3387. * Purpose: If Second RX ring is Indication ring, DDR address where
  3388. * IPA uC updates the Read Index for Ring2.
  3389. * If Second RX ring is completion ring, this is NOT used
  3390. * - RX_RING2_WR_IDX_ADDR
  3391. * Bits 31:0
  3392. * Purpose: If Second RX ring is Indication ring, DDR address where
  3393. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3394. * If second RX ring is completion ring, DDR address where
  3395. * IPA uC updates the Write Index for Ring 2.
  3396. * For systems using 64-bit format for bus addresses:
  3397. * - TX_COMP_RING_BASE_ADDR_LO
  3398. * Bits 31:0
  3399. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3400. * - TX_COMP_RING_BASE_ADDR_HI
  3401. * Bits 31:0
  3402. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3403. * - TX_COMP_RING_SIZE
  3404. * Bits 31:0
  3405. * Purpose: TX Completion Ring size (must be power of 2)
  3406. * - TX_COMP_WR_IDX_ADDR_LO
  3407. * Bits 31:0
  3408. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3409. * Lower 4 bytes of DDR address where WIFI FW
  3410. * updates the Write Index for WDI_IPA TX completion ring
  3411. * - TX_COMP_WR_IDX_ADDR_HI
  3412. * Bits 31:0
  3413. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3414. * Higher 4 bytes of DDR address where WIFI FW
  3415. * updates the Write Index for WDI_IPA TX completion ring
  3416. * - TX_CE_WR_IDX_ADDR_LO
  3417. * Bits 31:0
  3418. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3419. * updates the WR Index for TX CE ring
  3420. * (needed for fusion platforms)
  3421. * - TX_CE_WR_IDX_ADDR_HI
  3422. * Bits 31:0
  3423. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3424. * updates the WR Index for TX CE ring
  3425. * (needed for fusion platforms)
  3426. * - RX_IND_RING_BASE_ADDR_LO
  3427. * Bits 31:0
  3428. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3429. * - RX_IND_RING_BASE_ADDR_HI
  3430. * Bits 31:0
  3431. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3432. * - RX_IND_RING_SIZE
  3433. * Bits 31:0
  3434. * Purpose: RX Indication Ring size
  3435. * - RX_IND_RD_IDX_ADDR_LO
  3436. * Bits 31:0
  3437. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3438. * for WDI_IPA RX indication ring
  3439. * - RX_IND_RD_IDX_ADDR_HI
  3440. * Bits 31:0
  3441. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3442. * for WDI_IPA RX indication ring
  3443. * - RX_IND_WR_IDX_ADDR_LO
  3444. * Bits 31:0
  3445. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3446. * Lower 4 bytes of DDR address where WIFI FW
  3447. * updates the Write Index for WDI_IPA RX indication ring
  3448. * - RX_IND_WR_IDX_ADDR_HI
  3449. * Bits 31:0
  3450. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3451. * Higher 4 bytes of DDR address where WIFI FW
  3452. * updates the Write Index for WDI_IPA RX indication ring
  3453. * - RX_RING2_BASE_ADDR_LO
  3454. * Bits 31:0
  3455. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3456. * - RX_RING2_BASE_ADDR_HI
  3457. * Bits 31:0
  3458. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3459. * - RX_RING2_SIZE
  3460. * Bits 31:0
  3461. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3462. * - RX_RING2_RD_IDX_ADDR_LO
  3463. * Bits 31:0
  3464. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3465. * DDR address where IPA uC updates the Read Index for Ring2.
  3466. * If Second RX ring is completion ring, this is NOT used
  3467. * - RX_RING2_RD_IDX_ADDR_HI
  3468. * Bits 31:0
  3469. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3470. * DDR address where IPA uC updates the Read Index for Ring2.
  3471. * If Second RX ring is completion ring, this is NOT used
  3472. * - RX_RING2_WR_IDX_ADDR_LO
  3473. * Bits 31:0
  3474. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3475. * DDR address where WIFI FW updates the Write Index
  3476. * for WDI_IPA RX ring2
  3477. * If second RX ring is completion ring, lower 4 bytes of
  3478. * DDR address where IPA uC updates the Write Index for Ring 2.
  3479. * - RX_RING2_WR_IDX_ADDR_HI
  3480. * Bits 31:0
  3481. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3482. * DDR address where WIFI FW updates the Write Index
  3483. * for WDI_IPA RX ring2
  3484. * If second RX ring is completion ring, higher 4 bytes of
  3485. * DDR address where IPA uC updates the Write Index for Ring 2.
  3486. */
  3487. #if HTT_PADDR64
  3488. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3489. #else
  3490. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3491. #endif
  3492. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3493. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3512. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3554. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3555. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3556. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3559. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3560. } while (0)
  3561. /* for systems using 32-bit format for bus addr */
  3562. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3564. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3568. } while (0)
  3569. /* for systems using 64-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3584. } while (0)
  3585. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3586. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3587. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3590. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3591. } while (0)
  3592. /* for systems using 32-bit format for bus addr */
  3593. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3594. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3595. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3598. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3599. } while (0)
  3600. /* for systems using 64-bit format for bus addr */
  3601. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3602. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3603. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3604. do { \
  3605. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3606. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3607. } while (0)
  3608. /* for systems using 64-bit format for bus addr */
  3609. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3611. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3614. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3615. } while (0)
  3616. /* for systems using 32-bit format for bus addr */
  3617. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3618. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3619. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3622. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3623. } while (0)
  3624. /* for systems using 64-bit format for bus addr */
  3625. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3626. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3627. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3630. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3631. } while (0)
  3632. /* for systems using 64-bit format for bus addr */
  3633. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3634. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3635. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3639. } while (0)
  3640. /* for systems using 32-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3643. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3647. } while (0)
  3648. /* for systems using 64-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3663. } while (0)
  3664. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3665. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3666. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3669. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3670. } while (0)
  3671. /* for systems using 32-bit format for bus addr */
  3672. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3673. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3674. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3677. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3678. } while (0)
  3679. /* for systems using 64-bit format for bus addr */
  3680. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3681. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3682. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3685. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3686. } while (0)
  3687. /* for systems using 64-bit format for bus addr */
  3688. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3689. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3690. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3693. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3694. } while (0)
  3695. /* for systems using 32-bit format for bus addr */
  3696. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3697. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3698. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3701. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3702. } while (0)
  3703. /* for systems using 64-bit format for bus addr */
  3704. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3705. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3706. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3707. do { \
  3708. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3709. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3710. } while (0)
  3711. /* for systems using 64-bit format for bus addr */
  3712. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3713. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3714. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3715. do { \
  3716. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3717. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3718. } while (0)
  3719. /* for systems using 32-bit format for bus addr */
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3721. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3722. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3723. do { \
  3724. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3725. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3726. } while (0)
  3727. /* for systems using 64-bit format for bus addr */
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3729. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3731. do { \
  3732. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3733. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3734. } while (0)
  3735. /* for systems using 64-bit format for bus addr */
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3737. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3739. do { \
  3740. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3741. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3742. } while (0)
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3744. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3746. do { \
  3747. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3748. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3749. } while (0)
  3750. /* for systems using 32-bit format for bus addr */
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3752. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3756. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3757. } while (0)
  3758. /* for systems using 64-bit format for bus addr */
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3760. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3764. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3765. } while (0)
  3766. /* for systems using 64-bit format for bus addr */
  3767. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3768. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3769. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3770. do { \
  3771. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3772. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3773. } while (0)
  3774. /* for systems using 32-bit format for bus addr */
  3775. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3776. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3777. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3778. do { \
  3779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3780. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3781. } while (0)
  3782. /* for systems using 64-bit format for bus addr */
  3783. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3784. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3785. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3788. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3789. } while (0)
  3790. /* for systems using 64-bit format for bus addr */
  3791. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3793. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3797. } while (0)
  3798. /*
  3799. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3800. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3801. * addresses are stored in a XXX-bit field.
  3802. * This macro is used to define both htt_wdi_ipa_config32_t and
  3803. * htt_wdi_ipa_config64_t structs.
  3804. */
  3805. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3806. _paddr__tx_comp_ring_base_addr_, \
  3807. _paddr__tx_comp_wr_idx_addr_, \
  3808. _paddr__tx_ce_wr_idx_addr_, \
  3809. _paddr__rx_ind_ring_base_addr_, \
  3810. _paddr__rx_ind_rd_idx_addr_, \
  3811. _paddr__rx_ind_wr_idx_addr_, \
  3812. _paddr__rx_ring2_base_addr_,\
  3813. _paddr__rx_ring2_rd_idx_addr_,\
  3814. _paddr__rx_ring2_wr_idx_addr_) \
  3815. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3816. { \
  3817. /* DWORD 0: flags and meta-data */ \
  3818. A_UINT32 \
  3819. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3820. reserved: 8, \
  3821. tx_pkt_pool_size: 16;\
  3822. /* DWORD 1 */\
  3823. _paddr__tx_comp_ring_base_addr_;\
  3824. /* DWORD 2 (or 3)*/\
  3825. A_UINT32 tx_comp_ring_size;\
  3826. /* DWORD 3 (or 4)*/\
  3827. _paddr__tx_comp_wr_idx_addr_;\
  3828. /* DWORD 4 (or 6)*/\
  3829. _paddr__tx_ce_wr_idx_addr_;\
  3830. /* DWORD 5 (or 8)*/\
  3831. _paddr__rx_ind_ring_base_addr_;\
  3832. /* DWORD 6 (or 10)*/\
  3833. A_UINT32 rx_ind_ring_size;\
  3834. /* DWORD 7 (or 11)*/\
  3835. _paddr__rx_ind_rd_idx_addr_;\
  3836. /* DWORD 8 (or 13)*/\
  3837. _paddr__rx_ind_wr_idx_addr_;\
  3838. /* DWORD 9 (or 15)*/\
  3839. _paddr__rx_ring2_base_addr_;\
  3840. /* DWORD 10 (or 17) */\
  3841. A_UINT32 rx_ring2_size;\
  3842. /* DWORD 11 (or 18) */\
  3843. _paddr__rx_ring2_rd_idx_addr_;\
  3844. /* DWORD 12 (or 20) */\
  3845. _paddr__rx_ring2_wr_idx_addr_;\
  3846. } POSTPACK
  3847. /* define a htt_wdi_ipa_config32_t type */
  3848. 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));
  3849. /* define a htt_wdi_ipa_config64_t type */
  3850. 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));
  3851. #if HTT_PADDR64
  3852. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3853. #else
  3854. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3855. #endif
  3856. enum htt_wdi_ipa_op_code {
  3857. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3858. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3859. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3860. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3861. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3862. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3863. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3864. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3865. /* keep this last */
  3866. HTT_WDI_IPA_OPCODE_MAX
  3867. };
  3868. /**
  3869. * @brief HTT WDI_IPA Operation Request Message
  3870. *
  3871. * @details
  3872. * HTT WDI_IPA Operation Request message is sent by host
  3873. * to either suspend or resume WDI_IPA TX or RX path.
  3874. * |31 24|23 16|15 8|7 0|
  3875. * |----------------+----------------+----------------+----------------|
  3876. * | op_code | Rsvd | msg_type |
  3877. * |-------------------------------------------------------------------|
  3878. *
  3879. * Header fields:
  3880. * - MSG_TYPE
  3881. * Bits 7:0
  3882. * Purpose: Identifies this as WDI_IPA Operation Request message
  3883. * value: = 0x9
  3884. * - OP_CODE
  3885. * Bits 31:16
  3886. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3887. * value: = enum htt_wdi_ipa_op_code
  3888. */
  3889. PREPACK struct htt_wdi_ipa_op_request_t
  3890. {
  3891. /* DWORD 0: flags and meta-data */
  3892. A_UINT32
  3893. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3894. reserved: 8,
  3895. op_code: 16;
  3896. } POSTPACK;
  3897. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3898. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3899. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3900. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3901. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3902. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3903. do { \
  3904. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3905. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3906. } while (0)
  3907. /*
  3908. * @brief host -> target HTT_SRING_SETUP message
  3909. *
  3910. * @details
  3911. * After target is booted up, Host can send SRING setup message for
  3912. * each host facing LMAC SRING. Target setups up HW registers based
  3913. * on setup message and confirms back to Host if response_required is set.
  3914. * Host should wait for confirmation message before sending new SRING
  3915. * setup message
  3916. *
  3917. * The message would appear as follows:
  3918. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3919. * |--------------- +-----------------+-----------------+-----------------|
  3920. * | ring_type | ring_id | pdev_id | msg_type |
  3921. * |----------------------------------------------------------------------|
  3922. * | ring_base_addr_lo |
  3923. * |----------------------------------------------------------------------|
  3924. * | ring_base_addr_hi |
  3925. * |----------------------------------------------------------------------|
  3926. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3927. * |----------------------------------------------------------------------|
  3928. * | ring_head_offset32_remote_addr_lo |
  3929. * |----------------------------------------------------------------------|
  3930. * | ring_head_offset32_remote_addr_hi |
  3931. * |----------------------------------------------------------------------|
  3932. * | ring_tail_offset32_remote_addr_lo |
  3933. * |----------------------------------------------------------------------|
  3934. * | ring_tail_offset32_remote_addr_hi |
  3935. * |----------------------------------------------------------------------|
  3936. * | ring_msi_addr_lo |
  3937. * |----------------------------------------------------------------------|
  3938. * | ring_msi_addr_hi |
  3939. * |----------------------------------------------------------------------|
  3940. * | ring_msi_data |
  3941. * |----------------------------------------------------------------------|
  3942. * | intr_timer_th |IM| intr_batch_counter_th |
  3943. * |----------------------------------------------------------------------|
  3944. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3945. * |----------------------------------------------------------------------|
  3946. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3947. * |----------------------------------------------------------------------|
  3948. * Where
  3949. * IM = sw_intr_mode
  3950. * RR = response_required
  3951. * PTCF = prefetch_timer_cfg
  3952. * IP = IPA drop flag
  3953. *
  3954. * The message is interpreted as follows:
  3955. * dword0 - b'0:7 - msg_type: This will be set to
  3956. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3957. * b'8:15 - pdev_id:
  3958. * 0 (for rings at SOC/UMAC level),
  3959. * 1/2/3 mac id (for rings at LMAC level)
  3960. * b'16:23 - ring_id: identify which ring is to setup,
  3961. * more details can be got from enum htt_srng_ring_id
  3962. * b'24:31 - ring_type: identify type of host rings,
  3963. * more details can be got from enum htt_srng_ring_type
  3964. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3965. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3966. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3967. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3968. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3969. * SW_TO_HW_RING.
  3970. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3971. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3972. * Lower 32 bits of memory address of the remote variable
  3973. * storing the 4-byte word offset that identifies the head
  3974. * element within the ring.
  3975. * (The head offset variable has type A_UINT32.)
  3976. * Valid for HW_TO_SW and SW_TO_SW rings.
  3977. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3978. * Upper 32 bits of memory address of the remote variable
  3979. * storing the 4-byte word offset that identifies the head
  3980. * element within the ring.
  3981. * (The head offset variable has type A_UINT32.)
  3982. * Valid for HW_TO_SW and SW_TO_SW rings.
  3983. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3984. * Lower 32 bits of memory address of the remote variable
  3985. * storing the 4-byte word offset that identifies the tail
  3986. * element within the ring.
  3987. * (The tail offset variable has type A_UINT32.)
  3988. * Valid for HW_TO_SW and SW_TO_SW rings.
  3989. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3990. * Upper 32 bits of memory address of the remote variable
  3991. * storing the 4-byte word offset that identifies the tail
  3992. * element within the ring.
  3993. * (The tail offset variable has type A_UINT32.)
  3994. * Valid for HW_TO_SW and SW_TO_SW rings.
  3995. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3996. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3997. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3998. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3999. * dword10 - b'0:31 - ring_msi_data: MSI data
  4000. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4001. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4002. * dword11 - b'0:14 - intr_batch_counter_th:
  4003. * batch counter threshold is in units of 4-byte words.
  4004. * HW internally maintains and increments batch count.
  4005. * (see SRING spec for detail description).
  4006. * When batch count reaches threshold value, an interrupt
  4007. * is generated by HW.
  4008. * b'15 - sw_intr_mode:
  4009. * This configuration shall be static.
  4010. * Only programmed at power up.
  4011. * 0: generate pulse style sw interrupts
  4012. * 1: generate level style sw interrupts
  4013. * b'16:31 - intr_timer_th:
  4014. * The timer init value when timer is idle or is
  4015. * initialized to start downcounting.
  4016. * In 8us units (to cover a range of 0 to 524 ms)
  4017. * dword12 - b'0:15 - intr_low_threshold:
  4018. * Used only by Consumer ring to generate ring_sw_int_p.
  4019. * Ring entries low threshold water mark, that is used
  4020. * in combination with the interrupt timer as well as
  4021. * the the clearing of the level interrupt.
  4022. * b'16:18 - prefetch_timer_cfg:
  4023. * Used only by Consumer ring to set timer mode to
  4024. * support Application prefetch handling.
  4025. * The external tail offset/pointer will be updated
  4026. * at following intervals:
  4027. * 3'b000: (Prefetch feature disabled; used only for debug)
  4028. * 3'b001: 1 usec
  4029. * 3'b010: 4 usec
  4030. * 3'b011: 8 usec (default)
  4031. * 3'b100: 16 usec
  4032. * Others: Reserverd
  4033. * b'19 - response_required:
  4034. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4035. * b'20 - ipa_drop_flag:
  4036. Indicates that host will config ipa drop threshold percentage
  4037. * b'21:31 - reserved: reserved for future use
  4038. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4039. * b'8:15 - ipa drop high threshold percentage:
  4040. * b'16:31 - Reserved
  4041. */
  4042. PREPACK struct htt_sring_setup_t {
  4043. A_UINT32 msg_type: 8,
  4044. pdev_id: 8,
  4045. ring_id: 8,
  4046. ring_type: 8;
  4047. A_UINT32 ring_base_addr_lo;
  4048. A_UINT32 ring_base_addr_hi;
  4049. A_UINT32 ring_size: 16,
  4050. ring_entry_size: 8,
  4051. ring_misc_cfg_flag: 8;
  4052. A_UINT32 ring_head_offset32_remote_addr_lo;
  4053. A_UINT32 ring_head_offset32_remote_addr_hi;
  4054. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4055. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4056. A_UINT32 ring_msi_addr_lo;
  4057. A_UINT32 ring_msi_addr_hi;
  4058. A_UINT32 ring_msi_data;
  4059. A_UINT32 intr_batch_counter_th: 15,
  4060. sw_intr_mode: 1,
  4061. intr_timer_th: 16;
  4062. A_UINT32 intr_low_threshold: 16,
  4063. prefetch_timer_cfg: 3,
  4064. response_required: 1,
  4065. ipa_drop_flag: 1,
  4066. reserved1: 11;
  4067. A_UINT32 ipa_drop_low_threshold: 8,
  4068. ipa_drop_high_threshold: 8,
  4069. reserved: 16;
  4070. } POSTPACK;
  4071. enum htt_srng_ring_type {
  4072. HTT_HW_TO_SW_RING = 0,
  4073. HTT_SW_TO_HW_RING,
  4074. HTT_SW_TO_SW_RING,
  4075. /* Insert new ring types above this line */
  4076. };
  4077. enum htt_srng_ring_id {
  4078. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4079. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4080. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4081. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4082. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4083. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4084. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4085. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4086. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4087. /* Add Other SRING which can't be directly configured by host software above this line */
  4088. };
  4089. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4090. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4091. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4092. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4093. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4094. HTT_SRING_SETUP_PDEV_ID_S)
  4095. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4098. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4099. } while (0)
  4100. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4101. #define HTT_SRING_SETUP_RING_ID_S 16
  4102. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4104. HTT_SRING_SETUP_RING_ID_S)
  4105. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4109. } while (0)
  4110. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4111. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4112. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4113. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4114. HTT_SRING_SETUP_RING_TYPE_S)
  4115. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4118. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4119. } while (0)
  4120. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4121. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4122. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4123. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4124. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4125. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4128. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4129. } while (0)
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4131. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4132. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4133. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4134. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4135. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4138. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4139. } while (0)
  4140. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4141. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4142. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4143. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4144. HTT_SRING_SETUP_RING_SIZE_S)
  4145. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4148. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4149. } while (0)
  4150. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4151. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4152. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4153. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4154. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4155. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4156. do { \
  4157. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4158. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4159. } while (0)
  4160. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4161. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4162. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4163. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4164. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4165. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4168. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4169. } while (0)
  4170. /* This control bit is applicable to only Producer, which updates Ring ID field
  4171. * of each descriptor before pushing into the ring.
  4172. * 0: updates ring_id(default)
  4173. * 1: ring_id updating disabled */
  4174. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4175. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4176. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4177. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4178. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4179. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4182. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4183. } while (0)
  4184. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4185. * of each descriptor before pushing into the ring.
  4186. * 0: updates Loopcnt(default)
  4187. * 1: Loopcnt updating disabled */
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4190. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4191. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4192. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4193. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4196. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4197. } while (0)
  4198. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4199. * into security_id port of GXI/AXI. */
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4202. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4203. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4204. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4208. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4209. } while (0)
  4210. /* During MSI write operation, SRNG drives value of this register bit into
  4211. * swap bit of GXI/AXI. */
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4214. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4215. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4216. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4217. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4220. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4221. } while (0)
  4222. /* During Pointer write operation, SRNG drives value of this register bit into
  4223. * swap bit of GXI/AXI. */
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4226. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4227. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4228. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4232. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4233. } while (0)
  4234. /* During any data or TLV write operation, SRNG drives value of this register
  4235. * bit into swap bit of GXI/AXI. */
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4238. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4239. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4240. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4241. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4244. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4245. } while (0)
  4246. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4247. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4248. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4249. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4250. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4251. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4252. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4253. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4256. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4257. } while (0)
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4259. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4260. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4261. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4262. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4263. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4266. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4267. } while (0)
  4268. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4269. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4270. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4271. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4272. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4273. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4276. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4277. } while (0)
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4279. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4280. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4281. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4282. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4283. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4286. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4287. } while (0)
  4288. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4289. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4290. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4291. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4292. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4293. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4296. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4297. } while (0)
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4299. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4300. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4301. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4302. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4303. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4306. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4307. } while (0)
  4308. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4309. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4310. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4311. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4312. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4313. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4316. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4317. } while (0)
  4318. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4319. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4320. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4321. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4322. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4323. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4326. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4327. } while (0)
  4328. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4329. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4330. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4331. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4332. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4333. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4336. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4337. } while (0)
  4338. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4339. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4340. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4341. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4342. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4343. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4346. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4347. } while (0)
  4348. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4349. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4350. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4351. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4352. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4353. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4356. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4357. } while (0)
  4358. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4359. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4360. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4361. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4362. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4363. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4364. do { \
  4365. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4366. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4367. } while (0)
  4368. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4369. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4370. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4371. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4372. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4373. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4376. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4377. } while (0)
  4378. /**
  4379. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4380. *
  4381. * @details
  4382. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4383. * configure RXDMA rings.
  4384. * The configuration is per ring based and includes both packet subtypes
  4385. * and PPDU/MPDU TLVs.
  4386. *
  4387. * The message would appear as follows:
  4388. *
  4389. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4390. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4391. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4392. * |-------------------------------------------------------------------|
  4393. * | rsvd2 | ring_buffer_size |
  4394. * |-------------------------------------------------------------------|
  4395. * | packet_type_enable_flags_0 |
  4396. * |-------------------------------------------------------------------|
  4397. * | packet_type_enable_flags_1 |
  4398. * |-------------------------------------------------------------------|
  4399. * | packet_type_enable_flags_2 |
  4400. * |-------------------------------------------------------------------|
  4401. * | packet_type_enable_flags_3 |
  4402. * |-------------------------------------------------------------------|
  4403. * | tlv_filter_in_flags |
  4404. * |-------------------------------------------------------------------|
  4405. * | rx_header_offset | rx_packet_offset |
  4406. * |-------------------------------------------------------------------|
  4407. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4408. * |-------------------------------------------------------------------|
  4409. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4410. * |-------------------------------------------------------------------|
  4411. * | rsvd3 | rx_attention_offset |
  4412. * |-------------------------------------------------------------------|
  4413. * | rsvd4 | mo| fp| rx_drop_threshold |
  4414. * | |ndp|ndp| |
  4415. * |-------------------------------------------------------------------|
  4416. * Where:
  4417. * PS = pkt_swap
  4418. * SS = status_swap
  4419. * OV = rx_offsets_valid
  4420. * DT = drop_thresh_valid
  4421. * The message is interpreted as follows:
  4422. * dword0 - b'0:7 - msg_type: This will be set to
  4423. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4424. * b'8:15 - pdev_id:
  4425. * 0 (for rings at SOC/UMAC level),
  4426. * 1/2/3 mac id (for rings at LMAC level)
  4427. * b'16:23 - ring_id : Identify the ring to configure.
  4428. * More details can be got from enum htt_srng_ring_id
  4429. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4430. * BUF_RING_CFG_0 defs within HW .h files,
  4431. * e.g. wmac_top_reg_seq_hwioreg.h
  4432. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4433. * BUF_RING_CFG_0 defs within HW .h files,
  4434. * e.g. wmac_top_reg_seq_hwioreg.h
  4435. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4436. * configuration fields are valid
  4437. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4438. * rx_drop_threshold field is valid
  4439. * b'28:31 - rsvd1: reserved for future use
  4440. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4441. * in byte units.
  4442. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4443. * - b'16:31 - rsvd2: Reserved for future use
  4444. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4445. * Enable MGMT packet from 0b0000 to 0b1001
  4446. * bits from low to high: FP, MD, MO - 3 bits
  4447. * FP: Filter_Pass
  4448. * MD: Monitor_Direct
  4449. * MO: Monitor_Other
  4450. * 10 mgmt subtypes * 3 bits -> 30 bits
  4451. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4452. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4453. * Enable MGMT packet from 0b1010 to 0b1111
  4454. * bits from low to high: FP, MD, MO - 3 bits
  4455. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4456. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4457. * Enable CTRL packet from 0b0000 to 0b1001
  4458. * bits from low to high: FP, MD, MO - 3 bits
  4459. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4460. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4461. * Enable CTRL packet from 0b1010 to 0b1111,
  4462. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4463. * bits from low to high: FP, MD, MO - 3 bits
  4464. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4465. * dword6 - b'0:31 - tlv_filter_in_flags:
  4466. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4467. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4468. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4469. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4470. * A value of 0 will be considered as ignore this config.
  4471. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4472. * e.g. wmac_top_reg_seq_hwioreg.h
  4473. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4474. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4475. * A value of 0 will be considered as ignore this config.
  4476. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4477. * e.g. wmac_top_reg_seq_hwioreg.h
  4478. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4479. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4480. * A value of 0 will be considered as ignore this config.
  4481. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4482. * e.g. wmac_top_reg_seq_hwioreg.h
  4483. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4484. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4485. * A value of 0 will be considered as ignore this config.
  4486. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4487. * e.g. wmac_top_reg_seq_hwioreg.h
  4488. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4489. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4490. * A value of 0 will be considered as ignore this config.
  4491. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4492. * e.g. wmac_top_reg_seq_hwioreg.h
  4493. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4494. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4495. * A value of 0 will be considered as ignore this config.
  4496. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4497. * e.g. wmac_top_reg_seq_hwioreg.h
  4498. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4499. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4500. * A value of 0 will be considered as ignore this config.
  4501. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4502. * e.g. wmac_top_reg_seq_hwioreg.h
  4503. * - b'16:31 - rsvd3 for future use
  4504. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4505. * to source rings. Consumer drops packets if the available
  4506. * words in the ring falls below the configured threshold
  4507. * value.
  4508. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4509. * by host. 1 -> subscribed
  4510. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4511. * by host. 1 -> subscribed
  4512. */
  4513. PREPACK struct htt_rx_ring_selection_cfg_t {
  4514. A_UINT32 msg_type: 8,
  4515. pdev_id: 8,
  4516. ring_id: 8,
  4517. status_swap: 1,
  4518. pkt_swap: 1,
  4519. rx_offsets_valid: 1,
  4520. drop_thresh_valid: 1,
  4521. rsvd1: 4;
  4522. A_UINT32 ring_buffer_size: 16,
  4523. rsvd2: 16;
  4524. A_UINT32 packet_type_enable_flags_0;
  4525. A_UINT32 packet_type_enable_flags_1;
  4526. A_UINT32 packet_type_enable_flags_2;
  4527. A_UINT32 packet_type_enable_flags_3;
  4528. A_UINT32 tlv_filter_in_flags;
  4529. A_UINT32 rx_packet_offset: 16,
  4530. rx_header_offset: 16;
  4531. A_UINT32 rx_mpdu_end_offset: 16,
  4532. rx_mpdu_start_offset: 16;
  4533. A_UINT32 rx_msdu_end_offset: 16,
  4534. rx_msdu_start_offset: 16;
  4535. A_UINT32 rx_attn_offset: 16,
  4536. rsvd3: 16;
  4537. A_UINT32 rx_drop_threshold: 10,
  4538. fp_ndp: 1,
  4539. mo_ndp: 1,
  4540. rsvd4: 20;
  4541. } POSTPACK;
  4542. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4543. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4544. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4545. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4546. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4547. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4548. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4549. do { \
  4550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4552. } while (0)
  4553. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4554. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4555. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4556. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4557. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4558. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4559. do { \
  4560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4562. } while (0)
  4563. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4564. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4565. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4566. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4567. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4568. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4569. do { \
  4570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4572. } while (0)
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4576. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4577. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4579. do { \
  4580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4582. } while (0)
  4583. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4584. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4585. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4586. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4587. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4588. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4589. do { \
  4590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4592. } while (0)
  4593. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4594. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4595. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4596. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4597. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4598. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4599. do { \
  4600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4602. } while (0)
  4603. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4604. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4605. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4606. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4607. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4608. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4609. do { \
  4610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4612. } while (0)
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4616. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4617. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4619. do { \
  4620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4622. } while (0)
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4626. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4627. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4629. do { \
  4630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4632. } while (0)
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4636. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4637. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4639. do { \
  4640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4642. } while (0)
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4646. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4647. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4649. do { \
  4650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4652. } while (0)
  4653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4656. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4657. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4658. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4659. do { \
  4660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4662. } while (0)
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4665. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4666. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4667. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4668. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4669. do { \
  4670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4672. } while (0)
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4676. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4677. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4679. do { \
  4680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4682. } while (0)
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4686. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4687. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4689. do { \
  4690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4692. } while (0)
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4696. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4697. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4699. do { \
  4700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4702. } while (0)
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4706. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4707. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4712. } while (0)
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4716. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4717. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4722. } while (0)
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4724. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4725. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4726. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4727. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4728. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4732. } while (0)
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4734. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4735. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4736. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4737. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4738. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4742. } while (0)
  4743. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4744. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4745. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4746. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4747. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4748. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4749. do { \
  4750. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4751. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4752. } while (0)
  4753. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4754. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4755. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4756. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4757. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4758. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4761. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4762. } while (0)
  4763. /*
  4764. * Subtype based MGMT frames enable bits.
  4765. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4766. */
  4767. /* association request */
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4774. /* association response */
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4781. /* Reassociation request */
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4788. /* Reassociation response */
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4795. /* Probe request */
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4802. /* Probe response */
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4809. /* Timing Advertisement */
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4816. /* Reserved */
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4823. /* Beacon */
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4830. /* ATIM */
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4837. /* Disassociation */
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4844. /* Authentication */
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4851. /* Deauthentication */
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4858. /* Action */
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4865. /* Action No Ack */
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4872. /* Reserved */
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4879. /*
  4880. * Subtype based CTRL frames enable bits.
  4881. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4882. */
  4883. /* Reserved */
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4890. /* Reserved */
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4897. /* Reserved */
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4904. /* Reserved */
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4911. /* Reserved */
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4918. /* Reserved */
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4925. /* Reserved */
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4932. /* Control Wrapper */
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4939. /* Block Ack Request */
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4946. /* Block Ack*/
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4953. /* PS-POLL */
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4960. /* RTS */
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4967. /* CTS */
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4974. /* ACK */
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4981. /* CF-END */
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4988. /* CF-END + CF-ACK */
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4995. /* Multicast data */
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5002. /* Unicast data */
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5009. /* NULL data */
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5017. do { \
  5018. HTT_CHECK_SET_VAL(httsym, value); \
  5019. (word) |= (value) << httsym##_S; \
  5020. } while (0)
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5022. (((word) & httsym##_M) >> httsym##_S)
  5023. #define htt_rx_ring_pkt_enable_subtype_set( \
  5024. word, flag, mode, type, subtype, val) \
  5025. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5026. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5027. #define htt_rx_ring_pkt_enable_subtype_get( \
  5028. word, flag, mode, type, subtype) \
  5029. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5030. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5031. /* Definition to filter in TLVs */
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5058. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5059. do { \
  5060. HTT_CHECK_SET_VAL(httsym, enable); \
  5061. (word) |= (enable) << httsym##_S; \
  5062. } while (0)
  5063. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5064. (((word) & httsym##_M) >> httsym##_S)
  5065. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5066. HTT_RX_RING_TLV_ENABLE_SET( \
  5067. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5068. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5069. HTT_RX_RING_TLV_ENABLE_GET( \
  5070. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5071. /**
  5072. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5073. * host --> target Receive Flow Steering configuration message definition.
  5074. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5075. * The reason for this is we want RFS to be configured and ready before MAC
  5076. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5077. *
  5078. * |31 24|23 16|15 9|8|7 0|
  5079. * |----------------+----------------+----------------+----------------|
  5080. * | reserved |E| msg type |
  5081. * |-------------------------------------------------------------------|
  5082. * Where E = RFS enable flag
  5083. *
  5084. * The RFS_CONFIG message consists of a single 4-byte word.
  5085. *
  5086. * Header fields:
  5087. * - MSG_TYPE
  5088. * Bits 7:0
  5089. * Purpose: identifies this as a RFS config msg
  5090. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5091. * - RFS_CONFIG
  5092. * Bit 8
  5093. * Purpose: Tells target whether to enable (1) or disable (0)
  5094. * flow steering feature when sending rx indication messages to host
  5095. */
  5096. #define HTT_H2T_RFS_CONFIG_M 0x100
  5097. #define HTT_H2T_RFS_CONFIG_S 8
  5098. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5099. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5100. HTT_H2T_RFS_CONFIG_S)
  5101. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5102. do { \
  5103. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5104. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5105. } while (0)
  5106. #define HTT_RFS_CFG_REQ_BYTES 4
  5107. /**
  5108. * @brief host -> target FW extended statistics retrieve
  5109. *
  5110. * @details
  5111. * The following field definitions describe the format of the HTT host
  5112. * to target FW extended stats retrieve message.
  5113. * The message specifies the type of stats the host wants to retrieve.
  5114. *
  5115. * |31 24|23 16|15 8|7 0|
  5116. * |-----------------------------------------------------------|
  5117. * | reserved | stats type | pdev_mask | msg type |
  5118. * |-----------------------------------------------------------|
  5119. * | config param [0] |
  5120. * |-----------------------------------------------------------|
  5121. * | config param [1] |
  5122. * |-----------------------------------------------------------|
  5123. * | config param [2] |
  5124. * |-----------------------------------------------------------|
  5125. * | config param [3] |
  5126. * |-----------------------------------------------------------|
  5127. * | reserved |
  5128. * |-----------------------------------------------------------|
  5129. * | cookie LSBs |
  5130. * |-----------------------------------------------------------|
  5131. * | cookie MSBs |
  5132. * |-----------------------------------------------------------|
  5133. * Header fields:
  5134. * - MSG_TYPE
  5135. * Bits 7:0
  5136. * Purpose: identifies this is a extended stats upload request message
  5137. * Value: 0x10
  5138. * - PDEV_MASK
  5139. * Bits 8:15
  5140. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5141. * Value: This is a overloaded field, refer to usage and interpretation of
  5142. * PDEV in interface document.
  5143. * Bit 8 : Reserved for SOC stats
  5144. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5145. * Indicates MACID_MASK in DBS
  5146. * - STATS_TYPE
  5147. * Bits 23:16
  5148. * Purpose: identifies which FW statistics to upload
  5149. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5150. * - Reserved
  5151. * Bits 31:24
  5152. * - CONFIG_PARAM [0]
  5153. * Bits 31:0
  5154. * Purpose: give an opaque configuration value to the specified stats type
  5155. * Value: stats-type specific configuration value
  5156. * Refer to htt_stats.h for interpretation for each stats sub_type
  5157. * - CONFIG_PARAM [1]
  5158. * Bits 31:0
  5159. * Purpose: give an opaque configuration value to the specified stats type
  5160. * Value: stats-type specific configuration value
  5161. * Refer to htt_stats.h for interpretation for each stats sub_type
  5162. * - CONFIG_PARAM [2]
  5163. * Bits 31:0
  5164. * Purpose: give an opaque configuration value to the specified stats type
  5165. * Value: stats-type specific configuration value
  5166. * Refer to htt_stats.h for interpretation for each stats sub_type
  5167. * - CONFIG_PARAM [3]
  5168. * Bits 31:0
  5169. * Purpose: give an opaque configuration value to the specified stats type
  5170. * Value: stats-type specific configuration value
  5171. * Refer to htt_stats.h for interpretation for each stats sub_type
  5172. * - Reserved [31:0] for future use.
  5173. * - COOKIE_LSBS
  5174. * Bits 31:0
  5175. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5176. * message with its preceding host->target stats request message.
  5177. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5178. * - COOKIE_MSBS
  5179. * Bits 31:0
  5180. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5181. * message with its preceding host->target stats request message.
  5182. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5183. */
  5184. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5185. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5186. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5187. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5188. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5189. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5191. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5192. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5193. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5194. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5195. do { \
  5196. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5197. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5198. } while (0)
  5199. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5200. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5201. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5202. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5203. do { \
  5204. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5205. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5206. } while (0)
  5207. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5208. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5209. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5210. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5211. do { \
  5212. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5213. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5214. } while (0)
  5215. /**
  5216. * @brief host -> target FW PPDU_STATS request message
  5217. *
  5218. * @details
  5219. * The following field definitions describe the format of the HTT host
  5220. * to target FW for PPDU_STATS_CFG msg.
  5221. * The message allows the host to configure the PPDU_STATS_IND messages
  5222. * produced by the target.
  5223. *
  5224. * |31 24|23 16|15 8|7 0|
  5225. * |-----------------------------------------------------------|
  5226. * | REQ bit mask | pdev_mask | msg type |
  5227. * |-----------------------------------------------------------|
  5228. * Header fields:
  5229. * - MSG_TYPE
  5230. * Bits 7:0
  5231. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5232. * Value: 0x11
  5233. * - PDEV_MASK
  5234. * Bits 8:15
  5235. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5236. * Value: This is a overloaded field, refer to usage and interpretation of
  5237. * PDEV in interface document.
  5238. * Bit 8 : Reserved for SOC stats
  5239. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5240. * Indicates MACID_MASK in DBS
  5241. * - REQ_TLV_BIT_MASK
  5242. * Bits 16:31
  5243. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5244. * needs to be included in the target's PPDU_STATS_IND messages.
  5245. * Value: refer htt_ppdu_stats_tlv_tag_t
  5246. *
  5247. */
  5248. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5249. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5250. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5251. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5252. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5253. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5254. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5255. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5256. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5257. do { \
  5258. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5259. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5260. } while (0)
  5261. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5262. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5263. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5264. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5265. do { \
  5266. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5267. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5268. } while (0)
  5269. /**
  5270. * @brief Host-->target HTT RX FSE setup message
  5271. * @details
  5272. * Through this message, the host will provide details of the flow tables
  5273. * in host DDR along with hash keys.
  5274. * This message can be sent per SOC or per PDEV, which is differentiated
  5275. * by pdev id values.
  5276. * The host will allocate flow search table and sends table size,
  5277. * physical DMA address of flow table, and hash keys to firmware to
  5278. * program into the RXOLE FSE HW block.
  5279. *
  5280. * The following field definitions describe the format of the RX FSE setup
  5281. * message sent from the host to target
  5282. *
  5283. * Header fields:
  5284. * dword0 - b'7:0 - msg_type: This will be set to
  5285. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5286. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5287. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5288. * pdev's LMAC ring.
  5289. * b'31:16 - reserved : Reserved for future use
  5290. * dword1 - b'19:0 - number of records: This field indicates the number of
  5291. * entries in the flow table. For example: 8k number of
  5292. * records is equivalent to
  5293. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5294. * b'27:20 - max search: This field specifies the skid length to FSE
  5295. * parser HW module whenever match is not found at the
  5296. * exact index pointed by hash.
  5297. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5298. * Refer htt_ip_da_sa_prefix below for more details.
  5299. * b'31:30 - reserved: Reserved for future use
  5300. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5301. * table allocated by host in DDR
  5302. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5303. * table allocated by host in DDR
  5304. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5305. * entry hashing
  5306. *
  5307. *
  5308. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5309. * |---------------------------------------------------------------|
  5310. * | reserved | pdev_id | MSG_TYPE |
  5311. * |---------------------------------------------------------------|
  5312. * |resvd|IPDSA| max_search | Number of records |
  5313. * |---------------------------------------------------------------|
  5314. * | base address lo |
  5315. * |---------------------------------------------------------------|
  5316. * | base address high |
  5317. * |---------------------------------------------------------------|
  5318. * | toeplitz key 31_0 |
  5319. * |---------------------------------------------------------------|
  5320. * | toeplitz key 63_32 |
  5321. * |---------------------------------------------------------------|
  5322. * | toeplitz key 95_64 |
  5323. * |---------------------------------------------------------------|
  5324. * | toeplitz key 127_96 |
  5325. * |---------------------------------------------------------------|
  5326. * | toeplitz key 159_128 |
  5327. * |---------------------------------------------------------------|
  5328. * | toeplitz key 191_160 |
  5329. * |---------------------------------------------------------------|
  5330. * | toeplitz key 223_192 |
  5331. * |---------------------------------------------------------------|
  5332. * | toeplitz key 255_224 |
  5333. * |---------------------------------------------------------------|
  5334. * | toeplitz key 287_256 |
  5335. * |---------------------------------------------------------------|
  5336. * | reserved | toeplitz key 314_288(26:0 bits) |
  5337. * |---------------------------------------------------------------|
  5338. * where:
  5339. * IPDSA = ip_da_sa
  5340. */
  5341. /**
  5342. * @brief: htt_ip_da_sa_prefix
  5343. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5344. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5345. * documentation per RFC3849
  5346. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5347. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5348. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5349. */
  5350. enum htt_ip_da_sa_prefix {
  5351. HTT_RX_IPV6_20010db8,
  5352. HTT_RX_IPV4_MAPPED_IPV6,
  5353. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5354. HTT_RX_IPV6_64FF9B,
  5355. };
  5356. /**
  5357. * @brief Host-->target HTT RX FISA configure and enable
  5358. * @details
  5359. * The host will send this command down to configure and enable the FISA
  5360. * operational params.
  5361. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5362. * register.
  5363. * Should configure both the MACs.
  5364. *
  5365. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5366. *
  5367. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5368. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5369. * pdev's LMAC ring.
  5370. * b'31:16 - reserved : Reserved for future use
  5371. *
  5372. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5373. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5374. * packets. 1 flow search will be skipped
  5375. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5376. * tcp,udp packets
  5377. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5378. * calculation
  5379. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5380. * calculation
  5381. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5382. * calculation
  5383. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5384. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5385. * length
  5386. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5387. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5388. * length
  5389. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5390. * num jump
  5391. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5392. * num jump
  5393. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5394. * data type switch has happend for MPDU Sequence num jump
  5395. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5396. * for MPDU Sequence num jump
  5397. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5398. * for decrypt errors
  5399. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5400. * while aggregating a msdu
  5401. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5402. * The aggregation is done until (number of MSDUs aggregated
  5403. * < LIMIT + 1)
  5404. * b'31:18 - Reserved
  5405. *
  5406. * fisa_control_value - 32bit value FW can write to register
  5407. *
  5408. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5409. * Threshold value for FISA timeout (units are microseconds).
  5410. * When the global timestamp exceeds this threshold, FISA
  5411. * aggregation will be restarted.
  5412. * A value of 0 means timeout is disabled.
  5413. * Compare the threshold register with timestamp field in
  5414. * flow entry to generate timeout for the flow.
  5415. *
  5416. * |31 18 |17 16|15 8|7 0|
  5417. * |-------------------------------------------------------------|
  5418. * | reserved | pdev_mask | msg type |
  5419. * |-------------------------------------------------------------|
  5420. * | reserved | FISA_CTRL |
  5421. * |-------------------------------------------------------------|
  5422. * | FISA_TIMEOUT_THRESH |
  5423. * |-------------------------------------------------------------|
  5424. */
  5425. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5426. A_UINT32 msg_type:8,
  5427. pdev_id:8,
  5428. reserved0:16;
  5429. /**
  5430. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5431. * [17:0]
  5432. */
  5433. union {
  5434. struct {
  5435. A_UINT32 fisa_enable: 1,
  5436. ipsec_skip_search: 1,
  5437. nontcp_skip_search: 1,
  5438. add_ipv4_fixed_hdr_len: 1,
  5439. add_ipv6_fixed_hdr_len: 1,
  5440. add_tcp_fixed_hdr_len: 1,
  5441. add_udp_hdr_len: 1,
  5442. chksum_cum_ip_len_en: 1,
  5443. disable_tid_check: 1,
  5444. disable_ta_check: 1,
  5445. disable_qos_check: 1,
  5446. disable_raw_check: 1,
  5447. disable_decrypt_err_check: 1,
  5448. disable_msdu_drop_check: 1,
  5449. fisa_aggr_limit: 4,
  5450. reserved: 14;
  5451. } fisa_control_bits;
  5452. A_UINT32 fisa_control_value;
  5453. } u_fisa_control;
  5454. /**
  5455. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5456. * timeout threshold for aggregation. Unit in usec.
  5457. * [31:0]
  5458. */
  5459. A_UINT32 fisa_timeout_threshold;
  5460. } POSTPACK;
  5461. /* DWord 0: pdev-ID */
  5462. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5463. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5464. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5465. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5466. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5467. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5468. do { \
  5469. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5470. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5471. } while (0)
  5472. /* Dword 1: fisa_control_value fisa config */
  5473. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5474. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5475. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5476. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5477. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5478. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5482. } while (0)
  5483. /* Dword 1: fisa_control_value ipsec_skip_search */
  5484. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5485. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5486. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5487. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5488. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5489. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5493. } while (0)
  5494. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5495. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5496. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5497. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5498. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5499. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5500. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5501. do { \
  5502. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5503. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5504. } while (0)
  5505. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5506. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5507. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5508. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5509. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5510. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5511. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5515. } while (0)
  5516. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5517. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5518. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5519. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5520. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5521. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5522. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5525. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5526. } while (0)
  5527. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5528. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5529. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5530. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5531. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5532. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5533. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5537. } while (0)
  5538. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5539. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5540. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5541. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5542. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5543. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5544. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5547. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5548. } while (0)
  5549. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5550. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5551. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5552. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5553. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5554. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5555. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5556. do { \
  5557. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5558. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5559. } while (0)
  5560. /* Dword 1: fisa_control_value disable_tid_check */
  5561. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5562. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5563. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5564. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5565. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5566. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5569. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5570. } while (0)
  5571. /* Dword 1: fisa_control_value disable_ta_check */
  5572. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5573. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5574. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5575. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5576. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5577. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5578. do { \
  5579. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5580. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5581. } while (0)
  5582. /* Dword 1: fisa_control_value disable_qos_check */
  5583. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5584. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5586. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5587. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5588. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5591. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5592. } while (0)
  5593. /* Dword 1: fisa_control_value disable_raw_check */
  5594. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5595. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5597. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5598. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5599. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5603. } while (0)
  5604. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5605. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5606. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5608. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5609. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5610. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5611. do { \
  5612. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5613. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5614. } while (0)
  5615. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5616. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5617. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5618. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5619. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5620. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5621. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5625. } while (0)
  5626. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5627. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5628. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5629. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5630. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5631. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5632. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5633. do { \
  5634. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5635. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5636. } while (0)
  5637. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5638. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5639. pdev_id:8,
  5640. reserved0:16;
  5641. A_UINT32 num_records:20,
  5642. max_search:8,
  5643. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5644. reserved1:2;
  5645. A_UINT32 base_addr_lo;
  5646. A_UINT32 base_addr_hi;
  5647. A_UINT32 toeplitz31_0;
  5648. A_UINT32 toeplitz63_32;
  5649. A_UINT32 toeplitz95_64;
  5650. A_UINT32 toeplitz127_96;
  5651. A_UINT32 toeplitz159_128;
  5652. A_UINT32 toeplitz191_160;
  5653. A_UINT32 toeplitz223_192;
  5654. A_UINT32 toeplitz255_224;
  5655. A_UINT32 toeplitz287_256;
  5656. A_UINT32 toeplitz314_288:27,
  5657. reserved2:5;
  5658. } POSTPACK;
  5659. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5660. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5661. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5662. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5663. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5664. /* DWORD 0: Pdev ID */
  5665. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5666. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5667. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5668. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5669. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5670. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5671. do { \
  5672. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5673. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5674. } while (0)
  5675. /* DWORD 1:num of records */
  5676. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5677. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5678. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5679. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5680. HTT_RX_FSE_SETUP_NUM_REC_S)
  5681. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5685. } while (0)
  5686. /* DWORD 1:max_search */
  5687. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5688. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5689. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5690. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5691. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5692. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5695. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5696. } while (0)
  5697. /* DWORD 1:ip_da_sa prefix */
  5698. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5699. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5700. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5701. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5702. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5703. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5706. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5707. } while (0)
  5708. /* DWORD 2: Base Address LO */
  5709. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5710. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5711. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5712. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5713. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5714. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5717. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5718. } while (0)
  5719. /* DWORD 3: Base Address High */
  5720. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5721. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5722. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5723. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5724. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5725. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5726. do { \
  5727. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5728. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5729. } while (0)
  5730. /* DWORD 4-12: Hash Value */
  5731. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5732. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5733. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5734. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5735. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5736. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5739. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5740. } while (0)
  5741. /* DWORD 13: Hash Value 314:288 bits */
  5742. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5743. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5744. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5745. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5746. do { \
  5747. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5748. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5749. } while (0)
  5750. /**
  5751. * @brief Host-->target HTT RX FSE operation message
  5752. * @details
  5753. * The host will send this Flow Search Engine (FSE) operation message for
  5754. * every flow add/delete operation.
  5755. * The FSE operation includes FSE full cache invalidation or individual entry
  5756. * invalidation.
  5757. * This message can be sent per SOC or per PDEV which is differentiated
  5758. * by pdev id values.
  5759. *
  5760. * |31 16|15 8|7 1|0|
  5761. * |-------------------------------------------------------------|
  5762. * | reserved | pdev_id | MSG_TYPE |
  5763. * |-------------------------------------------------------------|
  5764. * | reserved | operation |I|
  5765. * |-------------------------------------------------------------|
  5766. * | ip_src_addr_31_0 |
  5767. * |-------------------------------------------------------------|
  5768. * | ip_src_addr_63_32 |
  5769. * |-------------------------------------------------------------|
  5770. * | ip_src_addr_95_64 |
  5771. * |-------------------------------------------------------------|
  5772. * | ip_src_addr_127_96 |
  5773. * |-------------------------------------------------------------|
  5774. * | ip_dst_addr_31_0 |
  5775. * |-------------------------------------------------------------|
  5776. * | ip_dst_addr_63_32 |
  5777. * |-------------------------------------------------------------|
  5778. * | ip_dst_addr_95_64 |
  5779. * |-------------------------------------------------------------|
  5780. * | ip_dst_addr_127_96 |
  5781. * |-------------------------------------------------------------|
  5782. * | l4_dst_port | l4_src_port |
  5783. * | (32-bit SPI incase of IPsec) |
  5784. * |-------------------------------------------------------------|
  5785. * | reserved | l4_proto |
  5786. * |-------------------------------------------------------------|
  5787. *
  5788. * where I is 1-bit ipsec_valid.
  5789. *
  5790. * The following field definitions describe the format of the RX FSE operation
  5791. * message sent from the host to target for every add/delete flow entry to flow
  5792. * table.
  5793. *
  5794. * Header fields:
  5795. * dword0 - b'7:0 - msg_type: This will be set to
  5796. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5797. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5798. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5799. * specified pdev's LMAC ring.
  5800. * b'31:16 - reserved : Reserved for future use
  5801. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5802. * (Internet Protocol Security).
  5803. * IPsec describes the framework for providing security at
  5804. * IP layer. IPsec is defined for both versions of IP:
  5805. * IPV4 and IPV6.
  5806. * Please refer to htt_rx_flow_proto enumeration below for
  5807. * more info.
  5808. * ipsec_valid = 1 for IPSEC packets
  5809. * ipsec_valid = 0 for IP Packets
  5810. * b'7:1 - operation: This indicates types of FSE operation.
  5811. * Refer to htt_rx_fse_operation enumeration:
  5812. * 0 - No Cache Invalidation required
  5813. * 1 - Cache invalidate only one entry given by IP
  5814. * src/dest address at DWORD[2:9]
  5815. * 2 - Complete FSE Cache Invalidation
  5816. * 3 - FSE Disable
  5817. * 4 - FSE Enable
  5818. * b'31:8 - reserved: Reserved for future use
  5819. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5820. * for per flow addition/deletion
  5821. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5822. * and the subsequent 3 A_UINT32 will be padding bytes.
  5823. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5824. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5825. * from 0 to 65535 but only 0 to 1023 are designated as
  5826. * well-known ports. Refer to [RFC1700] for more details.
  5827. * This field is valid only if
  5828. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5829. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5830. * range from 0 to 65535 but only 0 to 1023 are designated
  5831. * as well-known ports. Refer to [RFC1700] for more details.
  5832. * This field is valid only if
  5833. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5834. * - SPI (31:0): Security Parameters Index is an
  5835. * identification tag added to the header while using IPsec
  5836. * for tunneling the IP traffici.
  5837. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5838. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5839. * Assigned Internet Protocol Numbers.
  5840. * l4_proto numbers for standard protocol like UDP/TCP
  5841. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5842. * l4_proto = 17 for UDP etc.
  5843. * b'31:8 - reserved: Reserved for future use.
  5844. *
  5845. */
  5846. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5847. A_UINT32 msg_type:8,
  5848. pdev_id:8,
  5849. reserved0:16;
  5850. A_UINT32 ipsec_valid:1,
  5851. operation:7,
  5852. reserved1:24;
  5853. A_UINT32 ip_src_addr_31_0;
  5854. A_UINT32 ip_src_addr_63_32;
  5855. A_UINT32 ip_src_addr_95_64;
  5856. A_UINT32 ip_src_addr_127_96;
  5857. A_UINT32 ip_dest_addr_31_0;
  5858. A_UINT32 ip_dest_addr_63_32;
  5859. A_UINT32 ip_dest_addr_95_64;
  5860. A_UINT32 ip_dest_addr_127_96;
  5861. union {
  5862. A_UINT32 spi;
  5863. struct {
  5864. A_UINT32 l4_src_port:16,
  5865. l4_dest_port:16;
  5866. } ip;
  5867. } u;
  5868. A_UINT32 l4_proto:8,
  5869. reserved:24;
  5870. } POSTPACK;
  5871. /**
  5872. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5873. * @details
  5874. * The host will send this Full monitor mode register configuration message.
  5875. * This message can be sent per SOC or per PDEV which is differentiated
  5876. * by pdev id values.
  5877. *
  5878. * |31 16|15 11|10 8|7 3|2|1|0|
  5879. * |-------------------------------------------------------------|
  5880. * | reserved | pdev_id | MSG_TYPE |
  5881. * |-------------------------------------------------------------|
  5882. * | reserved |Release Ring |N|Z|E|
  5883. * |-------------------------------------------------------------|
  5884. *
  5885. * where E is 1-bit full monitor mode enable/disable.
  5886. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5887. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5888. *
  5889. * The following field definitions describe the format of the full monitor
  5890. * mode configuration message sent from the host to target for each pdev.
  5891. *
  5892. * Header fields:
  5893. * dword0 - b'7:0 - msg_type: This will be set to
  5894. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5895. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5896. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5897. * specified pdev's LMAC ring.
  5898. * b'31:16 - reserved : Reserved for future use.
  5899. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5900. * monitor mode rxdma register is to be enabled or disabled.
  5901. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5902. * additional descriptors at ppdu end for zero mpdus
  5903. * enabled or disabled.
  5904. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5905. * additional descriptors at ppdu end for non zero mpdus
  5906. * enabled or disabled.
  5907. * b'10:3 - release_ring: This indicates the destination ring
  5908. * selection for the descriptor at the end of PPDU
  5909. * 0 - REO ring select
  5910. * 1 - FW ring select
  5911. * 2 - SW ring select
  5912. * 3 - Release ring select
  5913. * Refer to htt_rx_full_mon_release_ring.
  5914. * b'31:11 - reserved for future use
  5915. */
  5916. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5917. A_UINT32 msg_type:8,
  5918. pdev_id:8,
  5919. reserved0:16;
  5920. A_UINT32 full_monitor_mode_enable:1,
  5921. addnl_descs_zero_mpdus_end:1,
  5922. addnl_descs_non_zero_mpdus_end:1,
  5923. release_ring:8,
  5924. reserved1:21;
  5925. } POSTPACK;
  5926. /**
  5927. * Enumeration for full monitor mode destination ring select
  5928. * 0 - REO destination ring select
  5929. * 1 - FW destination ring select
  5930. * 2 - SW destination ring select
  5931. * 3 - Release destination ring select
  5932. */
  5933. enum htt_rx_full_mon_release_ring {
  5934. HTT_RX_MON_RING_REO,
  5935. HTT_RX_MON_RING_FW,
  5936. HTT_RX_MON_RING_SW,
  5937. HTT_RX_MON_RING_RELEASE,
  5938. };
  5939. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5940. /* DWORD 0: Pdev ID */
  5941. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5942. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5943. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5944. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5945. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5946. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5947. do { \
  5948. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5949. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5950. } while (0)
  5951. /* DWORD 1:ENABLE */
  5952. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5953. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5954. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5955. do { \
  5956. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5957. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5958. } while (0)
  5959. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5960. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5961. /* DWORD 1:ZERO_MPDU */
  5962. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5963. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5964. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5965. do { \
  5966. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5967. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5968. } while (0)
  5969. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5970. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5971. /* DWORD 1:NON_ZERO_MPDU */
  5972. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5973. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5974. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5977. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5978. } while (0)
  5979. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5980. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5981. /* DWORD 1:RELEASE_RINGS */
  5982. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5983. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5984. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  5987. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  5988. } while (0)
  5989. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  5990. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  5991. /**
  5992. * Enumeration for IP Protocol or IPSEC Protocol
  5993. * IPsec describes the framework for providing security at IP layer.
  5994. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  5995. */
  5996. enum htt_rx_flow_proto {
  5997. HTT_RX_FLOW_IP_PROTO,
  5998. HTT_RX_FLOW_IPSEC_PROTO,
  5999. };
  6000. /**
  6001. * Enumeration for FSE Cache Invalidation
  6002. * 0 - No Cache Invalidation required
  6003. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6004. * 2 - Complete FSE Cache Invalidation
  6005. * 3 - FSE Disable
  6006. * 4 - FSE Enable
  6007. */
  6008. enum htt_rx_fse_operation {
  6009. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6010. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6011. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6012. HTT_RX_FSE_DISABLE,
  6013. HTT_RX_FSE_ENABLE,
  6014. };
  6015. /* DWORD 0: Pdev ID */
  6016. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6017. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6018. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6019. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6020. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6021. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6022. do { \
  6023. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6024. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6025. } while (0)
  6026. /* DWORD 1:IP PROTO or IPSEC */
  6027. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6028. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6029. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6030. do { \
  6031. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6032. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6033. } while (0)
  6034. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6035. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6036. /* DWORD 1:FSE Operation */
  6037. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6038. #define HTT_RX_FSE_OPERATION_S 1
  6039. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6040. do { \
  6041. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6042. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6043. } while (0)
  6044. #define HTT_RX_FSE_OPERATION_GET(word) \
  6045. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6046. /* DWORD 2-9:IP Address */
  6047. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6048. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6049. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6050. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6051. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6052. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6055. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6056. } while (0)
  6057. /* DWORD 10:Source Port Number */
  6058. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6059. #define HTT_RX_FSE_SOURCEPORT_S 0
  6060. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6061. do { \
  6062. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6063. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6064. } while (0)
  6065. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6066. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6067. /* DWORD 11:Destination Port Number */
  6068. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6069. #define HTT_RX_FSE_DESTPORT_S 16
  6070. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6073. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6074. } while (0)
  6075. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6076. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6077. /* DWORD 10-11:SPI (In case of IPSEC) */
  6078. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6079. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6080. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6081. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6082. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6083. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6084. do { \
  6085. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6086. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6087. } while (0)
  6088. /* DWORD 12:L4 PROTO */
  6089. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6090. #define HTT_RX_FSE_L4_PROTO_S 0
  6091. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6092. do { \
  6093. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6094. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6095. } while (0)
  6096. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6097. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6098. /**
  6099. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6100. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6101. *
  6102. * |31 24|23 |15 8|7 2|1|0|
  6103. * |----------------+----------------+----------------+----------------|
  6104. * | reserved | pdev_id | msg_type |
  6105. * |---------------------------------+----------------+----------------|
  6106. * | reserved |E|F|
  6107. * |---------------------------------+----------------+----------------|
  6108. * Where E = Configure the target to provide the 3-tuple hash value in
  6109. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6110. * F = Configure the target to provide the 3-tuple hash value in
  6111. * flow_id_toeplitz field of rx_msdu_start tlv
  6112. *
  6113. * The following field definitions describe the format of the 3 tuple hash value
  6114. * message sent from the host to target as part of initialization sequence.
  6115. *
  6116. * Header fields:
  6117. * dword0 - b'7:0 - msg_type: This will be set to
  6118. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6119. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6120. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6121. * specified pdev's LMAC ring.
  6122. * b'31:16 - reserved : Reserved for future use
  6123. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6124. * b'1 - toeplitz_hash_2_or_4_field_enable
  6125. * b'31:2 - reserved : Reserved for future use
  6126. * ---------+------+----------------------------------------------------------
  6127. * bit1 | bit0 | Functionality
  6128. * ---------+------+----------------------------------------------------------
  6129. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6130. * | | in flow_id_toeplitz field
  6131. * ---------+------+----------------------------------------------------------
  6132. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6133. * | | in toeplitz_hash_2_or_4 field
  6134. * ---------+------+----------------------------------------------------------
  6135. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6136. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6137. * ---------+------+----------------------------------------------------------
  6138. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6139. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6140. * | | toeplitz_hash_2_or_4 field
  6141. *----------------------------------------------------------------------------
  6142. */
  6143. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6144. A_UINT32 msg_type :8,
  6145. pdev_id :8,
  6146. reserved0 :16;
  6147. A_UINT32 flow_id_toeplitz_field_enable :1,
  6148. toeplitz_hash_2_or_4_field_enable :1,
  6149. reserved1 :30;
  6150. } POSTPACK;
  6151. /* DWORD0 : pdev_id configuration Macros */
  6152. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6153. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6154. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6155. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6156. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6157. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6158. do { \
  6159. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6160. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6161. } while (0)
  6162. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6163. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6164. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6165. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6166. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6167. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6168. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6169. do { \
  6170. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6171. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6172. } while (0)
  6173. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6174. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6175. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6176. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6177. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6178. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6179. do { \
  6180. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6181. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6182. } while (0)
  6183. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6184. /*=== target -> host messages ===============================================*/
  6185. enum htt_t2h_msg_type {
  6186. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6187. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6188. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6189. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6190. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6191. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6192. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6193. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6194. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6195. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6196. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6197. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6198. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6199. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6200. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6201. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6202. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6203. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6204. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6205. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6206. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6207. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6208. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6209. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6210. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6211. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6212. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6213. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6214. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6215. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6216. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6217. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6218. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6219. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6220. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6221. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6222. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6223. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6224. /* TX_OFFLOAD_DELIVER_IND:
  6225. * Forward the target's locally-generated packets to the host,
  6226. * to provide to the monitor mode interface.
  6227. */
  6228. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6229. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6230. HTT_T2H_MSG_TYPE_TEST,
  6231. /* keep this last */
  6232. HTT_T2H_NUM_MSGS
  6233. };
  6234. /*
  6235. * HTT target to host message type -
  6236. * stored in bits 7:0 of the first word of the message
  6237. */
  6238. #define HTT_T2H_MSG_TYPE_M 0xff
  6239. #define HTT_T2H_MSG_TYPE_S 0
  6240. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6243. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6244. } while (0)
  6245. #define HTT_T2H_MSG_TYPE_GET(word) \
  6246. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6247. /**
  6248. * @brief target -> host version number confirmation message definition
  6249. *
  6250. * |31 24|23 16|15 8|7 0|
  6251. * |----------------+----------------+----------------+----------------|
  6252. * | reserved | major number | minor number | msg type |
  6253. * |-------------------------------------------------------------------|
  6254. * : option request TLV (optional) |
  6255. * :...................................................................:
  6256. *
  6257. * The VER_CONF message may consist of a single 4-byte word, or may be
  6258. * extended with TLVs that specify HTT options selected by the target.
  6259. * The following option TLVs may be appended to the VER_CONF message:
  6260. * - LL_BUS_ADDR_SIZE
  6261. * - HL_SUPPRESS_TX_COMPL_IND
  6262. * - MAX_TX_QUEUE_GROUPS
  6263. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6264. * may be appended to the VER_CONF message (but only one TLV of each type).
  6265. *
  6266. * Header fields:
  6267. * - MSG_TYPE
  6268. * Bits 7:0
  6269. * Purpose: identifies this as a version number confirmation message
  6270. * Value: 0x0
  6271. * - VER_MINOR
  6272. * Bits 15:8
  6273. * Purpose: Specify the minor number of the HTT message library version
  6274. * in use by the target firmware.
  6275. * The minor number specifies the specific revision within a range
  6276. * of fundamentally compatible HTT message definition revisions.
  6277. * Compatible revisions involve adding new messages or perhaps
  6278. * adding new fields to existing messages, in a backwards-compatible
  6279. * manner.
  6280. * Incompatible revisions involve changing the message type values,
  6281. * or redefining existing messages.
  6282. * Value: minor number
  6283. * - VER_MAJOR
  6284. * Bits 15:8
  6285. * Purpose: Specify the major number of the HTT message library version
  6286. * in use by the target firmware.
  6287. * The major number specifies the family of minor revisions that are
  6288. * fundamentally compatible with each other, but not with prior or
  6289. * later families.
  6290. * Value: major number
  6291. */
  6292. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6293. #define HTT_VER_CONF_MINOR_S 8
  6294. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6295. #define HTT_VER_CONF_MAJOR_S 16
  6296. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6297. do { \
  6298. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6299. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6300. } while (0)
  6301. #define HTT_VER_CONF_MINOR_GET(word) \
  6302. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6303. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6306. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6307. } while (0)
  6308. #define HTT_VER_CONF_MAJOR_GET(word) \
  6309. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6310. #define HTT_VER_CONF_BYTES 4
  6311. /**
  6312. * @brief - target -> host HTT Rx In order indication message
  6313. *
  6314. * @details
  6315. *
  6316. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6317. * |----------------+-------------------+---------------------+---------------|
  6318. * | peer ID | P| F| O| ext TID | msg type |
  6319. * |--------------------------------------------------------------------------|
  6320. * | MSDU count | Reserved | vdev id |
  6321. * |--------------------------------------------------------------------------|
  6322. * | MSDU 0 bus address (bits 31:0) |
  6323. #if HTT_PADDR64
  6324. * | MSDU 0 bus address (bits 63:32) |
  6325. #endif
  6326. * |--------------------------------------------------------------------------|
  6327. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6328. * |--------------------------------------------------------------------------|
  6329. * | MSDU 1 bus address (bits 31:0) |
  6330. #if HTT_PADDR64
  6331. * | MSDU 1 bus address (bits 63:32) |
  6332. #endif
  6333. * |--------------------------------------------------------------------------|
  6334. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6335. * |--------------------------------------------------------------------------|
  6336. */
  6337. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6338. *
  6339. * @details
  6340. * bits
  6341. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6342. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6343. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6344. * | | frag | | | | fail |chksum fail|
  6345. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6346. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6347. */
  6348. struct htt_rx_in_ord_paddr_ind_hdr_t
  6349. {
  6350. A_UINT32 /* word 0 */
  6351. msg_type: 8,
  6352. ext_tid: 5,
  6353. offload: 1,
  6354. frag: 1,
  6355. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6356. peer_id: 16;
  6357. A_UINT32 /* word 1 */
  6358. vap_id: 8,
  6359. /* NOTE:
  6360. * This reserved_1 field is not truly reserved - certain targets use
  6361. * this field internally to store debug information, and do not zero
  6362. * out the contents of the field before uploading the message to the
  6363. * host. Thus, any host-target communication supported by this field
  6364. * is limited to using values that are never used by the debug
  6365. * information stored by certain targets in the reserved_1 field.
  6366. * In particular, the targets in question don't use the value 0x3
  6367. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6368. * so this previously-unused value within these bits is available to
  6369. * use as the host / target PKT_CAPTURE_MODE flag.
  6370. */
  6371. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6372. /* if pkt_capture_mode == 0x3, host should
  6373. * send rx frames to monitor mode interface
  6374. */
  6375. msdu_cnt: 16;
  6376. };
  6377. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6378. {
  6379. A_UINT32 dma_addr;
  6380. A_UINT32
  6381. length: 16,
  6382. fw_desc: 8,
  6383. msdu_info:8;
  6384. };
  6385. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6386. {
  6387. A_UINT32 dma_addr_lo;
  6388. A_UINT32 dma_addr_hi;
  6389. A_UINT32
  6390. length: 16,
  6391. fw_desc: 8,
  6392. msdu_info:8;
  6393. };
  6394. #if HTT_PADDR64
  6395. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6396. #else
  6397. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6398. #endif
  6399. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6400. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6401. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6402. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6403. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6404. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6405. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6406. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6407. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6408. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6409. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6410. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6411. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6412. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6413. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6414. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6415. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6416. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6417. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6418. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6419. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6420. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6421. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6422. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6423. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6424. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6425. /* for systems using 64-bit format for bus addresses */
  6426. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6427. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6428. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6429. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6430. /* for systems using 32-bit format for bus addresses */
  6431. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6432. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6434. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6435. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6436. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6437. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6438. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6439. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6440. do { \
  6441. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6442. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6443. } while (0)
  6444. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6445. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6446. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6447. do { \
  6448. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6449. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6450. } while (0)
  6451. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6452. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6453. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6454. do { \
  6455. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6456. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6457. } while (0)
  6458. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6459. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6460. /*
  6461. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6462. * deliver the rx frames to the monitor mode interface.
  6463. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6464. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6465. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6466. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6467. */
  6468. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6469. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6470. do { \
  6471. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6472. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6473. } while (0)
  6474. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6475. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6476. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6477. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6478. do { \
  6479. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6480. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6481. } while (0)
  6482. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6483. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6484. /* for systems using 64-bit format for bus addresses */
  6485. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6488. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6489. } while (0)
  6490. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6491. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6492. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6493. do { \
  6494. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6495. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6496. } while (0)
  6497. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6498. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6499. /* for systems using 32-bit format for bus addresses */
  6500. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6503. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6504. } while (0)
  6505. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6506. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6507. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6508. do { \
  6509. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6510. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6511. } while (0)
  6512. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6513. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6514. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6515. do { \
  6516. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6517. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6518. } while (0)
  6519. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6520. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6521. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6524. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6525. } while (0)
  6526. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6527. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6528. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6529. do { \
  6530. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6531. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6532. } while (0)
  6533. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6534. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6535. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6536. do { \
  6537. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6538. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6539. } while (0)
  6540. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6541. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6542. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6545. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6546. } while (0)
  6547. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6548. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6549. /* definitions used within target -> host rx indication message */
  6550. PREPACK struct htt_rx_ind_hdr_prefix_t
  6551. {
  6552. A_UINT32 /* word 0 */
  6553. msg_type: 8,
  6554. ext_tid: 5,
  6555. release_valid: 1,
  6556. flush_valid: 1,
  6557. reserved0: 1,
  6558. peer_id: 16;
  6559. A_UINT32 /* word 1 */
  6560. flush_start_seq_num: 6,
  6561. flush_end_seq_num: 6,
  6562. release_start_seq_num: 6,
  6563. release_end_seq_num: 6,
  6564. num_mpdu_ranges: 8;
  6565. } POSTPACK;
  6566. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6567. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6568. #define HTT_TGT_RSSI_INVALID 0x80
  6569. PREPACK struct htt_rx_ppdu_desc_t
  6570. {
  6571. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6572. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6573. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6574. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6575. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6576. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6577. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6578. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6579. A_UINT32 /* word 0 */
  6580. rssi_cmb: 8,
  6581. timestamp_submicrosec: 8,
  6582. phy_err_code: 8,
  6583. phy_err: 1,
  6584. legacy_rate: 4,
  6585. legacy_rate_sel: 1,
  6586. end_valid: 1,
  6587. start_valid: 1;
  6588. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6589. union {
  6590. A_UINT32 /* word 1 */
  6591. rssi0_pri20: 8,
  6592. rssi0_ext20: 8,
  6593. rssi0_ext40: 8,
  6594. rssi0_ext80: 8;
  6595. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6596. } u0;
  6597. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6598. union {
  6599. A_UINT32 /* word 2 */
  6600. rssi1_pri20: 8,
  6601. rssi1_ext20: 8,
  6602. rssi1_ext40: 8,
  6603. rssi1_ext80: 8;
  6604. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6605. } u1;
  6606. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6607. union {
  6608. A_UINT32 /* word 3 */
  6609. rssi2_pri20: 8,
  6610. rssi2_ext20: 8,
  6611. rssi2_ext40: 8,
  6612. rssi2_ext80: 8;
  6613. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6614. } u2;
  6615. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6616. union {
  6617. A_UINT32 /* word 4 */
  6618. rssi3_pri20: 8,
  6619. rssi3_ext20: 8,
  6620. rssi3_ext40: 8,
  6621. rssi3_ext80: 8;
  6622. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6623. } u3;
  6624. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6625. A_UINT32 tsf32; /* word 5 */
  6626. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6627. A_UINT32 timestamp_microsec; /* word 6 */
  6628. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6629. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6630. A_UINT32 /* word 7 */
  6631. vht_sig_a1: 24,
  6632. preamble_type: 8;
  6633. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6634. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6635. A_UINT32 /* word 8 */
  6636. vht_sig_a2: 24,
  6637. /* sa_ant_matrix
  6638. * For cases where a single rx chain has options to be connected to
  6639. * different rx antennas, show which rx antennas were in use during
  6640. * receipt of a given PPDU.
  6641. * This sa_ant_matrix provides a bitmask of the antennas used while
  6642. * receiving this frame.
  6643. */
  6644. sa_ant_matrix: 8;
  6645. } POSTPACK;
  6646. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6647. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6648. PREPACK struct htt_rx_ind_hdr_suffix_t
  6649. {
  6650. A_UINT32 /* word 0 */
  6651. fw_rx_desc_bytes: 16,
  6652. reserved0: 16;
  6653. } POSTPACK;
  6654. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6655. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6656. PREPACK struct htt_rx_ind_hdr_t
  6657. {
  6658. struct htt_rx_ind_hdr_prefix_t prefix;
  6659. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6660. struct htt_rx_ind_hdr_suffix_t suffix;
  6661. } POSTPACK;
  6662. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6663. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6664. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6665. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6666. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6667. /*
  6668. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6669. * the offset into the HTT rx indication message at which the
  6670. * FW rx PPDU descriptor resides
  6671. */
  6672. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6673. /*
  6674. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6675. * the offset into the HTT rx indication message at which the
  6676. * header suffix (FW rx MSDU byte count) resides
  6677. */
  6678. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6679. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6680. /*
  6681. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6682. * the offset into the HTT rx indication message at which the per-MSDU
  6683. * information starts
  6684. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6685. * per-MSDU information portion of the message. The per-MSDU info itself
  6686. * starts at byte 12.
  6687. */
  6688. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6689. /**
  6690. * @brief target -> host rx indication message definition
  6691. *
  6692. * @details
  6693. * The following field definitions describe the format of the rx indication
  6694. * message sent from the target to the host.
  6695. * The message consists of three major sections:
  6696. * 1. a fixed-length header
  6697. * 2. a variable-length list of firmware rx MSDU descriptors
  6698. * 3. one or more 4-octet MPDU range information elements
  6699. * The fixed length header itself has two sub-sections
  6700. * 1. the message meta-information, including identification of the
  6701. * sender and type of the received data, and a 4-octet flush/release IE
  6702. * 2. the firmware rx PPDU descriptor
  6703. *
  6704. * The format of the message is depicted below.
  6705. * in this depiction, the following abbreviations are used for information
  6706. * elements within the message:
  6707. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6708. * elements associated with the PPDU start are valid.
  6709. * Specifically, the following fields are valid only if SV is set:
  6710. * RSSI (all variants), L, legacy rate, preamble type, service,
  6711. * VHT-SIG-A
  6712. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6713. * elements associated with the PPDU end are valid.
  6714. * Specifically, the following fields are valid only if EV is set:
  6715. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6716. * - L - Legacy rate selector - if legacy rates are used, this flag
  6717. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6718. * (L == 0) PHY.
  6719. * - P - PHY error flag - boolean indication of whether the rx frame had
  6720. * a PHY error
  6721. *
  6722. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6723. * |----------------+-------------------+---------------------+---------------|
  6724. * | peer ID | |RV|FV| ext TID | msg type |
  6725. * |--------------------------------------------------------------------------|
  6726. * | num | release | release | flush | flush |
  6727. * | MPDU | end | start | end | start |
  6728. * | ranges | seq num | seq num | seq num | seq num |
  6729. * |==========================================================================|
  6730. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6731. * |V|V| | rate | | | timestamp | RSSI |
  6732. * |--------------------------------------------------------------------------|
  6733. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6734. * |--------------------------------------------------------------------------|
  6735. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6736. * |--------------------------------------------------------------------------|
  6737. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6738. * |--------------------------------------------------------------------------|
  6739. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6740. * |--------------------------------------------------------------------------|
  6741. * | TSF LSBs |
  6742. * |--------------------------------------------------------------------------|
  6743. * | microsec timestamp |
  6744. * |--------------------------------------------------------------------------|
  6745. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6746. * |--------------------------------------------------------------------------|
  6747. * | service | HT-SIG / VHT-SIG-A2 |
  6748. * |==========================================================================|
  6749. * | reserved | FW rx desc bytes |
  6750. * |--------------------------------------------------------------------------|
  6751. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6752. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6753. * |--------------------------------------------------------------------------|
  6754. * : : :
  6755. * |--------------------------------------------------------------------------|
  6756. * | alignment | MSDU Rx |
  6757. * | padding | desc Bn |
  6758. * |--------------------------------------------------------------------------|
  6759. * | reserved | MPDU range status | MPDU count |
  6760. * |--------------------------------------------------------------------------|
  6761. * : reserved : MPDU range status : MPDU count :
  6762. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6763. *
  6764. * Header fields:
  6765. * - MSG_TYPE
  6766. * Bits 7:0
  6767. * Purpose: identifies this as an rx indication message
  6768. * Value: 0x1
  6769. * - EXT_TID
  6770. * Bits 12:8
  6771. * Purpose: identify the traffic ID of the rx data, including
  6772. * special "extended" TID values for multicast, broadcast, and
  6773. * non-QoS data frames
  6774. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6775. * - FLUSH_VALID (FV)
  6776. * Bit 13
  6777. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6778. * is valid
  6779. * Value:
  6780. * 1 -> flush IE is valid and needs to be processed
  6781. * 0 -> flush IE is not valid and should be ignored
  6782. * - REL_VALID (RV)
  6783. * Bit 13
  6784. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6785. * is valid
  6786. * Value:
  6787. * 1 -> release IE is valid and needs to be processed
  6788. * 0 -> release IE is not valid and should be ignored
  6789. * - PEER_ID
  6790. * Bits 31:16
  6791. * Purpose: Identify, by ID, which peer sent the rx data
  6792. * Value: ID of the peer who sent the rx data
  6793. * - FLUSH_SEQ_NUM_START
  6794. * Bits 5:0
  6795. * Purpose: Indicate the start of a series of MPDUs to flush
  6796. * Not all MPDUs within this series are necessarily valid - the host
  6797. * must check each sequence number within this range to see if the
  6798. * corresponding MPDU is actually present.
  6799. * This field is only valid if the FV bit is set.
  6800. * Value:
  6801. * The sequence number for the first MPDUs to check to flush.
  6802. * The sequence number is masked by 0x3f.
  6803. * - FLUSH_SEQ_NUM_END
  6804. * Bits 11:6
  6805. * Purpose: Indicate the end of a series of MPDUs to flush
  6806. * Value:
  6807. * The sequence number one larger than the sequence number of the
  6808. * last MPDU to check to flush.
  6809. * The sequence number is masked by 0x3f.
  6810. * Not all MPDUs within this series are necessarily valid - the host
  6811. * must check each sequence number within this range to see if the
  6812. * corresponding MPDU is actually present.
  6813. * This field is only valid if the FV bit is set.
  6814. * - REL_SEQ_NUM_START
  6815. * Bits 17:12
  6816. * Purpose: Indicate the start of a series of MPDUs to release.
  6817. * All MPDUs within this series are present and valid - the host
  6818. * need not check each sequence number within this range to see if
  6819. * the corresponding MPDU is actually present.
  6820. * This field is only valid if the RV bit is set.
  6821. * Value:
  6822. * The sequence number for the first MPDUs to check to release.
  6823. * The sequence number is masked by 0x3f.
  6824. * - REL_SEQ_NUM_END
  6825. * Bits 23:18
  6826. * Purpose: Indicate the end of a series of MPDUs to release.
  6827. * Value:
  6828. * The sequence number one larger than the sequence number of the
  6829. * last MPDU to check to release.
  6830. * The sequence number is masked by 0x3f.
  6831. * All MPDUs within this series are present and valid - the host
  6832. * need not check each sequence number within this range to see if
  6833. * the corresponding MPDU is actually present.
  6834. * This field is only valid if the RV bit is set.
  6835. * - NUM_MPDU_RANGES
  6836. * Bits 31:24
  6837. * Purpose: Indicate how many ranges of MPDUs are present.
  6838. * Each MPDU range consists of a series of contiguous MPDUs within the
  6839. * rx frame sequence which all have the same MPDU status.
  6840. * Value: 1-63 (typically a small number, like 1-3)
  6841. *
  6842. * Rx PPDU descriptor fields:
  6843. * - RSSI_CMB
  6844. * Bits 7:0
  6845. * Purpose: Combined RSSI from all active rx chains, across the active
  6846. * bandwidth.
  6847. * Value: RSSI dB units w.r.t. noise floor
  6848. * - TIMESTAMP_SUBMICROSEC
  6849. * Bits 15:8
  6850. * Purpose: high-resolution timestamp
  6851. * Value:
  6852. * Sub-microsecond time of PPDU reception.
  6853. * This timestamp ranges from [0,MAC clock MHz).
  6854. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6855. * to form a high-resolution, large range rx timestamp.
  6856. * - PHY_ERR_CODE
  6857. * Bits 23:16
  6858. * Purpose:
  6859. * If the rx frame processing resulted in a PHY error, indicate what
  6860. * type of rx PHY error occurred.
  6861. * Value:
  6862. * This field is valid if the "P" (PHY_ERR) flag is set.
  6863. * TBD: document/specify the values for this field
  6864. * - PHY_ERR
  6865. * Bit 24
  6866. * Purpose: indicate whether the rx PPDU had a PHY error
  6867. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6868. * - LEGACY_RATE
  6869. * Bits 28:25
  6870. * Purpose:
  6871. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6872. * specify which rate was used.
  6873. * Value:
  6874. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6875. * flag.
  6876. * If LEGACY_RATE_SEL is 0:
  6877. * 0x8: OFDM 48 Mbps
  6878. * 0x9: OFDM 24 Mbps
  6879. * 0xA: OFDM 12 Mbps
  6880. * 0xB: OFDM 6 Mbps
  6881. * 0xC: OFDM 54 Mbps
  6882. * 0xD: OFDM 36 Mbps
  6883. * 0xE: OFDM 18 Mbps
  6884. * 0xF: OFDM 9 Mbps
  6885. * If LEGACY_RATE_SEL is 1:
  6886. * 0x8: CCK 11 Mbps long preamble
  6887. * 0x9: CCK 5.5 Mbps long preamble
  6888. * 0xA: CCK 2 Mbps long preamble
  6889. * 0xB: CCK 1 Mbps long preamble
  6890. * 0xC: CCK 11 Mbps short preamble
  6891. * 0xD: CCK 5.5 Mbps short preamble
  6892. * 0xE: CCK 2 Mbps short preamble
  6893. * - LEGACY_RATE_SEL
  6894. * Bit 29
  6895. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6896. * Value:
  6897. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6898. * used a legacy rate.
  6899. * 0 -> OFDM, 1 -> CCK
  6900. * - END_VALID
  6901. * Bit 30
  6902. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6903. * the start of the PPDU are valid. Specifically, the following
  6904. * fields are only valid if END_VALID is set:
  6905. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6906. * TIMESTAMP_SUBMICROSEC
  6907. * Value:
  6908. * 0 -> rx PPDU desc end fields are not valid
  6909. * 1 -> rx PPDU desc end fields are valid
  6910. * - START_VALID
  6911. * Bit 31
  6912. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6913. * the end of the PPDU are valid. Specifically, the following
  6914. * fields are only valid if START_VALID is set:
  6915. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6916. * VHT-SIG-A
  6917. * Value:
  6918. * 0 -> rx PPDU desc start fields are not valid
  6919. * 1 -> rx PPDU desc start fields are valid
  6920. * - RSSI0_PRI20
  6921. * Bits 7:0
  6922. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6923. * Value: RSSI dB units w.r.t. noise floor
  6924. *
  6925. * - RSSI0_EXT20
  6926. * Bits 7:0
  6927. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6928. * (if the rx bandwidth was >= 40 MHz)
  6929. * Value: RSSI dB units w.r.t. noise floor
  6930. * - RSSI0_EXT40
  6931. * Bits 7:0
  6932. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6933. * (if the rx bandwidth was >= 80 MHz)
  6934. * Value: RSSI dB units w.r.t. noise floor
  6935. * - RSSI0_EXT80
  6936. * Bits 7:0
  6937. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6938. * (if the rx bandwidth was >= 160 MHz)
  6939. * Value: RSSI dB units w.r.t. noise floor
  6940. *
  6941. * - RSSI1_PRI20
  6942. * Bits 7:0
  6943. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6944. * Value: RSSI dB units w.r.t. noise floor
  6945. * - RSSI1_EXT20
  6946. * Bits 7:0
  6947. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6948. * (if the rx bandwidth was >= 40 MHz)
  6949. * Value: RSSI dB units w.r.t. noise floor
  6950. * - RSSI1_EXT40
  6951. * Bits 7:0
  6952. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6953. * (if the rx bandwidth was >= 80 MHz)
  6954. * Value: RSSI dB units w.r.t. noise floor
  6955. * - RSSI1_EXT80
  6956. * Bits 7:0
  6957. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6958. * (if the rx bandwidth was >= 160 MHz)
  6959. * Value: RSSI dB units w.r.t. noise floor
  6960. *
  6961. * - RSSI2_PRI20
  6962. * Bits 7:0
  6963. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6964. * Value: RSSI dB units w.r.t. noise floor
  6965. * - RSSI2_EXT20
  6966. * Bits 7:0
  6967. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6968. * (if the rx bandwidth was >= 40 MHz)
  6969. * Value: RSSI dB units w.r.t. noise floor
  6970. * - RSSI2_EXT40
  6971. * Bits 7:0
  6972. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6973. * (if the rx bandwidth was >= 80 MHz)
  6974. * Value: RSSI dB units w.r.t. noise floor
  6975. * - RSSI2_EXT80
  6976. * Bits 7:0
  6977. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6978. * (if the rx bandwidth was >= 160 MHz)
  6979. * Value: RSSI dB units w.r.t. noise floor
  6980. *
  6981. * - RSSI3_PRI20
  6982. * Bits 7:0
  6983. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6984. * Value: RSSI dB units w.r.t. noise floor
  6985. * - RSSI3_EXT20
  6986. * Bits 7:0
  6987. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6988. * (if the rx bandwidth was >= 40 MHz)
  6989. * Value: RSSI dB units w.r.t. noise floor
  6990. * - RSSI3_EXT40
  6991. * Bits 7:0
  6992. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6993. * (if the rx bandwidth was >= 80 MHz)
  6994. * Value: RSSI dB units w.r.t. noise floor
  6995. * - RSSI3_EXT80
  6996. * Bits 7:0
  6997. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6998. * (if the rx bandwidth was >= 160 MHz)
  6999. * Value: RSSI dB units w.r.t. noise floor
  7000. *
  7001. * - TSF32
  7002. * Bits 31:0
  7003. * Purpose: specify the time the rx PPDU was received, in TSF units
  7004. * Value: 32 LSBs of the TSF
  7005. * - TIMESTAMP_MICROSEC
  7006. * Bits 31:0
  7007. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7008. * Value: PPDU rx time, in microseconds
  7009. * - VHT_SIG_A1
  7010. * Bits 23:0
  7011. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7012. * from the rx PPDU
  7013. * Value:
  7014. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7015. * VHT-SIG-A1 data.
  7016. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7017. * first 24 bits of the HT-SIG data.
  7018. * Otherwise, this field is invalid.
  7019. * Refer to the the 802.11 protocol for the definition of the
  7020. * HT-SIG and VHT-SIG-A1 fields
  7021. * - VHT_SIG_A2
  7022. * Bits 23:0
  7023. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7024. * from the rx PPDU
  7025. * Value:
  7026. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7027. * VHT-SIG-A2 data.
  7028. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7029. * last 24 bits of the HT-SIG data.
  7030. * Otherwise, this field is invalid.
  7031. * Refer to the the 802.11 protocol for the definition of the
  7032. * HT-SIG and VHT-SIG-A2 fields
  7033. * - PREAMBLE_TYPE
  7034. * Bits 31:24
  7035. * Purpose: indicate the PHY format of the received burst
  7036. * Value:
  7037. * 0x4: Legacy (OFDM/CCK)
  7038. * 0x8: HT
  7039. * 0x9: HT with TxBF
  7040. * 0xC: VHT
  7041. * 0xD: VHT with TxBF
  7042. * - SERVICE
  7043. * Bits 31:24
  7044. * Purpose: TBD
  7045. * Value: TBD
  7046. *
  7047. * Rx MSDU descriptor fields:
  7048. * - FW_RX_DESC_BYTES
  7049. * Bits 15:0
  7050. * Purpose: Indicate how many bytes in the Rx indication are used for
  7051. * FW Rx descriptors
  7052. *
  7053. * Payload fields:
  7054. * - MPDU_COUNT
  7055. * Bits 7:0
  7056. * Purpose: Indicate how many sequential MPDUs share the same status.
  7057. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7058. * - MPDU_STATUS
  7059. * Bits 15:8
  7060. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7061. * received successfully.
  7062. * Value:
  7063. * 0x1: success
  7064. * 0x2: FCS error
  7065. * 0x3: duplicate error
  7066. * 0x4: replay error
  7067. * 0x5: invalid peer
  7068. */
  7069. /* header fields */
  7070. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7071. #define HTT_RX_IND_EXT_TID_S 8
  7072. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7073. #define HTT_RX_IND_FLUSH_VALID_S 13
  7074. #define HTT_RX_IND_REL_VALID_M 0x4000
  7075. #define HTT_RX_IND_REL_VALID_S 14
  7076. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7077. #define HTT_RX_IND_PEER_ID_S 16
  7078. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7079. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7080. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7081. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7082. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7083. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7084. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7085. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7086. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7087. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7088. /* rx PPDU descriptor fields */
  7089. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7090. #define HTT_RX_IND_RSSI_CMB_S 0
  7091. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7092. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7093. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7094. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7095. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7096. #define HTT_RX_IND_PHY_ERR_S 24
  7097. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7098. #define HTT_RX_IND_LEGACY_RATE_S 25
  7099. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7100. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7101. #define HTT_RX_IND_END_VALID_M 0x40000000
  7102. #define HTT_RX_IND_END_VALID_S 30
  7103. #define HTT_RX_IND_START_VALID_M 0x80000000
  7104. #define HTT_RX_IND_START_VALID_S 31
  7105. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7106. #define HTT_RX_IND_RSSI_PRI20_S 0
  7107. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7108. #define HTT_RX_IND_RSSI_EXT20_S 8
  7109. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7110. #define HTT_RX_IND_RSSI_EXT40_S 16
  7111. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7112. #define HTT_RX_IND_RSSI_EXT80_S 24
  7113. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7114. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7115. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7116. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7117. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7118. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7119. #define HTT_RX_IND_SERVICE_M 0xff000000
  7120. #define HTT_RX_IND_SERVICE_S 24
  7121. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7122. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7123. /* rx MSDU descriptor fields */
  7124. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7125. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7126. /* payload fields */
  7127. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7128. #define HTT_RX_IND_MPDU_COUNT_S 0
  7129. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7130. #define HTT_RX_IND_MPDU_STATUS_S 8
  7131. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7132. do { \
  7133. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7134. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7135. } while (0)
  7136. #define HTT_RX_IND_EXT_TID_GET(word) \
  7137. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7138. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7139. do { \
  7140. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7141. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7142. } while (0)
  7143. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7144. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7145. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7146. do { \
  7147. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7148. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7149. } while (0)
  7150. #define HTT_RX_IND_REL_VALID_GET(word) \
  7151. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7152. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7153. do { \
  7154. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7155. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7156. } while (0)
  7157. #define HTT_RX_IND_PEER_ID_GET(word) \
  7158. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7159. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7160. do { \
  7161. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7162. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7163. } while (0)
  7164. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7165. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7166. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7167. do { \
  7168. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7169. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7170. } while (0)
  7171. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7172. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7173. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7174. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7177. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7178. } while (0)
  7179. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7180. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7181. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7182. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7183. do { \
  7184. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7185. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7186. } while (0)
  7187. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7188. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7189. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7190. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7191. do { \
  7192. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7193. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7194. } while (0)
  7195. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7196. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7197. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7198. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7199. do { \
  7200. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7201. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7202. } while (0)
  7203. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7204. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7205. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7206. /* FW rx PPDU descriptor fields */
  7207. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7208. do { \
  7209. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7210. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7211. } while (0)
  7212. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7213. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7214. HTT_RX_IND_RSSI_CMB_S)
  7215. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7218. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7219. } while (0)
  7220. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7221. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7222. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7223. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7224. do { \
  7225. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7226. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7227. } while (0)
  7228. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7229. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7230. HTT_RX_IND_PHY_ERR_CODE_S)
  7231. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7232. do { \
  7233. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7234. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7235. } while (0)
  7236. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7237. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7238. HTT_RX_IND_PHY_ERR_S)
  7239. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7240. do { \
  7241. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7242. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7243. } while (0)
  7244. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7245. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7246. HTT_RX_IND_LEGACY_RATE_S)
  7247. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7248. do { \
  7249. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7250. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7251. } while (0)
  7252. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7253. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7254. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7255. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7258. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7259. } while (0)
  7260. #define HTT_RX_IND_END_VALID_GET(word) \
  7261. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7262. HTT_RX_IND_END_VALID_S)
  7263. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7264. do { \
  7265. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7266. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7267. } while (0)
  7268. #define HTT_RX_IND_START_VALID_GET(word) \
  7269. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7270. HTT_RX_IND_START_VALID_S)
  7271. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7272. do { \
  7273. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7274. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7275. } while (0)
  7276. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7277. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7278. HTT_RX_IND_RSSI_PRI20_S)
  7279. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7280. do { \
  7281. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7282. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7283. } while (0)
  7284. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7285. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7286. HTT_RX_IND_RSSI_EXT20_S)
  7287. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7290. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7291. } while (0)
  7292. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7293. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7294. HTT_RX_IND_RSSI_EXT40_S)
  7295. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7296. do { \
  7297. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7298. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7299. } while (0)
  7300. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7301. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7302. HTT_RX_IND_RSSI_EXT80_S)
  7303. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7304. do { \
  7305. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7306. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7307. } while (0)
  7308. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7309. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7310. HTT_RX_IND_VHT_SIG_A1_S)
  7311. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7312. do { \
  7313. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7314. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7315. } while (0)
  7316. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7317. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7318. HTT_RX_IND_VHT_SIG_A2_S)
  7319. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7322. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7323. } while (0)
  7324. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7325. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7326. HTT_RX_IND_PREAMBLE_TYPE_S)
  7327. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7328. do { \
  7329. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7330. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7331. } while (0)
  7332. #define HTT_RX_IND_SERVICE_GET(word) \
  7333. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7334. HTT_RX_IND_SERVICE_S)
  7335. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7336. do { \
  7337. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7338. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7339. } while (0)
  7340. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7341. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7342. HTT_RX_IND_SA_ANT_MATRIX_S)
  7343. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7346. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7347. } while (0)
  7348. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7349. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7350. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7351. do { \
  7352. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7353. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7354. } while (0)
  7355. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7356. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7357. #define HTT_RX_IND_HL_BYTES \
  7358. (HTT_RX_IND_HDR_BYTES + \
  7359. 4 /* single FW rx MSDU descriptor */ + \
  7360. 4 /* single MPDU range information element */)
  7361. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7362. /* Could we use one macro entry? */
  7363. #define HTT_WORD_SET(word, field, value) \
  7364. do { \
  7365. HTT_CHECK_SET_VAL(field, value); \
  7366. (word) |= ((value) << field ## _S); \
  7367. } while (0)
  7368. #define HTT_WORD_GET(word, field) \
  7369. (((word) & field ## _M) >> field ## _S)
  7370. PREPACK struct hl_htt_rx_ind_base {
  7371. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7372. } POSTPACK;
  7373. /*
  7374. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7375. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7376. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7377. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7378. * htt_rx_ind_hl_rx_desc_t.
  7379. */
  7380. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7381. struct htt_rx_ind_hl_rx_desc_t {
  7382. A_UINT8 ver;
  7383. A_UINT8 len;
  7384. struct {
  7385. A_UINT8
  7386. first_msdu: 1,
  7387. last_msdu: 1,
  7388. c3_failed: 1,
  7389. c4_failed: 1,
  7390. ipv6: 1,
  7391. tcp: 1,
  7392. udp: 1,
  7393. reserved: 1;
  7394. } flags;
  7395. /* NOTE: no reserved space - don't append any new fields here */
  7396. };
  7397. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7398. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7399. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7400. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7401. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7402. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7403. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7404. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7405. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7406. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7407. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7408. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7409. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7410. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7411. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7412. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7413. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7414. /* This structure is used in HL, the basic descriptor information
  7415. * used by host. the structure is translated by FW from HW desc
  7416. * or generated by FW. But in HL monitor mode, the host would use
  7417. * the same structure with LL.
  7418. */
  7419. PREPACK struct hl_htt_rx_desc_base {
  7420. A_UINT32
  7421. seq_num:12,
  7422. encrypted:1,
  7423. chan_info_present:1,
  7424. resv0:2,
  7425. mcast_bcast:1,
  7426. fragment:1,
  7427. key_id_oct:8,
  7428. resv1:6;
  7429. A_UINT32
  7430. pn_31_0;
  7431. union {
  7432. struct {
  7433. A_UINT16 pn_47_32;
  7434. A_UINT16 pn_63_48;
  7435. } pn16;
  7436. A_UINT32 pn_63_32;
  7437. } u0;
  7438. A_UINT32
  7439. pn_95_64;
  7440. A_UINT32
  7441. pn_127_96;
  7442. } POSTPACK;
  7443. /*
  7444. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7445. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7446. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7447. * Please see htt_chan_change_t for description of the fields.
  7448. */
  7449. PREPACK struct htt_chan_info_t
  7450. {
  7451. A_UINT32 primary_chan_center_freq_mhz: 16,
  7452. contig_chan1_center_freq_mhz: 16;
  7453. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7454. phy_mode: 8,
  7455. reserved: 8;
  7456. } POSTPACK;
  7457. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7458. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7459. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7460. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7461. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7462. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7463. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7464. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7465. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7466. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7467. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7468. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7469. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7470. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7471. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7472. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7473. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7474. /* Channel information */
  7475. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7476. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7477. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7478. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7479. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7480. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7481. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7482. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7483. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7486. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7487. } while (0)
  7488. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7489. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7490. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7491. do { \
  7492. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7493. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7494. } while (0)
  7495. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7496. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7497. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7498. do { \
  7499. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7500. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7501. } while (0)
  7502. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7503. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7504. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7505. do { \
  7506. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7507. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7508. } while (0)
  7509. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7510. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7511. /*
  7512. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7513. * @brief target -> host message definition for FW offloaded pkts
  7514. *
  7515. * @details
  7516. * The following field definitions describe the format of the firmware
  7517. * offload deliver message sent from the target to the host.
  7518. *
  7519. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7520. *
  7521. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7522. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7523. * | reserved_1 | msg type |
  7524. * |--------------------------------------------------------------------------|
  7525. * | phy_timestamp_l32 |
  7526. * |--------------------------------------------------------------------------|
  7527. * | WORD2 (see below) |
  7528. * |--------------------------------------------------------------------------|
  7529. * | seqno | framectrl |
  7530. * |--------------------------------------------------------------------------|
  7531. * | reserved_3 | vdev_id | tid_num|
  7532. * |--------------------------------------------------------------------------|
  7533. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7534. * |--------------------------------------------------------------------------|
  7535. *
  7536. * where:
  7537. * STAT = status
  7538. * F = format (802.3 vs. 802.11)
  7539. *
  7540. * definition for word 2
  7541. *
  7542. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7543. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7544. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7545. * |--------------------------------------------------------------------------|
  7546. *
  7547. * where:
  7548. * PR = preamble
  7549. * BF = beamformed
  7550. */
  7551. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7552. {
  7553. A_UINT32 /* word 0 */
  7554. msg_type:8, /* [ 7: 0] */
  7555. reserved_1:24; /* [31: 8] */
  7556. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7557. A_UINT32 /* word 2 */
  7558. /* preamble:
  7559. * 0-OFDM,
  7560. * 1-CCk,
  7561. * 2-HT,
  7562. * 3-VHT
  7563. */
  7564. preamble: 2, /* [1:0] */
  7565. /* mcs:
  7566. * In case of HT preamble interpret
  7567. * MCS along with NSS.
  7568. * Valid values for HT are 0 to 7.
  7569. * HT mcs 0 with NSS 2 is mcs 8.
  7570. * Valid values for VHT are 0 to 9.
  7571. */
  7572. mcs: 4, /* [5:2] */
  7573. /* rate:
  7574. * This is applicable only for
  7575. * CCK and OFDM preamble type
  7576. * rate 0: OFDM 48 Mbps,
  7577. * 1: OFDM 24 Mbps,
  7578. * 2: OFDM 12 Mbps
  7579. * 3: OFDM 6 Mbps
  7580. * 4: OFDM 54 Mbps
  7581. * 5: OFDM 36 Mbps
  7582. * 6: OFDM 18 Mbps
  7583. * 7: OFDM 9 Mbps
  7584. * rate 0: CCK 11 Mbps Long
  7585. * 1: CCK 5.5 Mbps Long
  7586. * 2: CCK 2 Mbps Long
  7587. * 3: CCK 1 Mbps Long
  7588. * 4: CCK 11 Mbps Short
  7589. * 5: CCK 5.5 Mbps Short
  7590. * 6: CCK 2 Mbps Short
  7591. */
  7592. rate : 3, /* [ 8: 6] */
  7593. rssi : 8, /* [16: 9] units=dBm */
  7594. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7595. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7596. stbc : 1, /* [22] */
  7597. sgi : 1, /* [23] */
  7598. ldpc : 1, /* [24] */
  7599. beamformed: 1, /* [25] */
  7600. reserved_2: 6; /* [31:26] */
  7601. A_UINT32 /* word 3 */
  7602. framectrl:16, /* [15: 0] */
  7603. seqno:16; /* [31:16] */
  7604. A_UINT32 /* word 4 */
  7605. tid_num:5, /* [ 4: 0] actual TID number */
  7606. vdev_id:8, /* [12: 5] */
  7607. reserved_3:19; /* [31:13] */
  7608. A_UINT32 /* word 5 */
  7609. /* status:
  7610. * 0: tx_ok
  7611. * 1: retry
  7612. * 2: drop
  7613. * 3: filtered
  7614. * 4: abort
  7615. * 5: tid delete
  7616. * 6: sw abort
  7617. * 7: dropped by peer migration
  7618. */
  7619. status:3, /* [2:0] */
  7620. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7621. tx_mpdu_bytes:16, /* [19:4] */
  7622. /* Indicates retry count of offloaded/local generated Data tx frames */
  7623. tx_retry_cnt:6, /* [25:20] */
  7624. reserved_4:6; /* [31:26] */
  7625. } POSTPACK;
  7626. /* FW offload deliver ind message header fields */
  7627. /* DWORD one */
  7628. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7629. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7630. /* DWORD two */
  7631. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7632. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7633. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7634. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7635. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7636. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7637. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7638. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7639. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7640. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7641. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7642. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7643. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7644. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7645. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7646. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7647. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7648. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7649. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7650. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7651. /* DWORD three*/
  7652. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7653. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7654. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7655. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7656. /* DWORD four */
  7657. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7658. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7659. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7660. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7661. /* DWORD five */
  7662. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7663. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7664. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7665. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7666. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7667. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7668. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7669. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7670. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7673. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7674. } while (0)
  7675. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7676. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7677. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7680. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7681. } while (0)
  7682. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7683. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7684. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7687. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7688. } while (0)
  7689. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7690. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7691. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7694. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7695. } while (0)
  7696. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7697. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7698. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7701. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7702. } while (0)
  7703. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7704. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7705. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7706. do { \
  7707. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7708. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7709. } while (0)
  7710. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7711. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7712. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7715. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7716. } while (0)
  7717. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7718. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7719. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7722. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7723. } while (0)
  7724. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7725. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7726. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7727. do { \
  7728. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7729. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7730. } while (0)
  7731. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7732. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7733. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7736. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7737. } while (0)
  7738. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7739. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7740. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7743. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7744. } while (0)
  7745. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7746. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7747. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7750. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7751. } while (0)
  7752. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7753. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7754. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7755. do { \
  7756. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7757. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7758. } while (0)
  7759. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7760. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7761. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7762. do { \
  7763. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7764. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7765. } while (0)
  7766. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7767. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7768. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7769. do { \
  7770. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7771. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7772. } while (0)
  7773. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7774. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7775. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7778. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7779. } while (0)
  7780. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7781. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7782. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7783. do { \
  7784. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7785. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7786. } while (0)
  7787. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7788. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7789. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7790. do { \
  7791. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7792. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7793. } while (0)
  7794. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7795. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7796. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7797. do { \
  7798. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7799. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7800. } while (0)
  7801. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7802. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7803. /*
  7804. * @brief target -> host rx reorder flush message definition
  7805. *
  7806. * @details
  7807. * The following field definitions describe the format of the rx flush
  7808. * message sent from the target to the host.
  7809. * The message consists of a 4-octet header, followed by one or more
  7810. * 4-octet payload information elements.
  7811. *
  7812. * |31 24|23 8|7 0|
  7813. * |--------------------------------------------------------------|
  7814. * | TID | peer ID | msg type |
  7815. * |--------------------------------------------------------------|
  7816. * | seq num end | seq num start | MPDU status | reserved |
  7817. * |--------------------------------------------------------------|
  7818. * First DWORD:
  7819. * - MSG_TYPE
  7820. * Bits 7:0
  7821. * Purpose: identifies this as an rx flush message
  7822. * Value: 0x2
  7823. * - PEER_ID
  7824. * Bits 23:8 (only bits 18:8 actually used)
  7825. * Purpose: identify which peer's rx data is being flushed
  7826. * Value: (rx) peer ID
  7827. * - TID
  7828. * Bits 31:24 (only bits 27:24 actually used)
  7829. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7830. * Value: traffic identifier
  7831. * Second DWORD:
  7832. * - MPDU_STATUS
  7833. * Bits 15:8
  7834. * Purpose:
  7835. * Indicate whether the flushed MPDUs should be discarded or processed.
  7836. * Value:
  7837. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7838. * stages of rx processing
  7839. * other: discard the MPDUs
  7840. * It is anticipated that flush messages will always have
  7841. * MPDU status == 1, but the status flag is included for
  7842. * flexibility.
  7843. * - SEQ_NUM_START
  7844. * Bits 23:16
  7845. * Purpose:
  7846. * Indicate the start of a series of consecutive MPDUs being flushed.
  7847. * Not all MPDUs within this range are necessarily valid - the host
  7848. * must check each sequence number within this range to see if the
  7849. * corresponding MPDU is actually present.
  7850. * Value:
  7851. * The sequence number for the first MPDU in the sequence.
  7852. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7853. * - SEQ_NUM_END
  7854. * Bits 30:24
  7855. * Purpose:
  7856. * Indicate the end of a series of consecutive MPDUs being flushed.
  7857. * Value:
  7858. * The sequence number one larger than the sequence number of the
  7859. * last MPDU being flushed.
  7860. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7861. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7862. * are to be released for further rx processing.
  7863. * Not all MPDUs within this range are necessarily valid - the host
  7864. * must check each sequence number within this range to see if the
  7865. * corresponding MPDU is actually present.
  7866. */
  7867. /* first DWORD */
  7868. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7869. #define HTT_RX_FLUSH_PEER_ID_S 8
  7870. #define HTT_RX_FLUSH_TID_M 0xff000000
  7871. #define HTT_RX_FLUSH_TID_S 24
  7872. /* second DWORD */
  7873. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7874. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7875. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7876. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7877. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7878. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7879. #define HTT_RX_FLUSH_BYTES 8
  7880. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7881. do { \
  7882. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7883. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7884. } while (0)
  7885. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7886. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7887. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7890. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7891. } while (0)
  7892. #define HTT_RX_FLUSH_TID_GET(word) \
  7893. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7894. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7895. do { \
  7896. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7897. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7898. } while (0)
  7899. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7900. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7901. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7902. do { \
  7903. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7904. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7905. } while (0)
  7906. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7907. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7908. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7909. do { \
  7910. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7911. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7912. } while (0)
  7913. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7914. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7915. /*
  7916. * @brief target -> host rx pn check indication message
  7917. *
  7918. * @details
  7919. * The following field definitions describe the format of the Rx PN check
  7920. * indication message sent from the target to the host.
  7921. * The message consists of a 4-octet header, followed by the start and
  7922. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7923. * IE is one octet containing the sequence number that failed the PN
  7924. * check.
  7925. *
  7926. * |31 24|23 8|7 0|
  7927. * |--------------------------------------------------------------|
  7928. * | TID | peer ID | msg type |
  7929. * |--------------------------------------------------------------|
  7930. * | Reserved | PN IE count | seq num end | seq num start|
  7931. * |--------------------------------------------------------------|
  7932. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7933. * |--------------------------------------------------------------|
  7934. * First DWORD:
  7935. * - MSG_TYPE
  7936. * Bits 7:0
  7937. * Purpose: Identifies this as an rx pn check indication message
  7938. * Value: 0x2
  7939. * - PEER_ID
  7940. * Bits 23:8 (only bits 18:8 actually used)
  7941. * Purpose: identify which peer
  7942. * Value: (rx) peer ID
  7943. * - TID
  7944. * Bits 31:24 (only bits 27:24 actually used)
  7945. * Purpose: identify traffic identifier
  7946. * Value: traffic identifier
  7947. * Second DWORD:
  7948. * - SEQ_NUM_START
  7949. * Bits 7:0
  7950. * Purpose:
  7951. * Indicates the starting sequence number of the MPDU in this
  7952. * series of MPDUs that went though PN check.
  7953. * Value:
  7954. * The sequence number for the first MPDU in the sequence.
  7955. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7956. * - SEQ_NUM_END
  7957. * Bits 15:8
  7958. * Purpose:
  7959. * Indicates the ending sequence number of the MPDU in this
  7960. * series of MPDUs that went though PN check.
  7961. * Value:
  7962. * The sequence number one larger then the sequence number of the last
  7963. * MPDU being flushed.
  7964. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7965. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7966. * for invalid PN numbers and are ready to be released for further processing.
  7967. * Not all MPDUs within this range are necessarily valid - the host
  7968. * must check each sequence number within this range to see if the
  7969. * corresponding MPDU is actually present.
  7970. * - PN_IE_COUNT
  7971. * Bits 23:16
  7972. * Purpose:
  7973. * Used to determine the variable number of PN information elements in this
  7974. * message
  7975. *
  7976. * PN information elements:
  7977. * - PN_IE_x-
  7978. * Purpose:
  7979. * Each PN information element contains the sequence number of the MPDU that
  7980. * has failed the target PN check.
  7981. * Value:
  7982. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7983. * that failed the PN check.
  7984. */
  7985. /* first DWORD */
  7986. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7987. #define HTT_RX_PN_IND_PEER_ID_S 8
  7988. #define HTT_RX_PN_IND_TID_M 0xff000000
  7989. #define HTT_RX_PN_IND_TID_S 24
  7990. /* second DWORD */
  7991. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7992. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7993. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7994. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7995. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7996. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7997. #define HTT_RX_PN_IND_BYTES 8
  7998. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7999. do { \
  8000. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8001. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8002. } while (0)
  8003. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8004. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8005. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8006. do { \
  8007. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8008. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8009. } while (0)
  8010. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8011. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8012. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8013. do { \
  8014. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8015. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8016. } while (0)
  8017. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8018. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8019. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8020. do { \
  8021. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8022. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8023. } while (0)
  8024. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8025. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8026. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8027. do { \
  8028. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8029. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8030. } while (0)
  8031. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8032. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8033. /*
  8034. * @brief target -> host rx offload deliver message for LL system
  8035. *
  8036. * @details
  8037. * In a low latency system this message is sent whenever the offload
  8038. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8039. * The DMA of the actual packets into host memory is done before sending out
  8040. * this message. This message indicates only how many MSDUs to reap. The
  8041. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8042. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8043. * DMA'd by the MAC directly into host memory these packets do not contain
  8044. * the MAC descriptors in the header portion of the packet. Instead they contain
  8045. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8046. * message, the packets are delivered directly to the NW stack without going
  8047. * through the regular reorder buffering and PN checking path since it has
  8048. * already been done in target.
  8049. *
  8050. * |31 24|23 16|15 8|7 0|
  8051. * |-----------------------------------------------------------------------|
  8052. * | Total MSDU count | reserved | msg type |
  8053. * |-----------------------------------------------------------------------|
  8054. *
  8055. * @brief target -> host rx offload deliver message for HL system
  8056. *
  8057. * @details
  8058. * In a high latency system this message is sent whenever the offload manager
  8059. * flushes out the packets it has coalesced in its coalescing buffer. The
  8060. * actual packets are also carried along with this message. When the host
  8061. * receives this message, it is expected to deliver these packets to the NW
  8062. * stack directly instead of routing them through the reorder buffering and
  8063. * PN checking path since it has already been done in target.
  8064. *
  8065. * |31 24|23 16|15 8|7 0|
  8066. * |-----------------------------------------------------------------------|
  8067. * | Total MSDU count | reserved | msg type |
  8068. * |-----------------------------------------------------------------------|
  8069. * | peer ID | MSDU length |
  8070. * |-----------------------------------------------------------------------|
  8071. * | MSDU payload | FW Desc | tid | vdev ID |
  8072. * |-----------------------------------------------------------------------|
  8073. * | MSDU payload contd. |
  8074. * |-----------------------------------------------------------------------|
  8075. * | peer ID | MSDU length |
  8076. * |-----------------------------------------------------------------------|
  8077. * | MSDU payload | FW Desc | tid | vdev ID |
  8078. * |-----------------------------------------------------------------------|
  8079. * | MSDU payload contd. |
  8080. * |-----------------------------------------------------------------------|
  8081. *
  8082. */
  8083. /* first DWORD */
  8084. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8085. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8086. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8087. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8088. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8089. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8090. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8091. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8092. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8093. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8094. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8095. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8096. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8097. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8098. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8099. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8101. do { \
  8102. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8103. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8104. } while (0)
  8105. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8106. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8107. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8108. do { \
  8109. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8110. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8111. } while (0)
  8112. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8113. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8115. do { \
  8116. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8117. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8118. } while (0)
  8119. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8120. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8121. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8122. do { \
  8123. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8124. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8125. } while (0)
  8126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8127. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8129. do { \
  8130. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8131. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8132. } while (0)
  8133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8134. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8136. do { \
  8137. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8138. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8139. } while (0)
  8140. /**
  8141. * @brief target -> host rx peer map/unmap message definition
  8142. *
  8143. * @details
  8144. * The following diagram shows the format of the rx peer map message sent
  8145. * from the target to the host. This layout assumes the target operates
  8146. * as little-endian.
  8147. *
  8148. * This message always contains a SW peer ID. The main purpose of the
  8149. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8150. * with, so that the host can use that peer ID to determine which peer
  8151. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8152. * other purposes, such as identifying during tx completions which peer
  8153. * the tx frames in question were transmitted to.
  8154. *
  8155. * In certain generations of chips, the peer map message also contains
  8156. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8157. * to identify which peer the frame needs to be forwarded to (i.e. the
  8158. * peer assocated with the Destination MAC Address within the packet),
  8159. * and particularly which vdev needs to transmit the frame (for cases
  8160. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8161. * meaning as AST_INDEX_0.
  8162. * This DA-based peer ID that is provided for certain rx frames
  8163. * (the rx frames that need to be re-transmitted as tx frames)
  8164. * is the ID that the HW uses for referring to the peer in question,
  8165. * rather than the peer ID that the SW+FW use to refer to the peer.
  8166. *
  8167. *
  8168. * |31 24|23 16|15 8|7 0|
  8169. * |-----------------------------------------------------------------------|
  8170. * | SW peer ID | VDEV ID | msg type |
  8171. * |-----------------------------------------------------------------------|
  8172. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8173. * |-----------------------------------------------------------------------|
  8174. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8175. * |-----------------------------------------------------------------------|
  8176. *
  8177. *
  8178. * The following diagram shows the format of the rx peer unmap message sent
  8179. * from the target to the host.
  8180. *
  8181. * |31 24|23 16|15 8|7 0|
  8182. * |-----------------------------------------------------------------------|
  8183. * | SW peer ID | VDEV ID | msg type |
  8184. * |-----------------------------------------------------------------------|
  8185. *
  8186. * The following field definitions describe the format of the rx peer map
  8187. * and peer unmap messages sent from the target to the host.
  8188. * - MSG_TYPE
  8189. * Bits 7:0
  8190. * Purpose: identifies this as an rx peer map or peer unmap message
  8191. * Value: peer map -> 0x3, peer unmap -> 0x4
  8192. * - VDEV_ID
  8193. * Bits 15:8
  8194. * Purpose: Indicates which virtual device the peer is associated
  8195. * with.
  8196. * Value: vdev ID (used in the host to look up the vdev object)
  8197. * - PEER_ID (a.k.a. SW_PEER_ID)
  8198. * Bits 31:16
  8199. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8200. * freeing (unmap)
  8201. * Value: (rx) peer ID
  8202. * - MAC_ADDR_L32 (peer map only)
  8203. * Bits 31:0
  8204. * Purpose: Identifies which peer node the peer ID is for.
  8205. * Value: lower 4 bytes of peer node's MAC address
  8206. * - MAC_ADDR_U16 (peer map only)
  8207. * Bits 15:0
  8208. * Purpose: Identifies which peer node the peer ID is for.
  8209. * Value: upper 2 bytes of peer node's MAC address
  8210. * - HW_PEER_ID
  8211. * Bits 31:16
  8212. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8213. * address, so for rx frames marked for rx --> tx forwarding, the
  8214. * host can determine from the HW peer ID provided as meta-data with
  8215. * the rx frame which peer the frame is supposed to be forwarded to.
  8216. * Value: ID used by the MAC HW to identify the peer
  8217. */
  8218. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8219. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8220. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8221. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8222. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8223. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8224. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8225. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8226. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8227. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8228. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8229. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8230. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8231. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8232. do { \
  8233. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8234. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8235. } while (0)
  8236. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8237. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8238. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8239. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8242. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8243. } while (0)
  8244. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8245. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8246. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8247. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8248. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8251. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8252. } while (0)
  8253. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8254. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8255. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8256. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8257. #define HTT_RX_PEER_MAP_BYTES 12
  8258. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8259. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8260. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8261. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8262. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8263. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8264. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8265. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8266. #define HTT_RX_PEER_UNMAP_BYTES 4
  8267. /**
  8268. * @brief target -> host rx peer map V2 message definition
  8269. *
  8270. * @details
  8271. * The following diagram shows the format of the rx peer map v2 message sent
  8272. * from the target to the host. This layout assumes the target operates
  8273. * as little-endian.
  8274. *
  8275. * This message always contains a SW peer ID. The main purpose of the
  8276. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8277. * with, so that the host can use that peer ID to determine which peer
  8278. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8279. * other purposes, such as identifying during tx completions which peer
  8280. * the tx frames in question were transmitted to.
  8281. *
  8282. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8283. * is used during rx --> tx frame forwarding to identify which peer the
  8284. * frame needs to be forwarded to (i.e. the peer assocated with the
  8285. * Destination MAC Address within the packet), and particularly which vdev
  8286. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8287. * This DA-based peer ID that is provided for certain rx frames
  8288. * (the rx frames that need to be re-transmitted as tx frames)
  8289. * is the ID that the HW uses for referring to the peer in question,
  8290. * rather than the peer ID that the SW+FW use to refer to the peer.
  8291. *
  8292. * The HW peer id here is the same meaning as AST_INDEX_0.
  8293. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8294. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8295. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8296. * AST is valid.
  8297. *
  8298. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8299. * |-----------------------------------------------------------------------|
  8300. * | SW peer ID | VDEV ID | msg type |
  8301. * |-----------------------------------------------------------------------|
  8302. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8303. * |-----------------------------------------------------------------------|
  8304. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8305. * |-----------------------------------------------------------------------|
  8306. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8307. * |-----------------------------------------------------------------------|
  8308. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8309. * |-----------------------------------------------------------------------|
  8310. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8311. * |-----------------------------------------------------------------------|
  8312. * | Reserved_1 | AST index 3 |
  8313. * |-----------------------------------------------------------------------|
  8314. * | Reserved_2 |
  8315. * |-----------------------------------------------------------------------|
  8316. * Where:
  8317. * NH = Next Hop
  8318. * ASTVM = AST valid mask
  8319. * ASTFM = AST flow mask
  8320. *
  8321. * The following field definitions describe the format of the rx peer map v2
  8322. * messages sent from the target to the host.
  8323. * - MSG_TYPE
  8324. * Bits 7:0
  8325. * Purpose: identifies this as an rx peer map v2 message
  8326. * Value: peer map v2 -> 0x1e
  8327. * - VDEV_ID
  8328. * Bits 15:8
  8329. * Purpose: Indicates which virtual device the peer is associated with.
  8330. * Value: vdev ID (used in the host to look up the vdev object)
  8331. * - SW_PEER_ID
  8332. * Bits 31:16
  8333. * Purpose: The peer ID (index) that WAL is allocating
  8334. * Value: (rx) peer ID
  8335. * - MAC_ADDR_L32
  8336. * Bits 31:0
  8337. * Purpose: Identifies which peer node the peer ID is for.
  8338. * Value: lower 4 bytes of peer node's MAC address
  8339. * - MAC_ADDR_U16
  8340. * Bits 15:0
  8341. * Purpose: Identifies which peer node the peer ID is for.
  8342. * Value: upper 2 bytes of peer node's MAC address
  8343. * - HW_PEER_ID / AST_INDEX_0
  8344. * Bits 31:16
  8345. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8346. * address, so for rx frames marked for rx --> tx forwarding, the
  8347. * host can determine from the HW peer ID provided as meta-data with
  8348. * the rx frame which peer the frame is supposed to be forwarded to.
  8349. * Value: ID used by the MAC HW to identify the peer
  8350. * - AST_HASH_VALUE
  8351. * Bits 15:0
  8352. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8353. * override feature.
  8354. * - NEXT_HOP
  8355. * Bit 16
  8356. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8357. * (Wireless Distribution System).
  8358. * - AST_VALID_MASK
  8359. * Bits 19:17
  8360. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8361. * - AST_INDEX_1
  8362. * Bits 15:0
  8363. * Purpose: indicate the second AST index for this peer
  8364. * - AST_0_FLOW_MASK
  8365. * Bits 19:16
  8366. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8367. * - AST_1_FLOW_MASK
  8368. * Bits 23:20
  8369. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8370. * - AST_2_FLOW_MASK
  8371. * Bits 27:24
  8372. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8373. * - AST_3_FLOW_MASK
  8374. * Bits 31:28
  8375. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8376. * - AST_INDEX_2
  8377. * Bits 15:0
  8378. * Purpose: indicate the third AST index for this peer
  8379. * - TID_VALID_HI_PRI
  8380. * Bits 23:16
  8381. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8382. * - TID_VALID_LOW_PRI
  8383. * Bits 31:24
  8384. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8385. * - AST_INDEX_3
  8386. * Bits 15:0
  8387. * Purpose: indicate the fourth AST index for this peer
  8388. */
  8389. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8390. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8391. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8392. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8393. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8394. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8395. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8396. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8397. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8398. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8399. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8400. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8401. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8402. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8403. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8404. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8405. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8406. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8407. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8408. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8409. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8410. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8411. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8412. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8413. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8414. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8415. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8416. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8417. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8418. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8419. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8420. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8421. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8422. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8423. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8426. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8427. } while (0)
  8428. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8429. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8430. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8433. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8434. } while (0)
  8435. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8436. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8437. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8440. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8441. } while (0)
  8442. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8443. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8444. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8445. do { \
  8446. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8447. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8448. } while (0)
  8449. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8450. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8451. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8454. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8455. } while (0)
  8456. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8457. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8458. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8459. do { \
  8460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8461. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8462. } while (0)
  8463. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8464. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8465. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8466. do { \
  8467. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8468. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8469. } while (0)
  8470. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8471. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8472. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8473. do { \
  8474. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8475. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8476. } while (0)
  8477. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8478. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8479. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8480. do { \
  8481. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8482. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8483. } while (0)
  8484. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8485. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8486. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8489. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8490. } while (0)
  8491. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8492. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8493. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8494. do { \
  8495. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8496. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8497. } while (0)
  8498. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8499. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8500. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8503. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8504. } while (0)
  8505. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8506. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8507. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8508. do { \
  8509. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8510. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8511. } while (0)
  8512. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8513. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8514. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8515. do { \
  8516. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8517. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8518. } while (0)
  8519. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8520. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8521. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8524. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8525. } while (0)
  8526. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8527. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8528. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8529. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8530. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8531. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8532. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8533. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8534. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8535. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8536. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8537. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8538. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8539. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8540. /**
  8541. * @brief target -> host rx peer unmap V2 message definition
  8542. *
  8543. *
  8544. * The following diagram shows the format of the rx peer unmap message sent
  8545. * from the target to the host.
  8546. *
  8547. * |31 24|23 16|15 8|7 0|
  8548. * |-----------------------------------------------------------------------|
  8549. * | SW peer ID | VDEV ID | msg type |
  8550. * |-----------------------------------------------------------------------|
  8551. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8552. * |-----------------------------------------------------------------------|
  8553. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8554. * |-----------------------------------------------------------------------|
  8555. * | Peer Delete Duration |
  8556. * |-----------------------------------------------------------------------|
  8557. * | Reserved_0 |
  8558. * |-----------------------------------------------------------------------|
  8559. * | Reserved_1 |
  8560. * |-----------------------------------------------------------------------|
  8561. * | Reserved_2 |
  8562. * |-----------------------------------------------------------------------|
  8563. *
  8564. *
  8565. * The following field definitions describe the format of the rx peer unmap
  8566. * messages sent from the target to the host.
  8567. * - MSG_TYPE
  8568. * Bits 7:0
  8569. * Purpose: identifies this as an rx peer unmap v2 message
  8570. * Value: peer unmap v2 -> 0x1f
  8571. * - VDEV_ID
  8572. * Bits 15:8
  8573. * Purpose: Indicates which virtual device the peer is associated
  8574. * with.
  8575. * Value: vdev ID (used in the host to look up the vdev object)
  8576. * - SW_PEER_ID
  8577. * Bits 31:16
  8578. * Purpose: The peer ID (index) that WAL is freeing
  8579. * Value: (rx) peer ID
  8580. * - MAC_ADDR_L32
  8581. * Bits 31:0
  8582. * Purpose: Identifies which peer node the peer ID is for.
  8583. * Value: lower 4 bytes of peer node's MAC address
  8584. * - MAC_ADDR_U16
  8585. * Bits 15:0
  8586. * Purpose: Identifies which peer node the peer ID is for.
  8587. * Value: upper 2 bytes of peer node's MAC address
  8588. * - NEXT_HOP
  8589. * Bits 16
  8590. * Purpose: Bit indicates next_hop AST entry used for WDS
  8591. * (Wireless Distribution System).
  8592. * - PEER_DELETE_DURATION
  8593. * Bits 31:0
  8594. * Purpose: Time taken to delete peer, in msec,
  8595. * Used for monitoring / debugging PEER delete response delay
  8596. */
  8597. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8598. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8599. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8600. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8601. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8602. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8603. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8604. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8605. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8606. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8607. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8608. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8609. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8610. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8611. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8612. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8613. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8614. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8615. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8616. do { \
  8617. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8618. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8619. } while (0)
  8620. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8621. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8622. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8623. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8624. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8625. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8626. /**
  8627. * @brief target -> host message specifying security parameters
  8628. *
  8629. * @details
  8630. * The following diagram shows the format of the security specification
  8631. * message sent from the target to the host.
  8632. * This security specification message tells the host whether a PN check is
  8633. * necessary on rx data frames, and if so, how large the PN counter is.
  8634. * This message also tells the host about the security processing to apply
  8635. * to defragmented rx frames - specifically, whether a Message Integrity
  8636. * Check is required, and the Michael key to use.
  8637. *
  8638. * |31 24|23 16|15|14 8|7 0|
  8639. * |-----------------------------------------------------------------------|
  8640. * | peer ID | U| security type | msg type |
  8641. * |-----------------------------------------------------------------------|
  8642. * | Michael Key K0 |
  8643. * |-----------------------------------------------------------------------|
  8644. * | Michael Key K1 |
  8645. * |-----------------------------------------------------------------------|
  8646. * | WAPI RSC Low0 |
  8647. * |-----------------------------------------------------------------------|
  8648. * | WAPI RSC Low1 |
  8649. * |-----------------------------------------------------------------------|
  8650. * | WAPI RSC Hi0 |
  8651. * |-----------------------------------------------------------------------|
  8652. * | WAPI RSC Hi1 |
  8653. * |-----------------------------------------------------------------------|
  8654. *
  8655. * The following field definitions describe the format of the security
  8656. * indication message sent from the target to the host.
  8657. * - MSG_TYPE
  8658. * Bits 7:0
  8659. * Purpose: identifies this as a security specification message
  8660. * Value: 0xb
  8661. * - SEC_TYPE
  8662. * Bits 14:8
  8663. * Purpose: specifies which type of security applies to the peer
  8664. * Value: htt_sec_type enum value
  8665. * - UNICAST
  8666. * Bit 15
  8667. * Purpose: whether this security is applied to unicast or multicast data
  8668. * Value: 1 -> unicast, 0 -> multicast
  8669. * - PEER_ID
  8670. * Bits 31:16
  8671. * Purpose: The ID number for the peer the security specification is for
  8672. * Value: peer ID
  8673. * - MICHAEL_KEY_K0
  8674. * Bits 31:0
  8675. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8676. * Value: Michael Key K0 (if security type is TKIP)
  8677. * - MICHAEL_KEY_K1
  8678. * Bits 31:0
  8679. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8680. * Value: Michael Key K1 (if security type is TKIP)
  8681. * - WAPI_RSC_LOW0
  8682. * Bits 31:0
  8683. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8684. * Value: WAPI RSC Low0 (if security type is WAPI)
  8685. * - WAPI_RSC_LOW1
  8686. * Bits 31:0
  8687. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8688. * Value: WAPI RSC Low1 (if security type is WAPI)
  8689. * - WAPI_RSC_HI0
  8690. * Bits 31:0
  8691. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8692. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8693. * - WAPI_RSC_HI1
  8694. * Bits 31:0
  8695. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8696. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8697. */
  8698. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8699. #define HTT_SEC_IND_SEC_TYPE_S 8
  8700. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8701. #define HTT_SEC_IND_UNICAST_S 15
  8702. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8703. #define HTT_SEC_IND_PEER_ID_S 16
  8704. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8705. do { \
  8706. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8707. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8708. } while (0)
  8709. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8710. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8711. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8714. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8715. } while (0)
  8716. #define HTT_SEC_IND_UNICAST_GET(word) \
  8717. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8718. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8719. do { \
  8720. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8721. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8722. } while (0)
  8723. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8724. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8725. #define HTT_SEC_IND_BYTES 28
  8726. /**
  8727. * @brief target -> host rx ADDBA / DELBA message definitions
  8728. *
  8729. * @details
  8730. * The following diagram shows the format of the rx ADDBA message sent
  8731. * from the target to the host:
  8732. *
  8733. * |31 20|19 16|15 8|7 0|
  8734. * |---------------------------------------------------------------------|
  8735. * | peer ID | TID | window size | msg type |
  8736. * |---------------------------------------------------------------------|
  8737. *
  8738. * The following diagram shows the format of the rx DELBA message sent
  8739. * from the target to the host:
  8740. *
  8741. * |31 20|19 16|15 10|9 8|7 0|
  8742. * |---------------------------------------------------------------------|
  8743. * | peer ID | TID | reserved | IR| msg type |
  8744. * |---------------------------------------------------------------------|
  8745. *
  8746. * The following field definitions describe the format of the rx ADDBA
  8747. * and DELBA messages sent from the target to the host.
  8748. * - MSG_TYPE
  8749. * Bits 7:0
  8750. * Purpose: identifies this as an rx ADDBA or DELBA message
  8751. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8752. * - IR (initiator / recipient)
  8753. * Bits 9:8 (DELBA only)
  8754. * Purpose: specify whether the DELBA handshake was initiated by the
  8755. * local STA/AP, or by the peer STA/AP
  8756. * Value:
  8757. * 0 - unspecified
  8758. * 1 - initiator (a.k.a. originator)
  8759. * 2 - recipient (a.k.a. responder)
  8760. * 3 - unused / reserved
  8761. * - WIN_SIZE
  8762. * Bits 15:8 (ADDBA only)
  8763. * Purpose: Specifies the length of the block ack window (max = 64).
  8764. * Value:
  8765. * block ack window length specified by the received ADDBA
  8766. * management message.
  8767. * - TID
  8768. * Bits 19:16
  8769. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8770. * Value:
  8771. * TID specified by the received ADDBA or DELBA management message.
  8772. * - PEER_ID
  8773. * Bits 31:20
  8774. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8775. * Value:
  8776. * ID (hash value) used by the host for fast, direct lookup of
  8777. * host SW peer info, including rx reorder states.
  8778. */
  8779. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8780. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8781. #define HTT_RX_ADDBA_TID_M 0xf0000
  8782. #define HTT_RX_ADDBA_TID_S 16
  8783. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8784. #define HTT_RX_ADDBA_PEER_ID_S 20
  8785. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8786. do { \
  8787. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8788. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8789. } while (0)
  8790. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8791. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8792. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8793. do { \
  8794. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8795. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8796. } while (0)
  8797. #define HTT_RX_ADDBA_TID_GET(word) \
  8798. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8799. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8800. do { \
  8801. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8802. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8803. } while (0)
  8804. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8805. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8806. #define HTT_RX_ADDBA_BYTES 4
  8807. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8808. #define HTT_RX_DELBA_INITIATOR_S 8
  8809. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8810. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8811. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8812. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8813. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8814. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8815. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8816. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8817. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8820. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8821. } while (0)
  8822. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8823. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8824. #define HTT_RX_DELBA_BYTES 4
  8825. /**
  8826. * @brief tx queue group information element definition
  8827. *
  8828. * @details
  8829. * The following diagram shows the format of the tx queue group
  8830. * information element, which can be included in target --> host
  8831. * messages to specify the number of tx "credits" (tx descriptors
  8832. * for LL, or tx buffers for HL) available to a particular group
  8833. * of host-side tx queues, and which host-side tx queues belong to
  8834. * the group.
  8835. *
  8836. * |31|30 24|23 16|15|14|13 0|
  8837. * |------------------------------------------------------------------------|
  8838. * | X| reserved | tx queue grp ID | A| S| credit count |
  8839. * |------------------------------------------------------------------------|
  8840. * | vdev ID mask | AC mask |
  8841. * |------------------------------------------------------------------------|
  8842. *
  8843. * The following definitions describe the fields within the tx queue group
  8844. * information element:
  8845. * - credit_count
  8846. * Bits 13:1
  8847. * Purpose: specify how many tx credits are available to the tx queue group
  8848. * Value: An absolute or relative, positive or negative credit value
  8849. * The 'A' bit specifies whether the value is absolute or relative.
  8850. * The 'S' bit specifies whether the value is positive or negative.
  8851. * A negative value can only be relative, not absolute.
  8852. * An absolute value replaces any prior credit value the host has for
  8853. * the tx queue group in question.
  8854. * A relative value is added to the prior credit value the host has for
  8855. * the tx queue group in question.
  8856. * - sign
  8857. * Bit 14
  8858. * Purpose: specify whether the credit count is positive or negative
  8859. * Value: 0 -> positive, 1 -> negative
  8860. * - absolute
  8861. * Bit 15
  8862. * Purpose: specify whether the credit count is absolute or relative
  8863. * Value: 0 -> relative, 1 -> absolute
  8864. * - txq_group_id
  8865. * Bits 23:16
  8866. * Purpose: indicate which tx queue group's credit and/or membership are
  8867. * being specified
  8868. * Value: 0 to max_tx_queue_groups-1
  8869. * - reserved
  8870. * Bits 30:16
  8871. * Value: 0x0
  8872. * - eXtension
  8873. * Bit 31
  8874. * Purpose: specify whether another tx queue group info element follows
  8875. * Value: 0 -> no more tx queue group information elements
  8876. * 1 -> another tx queue group information element immediately follows
  8877. * - ac_mask
  8878. * Bits 15:0
  8879. * Purpose: specify which Access Categories belong to the tx queue group
  8880. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8881. * the tx queue group.
  8882. * The AC bit-mask values are obtained by left-shifting by the
  8883. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8884. * - vdev_id_mask
  8885. * Bits 31:16
  8886. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8887. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8888. * belong to the tx queue group.
  8889. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8890. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8891. */
  8892. PREPACK struct htt_txq_group {
  8893. A_UINT32
  8894. credit_count: 14,
  8895. sign: 1,
  8896. absolute: 1,
  8897. tx_queue_group_id: 8,
  8898. reserved0: 7,
  8899. extension: 1;
  8900. A_UINT32
  8901. ac_mask: 16,
  8902. vdev_id_mask: 16;
  8903. } POSTPACK;
  8904. /* first word */
  8905. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8906. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8907. #define HTT_TXQ_GROUP_SIGN_S 14
  8908. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8909. #define HTT_TXQ_GROUP_ABS_S 15
  8910. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8911. #define HTT_TXQ_GROUP_ID_S 16
  8912. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8913. #define HTT_TXQ_GROUP_EXT_S 31
  8914. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8915. /* second word */
  8916. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8917. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8918. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8919. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8920. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8921. do { \
  8922. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8923. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8924. } while (0)
  8925. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8926. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8927. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8928. do { \
  8929. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8930. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8931. } while (0)
  8932. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8933. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8934. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8935. do { \
  8936. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8937. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8938. } while (0)
  8939. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8940. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8941. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8942. do { \
  8943. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8944. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8945. } while (0)
  8946. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8947. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8948. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8949. do { \
  8950. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8951. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8952. } while (0)
  8953. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8954. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8955. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8956. do { \
  8957. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8958. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8959. } while (0)
  8960. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8961. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8962. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8963. do { \
  8964. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8965. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8966. } while (0)
  8967. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8968. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8969. /**
  8970. * @brief target -> host TX completion indication message definition
  8971. *
  8972. * @details
  8973. * The following diagram shows the format of the TX completion indication sent
  8974. * from the target to the host
  8975. *
  8976. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8977. * |-------------------------------------------------------------------|
  8978. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8979. * |-------------------------------------------------------------------|
  8980. * payload:| MSDU1 ID | MSDU0 ID |
  8981. * |-------------------------------------------------------------------|
  8982. * : MSDU3 ID | MSDU2 ID :
  8983. * |-------------------------------------------------------------------|
  8984. * | struct htt_tx_compl_ind_append_retries |
  8985. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8986. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8987. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8988. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8989. * |-------------------------------------------------------------------|
  8990. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8991. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8992. * | MSDU0 tx_tsf64_low |
  8993. * |-------------------------------------------------------------------|
  8994. * | MSDU0 tx_tsf64_high |
  8995. * |-------------------------------------------------------------------|
  8996. * | MSDU1 tx_tsf64_low |
  8997. * |-------------------------------------------------------------------|
  8998. * | MSDU1 tx_tsf64_high |
  8999. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9000. * | phy_timestamp |
  9001. * |-------------------------------------------------------------------|
  9002. * | rate specs (see below) |
  9003. * |-------------------------------------------------------------------|
  9004. * | seqctrl | framectrl |
  9005. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9006. * Where:
  9007. * A0 = append (a.k.a. append0)
  9008. * A1 = append1
  9009. * TP = MSDU tx power presence
  9010. * A2 = append2
  9011. * A3 = append3
  9012. * A4 = append4
  9013. *
  9014. * The following field definitions describe the format of the TX completion
  9015. * indication sent from the target to the host
  9016. * Header fields:
  9017. * - msg_type
  9018. * Bits 7:0
  9019. * Purpose: identifies this as HTT TX completion indication
  9020. * Value: 0x7
  9021. * - status
  9022. * Bits 10:8
  9023. * Purpose: the TX completion status of payload fragmentations descriptors
  9024. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9025. * - tid
  9026. * Bits 14:11
  9027. * Purpose: the tid associated with those fragmentation descriptors. It is
  9028. * valid or not, depending on the tid_invalid bit.
  9029. * Value: 0 to 15
  9030. * - tid_invalid
  9031. * Bits 15:15
  9032. * Purpose: this bit indicates whether the tid field is valid or not
  9033. * Value: 0 indicates valid; 1 indicates invalid
  9034. * - num
  9035. * Bits 23:16
  9036. * Purpose: the number of payload in this indication
  9037. * Value: 1 to 255
  9038. * - append (a.k.a. append0)
  9039. * Bits 24:24
  9040. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9041. * the number of tx retries for one MSDU at the end of this message
  9042. * Value: 0 indicates no appending; 1 indicates appending
  9043. * - append1
  9044. * Bits 25:25
  9045. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9046. * contains the timestamp info for each TX msdu id in payload.
  9047. * The order of the timestamps matches the order of the MSDU IDs.
  9048. * Note that a big-endian host needs to account for the reordering
  9049. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9050. * conversion) when determining which tx timestamp corresponds to
  9051. * which MSDU ID.
  9052. * Value: 0 indicates no appending; 1 indicates appending
  9053. * - msdu_tx_power_presence
  9054. * Bits 26:26
  9055. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9056. * for each MSDU referenced by the TX_COMPL_IND message.
  9057. * The tx power is reported in 0.5 dBm units.
  9058. * The order of the per-MSDU tx power reports matches the order
  9059. * of the MSDU IDs.
  9060. * Note that a big-endian host needs to account for the reordering
  9061. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9062. * conversion) when determining which Tx Power corresponds to
  9063. * which MSDU ID.
  9064. * Value: 0 indicates MSDU tx power reports are not appended,
  9065. * 1 indicates MSDU tx power reports are appended
  9066. * - append2
  9067. * Bits 27:27
  9068. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9069. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9070. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9071. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9072. * for each MSDU, for convenience.
  9073. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9074. * this append2 bit is set).
  9075. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9076. * dB above the noise floor.
  9077. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9078. * 1 indicates MSDU ACK RSSI values are appended.
  9079. * - append3
  9080. * Bits 28:28
  9081. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9082. * contains the tx tsf info based on wlan global TSF for
  9083. * each TX msdu id in payload.
  9084. * The order of the tx tsf matches the order of the MSDU IDs.
  9085. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9086. * values to indicate the the lower 32 bits and higher 32 bits of
  9087. * the tx tsf.
  9088. * The tx_tsf64 here represents the time MSDU was acked and the
  9089. * tx_tsf64 has microseconds units.
  9090. * Value: 0 indicates no appending; 1 indicates appending
  9091. * - append4
  9092. * Bits 29:29
  9093. * Purpose: Indicate whether data frame control fields and fields required
  9094. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9095. * message. The order of the this message matches the order of
  9096. * the MSDU IDs.
  9097. * Value: 0 indicates frame control fields and fields required for
  9098. * radio tap header values are not appended,
  9099. * 1 indicates frame control fields and fields required for
  9100. * radio tap header values are appended.
  9101. * Payload fields:
  9102. * - hmsdu_id
  9103. * Bits 15:0
  9104. * Purpose: this ID is used to track the Tx buffer in host
  9105. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9106. */
  9107. PREPACK struct htt_tx_data_hdr_information {
  9108. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9109. A_UINT32 /* word 1 */
  9110. /* preamble:
  9111. * 0-OFDM,
  9112. * 1-CCk,
  9113. * 2-HT,
  9114. * 3-VHT
  9115. */
  9116. preamble: 2, /* [1:0] */
  9117. /* mcs:
  9118. * In case of HT preamble interpret
  9119. * MCS along with NSS.
  9120. * Valid values for HT are 0 to 7.
  9121. * HT mcs 0 with NSS 2 is mcs 8.
  9122. * Valid values for VHT are 0 to 9.
  9123. */
  9124. mcs: 4, /* [5:2] */
  9125. /* rate:
  9126. * This is applicable only for
  9127. * CCK and OFDM preamble type
  9128. * rate 0: OFDM 48 Mbps,
  9129. * 1: OFDM 24 Mbps,
  9130. * 2: OFDM 12 Mbps
  9131. * 3: OFDM 6 Mbps
  9132. * 4: OFDM 54 Mbps
  9133. * 5: OFDM 36 Mbps
  9134. * 6: OFDM 18 Mbps
  9135. * 7: OFDM 9 Mbps
  9136. * rate 0: CCK 11 Mbps Long
  9137. * 1: CCK 5.5 Mbps Long
  9138. * 2: CCK 2 Mbps Long
  9139. * 3: CCK 1 Mbps Long
  9140. * 4: CCK 11 Mbps Short
  9141. * 5: CCK 5.5 Mbps Short
  9142. * 6: CCK 2 Mbps Short
  9143. */
  9144. rate : 3, /* [ 8: 6] */
  9145. rssi : 8, /* [16: 9] units=dBm */
  9146. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9147. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9148. stbc : 1, /* [22] */
  9149. sgi : 1, /* [23] */
  9150. ldpc : 1, /* [24] */
  9151. beamformed: 1, /* [25] */
  9152. /* tx_retry_cnt:
  9153. * Indicates retry count of data tx frames provided by the host.
  9154. */
  9155. tx_retry_cnt: 6; /* [31:26] */
  9156. A_UINT32 /* word 2 */
  9157. framectrl:16, /* [15: 0] */
  9158. seqno:16; /* [31:16] */
  9159. } POSTPACK;
  9160. #define HTT_TX_COMPL_IND_STATUS_S 8
  9161. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9162. #define HTT_TX_COMPL_IND_TID_S 11
  9163. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9164. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9165. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9166. #define HTT_TX_COMPL_IND_NUM_S 16
  9167. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9168. #define HTT_TX_COMPL_IND_APPEND_S 24
  9169. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9170. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9171. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9172. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9173. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9174. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9175. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9176. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9177. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9178. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9179. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9180. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9181. do { \
  9182. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9183. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9184. } while (0)
  9185. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9186. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9187. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9190. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9191. } while (0)
  9192. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9193. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9194. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9195. do { \
  9196. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9197. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9198. } while (0)
  9199. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9200. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9201. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9204. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9205. } while (0)
  9206. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9207. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9208. HTT_TX_COMPL_IND_TID_INV_S)
  9209. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9210. do { \
  9211. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9212. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9213. } while (0)
  9214. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9215. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9216. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9217. do { \
  9218. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9219. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9220. } while (0)
  9221. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9222. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9223. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9224. do { \
  9225. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9226. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9227. } while (0)
  9228. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9229. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9230. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9231. do { \
  9232. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9233. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9234. } while (0)
  9235. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9236. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9237. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9238. do { \
  9239. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9240. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9241. } while (0)
  9242. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9243. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9244. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9247. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9248. } while (0)
  9249. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9250. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9251. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9252. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9253. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9254. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9255. #define HTT_TX_COMPL_IND_STAT_OK 0
  9256. /* DISCARD:
  9257. * current meaning:
  9258. * MSDUs were queued for transmission but filtered by HW or SW
  9259. * without any over the air attempts
  9260. * legacy meaning (HL Rome):
  9261. * MSDUs were discarded by the target FW without any over the air
  9262. * attempts due to lack of space
  9263. */
  9264. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9265. /* NO_ACK:
  9266. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9267. */
  9268. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9269. /* POSTPONE:
  9270. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9271. * be downloaded again later (in the appropriate order), when they are
  9272. * deliverable.
  9273. */
  9274. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9275. /*
  9276. * The PEER_DEL tx completion status is used for HL cases
  9277. * where the peer the frame is for has been deleted.
  9278. * The host has already discarded its copy of the frame, but
  9279. * it still needs the tx completion to restore its credit.
  9280. */
  9281. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9282. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9283. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9284. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9285. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9286. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9287. PREPACK struct htt_tx_compl_ind_base {
  9288. A_UINT32 hdr;
  9289. A_UINT16 payload[1/*or more*/];
  9290. } POSTPACK;
  9291. PREPACK struct htt_tx_compl_ind_append_retries {
  9292. A_UINT16 msdu_id;
  9293. A_UINT8 tx_retries;
  9294. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9295. 0: this is the last append_retries struct */
  9296. } POSTPACK;
  9297. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9298. A_UINT32 timestamp[1/*or more*/];
  9299. } POSTPACK;
  9300. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9301. A_UINT32 tx_tsf64_low;
  9302. A_UINT32 tx_tsf64_high;
  9303. } POSTPACK;
  9304. /* htt_tx_data_hdr_information payload extension fields: */
  9305. /* DWORD zero */
  9306. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9307. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9308. /* DWORD one */
  9309. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9310. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9311. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9312. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9313. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9314. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9315. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9316. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9317. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9318. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9319. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9320. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9321. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9322. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9323. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9324. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9325. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9326. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9327. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9328. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9329. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9330. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9331. /* DWORD two */
  9332. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9333. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9334. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9335. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9336. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9337. do { \
  9338. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9339. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9340. } while (0)
  9341. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9342. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9343. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9344. do { \
  9345. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9346. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9347. } while (0)
  9348. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9349. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9350. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9351. do { \
  9352. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9353. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9354. } while (0)
  9355. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9356. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9357. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9358. do { \
  9359. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9360. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9361. } while (0)
  9362. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9363. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9364. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9365. do { \
  9366. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9367. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9368. } while (0)
  9369. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9370. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9371. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9372. do { \
  9373. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9374. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9375. } while (0)
  9376. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9377. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9378. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9379. do { \
  9380. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9381. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9382. } while (0)
  9383. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9384. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9385. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9386. do { \
  9387. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9388. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9389. } while (0)
  9390. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9391. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9392. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9393. do { \
  9394. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9395. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9396. } while (0)
  9397. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9398. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9399. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9402. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9403. } while (0)
  9404. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9405. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9406. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9407. do { \
  9408. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9409. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9410. } while (0)
  9411. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9412. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9413. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9414. do { \
  9415. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9416. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9417. } while (0)
  9418. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9419. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9420. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9421. do { \
  9422. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9423. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9424. } while (0)
  9425. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9426. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9427. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9430. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9431. } while (0)
  9432. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9433. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9434. /**
  9435. * @brief target -> host rate-control update indication message
  9436. *
  9437. * @details
  9438. * The following diagram shows the format of the RC Update message
  9439. * sent from the target to the host, while processing the tx-completion
  9440. * of a transmitted PPDU.
  9441. *
  9442. * |31 24|23 16|15 8|7 0|
  9443. * |-------------------------------------------------------------|
  9444. * | peer ID | vdev ID | msg_type |
  9445. * |-------------------------------------------------------------|
  9446. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9447. * |-------------------------------------------------------------|
  9448. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9449. * |-------------------------------------------------------------|
  9450. * | : |
  9451. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9452. * | : |
  9453. * |-------------------------------------------------------------|
  9454. * | : |
  9455. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9456. * | : |
  9457. * |-------------------------------------------------------------|
  9458. * : :
  9459. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9460. *
  9461. */
  9462. typedef struct {
  9463. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9464. A_UINT32 rate_code_flags;
  9465. A_UINT32 flags; /* Encodes information such as excessive
  9466. retransmission, aggregate, some info
  9467. from .11 frame control,
  9468. STBC, LDPC, (SGI and Tx Chain Mask
  9469. are encoded in ptx_rc->flags field),
  9470. AMPDU truncation (BT/time based etc.),
  9471. RTS/CTS attempt */
  9472. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9473. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9474. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9475. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9476. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9477. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9478. } HTT_RC_TX_DONE_PARAMS;
  9479. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9480. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9481. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9482. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9483. #define HTT_RC_UPDATE_VDEVID_S 8
  9484. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9485. #define HTT_RC_UPDATE_PEERID_S 16
  9486. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9487. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9488. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9489. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9490. do { \
  9491. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9492. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9493. } while (0)
  9494. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9495. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9496. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9497. do { \
  9498. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9499. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9500. } while (0)
  9501. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9502. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9503. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9504. do { \
  9505. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9506. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9507. } while (0)
  9508. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9509. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9510. /**
  9511. * @brief target -> host rx fragment indication message definition
  9512. *
  9513. * @details
  9514. * The following field definitions describe the format of the rx fragment
  9515. * indication message sent from the target to the host.
  9516. * The rx fragment indication message shares the format of the
  9517. * rx indication message, but not all fields from the rx indication message
  9518. * are relevant to the rx fragment indication message.
  9519. *
  9520. *
  9521. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9522. * |-----------+-------------------+---------------------+-------------|
  9523. * | peer ID | |FV| ext TID | msg type |
  9524. * |-------------------------------------------------------------------|
  9525. * | | flush | flush |
  9526. * | | end | start |
  9527. * | | seq num | seq num |
  9528. * |-------------------------------------------------------------------|
  9529. * | reserved | FW rx desc bytes |
  9530. * |-------------------------------------------------------------------|
  9531. * | | FW MSDU Rx |
  9532. * | | desc B0 |
  9533. * |-------------------------------------------------------------------|
  9534. * Header fields:
  9535. * - MSG_TYPE
  9536. * Bits 7:0
  9537. * Purpose: identifies this as an rx fragment indication message
  9538. * Value: 0xa
  9539. * - EXT_TID
  9540. * Bits 12:8
  9541. * Purpose: identify the traffic ID of the rx data, including
  9542. * special "extended" TID values for multicast, broadcast, and
  9543. * non-QoS data frames
  9544. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9545. * - FLUSH_VALID (FV)
  9546. * Bit 13
  9547. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9548. * is valid
  9549. * Value:
  9550. * 1 -> flush IE is valid and needs to be processed
  9551. * 0 -> flush IE is not valid and should be ignored
  9552. * - PEER_ID
  9553. * Bits 31:16
  9554. * Purpose: Identify, by ID, which peer sent the rx data
  9555. * Value: ID of the peer who sent the rx data
  9556. * - FLUSH_SEQ_NUM_START
  9557. * Bits 5:0
  9558. * Purpose: Indicate the start of a series of MPDUs to flush
  9559. * Not all MPDUs within this series are necessarily valid - the host
  9560. * must check each sequence number within this range to see if the
  9561. * corresponding MPDU is actually present.
  9562. * This field is only valid if the FV bit is set.
  9563. * Value:
  9564. * The sequence number for the first MPDUs to check to flush.
  9565. * The sequence number is masked by 0x3f.
  9566. * - FLUSH_SEQ_NUM_END
  9567. * Bits 11:6
  9568. * Purpose: Indicate the end of a series of MPDUs to flush
  9569. * Value:
  9570. * The sequence number one larger than the sequence number of the
  9571. * last MPDU to check to flush.
  9572. * The sequence number is masked by 0x3f.
  9573. * Not all MPDUs within this series are necessarily valid - the host
  9574. * must check each sequence number within this range to see if the
  9575. * corresponding MPDU is actually present.
  9576. * This field is only valid if the FV bit is set.
  9577. * Rx descriptor fields:
  9578. * - FW_RX_DESC_BYTES
  9579. * Bits 15:0
  9580. * Purpose: Indicate how many bytes in the Rx indication are used for
  9581. * FW Rx descriptors
  9582. * Value: 1
  9583. */
  9584. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9585. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9586. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9587. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9588. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9589. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9590. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9591. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9592. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9593. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9594. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9595. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9596. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9597. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9598. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9599. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9600. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9601. #define HTT_RX_FRAG_IND_BYTES \
  9602. (4 /* msg hdr */ + \
  9603. 4 /* flush spec */ + \
  9604. 4 /* (unused) FW rx desc bytes spec */ + \
  9605. 4 /* FW rx desc */)
  9606. /**
  9607. * @brief target -> host test message definition
  9608. *
  9609. * @details
  9610. * The following field definitions describe the format of the test
  9611. * message sent from the target to the host.
  9612. * The message consists of a 4-octet header, followed by a variable
  9613. * number of 32-bit integer values, followed by a variable number
  9614. * of 8-bit character values.
  9615. *
  9616. * |31 16|15 8|7 0|
  9617. * |-----------------------------------------------------------|
  9618. * | num chars | num ints | msg type |
  9619. * |-----------------------------------------------------------|
  9620. * | int 0 |
  9621. * |-----------------------------------------------------------|
  9622. * | int 1 |
  9623. * |-----------------------------------------------------------|
  9624. * | ... |
  9625. * |-----------------------------------------------------------|
  9626. * | char 3 | char 2 | char 1 | char 0 |
  9627. * |-----------------------------------------------------------|
  9628. * | | | ... | char 4 |
  9629. * |-----------------------------------------------------------|
  9630. * - MSG_TYPE
  9631. * Bits 7:0
  9632. * Purpose: identifies this as a test message
  9633. * Value: HTT_MSG_TYPE_TEST
  9634. * - NUM_INTS
  9635. * Bits 15:8
  9636. * Purpose: indicate how many 32-bit integers follow the message header
  9637. * - NUM_CHARS
  9638. * Bits 31:16
  9639. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9640. */
  9641. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9642. #define HTT_RX_TEST_NUM_INTS_S 8
  9643. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9644. #define HTT_RX_TEST_NUM_CHARS_S 16
  9645. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9646. do { \
  9647. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9648. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9649. } while (0)
  9650. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9651. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9652. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9653. do { \
  9654. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9655. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9656. } while (0)
  9657. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9658. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9659. /**
  9660. * @brief target -> host packet log message
  9661. *
  9662. * @details
  9663. * The following field definitions describe the format of the packet log
  9664. * message sent from the target to the host.
  9665. * The message consists of a 4-octet header,followed by a variable number
  9666. * of 32-bit character values.
  9667. *
  9668. * |31 16|15 12|11 10|9 8|7 0|
  9669. * |------------------------------------------------------------------|
  9670. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9671. * |------------------------------------------------------------------|
  9672. * | payload |
  9673. * |------------------------------------------------------------------|
  9674. * - MSG_TYPE
  9675. * Bits 7:0
  9676. * Purpose: identifies this as a pktlog message
  9677. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9678. * - mac_id
  9679. * Bits 9:8
  9680. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9681. * Value: 0-3
  9682. * - pdev_id
  9683. * Bits 11:10
  9684. * Purpose: pdev_id
  9685. * Value: 0-3
  9686. * 0 (for rings at SOC level),
  9687. * 1/2/3 PDEV -> 0/1/2
  9688. * - payload_size
  9689. * Bits 31:16
  9690. * Purpose: explicitly specify the payload size
  9691. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9692. */
  9693. PREPACK struct htt_pktlog_msg {
  9694. A_UINT32 header;
  9695. A_UINT32 payload[1/* or more */];
  9696. } POSTPACK;
  9697. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9698. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9699. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9700. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9701. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9702. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9703. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9704. do { \
  9705. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9706. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9707. } while (0)
  9708. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9709. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9710. HTT_T2H_PKTLOG_MAC_ID_S)
  9711. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9712. do { \
  9713. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9714. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9715. } while (0)
  9716. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9717. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9718. HTT_T2H_PKTLOG_PDEV_ID_S)
  9719. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9720. do { \
  9721. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9722. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9723. } while (0)
  9724. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9725. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9726. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9727. /*
  9728. * Rx reorder statistics
  9729. * NB: all the fields must be defined in 4 octets size.
  9730. */
  9731. struct rx_reorder_stats {
  9732. /* Non QoS MPDUs received */
  9733. A_UINT32 deliver_non_qos;
  9734. /* MPDUs received in-order */
  9735. A_UINT32 deliver_in_order;
  9736. /* Flush due to reorder timer expired */
  9737. A_UINT32 deliver_flush_timeout;
  9738. /* Flush due to move out of window */
  9739. A_UINT32 deliver_flush_oow;
  9740. /* Flush due to DELBA */
  9741. A_UINT32 deliver_flush_delba;
  9742. /* MPDUs dropped due to FCS error */
  9743. A_UINT32 fcs_error;
  9744. /* MPDUs dropped due to monitor mode non-data packet */
  9745. A_UINT32 mgmt_ctrl;
  9746. /* Unicast-data MPDUs dropped due to invalid peer */
  9747. A_UINT32 invalid_peer;
  9748. /* MPDUs dropped due to duplication (non aggregation) */
  9749. A_UINT32 dup_non_aggr;
  9750. /* MPDUs dropped due to processed before */
  9751. A_UINT32 dup_past;
  9752. /* MPDUs dropped due to duplicate in reorder queue */
  9753. A_UINT32 dup_in_reorder;
  9754. /* Reorder timeout happened */
  9755. A_UINT32 reorder_timeout;
  9756. /* invalid bar ssn */
  9757. A_UINT32 invalid_bar_ssn;
  9758. /* reorder reset due to bar ssn */
  9759. A_UINT32 ssn_reset;
  9760. /* Flush due to delete peer */
  9761. A_UINT32 deliver_flush_delpeer;
  9762. /* Flush due to offload*/
  9763. A_UINT32 deliver_flush_offload;
  9764. /* Flush due to out of buffer*/
  9765. A_UINT32 deliver_flush_oob;
  9766. /* MPDUs dropped due to PN check fail */
  9767. A_UINT32 pn_fail;
  9768. /* MPDUs dropped due to unable to allocate memory */
  9769. A_UINT32 store_fail;
  9770. /* Number of times the tid pool alloc succeeded */
  9771. A_UINT32 tid_pool_alloc_succ;
  9772. /* Number of times the MPDU pool alloc succeeded */
  9773. A_UINT32 mpdu_pool_alloc_succ;
  9774. /* Number of times the MSDU pool alloc succeeded */
  9775. A_UINT32 msdu_pool_alloc_succ;
  9776. /* Number of times the tid pool alloc failed */
  9777. A_UINT32 tid_pool_alloc_fail;
  9778. /* Number of times the MPDU pool alloc failed */
  9779. A_UINT32 mpdu_pool_alloc_fail;
  9780. /* Number of times the MSDU pool alloc failed */
  9781. A_UINT32 msdu_pool_alloc_fail;
  9782. /* Number of times the tid pool freed */
  9783. A_UINT32 tid_pool_free;
  9784. /* Number of times the MPDU pool freed */
  9785. A_UINT32 mpdu_pool_free;
  9786. /* Number of times the MSDU pool freed */
  9787. A_UINT32 msdu_pool_free;
  9788. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9789. A_UINT32 msdu_queued;
  9790. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9791. A_UINT32 msdu_recycled;
  9792. /* Number of MPDUs with invalid peer but A2 found in AST */
  9793. A_UINT32 invalid_peer_a2_in_ast;
  9794. /* Number of MPDUs with invalid peer but A3 found in AST */
  9795. A_UINT32 invalid_peer_a3_in_ast;
  9796. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9797. A_UINT32 invalid_peer_bmc_mpdus;
  9798. /* Number of MSDUs with err attention word */
  9799. A_UINT32 rxdesc_err_att;
  9800. /* Number of MSDUs with flag of peer_idx_invalid */
  9801. A_UINT32 rxdesc_err_peer_idx_inv;
  9802. /* Number of MSDUs with flag of peer_idx_timeout */
  9803. A_UINT32 rxdesc_err_peer_idx_to;
  9804. /* Number of MSDUs with flag of overflow */
  9805. A_UINT32 rxdesc_err_ov;
  9806. /* Number of MSDUs with flag of msdu_length_err */
  9807. A_UINT32 rxdesc_err_msdu_len;
  9808. /* Number of MSDUs with flag of mpdu_length_err */
  9809. A_UINT32 rxdesc_err_mpdu_len;
  9810. /* Number of MSDUs with flag of tkip_mic_err */
  9811. A_UINT32 rxdesc_err_tkip_mic;
  9812. /* Number of MSDUs with flag of decrypt_err */
  9813. A_UINT32 rxdesc_err_decrypt;
  9814. /* Number of MSDUs with flag of fcs_err */
  9815. A_UINT32 rxdesc_err_fcs;
  9816. /* Number of Unicast (bc_mc bit is not set in attention word)
  9817. * frames with invalid peer handler
  9818. */
  9819. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9820. /* Number of unicast frame directly (direct bit is set in attention word)
  9821. * to DUT with invalid peer handler
  9822. */
  9823. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9824. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9825. * frames with invalid peer handler
  9826. */
  9827. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9828. /* Number of MSDUs dropped due to no first MSDU flag */
  9829. A_UINT32 rxdesc_no_1st_msdu;
  9830. /* Number of MSDUs droped due to ring overflow */
  9831. A_UINT32 msdu_drop_ring_ov;
  9832. /* Number of MSDUs dropped due to FC mismatch */
  9833. A_UINT32 msdu_drop_fc_mismatch;
  9834. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9835. A_UINT32 msdu_drop_mgmt_remote_ring;
  9836. /* Number of MSDUs dropped due to errors not reported in attention word */
  9837. A_UINT32 msdu_drop_misc;
  9838. /* Number of MSDUs go to offload before reorder */
  9839. A_UINT32 offload_msdu_wal;
  9840. /* Number of data frame dropped by offload after reorder */
  9841. A_UINT32 offload_msdu_reorder;
  9842. /* Number of MPDUs with sequence number in the past and within the BA window */
  9843. A_UINT32 dup_past_within_window;
  9844. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9845. A_UINT32 dup_past_outside_window;
  9846. /* Number of MSDUs with decrypt/MIC error */
  9847. A_UINT32 rxdesc_err_decrypt_mic;
  9848. /* Number of data MSDUs received on both local and remote rings */
  9849. A_UINT32 data_msdus_on_both_rings;
  9850. /* MPDUs never filled */
  9851. A_UINT32 holes_not_filled;
  9852. };
  9853. /*
  9854. * Rx Remote buffer statistics
  9855. * NB: all the fields must be defined in 4 octets size.
  9856. */
  9857. struct rx_remote_buffer_mgmt_stats {
  9858. /* Total number of MSDUs reaped for Rx processing */
  9859. A_UINT32 remote_reaped;
  9860. /* MSDUs recycled within firmware */
  9861. A_UINT32 remote_recycled;
  9862. /* MSDUs stored by Data Rx */
  9863. A_UINT32 data_rx_msdus_stored;
  9864. /* Number of HTT indications from WAL Rx MSDU */
  9865. A_UINT32 wal_rx_ind;
  9866. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9867. A_UINT32 wal_rx_ind_unconsumed;
  9868. /* Number of HTT indications from Data Rx MSDU */
  9869. A_UINT32 data_rx_ind;
  9870. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9871. A_UINT32 data_rx_ind_unconsumed;
  9872. /* Number of HTT indications from ATHBUF */
  9873. A_UINT32 athbuf_rx_ind;
  9874. /* Number of remote buffers requested for refill */
  9875. A_UINT32 refill_buf_req;
  9876. /* Number of remote buffers filled by the host */
  9877. A_UINT32 refill_buf_rsp;
  9878. /* Number of times MAC hw_index = f/w write_index */
  9879. A_INT32 mac_no_bufs;
  9880. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9881. A_INT32 fw_indices_equal;
  9882. /* Number of times f/w finds no buffers to post */
  9883. A_INT32 host_no_bufs;
  9884. };
  9885. /*
  9886. * TXBF MU/SU packets and NDPA statistics
  9887. * NB: all the fields must be defined in 4 octets size.
  9888. */
  9889. struct rx_txbf_musu_ndpa_pkts_stats {
  9890. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9891. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9892. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9893. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9894. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9895. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9896. };
  9897. /*
  9898. * htt_dbg_stats_status -
  9899. * present - The requested stats have been delivered in full.
  9900. * This indicates that either the stats information was contained
  9901. * in its entirety within this message, or else this message
  9902. * completes the delivery of the requested stats info that was
  9903. * partially delivered through earlier STATS_CONF messages.
  9904. * partial - The requested stats have been delivered in part.
  9905. * One or more subsequent STATS_CONF messages with the same
  9906. * cookie value will be sent to deliver the remainder of the
  9907. * information.
  9908. * error - The requested stats could not be delivered, for example due
  9909. * to a shortage of memory to construct a message holding the
  9910. * requested stats.
  9911. * invalid - The requested stat type is either not recognized, or the
  9912. * target is configured to not gather the stats type in question.
  9913. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9914. * series_done - This special value indicates that no further stats info
  9915. * elements are present within a series of stats info elems
  9916. * (within a stats upload confirmation message).
  9917. */
  9918. enum htt_dbg_stats_status {
  9919. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9920. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9921. HTT_DBG_STATS_STATUS_ERROR = 2,
  9922. HTT_DBG_STATS_STATUS_INVALID = 3,
  9923. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9924. };
  9925. /**
  9926. * @brief target -> host statistics upload
  9927. *
  9928. * @details
  9929. * The following field definitions describe the format of the HTT target
  9930. * to host stats upload confirmation message.
  9931. * The message contains a cookie echoed from the HTT host->target stats
  9932. * upload request, which identifies which request the confirmation is
  9933. * for, and a series of tag-length-value stats information elements.
  9934. * The tag-length header for each stats info element also includes a
  9935. * status field, to indicate whether the request for the stat type in
  9936. * question was fully met, partially met, unable to be met, or invalid
  9937. * (if the stat type in question is disabled in the target).
  9938. * A special value of all 1's in this status field is used to indicate
  9939. * the end of the series of stats info elements.
  9940. *
  9941. *
  9942. * |31 16|15 8|7 5|4 0|
  9943. * |------------------------------------------------------------|
  9944. * | reserved | msg type |
  9945. * |------------------------------------------------------------|
  9946. * | cookie LSBs |
  9947. * |------------------------------------------------------------|
  9948. * | cookie MSBs |
  9949. * |------------------------------------------------------------|
  9950. * | stats entry length | reserved | S |stat type|
  9951. * |------------------------------------------------------------|
  9952. * | |
  9953. * | type-specific stats info |
  9954. * | |
  9955. * |------------------------------------------------------------|
  9956. * | stats entry length | reserved | S |stat type|
  9957. * |------------------------------------------------------------|
  9958. * | |
  9959. * | type-specific stats info |
  9960. * | |
  9961. * |------------------------------------------------------------|
  9962. * | n/a | reserved | 111 | n/a |
  9963. * |------------------------------------------------------------|
  9964. * Header fields:
  9965. * - MSG_TYPE
  9966. * Bits 7:0
  9967. * Purpose: identifies this is a statistics upload confirmation message
  9968. * Value: 0x9
  9969. * - COOKIE_LSBS
  9970. * Bits 31:0
  9971. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9972. * message with its preceding host->target stats request message.
  9973. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9974. * - COOKIE_MSBS
  9975. * Bits 31:0
  9976. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9977. * message with its preceding host->target stats request message.
  9978. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9979. *
  9980. * Stats Information Element tag-length header fields:
  9981. * - STAT_TYPE
  9982. * Bits 4:0
  9983. * Purpose: identifies the type of statistics info held in the
  9984. * following information element
  9985. * Value: htt_dbg_stats_type
  9986. * - STATUS
  9987. * Bits 7:5
  9988. * Purpose: indicate whether the requested stats are present
  9989. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9990. * the completion of the stats entry series
  9991. * - LENGTH
  9992. * Bits 31:16
  9993. * Purpose: indicate the stats information size
  9994. * Value: This field specifies the number of bytes of stats information
  9995. * that follows the element tag-length header.
  9996. * It is expected but not required that this length is a multiple of
  9997. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9998. * subsequent stats entry header will begin on a 4-byte aligned
  9999. * boundary.
  10000. */
  10001. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10002. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10003. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10004. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10005. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10006. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10007. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10008. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10009. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10010. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10011. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10012. do { \
  10013. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10014. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10015. } while (0)
  10016. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10017. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10018. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10019. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10020. do { \
  10021. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10022. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10023. } while (0)
  10024. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10025. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10026. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10027. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10028. do { \
  10029. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10030. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10031. } while (0)
  10032. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10033. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10034. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10035. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10036. #define HTT_MAX_AGGR 64
  10037. #define HTT_HL_MAX_AGGR 18
  10038. /**
  10039. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10040. *
  10041. * @details
  10042. * The following field definitions describe the format of the HTT host
  10043. * to target frag_desc/msdu_ext bank configuration message.
  10044. * The message contains the based address and the min and max id of the
  10045. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10046. * MSDU_EXT/FRAG_DESC.
  10047. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10048. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10049. * the hardware does the mapping/translation.
  10050. *
  10051. * Total banks that can be configured is configured to 16.
  10052. *
  10053. * This should be called before any TX has be initiated by the HTT
  10054. *
  10055. * |31 16|15 8|7 5|4 0|
  10056. * |------------------------------------------------------------|
  10057. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10058. * |------------------------------------------------------------|
  10059. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10060. #if HTT_PADDR64
  10061. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10062. #endif
  10063. * |------------------------------------------------------------|
  10064. * | ... |
  10065. * |------------------------------------------------------------|
  10066. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10067. #if HTT_PADDR64
  10068. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10069. #endif
  10070. * |------------------------------------------------------------|
  10071. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10072. * |------------------------------------------------------------|
  10073. * | ... |
  10074. * |------------------------------------------------------------|
  10075. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10076. * |------------------------------------------------------------|
  10077. * Header fields:
  10078. * - MSG_TYPE
  10079. * Bits 7:0
  10080. * Value: 0x6
  10081. * for systems with 64-bit format for bus addresses:
  10082. * - BANKx_BASE_ADDRESS_LO
  10083. * Bits 31:0
  10084. * Purpose: Provide a mechanism to specify the base address of the
  10085. * MSDU_EXT bank physical/bus address.
  10086. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10087. * - BANKx_BASE_ADDRESS_HI
  10088. * Bits 31:0
  10089. * Purpose: Provide a mechanism to specify the base address of the
  10090. * MSDU_EXT bank physical/bus address.
  10091. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10092. * for systems with 32-bit format for bus addresses:
  10093. * - BANKx_BASE_ADDRESS
  10094. * Bits 31:0
  10095. * Purpose: Provide a mechanism to specify the base address of the
  10096. * MSDU_EXT bank physical/bus address.
  10097. * Value: MSDU_EXT bank physical / bus address
  10098. * - BANKx_MIN_ID
  10099. * Bits 15:0
  10100. * Purpose: Provide a mechanism to specify the min index that needs to
  10101. * mapped.
  10102. * - BANKx_MAX_ID
  10103. * Bits 31:16
  10104. * Purpose: Provide a mechanism to specify the max index that needs to
  10105. * mapped.
  10106. *
  10107. */
  10108. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10109. * safe value.
  10110. * @note MAX supported banks is 16.
  10111. */
  10112. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10113. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10114. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10115. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10116. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10117. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10118. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10119. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10120. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10121. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10122. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10123. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10124. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10125. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10126. do { \
  10127. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10128. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10129. } while (0)
  10130. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10131. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10132. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10133. do { \
  10134. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10135. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10136. } while (0)
  10137. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10138. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10139. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10140. do { \
  10141. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10142. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10143. } while (0)
  10144. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10145. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10146. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10147. do { \
  10148. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10149. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10150. } while (0)
  10151. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10152. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10153. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10154. do { \
  10155. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10156. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10157. } while (0)
  10158. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10159. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10160. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10161. do { \
  10162. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10163. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10164. } while (0)
  10165. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10166. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10167. /*
  10168. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10169. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10170. * addresses are stored in a XXX-bit field.
  10171. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10172. * htt_tx_frag_desc64_bank_cfg_t structs.
  10173. */
  10174. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10175. _paddr_bits_, \
  10176. _paddr__bank_base_address_) \
  10177. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10178. /** word 0 \
  10179. * msg_type: 8, \
  10180. * pdev_id: 2, \
  10181. * swap: 1, \
  10182. * reserved0: 5, \
  10183. * num_banks: 8, \
  10184. * desc_size: 8; \
  10185. */ \
  10186. A_UINT32 word0; \
  10187. /* \
  10188. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10189. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10190. * the second A_UINT32). \
  10191. */ \
  10192. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10193. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10194. } POSTPACK
  10195. /* define htt_tx_frag_desc32_bank_cfg_t */
  10196. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10197. /* define htt_tx_frag_desc64_bank_cfg_t */
  10198. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10199. /*
  10200. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10201. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10202. */
  10203. #if HTT_PADDR64
  10204. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10205. #else
  10206. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10207. #endif
  10208. /**
  10209. * @brief target -> host HTT TX Credit total count update message definition
  10210. *
  10211. *|31 16|15|14 9| 8 |7 0 |
  10212. *|---------------------+--+----------+-------+----------|
  10213. *|cur htt credit delta | Q| reserved | sign | msg type |
  10214. *|------------------------------------------------------|
  10215. *
  10216. * Header fields:
  10217. * - MSG_TYPE
  10218. * Bits 7:0
  10219. * Purpose: identifies this as a htt tx credit delta update message
  10220. * Value: 0xe
  10221. * - SIGN
  10222. * Bits 8
  10223. * identifies whether credit delta is positive or negative
  10224. * Value:
  10225. * - 0x0: credit delta is positive, rebalance in some buffers
  10226. * - 0x1: credit delta is negative, rebalance out some buffers
  10227. * - reserved
  10228. * Bits 14:9
  10229. * Value: 0x0
  10230. * - TXQ_GRP
  10231. * Bit 15
  10232. * Purpose: indicates whether any tx queue group information elements
  10233. * are appended to the tx credit update message
  10234. * Value: 0 -> no tx queue group information element is present
  10235. * 1 -> a tx queue group information element immediately follows
  10236. * - DELTA_COUNT
  10237. * Bits 31:16
  10238. * Purpose: Specify current htt credit delta absolute count
  10239. */
  10240. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10241. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10242. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10243. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10244. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10245. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10246. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10247. do { \
  10248. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10249. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10250. } while (0)
  10251. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10252. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10253. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10254. do { \
  10255. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10256. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10257. } while (0)
  10258. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10259. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10260. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10261. do { \
  10262. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10263. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10264. } while (0)
  10265. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10266. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10267. #define HTT_TX_CREDIT_MSG_BYTES 4
  10268. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10269. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10270. /**
  10271. * @brief HTT WDI_IPA Operation Response Message
  10272. *
  10273. * @details
  10274. * HTT WDI_IPA Operation Response message is sent by target
  10275. * to host confirming suspend or resume operation.
  10276. * |31 24|23 16|15 8|7 0|
  10277. * |----------------+----------------+----------------+----------------|
  10278. * | op_code | Rsvd | msg_type |
  10279. * |-------------------------------------------------------------------|
  10280. * | Rsvd | Response len |
  10281. * |-------------------------------------------------------------------|
  10282. * | |
  10283. * | Response-type specific info |
  10284. * | |
  10285. * | |
  10286. * |-------------------------------------------------------------------|
  10287. * Header fields:
  10288. * - MSG_TYPE
  10289. * Bits 7:0
  10290. * Purpose: Identifies this as WDI_IPA Operation Response message
  10291. * value: = 0x13
  10292. * - OP_CODE
  10293. * Bits 31:16
  10294. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10295. * value: = enum htt_wdi_ipa_op_code
  10296. * - RSP_LEN
  10297. * Bits 16:0
  10298. * Purpose: length for the response-type specific info
  10299. * value: = length in bytes for response-type specific info
  10300. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10301. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10302. */
  10303. PREPACK struct htt_wdi_ipa_op_response_t
  10304. {
  10305. /* DWORD 0: flags and meta-data */
  10306. A_UINT32
  10307. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10308. reserved1: 8,
  10309. op_code: 16;
  10310. A_UINT32
  10311. rsp_len: 16,
  10312. reserved2: 16;
  10313. } POSTPACK;
  10314. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10315. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10316. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10317. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10318. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10319. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10320. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10321. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10322. do { \
  10323. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10324. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10325. } while (0)
  10326. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10327. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10328. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10329. do { \
  10330. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10331. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10332. } while (0)
  10333. enum htt_phy_mode {
  10334. htt_phy_mode_11a = 0,
  10335. htt_phy_mode_11g = 1,
  10336. htt_phy_mode_11b = 2,
  10337. htt_phy_mode_11g_only = 3,
  10338. htt_phy_mode_11na_ht20 = 4,
  10339. htt_phy_mode_11ng_ht20 = 5,
  10340. htt_phy_mode_11na_ht40 = 6,
  10341. htt_phy_mode_11ng_ht40 = 7,
  10342. htt_phy_mode_11ac_vht20 = 8,
  10343. htt_phy_mode_11ac_vht40 = 9,
  10344. htt_phy_mode_11ac_vht80 = 10,
  10345. htt_phy_mode_11ac_vht20_2g = 11,
  10346. htt_phy_mode_11ac_vht40_2g = 12,
  10347. htt_phy_mode_11ac_vht80_2g = 13,
  10348. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10349. htt_phy_mode_11ac_vht160 = 15,
  10350. htt_phy_mode_max,
  10351. };
  10352. /**
  10353. * @brief target -> host HTT channel change indication
  10354. * @details
  10355. * Specify when a channel change occurs.
  10356. * This allows the host to precisely determine which rx frames arrived
  10357. * on the old channel and which rx frames arrived on the new channel.
  10358. *
  10359. *|31 |7 0 |
  10360. *|-------------------------------------------+----------|
  10361. *| reserved | msg type |
  10362. *|------------------------------------------------------|
  10363. *| primary_chan_center_freq_mhz |
  10364. *|------------------------------------------------------|
  10365. *| contiguous_chan1_center_freq_mhz |
  10366. *|------------------------------------------------------|
  10367. *| contiguous_chan2_center_freq_mhz |
  10368. *|------------------------------------------------------|
  10369. *| phy_mode |
  10370. *|------------------------------------------------------|
  10371. *
  10372. * Header fields:
  10373. * - MSG_TYPE
  10374. * Bits 7:0
  10375. * Purpose: identifies this as a htt channel change indication message
  10376. * Value: 0x15
  10377. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10378. * Bits 31:0
  10379. * Purpose: identify the (center of the) new 20 MHz primary channel
  10380. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10381. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10382. * Bits 31:0
  10383. * Purpose: identify the (center of the) contiguous frequency range
  10384. * comprising the new channel.
  10385. * For example, if the new channel is a 80 MHz channel extending
  10386. * 60 MHz beyond the primary channel, this field would be 30 larger
  10387. * than the primary channel center frequency field.
  10388. * Value: center frequency of the contiguous frequency range comprising
  10389. * the full channel in MHz units
  10390. * (80+80 channels also use the CONTIG_CHAN2 field)
  10391. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10392. * Bits 31:0
  10393. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10394. * within a VHT 80+80 channel.
  10395. * This field is only relevant for VHT 80+80 channels.
  10396. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10397. * channel (arbitrary value for cases besides VHT 80+80)
  10398. * - PHY_MODE
  10399. * Bits 31:0
  10400. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10401. * and band
  10402. * Value: htt_phy_mode enum value
  10403. */
  10404. PREPACK struct htt_chan_change_t
  10405. {
  10406. /* DWORD 0: flags and meta-data */
  10407. A_UINT32
  10408. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10409. reserved1: 24;
  10410. A_UINT32 primary_chan_center_freq_mhz;
  10411. A_UINT32 contig_chan1_center_freq_mhz;
  10412. A_UINT32 contig_chan2_center_freq_mhz;
  10413. A_UINT32 phy_mode;
  10414. } POSTPACK;
  10415. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10416. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10417. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10418. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10419. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10420. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10421. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10422. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10423. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10424. do { \
  10425. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10426. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10427. } while (0)
  10428. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10429. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10430. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10431. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10432. do { \
  10433. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10434. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10435. } while (0)
  10436. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10437. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10438. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10439. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10442. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10443. } while (0)
  10444. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10445. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10446. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10447. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10450. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10451. } while (0)
  10452. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10453. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10454. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10455. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10456. /**
  10457. * @brief rx offload packet error message
  10458. *
  10459. * @details
  10460. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10461. * of target payload like mic err.
  10462. *
  10463. * |31 24|23 16|15 8|7 0|
  10464. * |----------------+----------------+----------------+----------------|
  10465. * | tid | vdev_id | msg_sub_type | msg_type |
  10466. * |-------------------------------------------------------------------|
  10467. * : (sub-type dependent content) :
  10468. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10469. * Header fields:
  10470. * - msg_type
  10471. * Bits 7:0
  10472. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10473. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10474. * - msg_sub_type
  10475. * Bits 15:8
  10476. * Purpose: Identifies which type of rx error is reported by this message
  10477. * value: htt_rx_ofld_pkt_err_type
  10478. * - vdev_id
  10479. * Bits 23:16
  10480. * Purpose: Identifies which vdev received the erroneous rx frame
  10481. * value:
  10482. * - tid
  10483. * Bits 31:24
  10484. * Purpose: Identifies the traffic type of the rx frame
  10485. * value:
  10486. *
  10487. * - The payload fields used if the sub-type == MIC error are shown below.
  10488. * Note - MIC err is per MSDU, while PN is per MPDU.
  10489. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10490. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10491. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10492. * instead of sending separate HTT messages for each wrong MSDU within
  10493. * the MPDU.
  10494. *
  10495. * |31 24|23 16|15 8|7 0|
  10496. * |----------------+----------------+----------------+----------------|
  10497. * | Rsvd | key_id | peer_id |
  10498. * |-------------------------------------------------------------------|
  10499. * | receiver MAC addr 31:0 |
  10500. * |-------------------------------------------------------------------|
  10501. * | Rsvd | receiver MAC addr 47:32 |
  10502. * |-------------------------------------------------------------------|
  10503. * | transmitter MAC addr 31:0 |
  10504. * |-------------------------------------------------------------------|
  10505. * | Rsvd | transmitter MAC addr 47:32 |
  10506. * |-------------------------------------------------------------------|
  10507. * | PN 31:0 |
  10508. * |-------------------------------------------------------------------|
  10509. * | Rsvd | PN 47:32 |
  10510. * |-------------------------------------------------------------------|
  10511. * - peer_id
  10512. * Bits 15:0
  10513. * Purpose: identifies which peer is frame is from
  10514. * value:
  10515. * - key_id
  10516. * Bits 23:16
  10517. * Purpose: identifies key_id of rx frame
  10518. * value:
  10519. * - RA_31_0 (receiver MAC addr 31:0)
  10520. * Bits 31:0
  10521. * Purpose: identifies by MAC address which vdev received the frame
  10522. * value: MAC address lower 4 bytes
  10523. * - RA_47_32 (receiver MAC addr 47:32)
  10524. * Bits 15:0
  10525. * Purpose: identifies by MAC address which vdev received the frame
  10526. * value: MAC address upper 2 bytes
  10527. * - TA_31_0 (transmitter MAC addr 31:0)
  10528. * Bits 31:0
  10529. * Purpose: identifies by MAC address which peer transmitted the frame
  10530. * value: MAC address lower 4 bytes
  10531. * - TA_47_32 (transmitter MAC addr 47:32)
  10532. * Bits 15:0
  10533. * Purpose: identifies by MAC address which peer transmitted the frame
  10534. * value: MAC address upper 2 bytes
  10535. * - PN_31_0
  10536. * Bits 31:0
  10537. * Purpose: Identifies pn of rx frame
  10538. * value: PN lower 4 bytes
  10539. * - PN_47_32
  10540. * Bits 15:0
  10541. * Purpose: Identifies pn of rx frame
  10542. * value:
  10543. * TKIP or CCMP: PN upper 2 bytes
  10544. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10545. */
  10546. enum htt_rx_ofld_pkt_err_type {
  10547. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10548. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10549. };
  10550. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10551. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10552. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10553. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10554. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10555. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10556. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10557. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10558. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10559. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10560. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10561. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10562. do { \
  10563. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10564. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10565. } while (0)
  10566. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10567. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10568. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10569. do { \
  10570. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10571. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10572. } while (0)
  10573. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10574. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10575. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10576. do { \
  10577. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10578. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10579. } while (0)
  10580. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10581. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10582. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10583. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10584. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10585. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10586. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10587. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10588. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10589. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10590. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10591. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10592. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10593. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10594. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10595. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10596. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10597. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10599. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10600. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10601. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10602. do { \
  10603. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10604. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10605. } while (0)
  10606. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10607. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10608. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10609. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10610. do { \
  10611. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10612. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10613. } while (0)
  10614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10615. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10616. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10618. do { \
  10619. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10620. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10621. } while (0)
  10622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10623. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10624. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10626. do { \
  10627. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10628. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10629. } while (0)
  10630. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10631. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10632. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10633. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10634. do { \
  10635. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10636. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10637. } while (0)
  10638. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10639. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10640. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10641. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10642. do { \
  10643. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10644. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10645. } while (0)
  10646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10647. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10648. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10650. do { \
  10651. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10652. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10653. } while (0)
  10654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10655. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10656. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10658. do { \
  10659. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10660. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10661. } while (0)
  10662. /**
  10663. * @brief peer rate report message
  10664. *
  10665. * @details
  10666. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10667. * justified rate of all the peers.
  10668. *
  10669. * |31 24|23 16|15 8|7 0|
  10670. * |----------------+----------------+----------------+----------------|
  10671. * | peer_count | | msg_type |
  10672. * |-------------------------------------------------------------------|
  10673. * : Payload (variant number of peer rate report) :
  10674. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10675. * Header fields:
  10676. * - msg_type
  10677. * Bits 7:0
  10678. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10679. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10680. * - reserved
  10681. * Bits 15:8
  10682. * Purpose:
  10683. * value:
  10684. * - peer_count
  10685. * Bits 31:16
  10686. * Purpose: Specify how many peer rate report elements are present in the payload.
  10687. * value:
  10688. *
  10689. * Payload:
  10690. * There are variant number of peer rate report follow the first 32 bits.
  10691. * The peer rate report is defined as follows.
  10692. *
  10693. * |31 20|19 16|15 0|
  10694. * |-----------------------+---------+---------------------------------|-
  10695. * | reserved | phy | peer_id | \
  10696. * |-------------------------------------------------------------------| -> report #0
  10697. * | rate | /
  10698. * |-----------------------+---------+---------------------------------|-
  10699. * | reserved | phy | peer_id | \
  10700. * |-------------------------------------------------------------------| -> report #1
  10701. * | rate | /
  10702. * |-----------------------+---------+---------------------------------|-
  10703. * | reserved | phy | peer_id | \
  10704. * |-------------------------------------------------------------------| -> report #2
  10705. * | rate | /
  10706. * |-------------------------------------------------------------------|-
  10707. * : :
  10708. * : :
  10709. * : :
  10710. * :-------------------------------------------------------------------:
  10711. *
  10712. * - peer_id
  10713. * Bits 15:0
  10714. * Purpose: identify the peer
  10715. * value:
  10716. * - phy
  10717. * Bits 19:16
  10718. * Purpose: identify which phy is in use
  10719. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10720. * Please see enum htt_peer_report_phy_type for detail.
  10721. * - reserved
  10722. * Bits 31:20
  10723. * Purpose:
  10724. * value:
  10725. * - rate
  10726. * Bits 31:0
  10727. * Purpose: represent the justified rate of the peer specified by peer_id
  10728. * value:
  10729. */
  10730. enum htt_peer_rate_report_phy_type {
  10731. HTT_PEER_RATE_REPORT_11B = 0,
  10732. HTT_PEER_RATE_REPORT_11A_G,
  10733. HTT_PEER_RATE_REPORT_11N,
  10734. HTT_PEER_RATE_REPORT_11AC,
  10735. };
  10736. #define HTT_PEER_RATE_REPORT_SIZE 8
  10737. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10738. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10739. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10740. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10741. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10742. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10743. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10744. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10745. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10746. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10747. do { \
  10748. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10749. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10750. } while (0)
  10751. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10752. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10753. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10754. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10755. do { \
  10756. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10757. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10758. } while (0)
  10759. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10760. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10761. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10762. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10763. do { \
  10764. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10765. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10766. } while (0)
  10767. /**
  10768. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10769. *
  10770. * @details
  10771. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10772. * a flow of descriptors.
  10773. *
  10774. * This message is in TLV format and indicates the parameters to be setup a
  10775. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10776. * receive descriptors from a specified pool.
  10777. *
  10778. * The message would appear as follows:
  10779. *
  10780. * |31 24|23 16|15 8|7 0|
  10781. * |----------------+----------------+----------------+----------------|
  10782. * header | reserved | num_flows | msg_type |
  10783. * |-------------------------------------------------------------------|
  10784. * | |
  10785. * : payload :
  10786. * | |
  10787. * |-------------------------------------------------------------------|
  10788. *
  10789. * The header field is one DWORD long and is interpreted as follows:
  10790. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10791. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10792. * this message
  10793. * b'16-31 - reserved: These bits are reserved for future use
  10794. *
  10795. * Payload:
  10796. * The payload would contain multiple objects of the following structure. Each
  10797. * object represents a flow.
  10798. *
  10799. * |31 24|23 16|15 8|7 0|
  10800. * |----------------+----------------+----------------+----------------|
  10801. * header | reserved | num_flows | msg_type |
  10802. * |-------------------------------------------------------------------|
  10803. * payload0| flow_type |
  10804. * |-------------------------------------------------------------------|
  10805. * | flow_id |
  10806. * |-------------------------------------------------------------------|
  10807. * | reserved0 | flow_pool_id |
  10808. * |-------------------------------------------------------------------|
  10809. * | reserved1 | flow_pool_size |
  10810. * |-------------------------------------------------------------------|
  10811. * | reserved2 |
  10812. * |-------------------------------------------------------------------|
  10813. * payload1| flow_type |
  10814. * |-------------------------------------------------------------------|
  10815. * | flow_id |
  10816. * |-------------------------------------------------------------------|
  10817. * | reserved0 | flow_pool_id |
  10818. * |-------------------------------------------------------------------|
  10819. * | reserved1 | flow_pool_size |
  10820. * |-------------------------------------------------------------------|
  10821. * | reserved2 |
  10822. * |-------------------------------------------------------------------|
  10823. * | . |
  10824. * | . |
  10825. * | . |
  10826. * |-------------------------------------------------------------------|
  10827. *
  10828. * Each payload is 5 DWORDS long and is interpreted as follows:
  10829. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10830. * this flow is associated. It can be VDEV, peer,
  10831. * or tid (AC). Based on enum htt_flow_type.
  10832. *
  10833. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10834. * object. For flow_type vdev it is set to the
  10835. * vdevid, for peer it is peerid and for tid, it is
  10836. * tid_num.
  10837. *
  10838. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10839. * in the host for this flow
  10840. * b'16:31 - reserved0: This field in reserved for the future. In case
  10841. * we have a hierarchical implementation (HCM) of
  10842. * pools, it can be used to indicate the ID of the
  10843. * parent-pool.
  10844. *
  10845. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10846. * Descriptors for this flow will be
  10847. * allocated from this pool in the host.
  10848. * b'16:31 - reserved1: This field in reserved for the future. In case
  10849. * we have a hierarchical implementation of pools,
  10850. * it can be used to indicate the max number of
  10851. * descriptors in the pool. The b'0:15 can be used
  10852. * to indicate min number of descriptors in the
  10853. * HCM scheme.
  10854. *
  10855. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10856. * we have a hierarchical implementation of pools,
  10857. * b'0:15 can be used to indicate the
  10858. * priority-based borrowing (PBB) threshold of
  10859. * the flow's pool. The b'16:31 are still left
  10860. * reserved.
  10861. */
  10862. enum htt_flow_type {
  10863. FLOW_TYPE_VDEV = 0,
  10864. /* Insert new flow types above this line */
  10865. };
  10866. PREPACK struct htt_flow_pool_map_payload_t {
  10867. A_UINT32 flow_type;
  10868. A_UINT32 flow_id;
  10869. A_UINT32 flow_pool_id:16,
  10870. reserved0:16;
  10871. A_UINT32 flow_pool_size:16,
  10872. reserved1:16;
  10873. A_UINT32 reserved2;
  10874. } POSTPACK;
  10875. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10876. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10877. (sizeof(struct htt_flow_pool_map_payload_t))
  10878. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10879. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10880. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10881. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10882. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10883. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10884. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10885. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10886. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10887. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10888. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10889. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10890. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10891. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10892. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10893. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10894. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10895. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10896. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10897. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10898. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10899. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10900. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10901. do { \
  10902. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10903. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10904. } while (0)
  10905. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10906. do { \
  10907. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10908. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10909. } while (0)
  10910. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10911. do { \
  10912. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10913. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10914. } while (0)
  10915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10916. do { \
  10917. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10918. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10919. } while (0)
  10920. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10921. do { \
  10922. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10923. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10924. } while (0)
  10925. /**
  10926. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10927. *
  10928. * @details
  10929. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10930. * down a flow of descriptors.
  10931. * This message indicates that for the flow (whose ID is provided) is wanting
  10932. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10933. * pool of descriptors from where descriptors are being allocated for this
  10934. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10935. * be unmapped by the host.
  10936. *
  10937. * The message would appear as follows:
  10938. *
  10939. * |31 24|23 16|15 8|7 0|
  10940. * |----------------+----------------+----------------+----------------|
  10941. * | reserved0 | msg_type |
  10942. * |-------------------------------------------------------------------|
  10943. * | flow_type |
  10944. * |-------------------------------------------------------------------|
  10945. * | flow_id |
  10946. * |-------------------------------------------------------------------|
  10947. * | reserved1 | flow_pool_id |
  10948. * |-------------------------------------------------------------------|
  10949. *
  10950. * The message is interpreted as follows:
  10951. * dword0 - b'0:7 - msg_type: This will be set to
  10952. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10953. * b'8:31 - reserved0: Reserved for future use
  10954. *
  10955. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10956. * this flow is associated. It can be VDEV, peer,
  10957. * or tid (AC). Based on enum htt_flow_type.
  10958. *
  10959. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10960. * object. For flow_type vdev it is set to the
  10961. * vdevid, for peer it is peerid and for tid, it is
  10962. * tid_num.
  10963. *
  10964. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10965. * used in the host for this flow
  10966. * b'16:31 - reserved0: This field in reserved for the future.
  10967. *
  10968. */
  10969. PREPACK struct htt_flow_pool_unmap_t {
  10970. A_UINT32 msg_type:8,
  10971. reserved0:24;
  10972. A_UINT32 flow_type;
  10973. A_UINT32 flow_id;
  10974. A_UINT32 flow_pool_id:16,
  10975. reserved1:16;
  10976. } POSTPACK;
  10977. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  10978. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  10979. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  10980. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  10981. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  10982. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10983. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10984. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10985. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10986. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10987. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10988. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10989. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10990. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10991. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10992. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10993. do { \
  10994. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10995. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10996. } while (0)
  10997. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10998. do { \
  10999. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11000. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11001. } while (0)
  11002. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11003. do { \
  11004. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11005. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11006. } while (0)
  11007. /**
  11008. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11009. *
  11010. * @details
  11011. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11012. * SRNG ring setup is done
  11013. *
  11014. * This message indicates whether the last setup operation is successful.
  11015. * It will be sent to host when host set respose_required bit in
  11016. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11017. * The message would appear as follows:
  11018. *
  11019. * |31 24|23 16|15 8|7 0|
  11020. * |--------------- +----------------+----------------+----------------|
  11021. * | setup_status | ring_id | pdev_id | msg_type |
  11022. * |-------------------------------------------------------------------|
  11023. *
  11024. * The message is interpreted as follows:
  11025. * dword0 - b'0:7 - msg_type: This will be set to
  11026. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11027. * b'8:15 - pdev_id:
  11028. * 0 (for rings at SOC/UMAC level),
  11029. * 1/2/3 mac id (for rings at LMAC level)
  11030. * b'16:23 - ring_id: Identify the ring which is set up
  11031. * More details can be got from enum htt_srng_ring_id
  11032. * b'24:31 - setup_status: Indicate status of setup operation
  11033. * Refer to htt_ring_setup_status
  11034. */
  11035. PREPACK struct htt_sring_setup_done_t {
  11036. A_UINT32 msg_type: 8,
  11037. pdev_id: 8,
  11038. ring_id: 8,
  11039. setup_status: 8;
  11040. } POSTPACK;
  11041. enum htt_ring_setup_status {
  11042. htt_ring_setup_status_ok = 0,
  11043. htt_ring_setup_status_error,
  11044. };
  11045. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11046. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11047. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11048. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11049. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11050. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11051. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11052. do { \
  11053. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11054. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11055. } while (0)
  11056. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11057. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11058. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11059. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11060. HTT_SRING_SETUP_DONE_RING_ID_S)
  11061. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11062. do { \
  11063. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11064. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11065. } while (0)
  11066. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11067. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11068. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11069. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11070. HTT_SRING_SETUP_DONE_STATUS_S)
  11071. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11072. do { \
  11073. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11074. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11075. } while (0)
  11076. /**
  11077. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11078. *
  11079. * @details
  11080. * HTT TX map flow entry with tqm flow pointer
  11081. * Sent from firmware to host to add tqm flow pointer in corresponding
  11082. * flow search entry. Flow metadata is replayed back to host as part of this
  11083. * struct to enable host to find the specific flow search entry
  11084. *
  11085. * The message would appear as follows:
  11086. *
  11087. * |31 28|27 18|17 14|13 8|7 0|
  11088. * |-------+------------------------------------------+----------------|
  11089. * | rsvd0 | fse_hsh_idx | msg_type |
  11090. * |-------------------------------------------------------------------|
  11091. * | rsvd1 | tid | peer_id |
  11092. * |-------------------------------------------------------------------|
  11093. * | tqm_flow_pntr_lo |
  11094. * |-------------------------------------------------------------------|
  11095. * | tqm_flow_pntr_hi |
  11096. * |-------------------------------------------------------------------|
  11097. * | fse_meta_data |
  11098. * |-------------------------------------------------------------------|
  11099. *
  11100. * The message is interpreted as follows:
  11101. *
  11102. * dword0 - b'0:7 - msg_type: This will be set to
  11103. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11104. *
  11105. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11106. * for this flow entry
  11107. *
  11108. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11109. *
  11110. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11111. *
  11112. * dword1 - b'14:17 - tid
  11113. *
  11114. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11115. *
  11116. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11117. *
  11118. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11119. *
  11120. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11121. * given by host
  11122. */
  11123. PREPACK struct htt_tx_map_flow_info {
  11124. A_UINT32
  11125. msg_type: 8,
  11126. fse_hsh_idx: 20,
  11127. rsvd0: 4;
  11128. A_UINT32
  11129. peer_id: 14,
  11130. tid: 4,
  11131. rsvd1: 14;
  11132. A_UINT32 tqm_flow_pntr_lo;
  11133. A_UINT32 tqm_flow_pntr_hi;
  11134. struct htt_tx_flow_metadata fse_meta_data;
  11135. } POSTPACK;
  11136. /* DWORD 0 */
  11137. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11138. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11139. /* DWORD 1 */
  11140. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11141. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11142. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11143. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11144. /* DWORD 0 */
  11145. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11146. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11147. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11148. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11149. do { \
  11150. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11151. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11152. } while (0)
  11153. /* DWORD 1 */
  11154. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11155. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11156. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11157. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11158. do { \
  11159. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11160. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11161. } while (0)
  11162. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11163. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11164. HTT_TX_MAP_FLOW_INFO_TID_S)
  11165. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11166. do { \
  11167. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11168. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11169. } while (0)
  11170. /*
  11171. * htt_dbg_ext_stats_status -
  11172. * present - The requested stats have been delivered in full.
  11173. * This indicates that either the stats information was contained
  11174. * in its entirety within this message, or else this message
  11175. * completes the delivery of the requested stats info that was
  11176. * partially delivered through earlier STATS_CONF messages.
  11177. * partial - The requested stats have been delivered in part.
  11178. * One or more subsequent STATS_CONF messages with the same
  11179. * cookie value will be sent to deliver the remainder of the
  11180. * information.
  11181. * error - The requested stats could not be delivered, for example due
  11182. * to a shortage of memory to construct a message holding the
  11183. * requested stats.
  11184. * invalid - The requested stat type is either not recognized, or the
  11185. * target is configured to not gather the stats type in question.
  11186. */
  11187. enum htt_dbg_ext_stats_status {
  11188. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11189. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11190. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11191. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11192. };
  11193. /**
  11194. * @brief target -> host ppdu stats upload
  11195. *
  11196. * @details
  11197. * The following field definitions describe the format of the HTT target
  11198. * to host ppdu stats indication message.
  11199. *
  11200. *
  11201. * |31 16|15 12|11 10|9 8|7 0 |
  11202. * |----------------------------------------------------------------------|
  11203. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11204. * |----------------------------------------------------------------------|
  11205. * | ppdu_id |
  11206. * |----------------------------------------------------------------------|
  11207. * | Timestamp in us |
  11208. * |----------------------------------------------------------------------|
  11209. * | reserved |
  11210. * |----------------------------------------------------------------------|
  11211. * | type-specific stats info |
  11212. * | (see htt_ppdu_stats.h) |
  11213. * |----------------------------------------------------------------------|
  11214. * Header fields:
  11215. * - MSG_TYPE
  11216. * Bits 7:0
  11217. * Purpose: Identifies this is a PPDU STATS indication
  11218. * message.
  11219. * Value: 0x1d
  11220. * - mac_id
  11221. * Bits 9:8
  11222. * Purpose: mac_id of this ppdu_id
  11223. * Value: 0-3
  11224. * - pdev_id
  11225. * Bits 11:10
  11226. * Purpose: pdev_id of this ppdu_id
  11227. * Value: 0-3
  11228. * 0 (for rings at SOC level),
  11229. * 1/2/3 PDEV -> 0/1/2
  11230. * - payload_size
  11231. * Bits 31:16
  11232. * Purpose: total tlv size
  11233. * Value: payload_size in bytes
  11234. */
  11235. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11236. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11237. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11238. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11239. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11240. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11241. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11242. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11243. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11244. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11247. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11248. } while (0)
  11249. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11250. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11251. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11252. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11253. do { \
  11254. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11255. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11256. } while (0)
  11257. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11258. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11259. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11260. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11261. do { \
  11262. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11263. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11264. } while (0)
  11265. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11266. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11267. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11268. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11269. do { \
  11270. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11271. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11272. } while (0)
  11273. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11274. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11275. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11276. /* htt_t2h_ppdu_stats_ind_hdr_t
  11277. * This struct contains the fields within the header of the
  11278. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11279. * stats info.
  11280. * This struct assumes little-endian layout, and thus is only
  11281. * suitable for use within processors known to be little-endian
  11282. * (such as the target).
  11283. * In contrast, the above macros provide endian-portable methods
  11284. * to get and set the bitfields within this PPDU_STATS_IND header.
  11285. */
  11286. typedef struct {
  11287. A_UINT32 msg_type: 8, /* bits 7:0 */
  11288. mac_id: 2, /* bits 9:8 */
  11289. pdev_id: 2, /* bits 11:10 */
  11290. reserved1: 4, /* bits 15:12 */
  11291. payload_size: 16; /* bits 31:16 */
  11292. A_UINT32 ppdu_id;
  11293. A_UINT32 timestamp_us;
  11294. A_UINT32 reserved2;
  11295. } htt_t2h_ppdu_stats_ind_hdr_t;
  11296. /**
  11297. * @brief target -> host extended statistics upload
  11298. *
  11299. * @details
  11300. * The following field definitions describe the format of the HTT target
  11301. * to host stats upload confirmation message.
  11302. * The message contains a cookie echoed from the HTT host->target stats
  11303. * upload request, which identifies which request the confirmation is
  11304. * for, and a single stats can span over multiple HTT stats indication
  11305. * due to the HTT message size limitation so every HTT ext stats indication
  11306. * will have tag-length-value stats information elements.
  11307. * The tag-length header for each HTT stats IND message also includes a
  11308. * status field, to indicate whether the request for the stat type in
  11309. * question was fully met, partially met, unable to be met, or invalid
  11310. * (if the stat type in question is disabled in the target).
  11311. * A Done bit 1's indicate the end of the of stats info elements.
  11312. *
  11313. *
  11314. * |31 16|15 12|11|10 8|7 5|4 0|
  11315. * |--------------------------------------------------------------|
  11316. * | reserved | msg type |
  11317. * |--------------------------------------------------------------|
  11318. * | cookie LSBs |
  11319. * |--------------------------------------------------------------|
  11320. * | cookie MSBs |
  11321. * |--------------------------------------------------------------|
  11322. * | stats entry length | rsvd | D| S | stat type |
  11323. * |--------------------------------------------------------------|
  11324. * | type-specific stats info |
  11325. * | (see htt_stats.h) |
  11326. * |--------------------------------------------------------------|
  11327. * Header fields:
  11328. * - MSG_TYPE
  11329. * Bits 7:0
  11330. * Purpose: Identifies this is a extended statistics upload confirmation
  11331. * message.
  11332. * Value: 0x1c
  11333. * - COOKIE_LSBS
  11334. * Bits 31:0
  11335. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11336. * message with its preceding host->target stats request message.
  11337. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11338. * - COOKIE_MSBS
  11339. * Bits 31:0
  11340. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11341. * message with its preceding host->target stats request message.
  11342. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11343. *
  11344. * Stats Information Element tag-length header fields:
  11345. * - STAT_TYPE
  11346. * Bits 7:0
  11347. * Purpose: identifies the type of statistics info held in the
  11348. * following information element
  11349. * Value: htt_dbg_ext_stats_type
  11350. * - STATUS
  11351. * Bits 10:8
  11352. * Purpose: indicate whether the requested stats are present
  11353. * Value: htt_dbg_ext_stats_status
  11354. * - DONE
  11355. * Bits 11
  11356. * Purpose:
  11357. * Indicates the completion of the stats entry, this will be the last
  11358. * stats conf HTT segment for the requested stats type.
  11359. * Value:
  11360. * 0 -> the stats retrieval is ongoing
  11361. * 1 -> the stats retrieval is complete
  11362. * - LENGTH
  11363. * Bits 31:16
  11364. * Purpose: indicate the stats information size
  11365. * Value: This field specifies the number of bytes of stats information
  11366. * that follows the element tag-length header.
  11367. * It is expected but not required that this length is a multiple of
  11368. * 4 bytes.
  11369. */
  11370. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11371. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11372. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11373. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11374. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11375. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11376. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11377. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11378. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11379. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11380. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11381. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11382. do { \
  11383. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11384. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11385. } while (0)
  11386. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11387. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11388. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11389. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11390. do { \
  11391. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11392. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11393. } while (0)
  11394. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11395. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11396. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11397. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11398. do { \
  11399. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11400. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11401. } while (0)
  11402. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11403. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11404. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11405. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11406. do { \
  11407. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11408. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11409. } while (0)
  11410. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11411. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11412. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11413. typedef enum {
  11414. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11415. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11416. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11417. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11418. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11419. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11420. /* Reserved from 128 - 255 for target internal use.*/
  11421. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11422. } HTT_PEER_TYPE;
  11423. /** 2 word representation of MAC addr */
  11424. typedef struct {
  11425. /** upper 4 bytes of MAC address */
  11426. A_UINT32 mac_addr31to0;
  11427. /** lower 2 bytes of MAC address */
  11428. A_UINT32 mac_addr47to32;
  11429. } htt_mac_addr;
  11430. /** macro to convert MAC address from char array to HTT word format */
  11431. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11432. (phtt_mac_addr)->mac_addr31to0 = \
  11433. (((c_macaddr)[0] << 0) | \
  11434. ((c_macaddr)[1] << 8) | \
  11435. ((c_macaddr)[2] << 16) | \
  11436. ((c_macaddr)[3] << 24)); \
  11437. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11438. } while (0)
  11439. /**
  11440. * @brief target -> host monitor mac header indication message
  11441. *
  11442. * @details
  11443. * The following diagram shows the format of the monitor mac header message
  11444. * sent from the target to the host.
  11445. * This message is primarily sent when promiscuous rx mode is enabled.
  11446. * One message is sent per rx PPDU.
  11447. *
  11448. * |31 24|23 16|15 8|7 0|
  11449. * |-------------------------------------------------------------|
  11450. * | peer_id | reserved0 | msg_type |
  11451. * |-------------------------------------------------------------|
  11452. * | reserved1 | num_mpdu |
  11453. * |-------------------------------------------------------------|
  11454. * | struct hw_rx_desc |
  11455. * | (see wal_rx_desc.h) |
  11456. * |-------------------------------------------------------------|
  11457. * | struct ieee80211_frame_addr4 |
  11458. * | (see ieee80211_defs.h) |
  11459. * |-------------------------------------------------------------|
  11460. * | struct ieee80211_frame_addr4 |
  11461. * | (see ieee80211_defs.h) |
  11462. * |-------------------------------------------------------------|
  11463. * | ...... |
  11464. * |-------------------------------------------------------------|
  11465. *
  11466. * Header fields:
  11467. * - msg_type
  11468. * Bits 7:0
  11469. * Purpose: Identifies this is a monitor mac header indication message.
  11470. * Value: 0x20
  11471. * - peer_id
  11472. * Bits 31:16
  11473. * Purpose: Software peer id given by host during association,
  11474. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11475. * for rx PPDUs received from unassociated peers.
  11476. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11477. * - num_mpdu
  11478. * Bits 15:0
  11479. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11480. * delivered within the message.
  11481. * Value: 1 to 32
  11482. * num_mpdu is limited to a maximum value of 32, due to buffer
  11483. * size limits. For PPDUs with more than 32 MPDUs, only the
  11484. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11485. * the PPDU will be provided.
  11486. */
  11487. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11488. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11489. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11490. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11491. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11492. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11493. do { \
  11494. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11495. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11496. } while (0)
  11497. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11498. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11499. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11500. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11503. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11504. } while (0)
  11505. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11506. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11507. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11508. /**
  11509. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11510. *
  11511. * @details
  11512. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11513. * the flow pool associated with the specified ID is resized
  11514. *
  11515. * The message would appear as follows:
  11516. *
  11517. * |31 16|15 8|7 0|
  11518. * |---------------------------------+----------------+----------------|
  11519. * | reserved0 | Msg type |
  11520. * |-------------------------------------------------------------------|
  11521. * | flow pool new size | flow pool ID |
  11522. * |-------------------------------------------------------------------|
  11523. *
  11524. * The message is interpreted as follows:
  11525. * b'0:7 - msg_type: This will be set to
  11526. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11527. *
  11528. * b'0:15 - flow pool ID: Existing flow pool ID
  11529. *
  11530. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11531. *
  11532. */
  11533. PREPACK struct htt_flow_pool_resize_t {
  11534. A_UINT32 msg_type:8,
  11535. reserved0:24;
  11536. A_UINT32 flow_pool_id:16,
  11537. flow_pool_new_size:16;
  11538. } POSTPACK;
  11539. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11540. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11541. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11542. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11543. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11544. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11545. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11546. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11547. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11548. do { \
  11549. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11550. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11551. } while (0)
  11552. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11553. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11554. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11555. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11556. do { \
  11557. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11558. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11559. } while (0)
  11560. /**
  11561. * @brief host -> target channel change message
  11562. *
  11563. * @details
  11564. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11565. * to associate RX frames to correct channel they were received on.
  11566. * The following field definitions describe the format of the HTT target
  11567. * to host channel change message.
  11568. * |31 16|15 8|7 5|4 0|
  11569. * |------------------------------------------------------------|
  11570. * | reserved | MSG_TYPE |
  11571. * |------------------------------------------------------------|
  11572. * | CHAN_MHZ |
  11573. * |------------------------------------------------------------|
  11574. * | BAND_CENTER_FREQ1 |
  11575. * |------------------------------------------------------------|
  11576. * | BAND_CENTER_FREQ2 |
  11577. * |------------------------------------------------------------|
  11578. * | CHAN_PHY_MODE |
  11579. * |------------------------------------------------------------|
  11580. * Header fields:
  11581. * - MSG_TYPE
  11582. * Bits 7:0
  11583. * Value: 0xf
  11584. * - CHAN_MHZ
  11585. * Bits 31:0
  11586. * Purpose: frequency of the primary 20mhz channel.
  11587. * - BAND_CENTER_FREQ1
  11588. * Bits 31:0
  11589. * Purpose: centre frequency of the full channel.
  11590. * - BAND_CENTER_FREQ2
  11591. * Bits 31:0
  11592. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11593. * - CHAN_PHY_MODE
  11594. * Bits 31:0
  11595. * Purpose: phy mode of the channel.
  11596. */
  11597. PREPACK struct htt_chan_change_msg {
  11598. A_UINT32 chan_mhz; /* frequency in mhz */
  11599. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11600. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11601. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11602. } POSTPACK;
  11603. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11604. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11605. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11606. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11607. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11608. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11609. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11610. /*
  11611. * The read and write indices point to the data within the host buffer.
  11612. * Because the first 4 bytes of the host buffer is used for the read index and
  11613. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11614. * The read index and write index are the byte offsets from the base of the
  11615. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11616. * Refer the ASCII text picture below.
  11617. */
  11618. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11619. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11620. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11621. /*
  11622. ***************************************************************************
  11623. *
  11624. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11625. *
  11626. ***************************************************************************
  11627. *
  11628. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11629. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11630. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11631. * written into the Host memory region mentioned below.
  11632. *
  11633. * Read index is updated by the Host. At any point of time, the read index will
  11634. * indicate the index that will next be read by the Host. The read index is
  11635. * in units of bytes offset from the base of the meta-data buffer.
  11636. *
  11637. * Write index is updated by the FW. At any point of time, the write index will
  11638. * indicate from where the FW can start writing any new data. The write index is
  11639. * in units of bytes offset from the base of the meta-data buffer.
  11640. *
  11641. * If the Host is not fast enough in reading the CFR data, any new capture data
  11642. * would be dropped if there is no space left to write the new captures.
  11643. *
  11644. * The last 4 bytes of the memory region will have the magic pattern
  11645. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11646. * not overrun the host buffer.
  11647. *
  11648. * ,--------------------. read and write indices store the
  11649. * | | byte offset from the base of the
  11650. * | ,--------+--------. meta-data buffer to the next
  11651. * | | | | location within the data buffer
  11652. * | | v v that will be read / written
  11653. * ************************************************************************
  11654. * * Read * Write * * Magic *
  11655. * * index * index * CFR data1 ...... CFR data N * pattern *
  11656. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11657. * ************************************************************************
  11658. * |<---------- data buffer ---------->|
  11659. *
  11660. * |<----------------- meta-data buffer allocated in Host ----------------|
  11661. *
  11662. * Note:
  11663. * - Considering the 4 bytes needed to store the Read index (R) and the
  11664. * Write index (W), the initial value is as follows:
  11665. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11666. * - Buffer empty condition:
  11667. * R = W
  11668. *
  11669. * Regarding CFR data format:
  11670. * --------------------------
  11671. *
  11672. * Each CFR tone is stored in HW as 16-bits with the following format:
  11673. * {bits[15:12], bits[11:6], bits[5:0]} =
  11674. * {unsigned exponent (4 bits),
  11675. * signed mantissa_real (6 bits),
  11676. * signed mantissa_imag (6 bits)}
  11677. *
  11678. * CFR_real = mantissa_real * 2^(exponent-5)
  11679. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11680. *
  11681. *
  11682. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11683. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11684. *
  11685. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11686. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11687. * .
  11688. * .
  11689. * .
  11690. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11691. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11692. */
  11693. /* Bandwidth of peer CFR captures */
  11694. typedef enum {
  11695. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11696. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11697. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11698. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11699. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11700. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11701. } HTT_PEER_CFR_CAPTURE_BW;
  11702. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11703. * was captured
  11704. */
  11705. typedef enum {
  11706. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11707. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11708. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11709. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11710. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11711. } HTT_PEER_CFR_CAPTURE_MODE;
  11712. typedef enum {
  11713. /* This message type is currently used for the below purpose:
  11714. *
  11715. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11716. * wmi_peer_cfr_capture_cmd.
  11717. * If payload_present bit is set to 0 then the associated memory region
  11718. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11719. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11720. * message; the CFR dump will be present at the end of the message,
  11721. * after the chan_phy_mode.
  11722. */
  11723. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11724. /* Always keep this last */
  11725. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11726. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11727. /**
  11728. * @brief target -> host CFR dump completion indication message definition
  11729. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11730. *
  11731. * @details
  11732. * The following diagram shows the format of the Channel Frequency Response
  11733. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11734. * the channel capture of a peer is copied by Firmware into the Host memory
  11735. *
  11736. * **************************************************************************
  11737. *
  11738. * Message format when the CFR capture message type is
  11739. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11740. *
  11741. * **************************************************************************
  11742. *
  11743. * |31 16|15 |8|7 0|
  11744. * |----------------------------------------------------------------|
  11745. * header: | reserved |P| msg_type |
  11746. * word 0 | | | |
  11747. * |----------------------------------------------------------------|
  11748. * payload: | cfr_capture_msg_type |
  11749. * word 1 | |
  11750. * |----------------------------------------------------------------|
  11751. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11752. * word 2 | | | | | | | | |
  11753. * |----------------------------------------------------------------|
  11754. * | mac_addr31to0 |
  11755. * word 3 | |
  11756. * |----------------------------------------------------------------|
  11757. * | unused / reserved | mac_addr47to32 |
  11758. * word 4 | | |
  11759. * |----------------------------------------------------------------|
  11760. * | index |
  11761. * word 5 | |
  11762. * |----------------------------------------------------------------|
  11763. * | length |
  11764. * word 6 | |
  11765. * |----------------------------------------------------------------|
  11766. * | timestamp |
  11767. * word 7 | |
  11768. * |----------------------------------------------------------------|
  11769. * | counter |
  11770. * word 8 | |
  11771. * |----------------------------------------------------------------|
  11772. * | chan_mhz |
  11773. * word 9 | |
  11774. * |----------------------------------------------------------------|
  11775. * | band_center_freq1 |
  11776. * word 10 | |
  11777. * |----------------------------------------------------------------|
  11778. * | band_center_freq2 |
  11779. * word 11 | |
  11780. * |----------------------------------------------------------------|
  11781. * | chan_phy_mode |
  11782. * word 12 | |
  11783. * |----------------------------------------------------------------|
  11784. * where,
  11785. * P - payload present bit (payload_present explained below)
  11786. * req_id - memory request id (mem_req_id explained below)
  11787. * S - status field (status explained below)
  11788. * capbw - capture bandwidth (capture_bw explained below)
  11789. * mode - mode of capture (mode explained below)
  11790. * sts - space time streams (sts_count explained below)
  11791. * chbw - channel bandwidth (channel_bw explained below)
  11792. * captype - capture type (cap_type explained below)
  11793. *
  11794. * The following field definitions describe the format of the CFR dump
  11795. * completion indication sent from the target to the host
  11796. *
  11797. * Header fields:
  11798. *
  11799. * Word 0
  11800. * - msg_type
  11801. * Bits 7:0
  11802. * Purpose: Identifies this as CFR TX completion indication
  11803. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11804. * - payload_present
  11805. * Bit 8
  11806. * Purpose: Identifies how CFR data is sent to host
  11807. * Value: 0 - If CFR Payload is written to host memory
  11808. * 1 - If CFR Payload is sent as part of HTT message
  11809. * (This is the requirement for SDIO/USB where it is
  11810. * not possible to write CFR data to host memory)
  11811. * - reserved
  11812. * Bits 31:9
  11813. * Purpose: Reserved
  11814. * Value: 0
  11815. *
  11816. * Payload fields:
  11817. *
  11818. * Word 1
  11819. * - cfr_capture_msg_type
  11820. * Bits 31:0
  11821. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11822. * to specify the format used for the remainder of the message
  11823. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11824. * (currently only MSG_TYPE_1 is defined)
  11825. *
  11826. * Word 2
  11827. * - mem_req_id
  11828. * Bits 6:0
  11829. * Purpose: Contain the mem request id of the region where the CFR capture
  11830. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11831. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11832. this value is invalid)
  11833. * - status
  11834. * Bit 7
  11835. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11836. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11837. * - capture_bw
  11838. * Bits 10:8
  11839. * Purpose: Carry the bandwidth of the CFR capture
  11840. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11841. * - mode
  11842. * Bits 13:11
  11843. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11844. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11845. * - sts_count
  11846. * Bits 16:14
  11847. * Purpose: Carry the number of space time streams
  11848. * Value: Number of space time streams
  11849. * - channel_bw
  11850. * Bits 19:17
  11851. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11852. * measurement
  11853. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11854. * - cap_type
  11855. * Bits 23:20
  11856. * Purpose: Carry the type of the capture
  11857. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11858. * - vdev_id
  11859. * Bits 31:24
  11860. * Purpose: Carry the virtual device id
  11861. * Value: vdev ID
  11862. *
  11863. * Word 3
  11864. * - mac_addr31to0
  11865. * Bits 31:0
  11866. * Purpose: Contain the bits 31:0 of the peer MAC address
  11867. * Value: Bits 31:0 of the peer MAC address
  11868. *
  11869. * Word 4
  11870. * - mac_addr47to32
  11871. * Bits 15:0
  11872. * Purpose: Contain the bits 47:32 of the peer MAC address
  11873. * Value: Bits 47:32 of the peer MAC address
  11874. *
  11875. * Word 5
  11876. * - index
  11877. * Bits 31:0
  11878. * Purpose: Contain the index at which this CFR dump was written in the Host
  11879. * allocated memory. This index is the number of bytes from the base address.
  11880. * Value: Index position
  11881. *
  11882. * Word 6
  11883. * - length
  11884. * Bits 31:0
  11885. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11886. * Value: Length of the CFR capture of the peer
  11887. *
  11888. * Word 7
  11889. * - timestamp
  11890. * Bits 31:0
  11891. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11892. * clock used for this timestamp is private to the target and not visible to
  11893. * the host i.e., Host can interpret only the relative timestamp deltas from
  11894. * one message to the next, but can't interpret the absolute timestamp from a
  11895. * single message.
  11896. * Value: Timestamp in microseconds
  11897. *
  11898. * Word 8
  11899. * - counter
  11900. * Bits 31:0
  11901. * Purpose: Carry the count of the current CFR capture from FW. This is
  11902. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11903. * in host memory)
  11904. * Value: Count of the current CFR capture
  11905. *
  11906. * Word 9
  11907. * - chan_mhz
  11908. * Bits 31:0
  11909. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11910. * Value: Primary 20 channel frequency
  11911. *
  11912. * Word 10
  11913. * - band_center_freq1
  11914. * Bits 31:0
  11915. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11916. * Value: Center frequency 1 in MHz
  11917. *
  11918. * Word 11
  11919. * - band_center_freq2
  11920. * Bits 31:0
  11921. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11922. * the VDEV
  11923. * 80plus80 mode
  11924. * Value: Center frequency 2 in MHz
  11925. *
  11926. * Word 12
  11927. * - chan_phy_mode
  11928. * Bits 31:0
  11929. * Purpose: Carry the phy mode of the channel, of the VDEV
  11930. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11931. */
  11932. PREPACK struct htt_cfr_dump_ind_type_1 {
  11933. A_UINT32 mem_req_id:7,
  11934. status:1,
  11935. capture_bw:3,
  11936. mode:3,
  11937. sts_count:3,
  11938. channel_bw:3,
  11939. cap_type:4,
  11940. vdev_id:8;
  11941. htt_mac_addr addr;
  11942. A_UINT32 index;
  11943. A_UINT32 length;
  11944. A_UINT32 timestamp;
  11945. A_UINT32 counter;
  11946. struct htt_chan_change_msg chan;
  11947. } POSTPACK;
  11948. PREPACK struct htt_cfr_dump_compl_ind {
  11949. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11950. union {
  11951. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11952. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11953. /* If there is a need to change the memory layout and its associated
  11954. * HTT indication format, a new CFR capture message type can be
  11955. * introduced and added into this union.
  11956. */
  11957. };
  11958. } POSTPACK;
  11959. /*
  11960. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11961. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11962. */
  11963. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11964. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11965. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11966. do { \
  11967. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11968. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11969. } while(0)
  11970. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  11971. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  11972. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  11973. /*
  11974. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  11975. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11976. */
  11977. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  11978. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  11979. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  11980. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  11981. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  11982. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11983. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11984. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11985. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11986. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11987. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11988. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11989. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11990. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11991. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11992. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11993. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11994. do { \
  11995. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11996. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11997. } while (0)
  11998. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11999. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12000. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12001. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12002. do { \
  12003. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12004. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12005. } while (0)
  12006. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12007. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12008. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12009. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12010. do { \
  12011. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12012. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12013. } while (0)
  12014. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12015. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12016. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12017. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12018. do { \
  12019. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12020. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12021. } while (0)
  12022. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12023. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12024. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12025. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12026. do { \
  12027. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12028. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12029. } while (0)
  12030. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12031. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12032. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12033. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12034. do { \
  12035. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12036. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12037. } while (0)
  12038. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12039. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12040. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12041. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12042. do { \
  12043. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12044. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12045. } while (0)
  12046. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12047. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12048. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12049. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12050. do { \
  12051. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12052. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12053. } while (0)
  12054. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12055. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12056. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12057. /**
  12058. * @brief target -> host peer (PPDU) stats message
  12059. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12060. * @details
  12061. * This message is generated by FW when FW is sending stats to host
  12062. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12063. * This message is sent autonomously by the target rather than upon request
  12064. * by the host.
  12065. * The following field definitions describe the format of the HTT target
  12066. * to host peer stats indication message.
  12067. *
  12068. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12069. * or more PPDU stats records.
  12070. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12071. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12072. * then the message would start with the
  12073. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12074. * below.
  12075. *
  12076. * |31 16|15|14|13 11|10 9|8|7 0|
  12077. * |-------------------------------------------------------------|
  12078. * | reserved |MSG_TYPE |
  12079. * |-------------------------------------------------------------|
  12080. * rec 0 | TLV header |
  12081. * rec 0 |-------------------------------------------------------------|
  12082. * rec 0 | ppdu successful bytes |
  12083. * rec 0 |-------------------------------------------------------------|
  12084. * rec 0 | ppdu retry bytes |
  12085. * rec 0 |-------------------------------------------------------------|
  12086. * rec 0 | ppdu failed bytes |
  12087. * rec 0 |-------------------------------------------------------------|
  12088. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12089. * rec 0 |-------------------------------------------------------------|
  12090. * rec 0 | retried MSDUs | successful MSDUs |
  12091. * rec 0 |-------------------------------------------------------------|
  12092. * rec 0 | TX duration | failed MSDUs |
  12093. * rec 0 |-------------------------------------------------------------|
  12094. * ...
  12095. * |-------------------------------------------------------------|
  12096. * rec N | TLV header |
  12097. * rec N |-------------------------------------------------------------|
  12098. * rec N | ppdu successful bytes |
  12099. * rec N |-------------------------------------------------------------|
  12100. * rec N | ppdu retry bytes |
  12101. * rec N |-------------------------------------------------------------|
  12102. * rec N | ppdu failed bytes |
  12103. * rec N |-------------------------------------------------------------|
  12104. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12105. * rec N |-------------------------------------------------------------|
  12106. * rec N | retried MSDUs | successful MSDUs |
  12107. * rec N |-------------------------------------------------------------|
  12108. * rec N | TX duration | failed MSDUs |
  12109. * rec N |-------------------------------------------------------------|
  12110. *
  12111. * where:
  12112. * A = is A-MPDU flag
  12113. * BA = block-ack failure flags
  12114. * BW = bandwidth spec
  12115. * SG = SGI enabled spec
  12116. * S = skipped rate ctrl
  12117. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12118. *
  12119. * Header
  12120. * ------
  12121. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12122. * dword0 - b'8:31 - reserved : Reserved for future use
  12123. *
  12124. * payload include below peer_stats information
  12125. * --------------------------------------------
  12126. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12127. * @tx_success_bytes : total successful bytes in the PPDU.
  12128. * @tx_retry_bytes : total retried bytes in the PPDU.
  12129. * @tx_failed_bytes : total failed bytes in the PPDU.
  12130. * @tx_ratecode : rate code used for the PPDU.
  12131. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12132. * @ba_ack_failed : BA/ACK failed for this PPDU
  12133. * b00 -> BA received
  12134. * b01 -> BA failed once
  12135. * b10 -> BA failed twice, when HW retry is enabled.
  12136. * @bw : BW
  12137. * b00 -> 20 MHz
  12138. * b01 -> 40 MHz
  12139. * b10 -> 80 MHz
  12140. * b11 -> 160 MHz (or 80+80)
  12141. * @sg : SGI enabled
  12142. * @s : skipped ratectrl
  12143. * @peer_id : peer id
  12144. * @tx_success_msdus : successful MSDUs
  12145. * @tx_retry_msdus : retried MSDUs
  12146. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12147. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12148. */
  12149. /**
  12150. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12151. *
  12152. * @details
  12153. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12154. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12155. * This message will only be sent if the backpressure condition has existed
  12156. * continuously for an initial period (100 ms).
  12157. * Repeat messages with updated information will be sent after each
  12158. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12159. * This message indicates the ring id along with current head and tail index
  12160. * locations (i.e. write and read indices).
  12161. * The backpressure time indicates the time in ms for which continous
  12162. * backpressure has been observed in the ring.
  12163. *
  12164. * The message format is as follows:
  12165. *
  12166. * |31 24|23 16|15 8|7 0|
  12167. * |----------------+----------------+----------------+----------------|
  12168. * | ring_id | ring_type | pdev_id | msg_type |
  12169. * |-------------------------------------------------------------------|
  12170. * | tail_idx | head_idx |
  12171. * |-------------------------------------------------------------------|
  12172. * | backpressure_time_ms |
  12173. * |-------------------------------------------------------------------|
  12174. *
  12175. * The message is interpreted as follows:
  12176. * dword0 - b'0:7 - msg_type: This will be set to
  12177. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12178. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12179. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12180. the msg is for LMAC ring.
  12181. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12182. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12183. * htt_backpressure_lmac_ring_id. This represents
  12184. * the ring id for which continous backpressure is seen
  12185. *
  12186. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12187. * the ring indicated by the ring_id
  12188. *
  12189. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12190. * the ring indicated by the ring id
  12191. *
  12192. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12193. * backpressure has been seen in the ring
  12194. * indicated by the ring_id.
  12195. * Units = milliseconds
  12196. */
  12197. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12198. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12199. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12200. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12201. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12202. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12203. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12204. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12205. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12206. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12207. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12208. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12209. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12210. do { \
  12211. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12212. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12213. } while (0)
  12214. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12215. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12216. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12217. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12218. do { \
  12219. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12220. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12221. } while (0)
  12222. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12223. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12224. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12225. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12226. do { \
  12227. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12228. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12229. } while (0)
  12230. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12231. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12232. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12233. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12234. do { \
  12235. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12236. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12237. } while (0)
  12238. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12239. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12240. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12241. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12242. do { \
  12243. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12244. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12245. } while (0)
  12246. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12247. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12248. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12249. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12252. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12253. } while (0)
  12254. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12255. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12256. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12257. enum htt_backpressure_ring_type {
  12258. HTT_SW_RING_TYPE_UMAC,
  12259. HTT_SW_RING_TYPE_LMAC,
  12260. HTT_SW_RING_TYPE_MAX,
  12261. };
  12262. /* Ring id for which the message is sent to host */
  12263. enum htt_backpressure_umac_ringid {
  12264. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12265. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12266. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12267. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12268. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12269. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12270. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12271. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12272. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12273. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12274. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12275. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12276. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12277. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12278. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12279. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12280. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12281. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12282. HTT_SW_UMAC_RING_IDX_MAX,
  12283. };
  12284. enum htt_backpressure_lmac_ringid {
  12285. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12286. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12287. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12288. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12289. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12290. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12291. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12292. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12293. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12294. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12295. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12296. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12297. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12298. HTT_SW_LMAC_RING_IDX_MAX,
  12299. };
  12300. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12301. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12302. pdev_id: 8,
  12303. ring_type: 8, /* htt_backpressure_ring_type */
  12304. /*
  12305. * ring_id holds an enum value from either
  12306. * htt_backpressure_umac_ringid or
  12307. * htt_backpressure_lmac_ringid, based on
  12308. * the ring_type setting.
  12309. */
  12310. ring_id: 8;
  12311. A_UINT16 head_idx;
  12312. A_UINT16 tail_idx;
  12313. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12314. } POSTPACK;
  12315. /*
  12316. * Defines two 32 bit words that can be used by the target to indicate a per
  12317. * user RU allocation and rate information.
  12318. *
  12319. * This information is currently provided in the "sw_response_reference_ptr"
  12320. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12321. * "rx_ppdu_end_user_stats" TLV.
  12322. *
  12323. * VALID:
  12324. * The consumer of these words must explicitly check the valid bit,
  12325. * and only attempt interpretation of any of the remaining fields if
  12326. * the valid bit is set to 1.
  12327. *
  12328. * VERSION:
  12329. * The consumer of these words must also explicitly check the version bit,
  12330. * and only use the V0 definition if the VERSION field is set to 0.
  12331. *
  12332. * Version 1 is currently undefined, with the exception of the VALID and
  12333. * VERSION fields.
  12334. *
  12335. * Version 0:
  12336. *
  12337. * The fields below are duplicated per BW.
  12338. *
  12339. * The consumer must determine which BW field to use, based on the UL OFDMA
  12340. * PPDU BW indicated by HW.
  12341. *
  12342. * RU_START: RU26 start index for the user.
  12343. * Note that this is always using the RU26 index, regardless
  12344. * of the actual RU assigned to the user
  12345. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12346. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12347. *
  12348. * For example, 20MHz (the value in the top row is RU_START)
  12349. *
  12350. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12351. * RU Size 1 (52): | | | | | |
  12352. * RU Size 2 (106): | | | |
  12353. * RU Size 3 (242): | |
  12354. *
  12355. * RU_SIZE: Indicates the RU size, as defined by enum
  12356. * htt_ul_ofdma_user_info_ru_size.
  12357. *
  12358. * LDPC: LDPC enabled (if 0, BCC is used)
  12359. *
  12360. * DCM: DCM enabled
  12361. *
  12362. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12363. * |---------------------------------+--------------------------------|
  12364. * |Ver|Valid| FW internal |
  12365. * |---------------------------------+--------------------------------|
  12366. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12367. * |---------------------------------+--------------------------------|
  12368. */
  12369. enum htt_ul_ofdma_user_info_ru_size {
  12370. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12371. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12372. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12373. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12374. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12375. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12376. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12377. };
  12378. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12379. struct htt_ul_ofdma_user_info_v0 {
  12380. A_UINT32 word0;
  12381. A_UINT32 word1;
  12382. };
  12383. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12384. A_UINT32 w0_fw_rsvd:30; \
  12385. A_UINT32 w0_valid:1; \
  12386. A_UINT32 w0_version:1;
  12387. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12388. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12389. };
  12390. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12391. A_UINT32 w1_nss:3; \
  12392. A_UINT32 w1_mcs:4; \
  12393. A_UINT32 w1_ldpc:1; \
  12394. A_UINT32 w1_dcm:1; \
  12395. A_UINT32 w1_ru_start:7; \
  12396. A_UINT32 w1_ru_size:3; \
  12397. A_UINT32 w1_trig_type:4; \
  12398. A_UINT32 w1_unused:9;
  12399. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12400. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12401. };
  12402. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12403. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12404. union {
  12405. A_UINT32 word0;
  12406. struct {
  12407. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12408. };
  12409. };
  12410. union {
  12411. A_UINT32 word1;
  12412. struct {
  12413. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12414. };
  12415. };
  12416. } POSTPACK;
  12417. enum HTT_UL_OFDMA_TRIG_TYPE {
  12418. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12419. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12420. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12421. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12422. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12423. };
  12424. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12425. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12426. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12427. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12428. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12429. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12430. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12431. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12432. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12433. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12434. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12435. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12436. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12437. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12438. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12439. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12440. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12441. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12442. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12443. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12444. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12445. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12446. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12447. /*--- word 0 ---*/
  12448. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12449. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12450. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12451. do { \
  12452. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12453. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12454. } while (0)
  12455. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12456. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12457. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12458. do { \
  12459. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12460. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12461. } while (0)
  12462. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12463. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12464. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12465. do { \
  12466. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12467. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12468. } while (0)
  12469. /*--- word 1 ---*/
  12470. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12471. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12472. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12473. do { \
  12474. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12475. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12476. } while (0)
  12477. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12478. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12479. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12480. do { \
  12481. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12482. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12483. } while (0)
  12484. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12485. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12486. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12487. do { \
  12488. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12489. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12490. } while (0)
  12491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12492. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12494. do { \
  12495. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12496. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12497. } while (0)
  12498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12499. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12501. do { \
  12502. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12503. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12504. } while (0)
  12505. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12506. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12507. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12508. do { \
  12509. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12510. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12511. } while (0)
  12512. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12513. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12514. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12515. do { \
  12516. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12517. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12518. } while (0)
  12519. /**
  12520. * @brief target -> host channel calibration data message
  12521. * @brief host -> target channel calibration data message
  12522. *
  12523. * @details
  12524. * The following field definitions describe the format of the channel
  12525. * calibration data message sent from the target to the host when
  12526. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12527. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12528. * The message is defined as htt_chan_caldata_msg followed by a variable
  12529. * number of 32-bit character values.
  12530. *
  12531. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12532. * |------------------------------------------------------------------|
  12533. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12534. * |------------------------------------------------------------------|
  12535. * | payload size | mhz |
  12536. * |------------------------------------------------------------------|
  12537. * | center frequency 2 | center frequency 1 |
  12538. * |------------------------------------------------------------------|
  12539. * | check sum |
  12540. * |------------------------------------------------------------------|
  12541. * | payload |
  12542. * |------------------------------------------------------------------|
  12543. * message info field:
  12544. * - MSG_TYPE
  12545. * Bits 7:0
  12546. * Purpose: identifies this as a channel calibration data message
  12547. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12548. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12549. * - SUB_TYPE
  12550. * Bits 11:8
  12551. * Purpose: T2H: indicates whether target is providing chan cal data
  12552. * to the host to store, or requesting that the host
  12553. * download previously-stored data.
  12554. * H2T: indicates whether the host is providing the requested
  12555. * channel cal data, or if it is rejecting the data
  12556. * request because it does not have the requested data.
  12557. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12558. * - CHKSUM_VALID
  12559. * Bit 12
  12560. * Purpose: indicates if the checksum field is valid
  12561. * value:
  12562. * - FRAG
  12563. * Bit 19:16
  12564. * Purpose: indicates the fragment index for message
  12565. * value: 0 for first fragment, 1 for second fragment, ...
  12566. * - APPEND
  12567. * Bit 20
  12568. * Purpose: indicates if this is the last fragment
  12569. * value: 0 = final fragment, 1 = more fragments will be appended
  12570. *
  12571. * channel and payload size field
  12572. * - MHZ
  12573. * Bits 15:0
  12574. * Purpose: indicates the channel primary frequency
  12575. * Value:
  12576. * - PAYLOAD_SIZE
  12577. * Bits 31:16
  12578. * Purpose: indicates the bytes of calibration data in payload
  12579. * Value:
  12580. *
  12581. * center frequency field
  12582. * - CENTER FREQUENCY 1
  12583. * Bits 15:0
  12584. * Purpose: indicates the channel center frequency
  12585. * Value: channel center frequency, in MHz units
  12586. * - CENTER FREQUENCY 2
  12587. * Bits 31:16
  12588. * Purpose: indicates the secondary channel center frequency,
  12589. * only for 11acvht 80plus80 mode
  12590. * Value: secondary channel center frequeny, in MHz units, if applicable
  12591. *
  12592. * checksum field
  12593. * - CHECK_SUM
  12594. * Bits 31:0
  12595. * Purpose: check the payload data, it is just for this fragment.
  12596. * This is intended for the target to check that the channel
  12597. * calibration data returned by the host is the unmodified data
  12598. * that was previously provided to the host by the target.
  12599. * value: checksum of fragment payload
  12600. */
  12601. PREPACK struct htt_chan_caldata_msg {
  12602. /* DWORD 0: message info */
  12603. A_UINT32
  12604. msg_type: 8,
  12605. sub_type: 4 ,
  12606. chksum_valid: 1, /** 1:valid, 0:invalid */
  12607. reserved1: 3,
  12608. frag_idx: 4, /** fragment index for calibration data */
  12609. appending: 1, /** 0: no fragment appending,
  12610. * 1: extra fragment appending */
  12611. reserved2: 11;
  12612. /* DWORD 1: channel and payload size */
  12613. A_UINT32
  12614. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12615. payload_size: 16; /** unit: bytes */
  12616. /* DWORD 2: center frequency */
  12617. A_UINT32
  12618. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12619. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12620. * valid only for 11acvht 80plus80 mode */
  12621. /* DWORD 3: check sum */
  12622. A_UINT32 chksum;
  12623. /* variable length for calibration data */
  12624. A_UINT32 payload[1/* or more */];
  12625. } POSTPACK;
  12626. /* T2H SUBTYPE */
  12627. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12628. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12629. /* H2T SUBTYPE */
  12630. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12631. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12632. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12633. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12634. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12635. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12636. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12637. do { \
  12638. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12639. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12640. } while (0)
  12641. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12642. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12643. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12644. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12645. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12646. do { \
  12647. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12648. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12649. } while (0)
  12650. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12651. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12652. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12653. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12654. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12655. do { \
  12656. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12657. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12658. } while (0)
  12659. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12660. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12661. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12662. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12663. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12664. do { \
  12665. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12666. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12667. } while (0)
  12668. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12669. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12670. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12671. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12672. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12673. do { \
  12674. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12675. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12676. } while (0)
  12677. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12678. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12679. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12680. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12681. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12682. do { \
  12683. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12684. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12685. } while (0)
  12686. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12687. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12688. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12689. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12690. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12693. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12694. } while (0)
  12695. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12696. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12697. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12698. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12699. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12700. do { \
  12701. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12702. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12703. } while (0)
  12704. #endif